storybook 9.1.2 → 9.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -41
- package/dist/bin/index.cjs +43 -43
- package/dist/bin/index.js +43 -43
- package/dist/cli/bin/index.cjs +1211 -1211
- package/dist/cli/bin/index.js +1214 -1214
- package/dist/common/index.cjs +58 -58
- package/dist/common/index.js +104 -104
- package/dist/core-server/index.cjs +3105 -3094
- package/dist/core-server/index.js +3409 -3398
- package/dist/core-server/presets/common-manager.js +142 -119
- package/dist/core-server/presets/common-preset.cjs +2489 -2483
- package/dist/core-server/presets/common-preset.js +7445 -7439
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs +57 -51
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +60 -52
- package/dist/csf-tools/index.cjs +4 -4
- package/dist/csf-tools/index.js +4 -4
- package/dist/manager/globals-runtime.js +7376 -7365
- package/dist/manager/runtime.js +32 -18
- package/dist/manager-api/index.cjs +546 -535
- package/dist/manager-api/index.js +653 -642
- package/dist/manager-errors.js +44 -33
- package/dist/preview/runtime.js +5559 -5548
- package/dist/preview-api/index.cjs +4 -4
- package/dist/preview-api/index.js +4 -4
- package/dist/preview-errors.cjs +82 -71
- package/dist/preview-errors.js +89 -78
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.js +1 -1
- package/dist/server-errors.cjs +121 -77
- package/dist/server-errors.d.ts +14 -1
- package/dist/server-errors.js +135 -91
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.js +1 -1
- package/package.json +17 -3
package/dist/cli/bin/index.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var d = (
|
|
8
|
-
var T = (
|
|
9
|
-
var
|
|
2
|
+
var Rs = Object.create;
|
|
3
|
+
var rt = Object.defineProperty;
|
|
4
|
+
var Ms = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var Ls = Object.getOwnPropertyNames;
|
|
6
|
+
var qs = Object.getPrototypeOf, Us = Object.prototype.hasOwnProperty;
|
|
7
|
+
var d = (r, e) => rt(r, "name", { value: e, configurable: !0 });
|
|
8
|
+
var T = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
|
|
9
|
+
var Fs = (r, e, t, s) => {
|
|
10
10
|
if (e && typeof e == "object" || typeof e == "function")
|
|
11
|
-
for (let i of
|
|
12
|
-
!
|
|
13
|
-
return
|
|
11
|
+
for (let i of Ls(e))
|
|
12
|
+
!Us.call(r, i) && i !== t && rt(r, i, { get: () => e[i], enumerable: !(s = Ms(e, i)) || s.enumerable });
|
|
13
|
+
return r;
|
|
14
14
|
};
|
|
15
|
-
var ee = (
|
|
15
|
+
var ee = (r, e, t) => (t = r != null ? Rs(qs(r)) : {}, Fs(
|
|
16
16
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
19
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
e || !
|
|
21
|
-
|
|
20
|
+
e || !r || !r.__esModule ? rt(t, "default", { value: r, enumerable: !0 }) : t,
|
|
21
|
+
r
|
|
22
22
|
));
|
|
23
23
|
|
|
24
24
|
// ../node_modules/commander/lib/error.js
|
|
@@ -33,8 +33,8 @@ var Oe = T((nt) => {
|
|
|
33
33
|
* @param {string} code an id string representing the error
|
|
34
34
|
* @param {string} message human-readable description of the error
|
|
35
35
|
*/
|
|
36
|
-
constructor(e, t,
|
|
37
|
-
super(
|
|
36
|
+
constructor(e, t, s) {
|
|
37
|
+
super(s), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
38
38
|
void 0;
|
|
39
39
|
}
|
|
40
40
|
}, it = class extends De {
|
|
@@ -55,7 +55,7 @@ var Oe = T((nt) => {
|
|
|
55
55
|
|
|
56
56
|
// ../node_modules/commander/lib/argument.js
|
|
57
57
|
var $e = T((ot) => {
|
|
58
|
-
var { InvalidArgumentError:
|
|
58
|
+
var { InvalidArgumentError: Hs } = Oe(), at = class {
|
|
59
59
|
static {
|
|
60
60
|
d(this, "Argument");
|
|
61
61
|
}
|
|
@@ -122,12 +122,12 @@ var $e = T((ot) => {
|
|
|
122
122
|
* @return {Argument}
|
|
123
123
|
*/
|
|
124
124
|
choices(e) {
|
|
125
|
-
return this.argChoices = e.slice(), this.parseArg = (t,
|
|
125
|
+
return this.argChoices = e.slice(), this.parseArg = (t, s) => {
|
|
126
126
|
if (!this.argChoices.includes(t))
|
|
127
|
-
throw new
|
|
127
|
+
throw new Hs(
|
|
128
128
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
129
129
|
);
|
|
130
|
-
return this.variadic ? this._concatValue(t,
|
|
130
|
+
return this.variadic ? this._concatValue(t, s) : t;
|
|
131
131
|
}, this;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
@@ -147,18 +147,18 @@ var $e = T((ot) => {
|
|
|
147
147
|
return this.required = !1, this;
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
let e =
|
|
152
|
-
return
|
|
150
|
+
function Bs(r) {
|
|
151
|
+
let e = r.name() + (r.variadic === !0 ? "..." : "");
|
|
152
|
+
return r.required ? "<" + e + ">" : "[" + e + "]";
|
|
153
153
|
}
|
|
154
|
-
d(
|
|
154
|
+
d(Bs, "humanReadableArgName");
|
|
155
155
|
ot.Argument = at;
|
|
156
|
-
ot.humanReadableArgName =
|
|
156
|
+
ot.humanReadableArgName = Bs;
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
// ../node_modules/commander/lib/help.js
|
|
160
|
-
var
|
|
161
|
-
var { humanReadableArgName:
|
|
160
|
+
var lt = T((Vt) => {
|
|
161
|
+
var { humanReadableArgName: Ws } = $e(), dt = class {
|
|
162
162
|
static {
|
|
163
163
|
d(this, "Help");
|
|
164
164
|
}
|
|
@@ -172,8 +172,8 @@ var ut = T((Vt) => {
|
|
|
172
172
|
* @returns {Command[]}
|
|
173
173
|
*/
|
|
174
174
|
visibleCommands(e) {
|
|
175
|
-
let t = e.commands.filter((i) => !i._hidden),
|
|
176
|
-
return
|
|
175
|
+
let t = e.commands.filter((i) => !i._hidden), s = e._getHelpCommand();
|
|
176
|
+
return s && !s._hidden && t.push(s), this.sortSubcommands && t.sort((i, n) => i.name().localeCompare(n.name())), t;
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* Compare options for sort.
|
|
@@ -183,8 +183,8 @@ var ut = T((Vt) => {
|
|
|
183
183
|
* @returns {number}
|
|
184
184
|
*/
|
|
185
185
|
compareOptions(e, t) {
|
|
186
|
-
let
|
|
187
|
-
return
|
|
186
|
+
let s = /* @__PURE__ */ d((i) => i.short ? i.short.replace(/^-/, "") : i.long.replace(/^--/, ""), "getSortKey");
|
|
187
|
+
return s(e).localeCompare(s(t));
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
190
|
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
|
|
@@ -193,13 +193,13 @@ var ut = T((Vt) => {
|
|
|
193
193
|
* @returns {Option[]}
|
|
194
194
|
*/
|
|
195
195
|
visibleOptions(e) {
|
|
196
|
-
let t = e.options.filter((i) => !i.hidden),
|
|
197
|
-
if (
|
|
198
|
-
let i =
|
|
199
|
-
!i && !n ? t.push(
|
|
200
|
-
e.createOption(
|
|
201
|
-
) :
|
|
202
|
-
e.createOption(
|
|
196
|
+
let t = e.options.filter((i) => !i.hidden), s = e._getHelpOption();
|
|
197
|
+
if (s && !s.hidden) {
|
|
198
|
+
let i = s.short && e._findOption(s.short), n = s.long && e._findOption(s.long);
|
|
199
|
+
!i && !n ? t.push(s) : s.long && !n ? t.push(
|
|
200
|
+
e.createOption(s.long, s.description)
|
|
201
|
+
) : s.short && !i && t.push(
|
|
202
|
+
e.createOption(s.short, s.description)
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
205
|
return this.sortOptions && t.sort(this.compareOptions), t;
|
|
@@ -213,8 +213,8 @@ var ut = T((Vt) => {
|
|
|
213
213
|
visibleGlobalOptions(e) {
|
|
214
214
|
if (!this.showGlobalOptions) return [];
|
|
215
215
|
let t = [];
|
|
216
|
-
for (let
|
|
217
|
-
let i =
|
|
216
|
+
for (let s = e.parent; s; s = s.parent) {
|
|
217
|
+
let i = s.options.filter(
|
|
218
218
|
(n) => !n.hidden
|
|
219
219
|
);
|
|
220
220
|
t.push(...i);
|
|
@@ -239,7 +239,7 @@ var ut = T((Vt) => {
|
|
|
239
239
|
* @returns {string}
|
|
240
240
|
*/
|
|
241
241
|
subcommandTerm(e) {
|
|
242
|
-
let t = e.registeredArguments.map((
|
|
242
|
+
let t = e.registeredArguments.map((s) => Ws(s)).join(" ");
|
|
243
243
|
return e._name + (e._aliases[0] ? "|" + e._aliases[0] : "") + (e.options.length ? " [options]" : "") + // simplistic check for non-help option
|
|
244
244
|
(t ? " " + t : "");
|
|
245
245
|
}
|
|
@@ -269,7 +269,7 @@ var ut = T((Vt) => {
|
|
|
269
269
|
* @returns {number}
|
|
270
270
|
*/
|
|
271
271
|
longestSubcommandTermLength(e, t) {
|
|
272
|
-
return t.visibleCommands(e).reduce((
|
|
272
|
+
return t.visibleCommands(e).reduce((s, i) => Math.max(s, t.subcommandTerm(i).length), 0);
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* Get the longest option term length.
|
|
@@ -279,7 +279,7 @@ var ut = T((Vt) => {
|
|
|
279
279
|
* @returns {number}
|
|
280
280
|
*/
|
|
281
281
|
longestOptionTermLength(e, t) {
|
|
282
|
-
return t.visibleOptions(e).reduce((
|
|
282
|
+
return t.visibleOptions(e).reduce((s, i) => Math.max(s, t.optionTerm(i).length), 0);
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
285
|
* Get the longest global option term length.
|
|
@@ -289,7 +289,7 @@ var ut = T((Vt) => {
|
|
|
289
289
|
* @returns {number}
|
|
290
290
|
*/
|
|
291
291
|
longestGlobalOptionTermLength(e, t) {
|
|
292
|
-
return t.visibleGlobalOptions(e).reduce((
|
|
292
|
+
return t.visibleGlobalOptions(e).reduce((s, i) => Math.max(s, t.optionTerm(i).length), 0);
|
|
293
293
|
}
|
|
294
294
|
/**
|
|
295
295
|
* Get the longest argument term length.
|
|
@@ -299,7 +299,7 @@ var ut = T((Vt) => {
|
|
|
299
299
|
* @returns {number}
|
|
300
300
|
*/
|
|
301
301
|
longestArgumentTermLength(e, t) {
|
|
302
|
-
return t.visibleArguments(e).reduce((
|
|
302
|
+
return t.visibleArguments(e).reduce((s, i) => Math.max(s, t.argumentTerm(i).length), 0);
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Get the command usage to be displayed at the top of the built-in help.
|
|
@@ -310,10 +310,10 @@ var ut = T((Vt) => {
|
|
|
310
310
|
commandUsage(e) {
|
|
311
311
|
let t = e._name;
|
|
312
312
|
e._aliases[0] && (t = t + "|" + e._aliases[0]);
|
|
313
|
-
let
|
|
313
|
+
let s = "";
|
|
314
314
|
for (let i = e.parent; i; i = i.parent)
|
|
315
|
-
|
|
316
|
-
return
|
|
315
|
+
s = i.name() + " " + s;
|
|
316
|
+
return s + t + " " + e.usage();
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
319
|
* Get the description for the command.
|
|
@@ -344,7 +344,7 @@ var ut = T((Vt) => {
|
|
|
344
344
|
let t = [];
|
|
345
345
|
return e.argChoices && t.push(
|
|
346
346
|
// use stringify to match the display of the default value
|
|
347
|
-
`choices: ${e.argChoices.map((
|
|
347
|
+
`choices: ${e.argChoices.map((s) => JSON.stringify(s)).join(", ")}`
|
|
348
348
|
), e.defaultValue !== void 0 && (e.required || e.optional || e.isBoolean() && typeof e.defaultValue == "boolean") && t.push(
|
|
349
349
|
`default: ${e.defaultValueDescription || JSON.stringify(e.defaultValue)}`
|
|
350
350
|
), e.presetArg !== void 0 && e.optional && t.push(`preset: ${JSON.stringify(e.presetArg)}`), e.envVar !== void 0 && t.push(`env: ${e.envVar}`),
|
|
@@ -360,12 +360,12 @@ var ut = T((Vt) => {
|
|
|
360
360
|
let t = [];
|
|
361
361
|
if (e.argChoices && t.push(
|
|
362
362
|
// use stringify to match the display of the default value
|
|
363
|
-
`choices: ${e.argChoices.map((
|
|
363
|
+
`choices: ${e.argChoices.map((s) => JSON.stringify(s)).join(", ")}`
|
|
364
364
|
), e.defaultValue !== void 0 && t.push(
|
|
365
365
|
`default: ${e.defaultValueDescription || JSON.stringify(e.defaultValue)}`
|
|
366
366
|
), t.length > 0) {
|
|
367
|
-
let
|
|
368
|
-
return e.description ? `${e.description} ${
|
|
367
|
+
let s = `(${t.join(", ")})`;
|
|
368
|
+
return e.description ? `${e.description} ${s}` : s;
|
|
369
369
|
}
|
|
370
370
|
return e.description;
|
|
371
371
|
}
|
|
@@ -377,14 +377,14 @@ var ut = T((Vt) => {
|
|
|
377
377
|
* @returns {string}
|
|
378
378
|
*/
|
|
379
379
|
formatHelp(e, t) {
|
|
380
|
-
let
|
|
380
|
+
let s = t.padWidth(e, t), i = t.helpWidth || 80, n = 2, a = 2;
|
|
381
381
|
function o(I, z) {
|
|
382
382
|
if (z) {
|
|
383
|
-
let
|
|
383
|
+
let st = `${I.padEnd(s + a)}${z}`;
|
|
384
384
|
return t.wrap(
|
|
385
|
-
|
|
385
|
+
st,
|
|
386
386
|
i - n,
|
|
387
|
-
|
|
387
|
+
s + a
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
390
|
return I;
|
|
@@ -453,20 +453,20 @@ var ut = T((Vt) => {
|
|
|
453
453
|
* @return {string}
|
|
454
454
|
*
|
|
455
455
|
*/
|
|
456
|
-
wrap(e, t,
|
|
456
|
+
wrap(e, t, s, i = 40) {
|
|
457
457
|
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", a = new RegExp(`[\\n][${n}]+`);
|
|
458
458
|
if (e.match(a)) return e;
|
|
459
|
-
let o = t -
|
|
459
|
+
let o = t - s;
|
|
460
460
|
if (o < i) return e;
|
|
461
|
-
let c = e.slice(0,
|
|
461
|
+
let c = e.slice(0, s), h = e.slice(s).replace(`\r
|
|
462
462
|
`, `
|
|
463
|
-
`), p = " ".repeat(
|
|
463
|
+
`), p = " ".repeat(s), C = "\\s\u200B", j = new RegExp(
|
|
464
464
|
`
|
|
465
465
|
|.{1,${o - 1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,
|
|
466
466
|
"g"
|
|
467
467
|
), I = h.match(j) || [];
|
|
468
|
-
return c + I.map((z,
|
|
469
|
-
` ? "" : (
|
|
468
|
+
return c + I.map((z, st) => z === `
|
|
469
|
+
` ? "" : (st > 0 ? p : "") + z.trimEnd()).join(`
|
|
470
470
|
`);
|
|
471
471
|
}
|
|
472
472
|
};
|
|
@@ -475,7 +475,7 @@ var ut = T((Vt) => {
|
|
|
475
475
|
|
|
476
476
|
// ../node_modules/commander/lib/option.js
|
|
477
477
|
var pt = T((ht) => {
|
|
478
|
-
var { InvalidArgumentError:
|
|
478
|
+
var { InvalidArgumentError: zs } = Oe(), ut = class {
|
|
479
479
|
static {
|
|
480
480
|
d(this, "Option");
|
|
481
481
|
}
|
|
@@ -488,8 +488,8 @@ var pt = T((ht) => {
|
|
|
488
488
|
constructor(e, t) {
|
|
489
489
|
this.flags = e, this.description = t || "", this.required = e.includes("<"), this.optional = e.includes("["), this.variadic = /\w\.\.\.[>\]]$/.
|
|
490
490
|
test(e), this.mandatory = !1;
|
|
491
|
-
let
|
|
492
|
-
this.short =
|
|
491
|
+
let s = Js(e);
|
|
492
|
+
this.short = s.shortFlag, this.long = s.longFlag, this.negate = !1, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue =
|
|
493
493
|
void 0, this.defaultValueDescription = void 0, this.presetArg = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = !1,
|
|
494
494
|
this.argChoices = void 0, this.conflictsWith = [], this.implied = void 0;
|
|
495
495
|
}
|
|
@@ -600,12 +600,12 @@ var pt = T((ht) => {
|
|
|
600
600
|
* @return {Option}
|
|
601
601
|
*/
|
|
602
602
|
choices(e) {
|
|
603
|
-
return this.argChoices = e.slice(), this.parseArg = (t,
|
|
603
|
+
return this.argChoices = e.slice(), this.parseArg = (t, s) => {
|
|
604
604
|
if (!this.argChoices.includes(t))
|
|
605
|
-
throw new
|
|
605
|
+
throw new zs(
|
|
606
606
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
607
607
|
);
|
|
608
|
-
return this.variadic ? this._concatValue(t,
|
|
608
|
+
return this.variadic ? this._concatValue(t, s) : t;
|
|
609
609
|
}, this;
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
@@ -623,7 +623,7 @@ var pt = T((ht) => {
|
|
|
623
623
|
* @return {string}
|
|
624
624
|
*/
|
|
625
625
|
attributeName() {
|
|
626
|
-
return
|
|
626
|
+
return Gs(this.name().replace(/^no-/, ""));
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
629
629
|
* Check if `arg` matches the short or long flag.
|
|
@@ -657,8 +657,8 @@ var pt = T((ht) => {
|
|
|
657
657
|
this.positiveOptions = /* @__PURE__ */ new Map(), this.negativeOptions = /* @__PURE__ */ new Map(), this.dualOptions = /* @__PURE__ */ new Set(),
|
|
658
658
|
e.forEach((t) => {
|
|
659
659
|
t.negate ? this.negativeOptions.set(t.attributeName(), t) : this.positiveOptions.set(t.attributeName(), t);
|
|
660
|
-
}), this.negativeOptions.forEach((t,
|
|
661
|
-
this.positiveOptions.has(
|
|
660
|
+
}), this.negativeOptions.forEach((t, s) => {
|
|
661
|
+
this.positiveOptions.has(s) && this.dualOptions.add(s);
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
/**
|
|
@@ -669,74 +669,74 @@ var pt = T((ht) => {
|
|
|
669
669
|
* @returns {boolean}
|
|
670
670
|
*/
|
|
671
671
|
valueFromOption(e, t) {
|
|
672
|
-
let
|
|
673
|
-
if (!this.dualOptions.has(
|
|
674
|
-
let i = this.negativeOptions.get(
|
|
672
|
+
let s = t.attributeName();
|
|
673
|
+
if (!this.dualOptions.has(s)) return !0;
|
|
674
|
+
let i = this.negativeOptions.get(s).presetArg, n = i !== void 0 ? i : !1;
|
|
675
675
|
return t.negate === (n === e);
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
function
|
|
679
|
-
return
|
|
678
|
+
function Gs(r) {
|
|
679
|
+
return r.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
680
680
|
}
|
|
681
|
-
d(
|
|
682
|
-
function
|
|
683
|
-
let e, t,
|
|
684
|
-
return
|
|
681
|
+
d(Gs, "camelcase");
|
|
682
|
+
function Js(r) {
|
|
683
|
+
let e, t, s = r.split(/[ |,]+/);
|
|
684
|
+
return s.length > 1 && !/^[[<]/.test(s[1]) && (e = s.shift()), t = s.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
685
685
|
longFlag: t };
|
|
686
686
|
}
|
|
687
|
-
d(
|
|
688
|
-
ht.Option =
|
|
687
|
+
d(Js, "splitOptionFlags");
|
|
688
|
+
ht.Option = ut;
|
|
689
689
|
ht.DualOptions = ct;
|
|
690
690
|
});
|
|
691
691
|
|
|
692
692
|
// ../node_modules/commander/lib/suggestSimilar.js
|
|
693
693
|
var $t = T((Dt) => {
|
|
694
|
-
function
|
|
695
|
-
if (Math.abs(
|
|
696
|
-
return Math.max(
|
|
694
|
+
function Ys(r, e) {
|
|
695
|
+
if (Math.abs(r.length - e.length) > 3)
|
|
696
|
+
return Math.max(r.length, e.length);
|
|
697
697
|
let t = [];
|
|
698
|
-
for (let
|
|
699
|
-
t[
|
|
700
|
-
for (let
|
|
701
|
-
t[0][
|
|
702
|
-
for (let
|
|
703
|
-
for (let i = 1; i <=
|
|
698
|
+
for (let s = 0; s <= r.length; s++)
|
|
699
|
+
t[s] = [s];
|
|
700
|
+
for (let s = 0; s <= e.length; s++)
|
|
701
|
+
t[0][s] = s;
|
|
702
|
+
for (let s = 1; s <= e.length; s++)
|
|
703
|
+
for (let i = 1; i <= r.length; i++) {
|
|
704
704
|
let n = 1;
|
|
705
|
-
|
|
706
|
-
t[i - 1][
|
|
705
|
+
r[i - 1] === e[s - 1] ? n = 0 : n = 1, t[i][s] = Math.min(
|
|
706
|
+
t[i - 1][s] + 1,
|
|
707
707
|
// deletion
|
|
708
|
-
t[i][
|
|
708
|
+
t[i][s - 1] + 1,
|
|
709
709
|
// insertion
|
|
710
|
-
t[i - 1][
|
|
710
|
+
t[i - 1][s - 1] + n
|
|
711
711
|
// substitution
|
|
712
|
-
), i > 1 &&
|
|
712
|
+
), i > 1 && s > 1 && r[i - 1] === e[s - 2] && r[i - 2] === e[s - 1] && (t[i][s] = Math.min(t[i][s], t[i - 2][s - 2] + 1));
|
|
713
713
|
}
|
|
714
|
-
return t[
|
|
714
|
+
return t[r.length][e.length];
|
|
715
715
|
}
|
|
716
|
-
d(
|
|
717
|
-
function
|
|
716
|
+
d(Ys, "editDistance");
|
|
717
|
+
function Ks(r, e) {
|
|
718
718
|
if (!e || e.length === 0) return "";
|
|
719
719
|
e = Array.from(new Set(e));
|
|
720
|
-
let t =
|
|
721
|
-
t && (
|
|
722
|
-
let
|
|
720
|
+
let t = r.startsWith("--");
|
|
721
|
+
t && (r = r.slice(2), e = e.map((a) => a.slice(2)));
|
|
722
|
+
let s = [], i = 3, n = 0.4;
|
|
723
723
|
return e.forEach((a) => {
|
|
724
724
|
if (a.length <= 1) return;
|
|
725
|
-
let o =
|
|
726
|
-
(c - o) / c > n && (o < i ? (i = o,
|
|
727
|
-
}),
|
|
728
|
-
(Did you mean one of ${
|
|
729
|
-
(Did you mean ${
|
|
725
|
+
let o = Ys(r, a), c = Math.max(r.length, a.length);
|
|
726
|
+
(c - o) / c > n && (o < i ? (i = o, s = [a]) : o === i && s.push(a));
|
|
727
|
+
}), s.sort((a, o) => a.localeCompare(o)), t && (s = s.map((a) => `--${a}`)), s.length > 1 ? `
|
|
728
|
+
(Did you mean one of ${s.join(", ")}?)` : s.length === 1 ? `
|
|
729
|
+
(Did you mean ${s[0]}?)` : "";
|
|
730
730
|
}
|
|
731
|
-
d(
|
|
732
|
-
Dt.suggestSimilar =
|
|
731
|
+
d(Ks, "suggestSimilar");
|
|
732
|
+
Dt.suggestSimilar = Ks;
|
|
733
733
|
});
|
|
734
734
|
|
|
735
735
|
// ../node_modules/commander/lib/command.js
|
|
736
736
|
var Ut = T((qt) => {
|
|
737
|
-
var
|
|
738
|
-
{ Argument:
|
|
739
|
-
{ suggestSimilar: Mt } = $t(), yt = class
|
|
737
|
+
var Xs = require("node:events").EventEmitter, ft = require("node:child_process"), U = require("node:path"), mt = require("node:fs"), k = require("node:process"),
|
|
738
|
+
{ Argument: Qs, humanReadableArgName: er } = $e(), { CommanderError: gt } = Oe(), { Help: tr } = lt(), { Option: Rt, DualOptions: sr } = pt(),
|
|
739
|
+
{ suggestSimilar: Mt } = $t(), yt = class r extends Xs {
|
|
740
740
|
static {
|
|
741
741
|
d(this, "Command");
|
|
742
742
|
}
|
|
@@ -757,7 +757,7 @@ var Ut = T((qt) => {
|
|
|
757
757
|
writeErr: /* @__PURE__ */ d((t) => k.stderr.write(t), "writeErr"),
|
|
758
758
|
getOutHelpWidth: /* @__PURE__ */ d(() => k.stdout.isTTY ? k.stdout.columns : void 0, "getOutHelpWidth"),
|
|
759
759
|
getErrHelpWidth: /* @__PURE__ */ d(() => k.stderr.isTTY ? k.stderr.columns : void 0, "getErrHelpWidth"),
|
|
760
|
-
outputError: /* @__PURE__ */ d((t,
|
|
760
|
+
outputError: /* @__PURE__ */ d((t, s) => s(t), "outputError")
|
|
761
761
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
762
762
|
{};
|
|
763
763
|
}
|
|
@@ -810,8 +810,8 @@ var Ut = T((qt) => {
|
|
|
810
810
|
* @param {object} [execOpts] - configuration options (for executable)
|
|
811
811
|
* @return {Command} returns new command for action handler, or `this` for executable command
|
|
812
812
|
*/
|
|
813
|
-
command(e, t,
|
|
814
|
-
let i = t, n =
|
|
813
|
+
command(e, t, s) {
|
|
814
|
+
let i = t, n = s;
|
|
815
815
|
typeof i == "object" && i !== null && (n = i, i = null), n = n || {};
|
|
816
816
|
let [, a, o] = e.match(/([^ ]+) *(.*)/), c = this.createCommand(a);
|
|
817
817
|
return i && (c.description(i), c._executableHandler = !0), n.isDefault && (this._defaultCommandName = c._name), c._hidden = !!(n.noHelp ||
|
|
@@ -828,7 +828,7 @@ var Ut = T((qt) => {
|
|
|
828
828
|
* @return {Command} new command
|
|
829
829
|
*/
|
|
830
830
|
createCommand(e) {
|
|
831
|
-
return new
|
|
831
|
+
return new r(e);
|
|
832
832
|
}
|
|
833
833
|
/**
|
|
834
834
|
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
@@ -837,7 +837,7 @@ var Ut = T((qt) => {
|
|
|
837
837
|
* @return {Help}
|
|
838
838
|
*/
|
|
839
839
|
createHelp() {
|
|
840
|
-
return Object.assign(new
|
|
840
|
+
return Object.assign(new tr(), this.configureHelp());
|
|
841
841
|
}
|
|
842
842
|
/**
|
|
843
843
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -915,7 +915,7 @@ var Ut = T((qt) => {
|
|
|
915
915
|
* @return {Argument} new argument
|
|
916
916
|
*/
|
|
917
917
|
createArgument(e, t) {
|
|
918
|
-
return new
|
|
918
|
+
return new Qs(e, t);
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
921
921
|
* Define argument syntax for command.
|
|
@@ -933,9 +933,9 @@ var Ut = T((qt) => {
|
|
|
933
933
|
* @param {*} [defaultValue]
|
|
934
934
|
* @return {Command} `this` command for chaining
|
|
935
935
|
*/
|
|
936
|
-
argument(e, t,
|
|
936
|
+
argument(e, t, s, i) {
|
|
937
937
|
let n = this.createArgument(e, t);
|
|
938
|
-
return typeof
|
|
938
|
+
return typeof s == "function" ? n.default(i).argParser(s) : n.default(s), this.addArgument(n), this;
|
|
939
939
|
}
|
|
940
940
|
/**
|
|
941
941
|
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
@@ -988,7 +988,7 @@ var Ut = T((qt) => {
|
|
|
988
988
|
if (typeof e == "boolean")
|
|
989
989
|
return this._addImplicitHelpCommand = e, this;
|
|
990
990
|
e = e ?? "help [command]";
|
|
991
|
-
let [,
|
|
991
|
+
let [, s, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command", a = this.createCommand(s);
|
|
992
992
|
return a.helpOption(!1), i && a.arguments(i), n && a.description(n), this._addImplicitHelpCommand = !0, this._helpCommand = a, this;
|
|
993
993
|
}
|
|
994
994
|
/**
|
|
@@ -1019,10 +1019,10 @@ var Ut = T((qt) => {
|
|
|
1019
1019
|
* @return {Command} `this` command for chaining
|
|
1020
1020
|
*/
|
|
1021
1021
|
hook(e, t) {
|
|
1022
|
-
let
|
|
1023
|
-
if (!
|
|
1022
|
+
let s = ["preSubcommand", "preAction", "postAction"];
|
|
1023
|
+
if (!s.includes(e))
|
|
1024
1024
|
throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
1025
|
-
Expecting one of '${
|
|
1025
|
+
Expecting one of '${s.join("', '")}'`);
|
|
1026
1026
|
return this._lifeCycleHooks[e] ? this._lifeCycleHooks[e].push(t) : this._lifeCycleHooks[e] = [t], this;
|
|
1027
1027
|
}
|
|
1028
1028
|
/**
|
|
@@ -1046,8 +1046,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1046
1046
|
* @return never
|
|
1047
1047
|
* @private
|
|
1048
1048
|
*/
|
|
1049
|
-
_exit(e, t,
|
|
1050
|
-
this._exitCallback && this._exitCallback(new gt(e, t,
|
|
1049
|
+
_exit(e, t, s) {
|
|
1050
|
+
this._exitCallback && this._exitCallback(new gt(e, t, s)), k.exit(e);
|
|
1051
1051
|
}
|
|
1052
1052
|
/**
|
|
1053
1053
|
* Register callback `fn` for the command.
|
|
@@ -1064,8 +1064,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1064
1064
|
* @return {Command} `this` command for chaining
|
|
1065
1065
|
*/
|
|
1066
1066
|
action(e) {
|
|
1067
|
-
let t = /* @__PURE__ */ d((
|
|
1068
|
-
let i = this.registeredArguments.length, n =
|
|
1067
|
+
let t = /* @__PURE__ */ d((s) => {
|
|
1068
|
+
let i = this.registeredArguments.length, n = s.slice(0, i);
|
|
1069
1069
|
return this._storeOptionsAsProperties ? n[i] = this : n[i] = this.opts(), n.push(this), e.apply(this, n);
|
|
1070
1070
|
}, "listener");
|
|
1071
1071
|
return this._actionHandler = t, this;
|
|
@@ -1092,9 +1092,9 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1092
1092
|
* @param {string} invalidArgumentMessage
|
|
1093
1093
|
* @private
|
|
1094
1094
|
*/
|
|
1095
|
-
_callParseArg(e, t,
|
|
1095
|
+
_callParseArg(e, t, s, i) {
|
|
1096
1096
|
try {
|
|
1097
|
-
return e.parseArg(t,
|
|
1097
|
+
return e.parseArg(t, s);
|
|
1098
1098
|
} catch (n) {
|
|
1099
1099
|
if (n.code === "commander.invalidArgument") {
|
|
1100
1100
|
let a = `${i} ${n.message}`;
|
|
@@ -1113,8 +1113,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1113
1113
|
_registerOption(e) {
|
|
1114
1114
|
let t = e.short && this._findOption(e.short) || e.long && this._findOption(e.long);
|
|
1115
1115
|
if (t) {
|
|
1116
|
-
let
|
|
1117
|
-
throw new Error(`Cannot add option '${e.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${
|
|
1116
|
+
let s = e.long && this._findOption(e.long) ? e.long : e.short;
|
|
1117
|
+
throw new Error(`Cannot add option '${e.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${s}'
|
|
1118
1118
|
- already used by option '${t.flags}'`);
|
|
1119
1119
|
}
|
|
1120
1120
|
this.options.push(e);
|
|
@@ -1127,11 +1127,11 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1127
1127
|
* @private
|
|
1128
1128
|
*/
|
|
1129
1129
|
_registerCommand(e) {
|
|
1130
|
-
let t = /* @__PURE__ */ d((i) => [i.name()].concat(i.aliases()), "knownBy"),
|
|
1130
|
+
let t = /* @__PURE__ */ d((i) => [i.name()].concat(i.aliases()), "knownBy"), s = t(e).find(
|
|
1131
1131
|
(i) => this._findCommand(i)
|
|
1132
1132
|
);
|
|
1133
|
-
if (
|
|
1134
|
-
let i = t(this._findCommand(
|
|
1133
|
+
if (s) {
|
|
1134
|
+
let i = t(this._findCommand(s)).join("|"), n = t(e).join("|");
|
|
1135
1135
|
throw new Error(
|
|
1136
1136
|
`cannot add command '${n}' as already have command '${i}'`
|
|
1137
1137
|
);
|
|
@@ -1146,20 +1146,20 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1146
1146
|
*/
|
|
1147
1147
|
addOption(e) {
|
|
1148
1148
|
this._registerOption(e);
|
|
1149
|
-
let t = e.name(),
|
|
1149
|
+
let t = e.name(), s = e.attributeName();
|
|
1150
1150
|
if (e.negate) {
|
|
1151
1151
|
let n = e.long.replace(/^--no-/, "--");
|
|
1152
1152
|
this._findOption(n) || this.setOptionValueWithSource(
|
|
1153
|
-
|
|
1153
|
+
s,
|
|
1154
1154
|
e.defaultValue === void 0 ? !0 : e.defaultValue,
|
|
1155
1155
|
"default"
|
|
1156
1156
|
);
|
|
1157
|
-
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(
|
|
1157
|
+
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(s, e.defaultValue, "default");
|
|
1158
1158
|
let i = /* @__PURE__ */ d((n, a, o) => {
|
|
1159
1159
|
n == null && e.presetArg !== void 0 && (n = e.presetArg);
|
|
1160
|
-
let c = this.getOptionValue(
|
|
1160
|
+
let c = this.getOptionValue(s);
|
|
1161
1161
|
n !== null && e.parseArg ? n = this._callParseArg(e, n, c, a) : n !== null && e.variadic && (n = e._concatValue(n, c)), n == null &&
|
|
1162
|
-
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(
|
|
1162
|
+
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(s, n, o);
|
|
1163
1163
|
}, "handleOptionValue");
|
|
1164
1164
|
return this.on("option:" + t, (n) => {
|
|
1165
1165
|
let a = `error: option '${e.flags}' argument '${n}' is invalid.`;
|
|
@@ -1175,12 +1175,12 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1175
1175
|
* @return {Command} `this` command for chaining
|
|
1176
1176
|
* @private
|
|
1177
1177
|
*/
|
|
1178
|
-
_optionEx(e, t,
|
|
1178
|
+
_optionEx(e, t, s, i, n) {
|
|
1179
1179
|
if (typeof t == "object" && t instanceof Rt)
|
|
1180
1180
|
throw new Error(
|
|
1181
1181
|
"To add an Option object use addOption() instead of option() or requiredOption()"
|
|
1182
1182
|
);
|
|
1183
|
-
let a = this.createOption(t,
|
|
1183
|
+
let a = this.createOption(t, s);
|
|
1184
1184
|
if (a.makeOptionMandatory(!!e.mandatory), typeof i == "function")
|
|
1185
1185
|
a.default(n).argParser(i);
|
|
1186
1186
|
else if (i instanceof RegExp) {
|
|
@@ -1214,8 +1214,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1214
1214
|
* @param {*} [defaultValue]
|
|
1215
1215
|
* @return {Command} `this` command for chaining
|
|
1216
1216
|
*/
|
|
1217
|
-
option(e, t,
|
|
1218
|
-
return this._optionEx({}, e, t,
|
|
1217
|
+
option(e, t, s, i) {
|
|
1218
|
+
return this._optionEx({}, e, t, s, i);
|
|
1219
1219
|
}
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Add a required option which must have a value after parsing. This usually means
|
|
@@ -1229,12 +1229,12 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1229
1229
|
* @param {*} [defaultValue]
|
|
1230
1230
|
* @return {Command} `this` command for chaining
|
|
1231
1231
|
*/
|
|
1232
|
-
requiredOption(e, t,
|
|
1232
|
+
requiredOption(e, t, s, i) {
|
|
1233
1233
|
return this._optionEx(
|
|
1234
1234
|
{ mandatory: !0 },
|
|
1235
1235
|
e,
|
|
1236
1236
|
t,
|
|
1237
|
-
|
|
1237
|
+
s,
|
|
1238
1238
|
i
|
|
1239
1239
|
);
|
|
1240
1240
|
}
|
|
@@ -1345,8 +1345,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1345
1345
|
* @param {string} source - expected values are default/config/env/cli/implied
|
|
1346
1346
|
* @return {Command} `this` command for chaining
|
|
1347
1347
|
*/
|
|
1348
|
-
setOptionValueWithSource(e, t,
|
|
1349
|
-
return this._storeOptionsAsProperties ? this[e] = t : this._optionValues[e] = t, this._optionValueSources[e] =
|
|
1348
|
+
setOptionValueWithSource(e, t, s) {
|
|
1349
|
+
return this._storeOptionsAsProperties ? this[e] = t : this._optionValues[e] = t, this._optionValueSources[e] = s, this;
|
|
1350
1350
|
}
|
|
1351
1351
|
/**
|
|
1352
1352
|
* Get source of option value.
|
|
@@ -1367,8 +1367,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1367
1367
|
*/
|
|
1368
1368
|
getOptionValueSourceWithGlobals(e) {
|
|
1369
1369
|
let t;
|
|
1370
|
-
return this._getCommandAndAncestors().forEach((
|
|
1371
|
-
|
|
1370
|
+
return this._getCommandAndAncestors().forEach((s) => {
|
|
1371
|
+
s.getOptionValueSource(e) !== void 0 && (t = s.getOptionValueSource(e));
|
|
1372
1372
|
}), t;
|
|
1373
1373
|
}
|
|
1374
1374
|
/**
|
|
@@ -1386,27 +1386,27 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1386
1386
|
(i.includes("-e") || i.includes("--eval") || i.includes("-p") || i.includes("--print")) && (t.from = "eval");
|
|
1387
1387
|
}
|
|
1388
1388
|
e === void 0 && (e = k.argv), this.rawArgs = e.slice();
|
|
1389
|
-
let
|
|
1389
|
+
let s;
|
|
1390
1390
|
switch (t.from) {
|
|
1391
1391
|
case void 0:
|
|
1392
1392
|
case "node":
|
|
1393
|
-
this._scriptPath = e[1],
|
|
1393
|
+
this._scriptPath = e[1], s = e.slice(2);
|
|
1394
1394
|
break;
|
|
1395
1395
|
case "electron":
|
|
1396
|
-
k.defaultApp ? (this._scriptPath = e[1],
|
|
1396
|
+
k.defaultApp ? (this._scriptPath = e[1], s = e.slice(2)) : s = e.slice(1);
|
|
1397
1397
|
break;
|
|
1398
1398
|
case "user":
|
|
1399
|
-
|
|
1399
|
+
s = e.slice(0);
|
|
1400
1400
|
break;
|
|
1401
1401
|
case "eval":
|
|
1402
|
-
|
|
1402
|
+
s = e.slice(1);
|
|
1403
1403
|
break;
|
|
1404
1404
|
default:
|
|
1405
1405
|
throw new Error(
|
|
1406
1406
|
`unexpected parse option { from: '${t.from}' }`
|
|
1407
1407
|
);
|
|
1408
1408
|
}
|
|
1409
|
-
return !this._name && this._scriptPath && this.nameFromFilename(this._scriptPath), this._name = this._name || "program",
|
|
1409
|
+
return !this._name && this._scriptPath && this.nameFromFilename(this._scriptPath), this._name = this._name || "program", s;
|
|
1410
1410
|
}
|
|
1411
1411
|
/**
|
|
1412
1412
|
* Parse `argv`, setting options and invoking commands when defined.
|
|
@@ -1431,8 +1431,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1431
1431
|
* @return {Command} `this` command for chaining
|
|
1432
1432
|
*/
|
|
1433
1433
|
parse(e, t) {
|
|
1434
|
-
let
|
|
1435
|
-
return this._parseCommand([],
|
|
1434
|
+
let s = this._prepareUserArgs(e, t);
|
|
1435
|
+
return this._parseCommand([], s), this;
|
|
1436
1436
|
}
|
|
1437
1437
|
/**
|
|
1438
1438
|
* Parse `argv`, setting options and invoking commands when defined.
|
|
@@ -1455,8 +1455,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1455
1455
|
* @return {Promise}
|
|
1456
1456
|
*/
|
|
1457
1457
|
async parseAsync(e, t) {
|
|
1458
|
-
let
|
|
1459
|
-
return await this._parseCommand([],
|
|
1458
|
+
let s = this._prepareUserArgs(e, t);
|
|
1459
|
+
return await this._parseCommand([], s), this;
|
|
1460
1460
|
}
|
|
1461
1461
|
/**
|
|
1462
1462
|
* Execute a sub-command executable.
|
|
@@ -1465,7 +1465,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1465
1465
|
*/
|
|
1466
1466
|
_executeSubCommand(e, t) {
|
|
1467
1467
|
t = t.slice();
|
|
1468
|
-
let
|
|
1468
|
+
let s = !1, i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1469
1469
|
function n(p, y) {
|
|
1470
1470
|
let C = U.resolve(p, y);
|
|
1471
1471
|
if (mt.existsSync(C)) return C;
|
|
@@ -1503,9 +1503,9 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1503
1503
|
}
|
|
1504
1504
|
a = p || a;
|
|
1505
1505
|
}
|
|
1506
|
-
|
|
1506
|
+
s = i.includes(U.extname(a));
|
|
1507
1507
|
let c;
|
|
1508
|
-
k.platform !== "win32" ?
|
|
1508
|
+
k.platform !== "win32" ? s ? (t.unshift(a), t = Lt(k.execArgv).concat(t), c = ft.spawn(k.argv[0], t, { stdio: "inherit" })) : c = ft.spawn(
|
|
1509
1509
|
a, t, { stdio: "inherit" }) : (t.unshift(a), t = Lt(k.execArgv).concat(t), c = ft.spawn(k.execPath, t, { stdio: "inherit" })), c.killed ||
|
|
1510
1510
|
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((y) => {
|
|
1511
1511
|
k.on(y, () => {
|
|
@@ -1547,7 +1547,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1547
1547
|
/**
|
|
1548
1548
|
* @private
|
|
1549
1549
|
*/
|
|
1550
|
-
_dispatchSubcommand(e, t,
|
|
1550
|
+
_dispatchSubcommand(e, t, s) {
|
|
1551
1551
|
let i = this._findCommand(e);
|
|
1552
1552
|
i || this.help({ error: !0 });
|
|
1553
1553
|
let n;
|
|
@@ -1557,9 +1557,9 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1557
1557
|
"preSubcommand"
|
|
1558
1558
|
), n = this._chainOrCall(n, () => {
|
|
1559
1559
|
if (i._executableHandler)
|
|
1560
|
-
this._executeSubCommand(i, t.concat(
|
|
1560
|
+
this._executeSubCommand(i, t.concat(s));
|
|
1561
1561
|
else
|
|
1562
|
-
return i._parseCommand(t,
|
|
1562
|
+
return i._parseCommand(t, s);
|
|
1563
1563
|
}), n;
|
|
1564
1564
|
}
|
|
1565
1565
|
/**
|
|
@@ -1594,12 +1594,12 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1594
1594
|
* @private
|
|
1595
1595
|
*/
|
|
1596
1596
|
_processArguments() {
|
|
1597
|
-
let e = /* @__PURE__ */ d((
|
|
1597
|
+
let e = /* @__PURE__ */ d((s, i, n) => {
|
|
1598
1598
|
let a = i;
|
|
1599
|
-
if (i !== null &&
|
|
1600
|
-
let o = `error: command-argument value '${i}' is invalid for argument '${
|
|
1599
|
+
if (i !== null && s.parseArg) {
|
|
1600
|
+
let o = `error: command-argument value '${i}' is invalid for argument '${s.name()}'.`;
|
|
1601
1601
|
a = this._callParseArg(
|
|
1602
|
-
|
|
1602
|
+
s,
|
|
1603
1603
|
i,
|
|
1604
1604
|
n,
|
|
1605
1605
|
o
|
|
@@ -1609,10 +1609,10 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1609
1609
|
}, "myParseArg");
|
|
1610
1610
|
this._checkNumberOfArguments();
|
|
1611
1611
|
let t = [];
|
|
1612
|
-
this.registeredArguments.forEach((
|
|
1613
|
-
let n =
|
|
1614
|
-
|
|
1615
|
-
void 0 && (n = []) : i < this.args.length && (n = this.args[i],
|
|
1612
|
+
this.registeredArguments.forEach((s, i) => {
|
|
1613
|
+
let n = s.defaultValue;
|
|
1614
|
+
s.variadic ? i < this.args.length ? (n = this.args.slice(i), s.parseArg && (n = n.reduce((a, o) => e(s, o, a), s.defaultValue))) : n ===
|
|
1615
|
+
void 0 && (n = []) : i < this.args.length && (n = this.args[i], s.parseArg && (n = e(s, n, s.defaultValue))), t[i] = n;
|
|
1616
1616
|
}), this.processedArgs = t;
|
|
1617
1617
|
}
|
|
1618
1618
|
/**
|
|
@@ -1634,14 +1634,14 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1634
1634
|
* @private
|
|
1635
1635
|
*/
|
|
1636
1636
|
_chainOrCallHooks(e, t) {
|
|
1637
|
-
let
|
|
1637
|
+
let s = e, i = [];
|
|
1638
1638
|
return this._getCommandAndAncestors().reverse().filter((n) => n._lifeCycleHooks[t] !== void 0).forEach((n) => {
|
|
1639
1639
|
n._lifeCycleHooks[t].forEach((a) => {
|
|
1640
1640
|
i.push({ hookedCommand: n, callback: a });
|
|
1641
1641
|
});
|
|
1642
1642
|
}), t === "postAction" && i.reverse(), i.forEach((n) => {
|
|
1643
|
-
|
|
1644
|
-
}),
|
|
1643
|
+
s = this._chainOrCall(s, () => n.callback(n.hookedCommand, this));
|
|
1644
|
+
}), s;
|
|
1645
1645
|
}
|
|
1646
1646
|
/**
|
|
1647
1647
|
*
|
|
@@ -1651,9 +1651,9 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1651
1651
|
* @return {(Promise|undefined)}
|
|
1652
1652
|
* @private
|
|
1653
1653
|
*/
|
|
1654
|
-
_chainOrCallSubCommandHook(e, t,
|
|
1654
|
+
_chainOrCallSubCommandHook(e, t, s) {
|
|
1655
1655
|
let i = e;
|
|
1656
|
-
return this._lifeCycleHooks[
|
|
1656
|
+
return this._lifeCycleHooks[s] !== void 0 && this._lifeCycleHooks[s].forEach((n) => {
|
|
1657
1657
|
i = this._chainOrCall(i, () => n(this, t));
|
|
1658
1658
|
}), i;
|
|
1659
1659
|
}
|
|
@@ -1664,8 +1664,8 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1664
1664
|
* @private
|
|
1665
1665
|
*/
|
|
1666
1666
|
_parseCommand(e, t) {
|
|
1667
|
-
let
|
|
1668
|
-
if (this._parseOptionsEnv(), this._parseOptionsImplied(), e = e.concat(
|
|
1667
|
+
let s = this.parseOptions(t);
|
|
1668
|
+
if (this._parseOptionsEnv(), this._parseOptionsImplied(), e = e.concat(s.operands), t = s.unknown, this.args = e.concat(t), e && this.
|
|
1669
1669
|
_findCommand(e[0]))
|
|
1670
1670
|
return this._dispatchSubcommand(e[0], e.slice(1), t);
|
|
1671
1671
|
if (this._getHelpCommand() && e[0] === this._getHelpCommand().name())
|
|
@@ -1677,9 +1677,9 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1677
1677
|
t
|
|
1678
1678
|
);
|
|
1679
1679
|
this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName && this.help({ error: !0 }), this.
|
|
1680
|
-
_outputHelpIfRequested(
|
|
1680
|
+
_outputHelpIfRequested(s.unknown), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1681
1681
|
let i = /* @__PURE__ */ d(() => {
|
|
1682
|
-
|
|
1682
|
+
s.unknown.length > 0 && this.unknownOption(s.unknown[0]);
|
|
1683
1683
|
}, "checkForUnknownOptions"), n = `command:${this.name()}`;
|
|
1684
1684
|
if (this._actionHandler) {
|
|
1685
1685
|
i(), this._processArguments();
|
|
@@ -1740,17 +1740,17 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1740
1740
|
* @private
|
|
1741
1741
|
*/
|
|
1742
1742
|
_checkForConflictingLocalOptions() {
|
|
1743
|
-
let e = this.options.filter((
|
|
1744
|
-
let i =
|
|
1743
|
+
let e = this.options.filter((s) => {
|
|
1744
|
+
let i = s.attributeName();
|
|
1745
1745
|
return this.getOptionValue(i) === void 0 ? !1 : this.getOptionValueSource(i) !== "default";
|
|
1746
1746
|
});
|
|
1747
1747
|
e.filter(
|
|
1748
|
-
(
|
|
1749
|
-
).forEach((
|
|
1748
|
+
(s) => s.conflictsWith.length > 0
|
|
1749
|
+
).forEach((s) => {
|
|
1750
1750
|
let i = e.find(
|
|
1751
|
-
(n) =>
|
|
1751
|
+
(n) => s.conflictsWith.includes(n.attributeName())
|
|
1752
1752
|
);
|
|
1753
|
-
i && this._conflictingOption(
|
|
1753
|
+
i && this._conflictingOption(s, i);
|
|
1754
1754
|
});
|
|
1755
1755
|
}
|
|
1756
1756
|
/**
|
|
@@ -1780,7 +1780,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1780
1780
|
* @return {{operands: string[], unknown: string[]}}
|
|
1781
1781
|
*/
|
|
1782
1782
|
parseOptions(e) {
|
|
1783
|
-
let t = [],
|
|
1783
|
+
let t = [], s = [], i = t, n = e.slice();
|
|
1784
1784
|
function a(c) {
|
|
1785
1785
|
return c.length > 1 && c[0] === "-";
|
|
1786
1786
|
}
|
|
@@ -1789,7 +1789,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1789
1789
|
for (; n.length; ) {
|
|
1790
1790
|
let c = n.shift();
|
|
1791
1791
|
if (c === "--") {
|
|
1792
|
-
i ===
|
|
1792
|
+
i === s && i.push(c), i.push(...n);
|
|
1793
1793
|
break;
|
|
1794
1794
|
}
|
|
1795
1795
|
if (o && !a(c)) {
|
|
@@ -1826,15 +1826,15 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1826
1826
|
continue;
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
if (a(c) && (i =
|
|
1829
|
+
if (a(c) && (i = s), (this._enablePositionalOptions || this._passThroughOptions) && t.length === 0 && s.length === 0) {
|
|
1830
1830
|
if (this._findCommand(c)) {
|
|
1831
|
-
t.push(c), n.length > 0 &&
|
|
1831
|
+
t.push(c), n.length > 0 && s.push(...n);
|
|
1832
1832
|
break;
|
|
1833
1833
|
} else if (this._getHelpCommand() && c === this._getHelpCommand().name()) {
|
|
1834
1834
|
t.push(c), n.length > 0 && t.push(...n);
|
|
1835
1835
|
break;
|
|
1836
1836
|
} else if (this._defaultCommandName) {
|
|
1837
|
-
|
|
1837
|
+
s.push(c), n.length > 0 && s.push(...n);
|
|
1838
1838
|
break;
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
@@ -1844,7 +1844,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1844
1844
|
}
|
|
1845
1845
|
i.push(c);
|
|
1846
1846
|
}
|
|
1847
|
-
return { operands: t, unknown:
|
|
1847
|
+
return { operands: t, unknown: s };
|
|
1848
1848
|
}
|
|
1849
1849
|
/**
|
|
1850
1850
|
* Return an object containing local option values as key-value pairs.
|
|
@@ -1854,8 +1854,8 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1854
1854
|
opts() {
|
|
1855
1855
|
if (this._storeOptionsAsProperties) {
|
|
1856
1856
|
let e = {}, t = this.options.length;
|
|
1857
|
-
for (let
|
|
1858
|
-
let i = this.options[
|
|
1857
|
+
for (let s = 0; s < t; s++) {
|
|
1858
|
+
let i = this.options[s].attributeName();
|
|
1859
1859
|
e[i] = i === this._versionOptionName ? this._version : this[i];
|
|
1860
1860
|
}
|
|
1861
1861
|
return e;
|
|
@@ -1889,7 +1889,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1889
1889
|
), typeof this._showHelpAfterError == "string" ? this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
1890
1890
|
`) : this._showHelpAfterError && (this._outputConfiguration.writeErr(`
|
|
1891
1891
|
`), this.outputHelp({ error: !0 }));
|
|
1892
|
-
let
|
|
1892
|
+
let s = t || {}, i = s.exitCode || 1, n = s.code || "commander.error";
|
|
1893
1893
|
this._exit(i, n, e);
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
@@ -1914,18 +1914,18 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1914
1914
|
* @private
|
|
1915
1915
|
*/
|
|
1916
1916
|
_parseOptionsImplied() {
|
|
1917
|
-
let e = new
|
|
1918
|
-
getOptionValueSource(
|
|
1917
|
+
let e = new sr(this.options), t = /* @__PURE__ */ d((s) => this.getOptionValue(s) !== void 0 && !["default", "implied"].includes(this.
|
|
1918
|
+
getOptionValueSource(s)), "hasCustomOptionValue");
|
|
1919
1919
|
this.options.filter(
|
|
1920
|
-
(
|
|
1921
|
-
this.getOptionValue(
|
|
1922
|
-
|
|
1920
|
+
(s) => s.implied !== void 0 && t(s.attributeName()) && e.valueFromOption(
|
|
1921
|
+
this.getOptionValue(s.attributeName()),
|
|
1922
|
+
s
|
|
1923
1923
|
)
|
|
1924
|
-
).forEach((
|
|
1925
|
-
Object.keys(
|
|
1924
|
+
).forEach((s) => {
|
|
1925
|
+
Object.keys(s.implied).filter((i) => !t(i)).forEach((i) => {
|
|
1926
1926
|
this.setOptionValueWithSource(
|
|
1927
1927
|
i,
|
|
1928
|
-
|
|
1928
|
+
s.implied[i],
|
|
1929
1929
|
"implied"
|
|
1930
1930
|
);
|
|
1931
1931
|
});
|
|
@@ -1969,7 +1969,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1969
1969
|
* @private
|
|
1970
1970
|
*/
|
|
1971
1971
|
_conflictingOption(e, t) {
|
|
1972
|
-
let
|
|
1972
|
+
let s = /* @__PURE__ */ d((a) => {
|
|
1973
1973
|
let o = a.attributeName(), c = this.getOptionValue(o), h = this.options.find(
|
|
1974
1974
|
(y) => y.negate && o === y.attributeName()
|
|
1975
1975
|
), p = this.options.find(
|
|
@@ -1977,7 +1977,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1977
1977
|
);
|
|
1978
1978
|
return h && (h.presetArg === void 0 && c === !1 || h.presetArg !== void 0 && c === h.presetArg) ? h : p || a;
|
|
1979
1979
|
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((a) => {
|
|
1980
|
-
let o =
|
|
1980
|
+
let o = s(a), c = o.attributeName();
|
|
1981
1981
|
return this.getOptionValueSource(c) === "env" ? `environment variable '${o.envVar}'` : `option '${o.flags}'`;
|
|
1982
1982
|
}, "getErrorMessage"), n = `error: ${i(e)} cannot be used with ${i(t)}`;
|
|
1983
1983
|
this.error(n, { code: "commander.conflictingOption" });
|
|
@@ -1999,8 +1999,8 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
1999
1999
|
} while (n && !n._enablePositionalOptions);
|
|
2000
2000
|
t = Mt(e, i);
|
|
2001
2001
|
}
|
|
2002
|
-
let
|
|
2003
|
-
this.error(
|
|
2002
|
+
let s = `error: unknown option '${e}'${t}`;
|
|
2003
|
+
this.error(s, { code: "commander.unknownOption" });
|
|
2004
2004
|
}
|
|
2005
2005
|
/**
|
|
2006
2006
|
* Excess arguments, more than expected.
|
|
@@ -2010,8 +2010,8 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2010
2010
|
*/
|
|
2011
2011
|
_excessArguments(e) {
|
|
2012
2012
|
if (this._allowExcessArguments) return;
|
|
2013
|
-
let t = this.registeredArguments.length,
|
|
2014
|
-
""}. Expected ${t} argument${
|
|
2013
|
+
let t = this.registeredArguments.length, s = t === 1 ? "" : "s", n = `error: too many arguments${this.parent ? ` for '${this.name()}'` :
|
|
2014
|
+
""}. Expected ${t} argument${s} but got ${e.length}.`;
|
|
2015
2015
|
this.error(n, { code: "commander.excessArguments" });
|
|
2016
2016
|
}
|
|
2017
2017
|
/**
|
|
@@ -2027,8 +2027,8 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2027
2027
|
i.push(n.name()), n.alias() && i.push(n.alias());
|
|
2028
2028
|
}), t = Mt(e, i);
|
|
2029
2029
|
}
|
|
2030
|
-
let
|
|
2031
|
-
this.error(
|
|
2030
|
+
let s = `error: unknown command '${e}'${t}`;
|
|
2031
|
+
this.error(s, { code: "commander.unknownCommand" });
|
|
2032
2032
|
}
|
|
2033
2033
|
/**
|
|
2034
2034
|
* Get or set the program version.
|
|
@@ -2042,10 +2042,10 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2042
2042
|
* @param {string} [description]
|
|
2043
2043
|
* @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
|
|
2044
2044
|
*/
|
|
2045
|
-
version(e, t,
|
|
2045
|
+
version(e, t, s) {
|
|
2046
2046
|
if (e === void 0) return this._version;
|
|
2047
|
-
this._version = e, t = t || "-V, --version",
|
|
2048
|
-
let i = this.createOption(t,
|
|
2047
|
+
this._version = e, t = t || "-V, --version", s = s || "output the version number";
|
|
2048
|
+
let i = this.createOption(t, s);
|
|
2049
2049
|
return this._versionOptionName = i.attributeName(), this._registerOption(i), this.on("option:" + i.name(), () => {
|
|
2050
2050
|
this._outputConfiguration.writeOut(`${e}
|
|
2051
2051
|
`), this._exit(0, "commander.version", e);
|
|
@@ -2084,9 +2084,9 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2084
2084
|
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler && (t = this.commands[this.commands.length -
|
|
2085
2085
|
1]), e === t._name)
|
|
2086
2086
|
throw new Error("Command alias can't be the same as its name");
|
|
2087
|
-
let
|
|
2088
|
-
if (
|
|
2089
|
-
let i = [
|
|
2087
|
+
let s = this.parent?._findCommand(e);
|
|
2088
|
+
if (s) {
|
|
2089
|
+
let i = [s.name()].concat(s.aliases()).join("|");
|
|
2090
2090
|
throw new Error(
|
|
2091
2091
|
`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`
|
|
2092
2092
|
);
|
|
@@ -2113,7 +2113,7 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2113
2113
|
usage(e) {
|
|
2114
2114
|
if (e === void 0) {
|
|
2115
2115
|
if (this._usage) return this._usage;
|
|
2116
|
-
let t = this.registeredArguments.map((
|
|
2116
|
+
let t = this.registeredArguments.map((s) => er(s));
|
|
2117
2117
|
return [].concat(
|
|
2118
2118
|
this.options.length || this._helpOption !== null ? "[options]" : [],
|
|
2119
2119
|
this.commands.length ? "[command]" : [],
|
|
@@ -2176,9 +2176,9 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2176
2176
|
*/
|
|
2177
2177
|
_getHelpContext(e) {
|
|
2178
2178
|
e = e || {};
|
|
2179
|
-
let t = { error: !!e.error },
|
|
2180
|
-
return t.error ?
|
|
2181
|
-
writeOut(i), "write"), t.write = e.write ||
|
|
2179
|
+
let t = { error: !!e.error }, s;
|
|
2180
|
+
return t.error ? s = /* @__PURE__ */ d((i) => this._outputConfiguration.writeErr(i), "write") : s = /* @__PURE__ */ d((i) => this._outputConfiguration.
|
|
2181
|
+
writeOut(i), "write"), t.write = e.write || s, t.command = this, t;
|
|
2182
2182
|
}
|
|
2183
2183
|
/**
|
|
2184
2184
|
* Output help information for this command.
|
|
@@ -2190,14 +2190,14 @@ cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
|
2190
2190
|
outputHelp(e) {
|
|
2191
2191
|
let t;
|
|
2192
2192
|
typeof e == "function" && (t = e, e = void 0);
|
|
2193
|
-
let
|
|
2194
|
-
this._getCommandAndAncestors().reverse().forEach((n) => n.emit("beforeAllHelp",
|
|
2195
|
-
let i = this.helpInformation(
|
|
2193
|
+
let s = this._getHelpContext(e);
|
|
2194
|
+
this._getCommandAndAncestors().reverse().forEach((n) => n.emit("beforeAllHelp", s)), this.emit("beforeHelp", s);
|
|
2195
|
+
let i = this.helpInformation(s);
|
|
2196
2196
|
if (t && (i = t(i), typeof i != "string" && !Buffer.isBuffer(i)))
|
|
2197
2197
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
2198
|
-
|
|
2198
|
+
s.write(i), this._getHelpOption()?.long && this.emit(this._getHelpOption().long), this.emit("afterHelp", s), this._getCommandAndAncestors().
|
|
2199
2199
|
forEach(
|
|
2200
|
-
(n) => n.emit("afterAllHelp",
|
|
2200
|
+
(n) => n.emit("afterAllHelp", s)
|
|
2201
2201
|
);
|
|
2202
2202
|
}
|
|
2203
2203
|
/**
|
|
@@ -2259,10 +2259,10 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2259
2259
|
* @return {Command} `this` command for chaining
|
|
2260
2260
|
*/
|
|
2261
2261
|
addHelpText(e, t) {
|
|
2262
|
-
let
|
|
2263
|
-
if (!
|
|
2262
|
+
let s = ["beforeAll", "before", "after", "afterAll"];
|
|
2263
|
+
if (!s.includes(e))
|
|
2264
2264
|
throw new Error(`Unexpected value for position to addHelpText.
|
|
2265
|
-
Expecting one of '${
|
|
2265
|
+
Expecting one of '${s.join("', '")}'`);
|
|
2266
2266
|
let i = `${e}Help`;
|
|
2267
2267
|
return this.on(i, (n) => {
|
|
2268
2268
|
let a;
|
|
@@ -2281,14 +2281,14 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2281
2281
|
t && e.find((i) => t.is(i)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2282
2282
|
}
|
|
2283
2283
|
};
|
|
2284
|
-
function Lt(
|
|
2285
|
-
return
|
|
2284
|
+
function Lt(r) {
|
|
2285
|
+
return r.map((e) => {
|
|
2286
2286
|
if (!e.startsWith("--inspect"))
|
|
2287
2287
|
return e;
|
|
2288
|
-
let t,
|
|
2288
|
+
let t, s = "127.0.0.1", i = "9229", n;
|
|
2289
2289
|
return (n = e.match(/^(--inspect(-brk)?)$/)) !== null ? t = n[1] : (n = e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null ? (t =
|
|
2290
|
-
n[1], /^\d+$/.test(n[3]) ? i = n[3] :
|
|
2291
|
-
n[3], i = n[4]), t && i !== "0" ? `${t}=${
|
|
2290
|
+
n[1], /^\d+$/.test(n[3]) ? i = n[3] : s = n[3]) : (n = e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null && (t = n[1], s =
|
|
2291
|
+
n[3], i = n[4]), t && i !== "0" ? `${t}=${s}:${parseInt(i) + 1}` : e;
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
2294
|
d(Lt, "incrementNodeInspectorPort");
|
|
@@ -2297,16 +2297,16 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2297
2297
|
|
|
2298
2298
|
// ../node_modules/commander/index.js
|
|
2299
2299
|
var Wt = T((E) => {
|
|
2300
|
-
var { Argument: Ft } = $e(), { Command: _t } = Ut(), { CommanderError:
|
|
2300
|
+
var { Argument: Ft } = $e(), { Command: _t } = Ut(), { CommanderError: rr, InvalidArgumentError: Ht } = Oe(), { Help: ir } = lt(), { Option: Bt } = pt();
|
|
2301
2301
|
E.program = new _t();
|
|
2302
|
-
E.createCommand = (
|
|
2303
|
-
E.createOption = (
|
|
2304
|
-
E.createArgument = (
|
|
2302
|
+
E.createCommand = (r) => new _t(r);
|
|
2303
|
+
E.createOption = (r, e) => new Bt(r, e);
|
|
2304
|
+
E.createArgument = (r, e) => new Ft(r, e);
|
|
2305
2305
|
E.Command = _t;
|
|
2306
2306
|
E.Option = Bt;
|
|
2307
2307
|
E.Argument = Ft;
|
|
2308
|
-
E.Help =
|
|
2309
|
-
E.CommanderError =
|
|
2308
|
+
E.Help = ir;
|
|
2309
|
+
E.CommanderError = rr;
|
|
2310
2310
|
E.InvalidArgumentError = Ht;
|
|
2311
2311
|
E.InvalidOptionArgumentError = Ht;
|
|
2312
2312
|
});
|
|
@@ -2316,34 +2316,34 @@ var Gt = T((Re) => {
|
|
|
2316
2316
|
"use strict";
|
|
2317
2317
|
Object.defineProperty(Re, "__esModule", { value: !0 });
|
|
2318
2318
|
Re.walkUp = void 0;
|
|
2319
|
-
var zt = require("path"),
|
|
2320
|
-
for (
|
|
2321
|
-
yield
|
|
2322
|
-
let e = (0, zt.dirname)(
|
|
2323
|
-
if (e ===
|
|
2319
|
+
var zt = require("path"), nr = /* @__PURE__ */ d(function* (r) {
|
|
2320
|
+
for (r = (0, zt.resolve)(r); r; ) {
|
|
2321
|
+
yield r;
|
|
2322
|
+
let e = (0, zt.dirname)(r);
|
|
2323
|
+
if (e === r)
|
|
2324
2324
|
break;
|
|
2325
|
-
|
|
2325
|
+
r = e;
|
|
2326
2326
|
}
|
|
2327
2327
|
}, "walkUp");
|
|
2328
|
-
Re.walkUp =
|
|
2328
|
+
Re.walkUp = nr;
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// ../node_modules/picocolors/picocolors.js
|
|
2332
|
-
var
|
|
2333
|
-
var qe = process || {}, Qt = qe.argv || [], Le = qe.env || {},
|
|
2334
|
-
includes("--color") || qe.platform === "win32" || (qe.stdout || {}).isTTY && Le.TERM !== "dumb" || !!Le.CI),
|
|
2335
|
-
let i = "" +
|
|
2336
|
-
return ~n ?
|
|
2337
|
-
}, "formatter"),
|
|
2332
|
+
var ts = T((nn, xt) => {
|
|
2333
|
+
var qe = process || {}, Qt = qe.argv || [], Le = qe.env || {}, dr = !(Le.NO_COLOR || Qt.includes("--no-color")) && (!!Le.FORCE_COLOR || Qt.
|
|
2334
|
+
includes("--color") || qe.platform === "win32" || (qe.stdout || {}).isTTY && Le.TERM !== "dumb" || !!Le.CI), lr = /* @__PURE__ */ d((r, e, t = r) => (s) => {
|
|
2335
|
+
let i = "" + s, n = i.indexOf(e, r.length);
|
|
2336
|
+
return ~n ? r + ur(i, e, t, n) + e : r + i + e;
|
|
2337
|
+
}, "formatter"), ur = /* @__PURE__ */ d((r, e, t, s) => {
|
|
2338
2338
|
let i = "", n = 0;
|
|
2339
2339
|
do
|
|
2340
|
-
i +=
|
|
2341
|
-
while (~
|
|
2342
|
-
return i +
|
|
2343
|
-
}, "replaceClose"),
|
|
2344
|
-
let e =
|
|
2340
|
+
i += r.substring(n, s) + t, n = s + e.length, s = r.indexOf(e, n);
|
|
2341
|
+
while (~s);
|
|
2342
|
+
return i + r.substring(n);
|
|
2343
|
+
}, "replaceClose"), es = /* @__PURE__ */ d((r = dr) => {
|
|
2344
|
+
let e = r ? lr : () => String;
|
|
2345
2345
|
return {
|
|
2346
|
-
isColorSupported:
|
|
2346
|
+
isColorSupported: r,
|
|
2347
2347
|
reset: e("\x1B[0m", "\x1B[0m"),
|
|
2348
2348
|
bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
2349
2349
|
dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
@@ -2387,8 +2387,8 @@ var tr = T((nn, xt) => {
|
|
|
2387
2387
|
bgWhiteBright: e("\x1B[107m", "\x1B[49m")
|
|
2388
2388
|
};
|
|
2389
2389
|
}, "createColors");
|
|
2390
|
-
xt.exports =
|
|
2391
|
-
xt.exports.createColors =
|
|
2390
|
+
xt.exports = es();
|
|
2391
|
+
xt.exports.createColors = es;
|
|
2392
2392
|
});
|
|
2393
2393
|
|
|
2394
2394
|
// ../node_modules/ts-dedent/dist/index.js
|
|
@@ -2396,12 +2396,12 @@ var kt = T((Ae) => {
|
|
|
2396
2396
|
"use strict";
|
|
2397
2397
|
Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
2398
2398
|
Ae.dedent = void 0;
|
|
2399
|
-
function
|
|
2399
|
+
function as(r) {
|
|
2400
2400
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
2401
2401
|
e[t - 1] = arguments[t];
|
|
2402
|
-
var
|
|
2403
|
-
|
|
2404
|
-
var i =
|
|
2402
|
+
var s = Array.from(typeof r == "string" ? [r] : r);
|
|
2403
|
+
s[s.length - 1] = s[s.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2404
|
+
var i = s.reduce(function(o, c) {
|
|
2405
2405
|
var h = c.match(/\n([\t ]+|(?!\s).)/g);
|
|
2406
2406
|
return h ? o.concat(h.map(function(p) {
|
|
2407
2407
|
var y, C;
|
|
@@ -2411,13 +2411,13 @@ var kt = T((Ae) => {
|
|
|
2411
2411
|
if (i.length) {
|
|
2412
2412
|
var n = new RegExp(`
|
|
2413
2413
|
[ ]{` + Math.min.apply(Math, i) + "}", "g");
|
|
2414
|
-
|
|
2414
|
+
s = s.map(function(o) {
|
|
2415
2415
|
return o.replace(n, `
|
|
2416
2416
|
`);
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
|
|
2420
|
-
var a =
|
|
2419
|
+
s[0] = s[0].replace(/^\r?\n/, "");
|
|
2420
|
+
var a = s[0];
|
|
2421
2421
|
return e.forEach(function(o, c) {
|
|
2422
2422
|
var h = a.match(/(?:^|\n)( *)$/), p = h ? h[1] : "", y = o;
|
|
2423
2423
|
typeof o == "string" && o.includes(`
|
|
@@ -2425,12 +2425,12 @@ var kt = T((Ae) => {
|
|
|
2425
2425
|
`).map(function(C, j) {
|
|
2426
2426
|
return j === 0 ? C : "" + p + C;
|
|
2427
2427
|
}).join(`
|
|
2428
|
-
`)), a += y +
|
|
2428
|
+
`)), a += y + s[c + 1];
|
|
2429
2429
|
}), a;
|
|
2430
2430
|
}
|
|
2431
|
-
d(
|
|
2432
|
-
Ae.dedent =
|
|
2433
|
-
Ae.default =
|
|
2431
|
+
d(as, "dedent");
|
|
2432
|
+
Ae.dedent = as;
|
|
2433
|
+
Ae.default = as;
|
|
2434
2434
|
});
|
|
2435
2435
|
|
|
2436
2436
|
// ../node_modules/zod/lib/helpers/util.js
|
|
@@ -2439,50 +2439,50 @@ var Ze = T((w) => {
|
|
|
2439
2439
|
Object.defineProperty(w, "__esModule", { value: !0 });
|
|
2440
2440
|
w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
|
|
2441
2441
|
var Tt;
|
|
2442
|
-
(function(
|
|
2443
|
-
|
|
2442
|
+
(function(r) {
|
|
2443
|
+
r.assertEqual = (i) => i;
|
|
2444
2444
|
function e(i) {
|
|
2445
2445
|
}
|
|
2446
|
-
d(e, "assertIs"),
|
|
2446
|
+
d(e, "assertIs"), r.assertIs = e;
|
|
2447
2447
|
function t(i) {
|
|
2448
2448
|
throw new Error();
|
|
2449
2449
|
}
|
|
2450
|
-
d(t, "assertNever"),
|
|
2450
|
+
d(t, "assertNever"), r.assertNever = t, r.arrayToEnum = (i) => {
|
|
2451
2451
|
let n = {};
|
|
2452
2452
|
for (let a of i)
|
|
2453
2453
|
n[a] = a;
|
|
2454
2454
|
return n;
|
|
2455
|
-
},
|
|
2456
|
-
let n =
|
|
2455
|
+
}, r.getValidEnumValues = (i) => {
|
|
2456
|
+
let n = r.objectKeys(i).filter((o) => typeof i[i[o]] != "number"), a = {};
|
|
2457
2457
|
for (let o of n)
|
|
2458
2458
|
a[o] = i[o];
|
|
2459
|
-
return
|
|
2460
|
-
},
|
|
2459
|
+
return r.objectValues(a);
|
|
2460
|
+
}, r.objectValues = (i) => r.objectKeys(i).map(function(n) {
|
|
2461
2461
|
return i[n];
|
|
2462
|
-
}),
|
|
2462
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (i) => Object.keys(i) : (i) => {
|
|
2463
2463
|
let n = [];
|
|
2464
2464
|
for (let a in i)
|
|
2465
2465
|
Object.prototype.hasOwnProperty.call(i, a) && n.push(a);
|
|
2466
2466
|
return n;
|
|
2467
|
-
},
|
|
2467
|
+
}, r.find = (i, n) => {
|
|
2468
2468
|
for (let a of i)
|
|
2469
2469
|
if (n(a))
|
|
2470
2470
|
return a;
|
|
2471
|
-
},
|
|
2471
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (i) => Number.isInteger(i) : (i) => typeof i == "number" && isFinite(i) && Math.
|
|
2472
2472
|
floor(i) === i;
|
|
2473
|
-
function
|
|
2473
|
+
function s(i, n = " | ") {
|
|
2474
2474
|
return i.map((a) => typeof a == "string" ? `'${a}'` : a).join(n);
|
|
2475
2475
|
}
|
|
2476
|
-
d(
|
|
2476
|
+
d(s, "joinValues"), r.joinValues = s, r.jsonStringifyReplacer = (i, n) => typeof n == "bigint" ? n.toString() : n;
|
|
2477
2477
|
})(Tt || (w.util = Tt = {}));
|
|
2478
|
-
var
|
|
2479
|
-
(function(
|
|
2480
|
-
|
|
2478
|
+
var ls;
|
|
2479
|
+
(function(r) {
|
|
2480
|
+
r.mergeShapes = (e, t) => ({
|
|
2481
2481
|
...e,
|
|
2482
2482
|
...t
|
|
2483
2483
|
// second overwrites first
|
|
2484
2484
|
});
|
|
2485
|
-
})(
|
|
2485
|
+
})(ls || (w.objectUtil = ls = {}));
|
|
2486
2486
|
w.ZodParsedType = Tt.arrayToEnum([
|
|
2487
2487
|
"string",
|
|
2488
2488
|
"nan",
|
|
@@ -2505,14 +2505,14 @@ var Ze = T((w) => {
|
|
|
2505
2505
|
"map",
|
|
2506
2506
|
"set"
|
|
2507
2507
|
]);
|
|
2508
|
-
var
|
|
2509
|
-
switch (typeof
|
|
2508
|
+
var fr = /* @__PURE__ */ d((r) => {
|
|
2509
|
+
switch (typeof r) {
|
|
2510
2510
|
case "undefined":
|
|
2511
2511
|
return w.ZodParsedType.undefined;
|
|
2512
2512
|
case "string":
|
|
2513
2513
|
return w.ZodParsedType.string;
|
|
2514
2514
|
case "number":
|
|
2515
|
-
return isNaN(
|
|
2515
|
+
return isNaN(r) ? w.ZodParsedType.nan : w.ZodParsedType.number;
|
|
2516
2516
|
case "boolean":
|
|
2517
2517
|
return w.ZodParsedType.boolean;
|
|
2518
2518
|
case "function":
|
|
@@ -2522,14 +2522,14 @@ var Ze = T((w) => {
|
|
|
2522
2522
|
case "symbol":
|
|
2523
2523
|
return w.ZodParsedType.symbol;
|
|
2524
2524
|
case "object":
|
|
2525
|
-
return Array.isArray(
|
|
2526
|
-
typeof
|
|
2527
|
-
u" &&
|
|
2525
|
+
return Array.isArray(r) ? w.ZodParsedType.array : r === null ? w.ZodParsedType.null : r.then && typeof r.then == "function" && r.catch &&
|
|
2526
|
+
typeof r.catch == "function" ? w.ZodParsedType.promise : typeof Map < "u" && r instanceof Map ? w.ZodParsedType.map : typeof Set < "\
|
|
2527
|
+
u" && r instanceof Set ? w.ZodParsedType.set : typeof Date < "u" && r instanceof Date ? w.ZodParsedType.date : w.ZodParsedType.object;
|
|
2528
2528
|
default:
|
|
2529
2529
|
return w.ZodParsedType.unknown;
|
|
2530
2530
|
}
|
|
2531
2531
|
}, "getParsedType");
|
|
2532
|
-
w.getParsedType =
|
|
2532
|
+
w.getParsedType = fr;
|
|
2533
2533
|
});
|
|
2534
2534
|
|
|
2535
2535
|
// ../node_modules/zod/lib/ZodError.js
|
|
@@ -2537,8 +2537,8 @@ var Be = T((Y) => {
|
|
|
2537
2537
|
"use strict";
|
|
2538
2538
|
Object.defineProperty(Y, "__esModule", { value: !0 });
|
|
2539
2539
|
Y.ZodError = Y.quotelessJson = Y.ZodIssueCode = void 0;
|
|
2540
|
-
var
|
|
2541
|
-
Y.ZodIssueCode =
|
|
2540
|
+
var us = Ze();
|
|
2541
|
+
Y.ZodIssueCode = us.util.arrayToEnum([
|
|
2542
2542
|
"invalid_type",
|
|
2543
2543
|
"invalid_literal",
|
|
2544
2544
|
"custom",
|
|
@@ -2556,9 +2556,9 @@ var Be = T((Y) => {
|
|
|
2556
2556
|
"not_multiple_of",
|
|
2557
2557
|
"not_finite"
|
|
2558
2558
|
]);
|
|
2559
|
-
var
|
|
2560
|
-
Y.quotelessJson =
|
|
2561
|
-
var je = class
|
|
2559
|
+
var mr = /* @__PURE__ */ d((r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson");
|
|
2560
|
+
Y.quotelessJson = mr;
|
|
2561
|
+
var je = class r extends Error {
|
|
2562
2562
|
static {
|
|
2563
2563
|
d(this, "ZodError");
|
|
2564
2564
|
}
|
|
@@ -2566,10 +2566,10 @@ var Be = T((Y) => {
|
|
|
2566
2566
|
return this.issues;
|
|
2567
2567
|
}
|
|
2568
2568
|
constructor(e) {
|
|
2569
|
-
super(), this.issues = [], this.addIssue = (
|
|
2570
|
-
this.issues = [...this.issues,
|
|
2571
|
-
}, this.addIssues = (
|
|
2572
|
-
this.issues = [...this.issues, ...
|
|
2569
|
+
super(), this.issues = [], this.addIssue = (s) => {
|
|
2570
|
+
this.issues = [...this.issues, s];
|
|
2571
|
+
}, this.addIssues = (s = []) => {
|
|
2572
|
+
this.issues = [...this.issues, ...s];
|
|
2573
2573
|
};
|
|
2574
2574
|
let t = new.target.prototype;
|
|
2575
2575
|
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
@@ -2577,7 +2577,7 @@ var Be = T((Y) => {
|
|
|
2577
2577
|
format(e) {
|
|
2578
2578
|
let t = e || function(n) {
|
|
2579
2579
|
return n.message;
|
|
2580
|
-
},
|
|
2580
|
+
}, s = { _errors: [] }, i = /* @__PURE__ */ d((n) => {
|
|
2581
2581
|
for (let a of n.issues)
|
|
2582
2582
|
if (a.code === "invalid_union")
|
|
2583
2583
|
a.unionErrors.map(i);
|
|
@@ -2586,9 +2586,9 @@ var Be = T((Y) => {
|
|
|
2586
2586
|
else if (a.code === "invalid_arguments")
|
|
2587
2587
|
i(a.argumentsError);
|
|
2588
2588
|
else if (a.path.length === 0)
|
|
2589
|
-
|
|
2589
|
+
s._errors.push(t(a));
|
|
2590
2590
|
else {
|
|
2591
|
-
let o =
|
|
2591
|
+
let o = s, c = 0;
|
|
2592
2592
|
for (; c < a.path.length; ) {
|
|
2593
2593
|
let h = a.path[c];
|
|
2594
2594
|
c === a.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(a))) : o[h] = o[h] || { _errors: [] }, o = o[h],
|
|
@@ -2596,59 +2596,59 @@ var Be = T((Y) => {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
2598
2598
|
}, "processError");
|
|
2599
|
-
return i(this),
|
|
2599
|
+
return i(this), s;
|
|
2600
2600
|
}
|
|
2601
2601
|
static assert(e) {
|
|
2602
|
-
if (!(e instanceof
|
|
2602
|
+
if (!(e instanceof r))
|
|
2603
2603
|
throw new Error(`Not a ZodError: ${e}`);
|
|
2604
2604
|
}
|
|
2605
2605
|
toString() {
|
|
2606
2606
|
return this.message;
|
|
2607
2607
|
}
|
|
2608
2608
|
get message() {
|
|
2609
|
-
return JSON.stringify(this.issues,
|
|
2609
|
+
return JSON.stringify(this.issues, us.util.jsonStringifyReplacer, 2);
|
|
2610
2610
|
}
|
|
2611
2611
|
get isEmpty() {
|
|
2612
2612
|
return this.issues.length === 0;
|
|
2613
2613
|
}
|
|
2614
2614
|
flatten(e = (t) => t.message) {
|
|
2615
|
-
let t = {},
|
|
2615
|
+
let t = {}, s = [];
|
|
2616
2616
|
for (let i of this.issues)
|
|
2617
|
-
i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(e(i))) :
|
|
2618
|
-
return { formErrors:
|
|
2617
|
+
i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(e(i))) : s.push(e(i));
|
|
2618
|
+
return { formErrors: s, fieldErrors: t };
|
|
2619
2619
|
}
|
|
2620
2620
|
get formErrors() {
|
|
2621
2621
|
return this.flatten();
|
|
2622
2622
|
}
|
|
2623
2623
|
};
|
|
2624
2624
|
Y.ZodError = je;
|
|
2625
|
-
je.create = (
|
|
2625
|
+
je.create = (r) => new je(r);
|
|
2626
2626
|
});
|
|
2627
2627
|
|
|
2628
2628
|
// ../node_modules/zod/lib/locales/en.js
|
|
2629
2629
|
var At = T((Ot) => {
|
|
2630
2630
|
"use strict";
|
|
2631
2631
|
Object.defineProperty(Ot, "__esModule", { value: !0 });
|
|
2632
|
-
var te = Ze(), O = Be(),
|
|
2632
|
+
var te = Ze(), O = Be(), gr = /* @__PURE__ */ d((r, e) => {
|
|
2633
2633
|
let t;
|
|
2634
|
-
switch (
|
|
2634
|
+
switch (r.code) {
|
|
2635
2635
|
case O.ZodIssueCode.invalid_type:
|
|
2636
|
-
|
|
2636
|
+
r.received === te.ZodParsedType.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
2637
2637
|
break;
|
|
2638
2638
|
case O.ZodIssueCode.invalid_literal:
|
|
2639
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
|
2639
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, te.util.jsonStringifyReplacer)}`;
|
|
2640
2640
|
break;
|
|
2641
2641
|
case O.ZodIssueCode.unrecognized_keys:
|
|
2642
|
-
t = `Unrecognized key(s) in object: ${te.util.joinValues(
|
|
2642
|
+
t = `Unrecognized key(s) in object: ${te.util.joinValues(r.keys, ", ")}`;
|
|
2643
2643
|
break;
|
|
2644
2644
|
case O.ZodIssueCode.invalid_union:
|
|
2645
2645
|
t = "Invalid input";
|
|
2646
2646
|
break;
|
|
2647
2647
|
case O.ZodIssueCode.invalid_union_discriminator:
|
|
2648
|
-
t = `Invalid discriminator value. Expected ${te.util.joinValues(
|
|
2648
|
+
t = `Invalid discriminator value. Expected ${te.util.joinValues(r.options)}`;
|
|
2649
2649
|
break;
|
|
2650
2650
|
case O.ZodIssueCode.invalid_enum_value:
|
|
2651
|
-
t = `Invalid enum value. Expected ${te.util.joinValues(
|
|
2651
|
+
t = `Invalid enum value. Expected ${te.util.joinValues(r.options)}, received '${r.received}'`;
|
|
2652
2652
|
break;
|
|
2653
2653
|
case O.ZodIssueCode.invalid_arguments:
|
|
2654
2654
|
t = "Invalid function arguments";
|
|
@@ -2660,26 +2660,26 @@ var At = T((Ot) => {
|
|
|
2660
2660
|
t = "Invalid date";
|
|
2661
2661
|
break;
|
|
2662
2662
|
case O.ZodIssueCode.invalid_string:
|
|
2663
|
-
typeof
|
|
2664
|
-
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${
|
|
2665
|
-
sWith" in
|
|
2666
|
-
: must end with "${
|
|
2663
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.
|
|
2664
|
+
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "start\
|
|
2665
|
+
sWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input\
|
|
2666
|
+
: must end with "${r.validation.endsWith}"` : te.util.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` :
|
|
2667
2667
|
t = "Invalid";
|
|
2668
2668
|
break;
|
|
2669
2669
|
case O.ZodIssueCode.too_small:
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
n "}${
|
|
2674
|
-
ater than "}${new Date(Number(
|
|
2670
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` :
|
|
2671
|
+
r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` :
|
|
2672
|
+
r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater tha\
|
|
2673
|
+
n "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "gre\
|
|
2674
|
+
ater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
2675
2675
|
break;
|
|
2676
2676
|
case O.ZodIssueCode.too_big:
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
Number(
|
|
2677
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` :
|
|
2678
|
+
r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` :
|
|
2679
|
+
r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` :
|
|
2680
|
+
r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` :
|
|
2681
|
+
r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(
|
|
2682
|
+
Number(r.maximum))}` : t = "Invalid input";
|
|
2683
2683
|
break;
|
|
2684
2684
|
case O.ZodIssueCode.custom:
|
|
2685
2685
|
t = "Invalid input";
|
|
@@ -2688,53 +2688,53 @@ ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
|
2688
2688
|
t = "Intersection results could not be merged";
|
|
2689
2689
|
break;
|
|
2690
2690
|
case O.ZodIssueCode.not_multiple_of:
|
|
2691
|
-
t = `Number must be a multiple of ${
|
|
2691
|
+
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
2692
2692
|
break;
|
|
2693
2693
|
case O.ZodIssueCode.not_finite:
|
|
2694
2694
|
t = "Number must be finite";
|
|
2695
2695
|
break;
|
|
2696
2696
|
default:
|
|
2697
|
-
t = e.defaultError, te.util.assertNever(
|
|
2697
|
+
t = e.defaultError, te.util.assertNever(r);
|
|
2698
2698
|
}
|
|
2699
2699
|
return { message: t };
|
|
2700
2700
|
}, "errorMap");
|
|
2701
|
-
Ot.default =
|
|
2701
|
+
Ot.default = gr;
|
|
2702
2702
|
});
|
|
2703
2703
|
|
|
2704
2704
|
// ../node_modules/zod/lib/errors.js
|
|
2705
2705
|
var We = T((M) => {
|
|
2706
2706
|
"use strict";
|
|
2707
|
-
var
|
|
2708
|
-
return
|
|
2707
|
+
var yr = M && M.__importDefault || function(r) {
|
|
2708
|
+
return r && r.__esModule ? r : { default: r };
|
|
2709
2709
|
};
|
|
2710
2710
|
Object.defineProperty(M, "__esModule", { value: !0 });
|
|
2711
2711
|
M.getErrorMap = M.setErrorMap = M.defaultErrorMap = void 0;
|
|
2712
|
-
var
|
|
2713
|
-
M.defaultErrorMap =
|
|
2714
|
-
var
|
|
2715
|
-
function
|
|
2716
|
-
|
|
2712
|
+
var cs = yr(At());
|
|
2713
|
+
M.defaultErrorMap = cs.default;
|
|
2714
|
+
var hs = cs.default;
|
|
2715
|
+
function _r(r) {
|
|
2716
|
+
hs = r;
|
|
2717
2717
|
}
|
|
2718
|
-
d(
|
|
2719
|
-
M.setErrorMap =
|
|
2720
|
-
function
|
|
2721
|
-
return
|
|
2718
|
+
d(_r, "setErrorMap");
|
|
2719
|
+
M.setErrorMap = _r;
|
|
2720
|
+
function vr() {
|
|
2721
|
+
return hs;
|
|
2722
2722
|
}
|
|
2723
|
-
d(
|
|
2724
|
-
M.getErrorMap =
|
|
2723
|
+
d(vr, "getErrorMap");
|
|
2724
|
+
M.getErrorMap = vr;
|
|
2725
2725
|
});
|
|
2726
2726
|
|
|
2727
2727
|
// ../node_modules/zod/lib/helpers/parseUtil.js
|
|
2728
2728
|
var jt = T((x) => {
|
|
2729
2729
|
"use strict";
|
|
2730
|
-
var
|
|
2731
|
-
return
|
|
2730
|
+
var br = x && x.__importDefault || function(r) {
|
|
2731
|
+
return r && r.__esModule ? r : { default: r };
|
|
2732
2732
|
};
|
|
2733
2733
|
Object.defineProperty(x, "__esModule", { value: !0 });
|
|
2734
2734
|
x.isAsync = x.isValid = x.isDirty = x.isAborted = x.OK = x.DIRTY = x.INVALID = x.ParseStatus = x.addIssueToContext = x.EMPTY_PATH = x.makeIssue =
|
|
2735
2735
|
void 0;
|
|
2736
|
-
var
|
|
2737
|
-
let { data: e, path: t, errorMaps:
|
|
2736
|
+
var xr = We(), ps = br(At()), wr = /* @__PURE__ */ d((r) => {
|
|
2737
|
+
let { data: e, path: t, errorMaps: s, issueData: i } = r, n = [...t, ...i.path || []], a = {
|
|
2738
2738
|
...i,
|
|
2739
2739
|
path: n
|
|
2740
2740
|
};
|
|
@@ -2744,7 +2744,7 @@ var jt = T((x) => {
|
|
|
2744
2744
|
path: n,
|
|
2745
2745
|
message: i.message
|
|
2746
2746
|
};
|
|
2747
|
-
let o = "", c =
|
|
2747
|
+
let o = "", c = s.filter((h) => !!h).slice().reverse();
|
|
2748
2748
|
for (let h of c)
|
|
2749
2749
|
o = h(a, { data: e, defaultError: o }).message;
|
|
2750
2750
|
return {
|
|
@@ -2753,29 +2753,29 @@ var jt = T((x) => {
|
|
|
2753
2753
|
message: o
|
|
2754
2754
|
};
|
|
2755
2755
|
}, "makeIssue");
|
|
2756
|
-
x.makeIssue =
|
|
2756
|
+
x.makeIssue = wr;
|
|
2757
2757
|
x.EMPTY_PATH = [];
|
|
2758
|
-
function
|
|
2759
|
-
let t = (0,
|
|
2758
|
+
function Cr(r, e) {
|
|
2759
|
+
let t = (0, xr.getErrorMap)(), s = (0, x.makeIssue)({
|
|
2760
2760
|
issueData: e,
|
|
2761
|
-
data:
|
|
2762
|
-
path:
|
|
2761
|
+
data: r.data,
|
|
2762
|
+
path: r.path,
|
|
2763
2763
|
errorMaps: [
|
|
2764
|
-
|
|
2764
|
+
r.common.contextualErrorMap,
|
|
2765
2765
|
// contextual error map is first priority
|
|
2766
|
-
|
|
2766
|
+
r.schemaErrorMap,
|
|
2767
2767
|
// then schema-bound map if available
|
|
2768
2768
|
t,
|
|
2769
2769
|
// then global override map
|
|
2770
|
-
t ===
|
|
2770
|
+
t === ps.default ? void 0 : ps.default
|
|
2771
2771
|
// then global default map
|
|
2772
2772
|
].filter((i) => !!i)
|
|
2773
2773
|
});
|
|
2774
|
-
|
|
2774
|
+
r.common.issues.push(s);
|
|
2775
2775
|
}
|
|
2776
|
-
d(
|
|
2777
|
-
x.addIssueToContext =
|
|
2778
|
-
var Zt = class
|
|
2776
|
+
d(Cr, "addIssueToContext");
|
|
2777
|
+
x.addIssueToContext = Cr;
|
|
2778
|
+
var Zt = class r {
|
|
2779
2779
|
static {
|
|
2780
2780
|
d(this, "ParseStatus");
|
|
2781
2781
|
}
|
|
@@ -2789,133 +2789,133 @@ var jt = T((x) => {
|
|
|
2789
2789
|
this.value !== "aborted" && (this.value = "aborted");
|
|
2790
2790
|
}
|
|
2791
2791
|
static mergeArray(e, t) {
|
|
2792
|
-
let
|
|
2792
|
+
let s = [];
|
|
2793
2793
|
for (let i of t) {
|
|
2794
2794
|
if (i.status === "aborted")
|
|
2795
2795
|
return x.INVALID;
|
|
2796
|
-
i.status === "dirty" && e.dirty(),
|
|
2796
|
+
i.status === "dirty" && e.dirty(), s.push(i.value);
|
|
2797
2797
|
}
|
|
2798
|
-
return { status: e.value, value:
|
|
2798
|
+
return { status: e.value, value: s };
|
|
2799
2799
|
}
|
|
2800
2800
|
static async mergeObjectAsync(e, t) {
|
|
2801
|
-
let
|
|
2801
|
+
let s = [];
|
|
2802
2802
|
for (let i of t) {
|
|
2803
2803
|
let n = await i.key, a = await i.value;
|
|
2804
|
-
|
|
2804
|
+
s.push({
|
|
2805
2805
|
key: n,
|
|
2806
2806
|
value: a
|
|
2807
2807
|
});
|
|
2808
2808
|
}
|
|
2809
|
-
return
|
|
2809
|
+
return r.mergeObjectSync(e, s);
|
|
2810
2810
|
}
|
|
2811
2811
|
static mergeObjectSync(e, t) {
|
|
2812
|
-
let
|
|
2812
|
+
let s = {};
|
|
2813
2813
|
for (let i of t) {
|
|
2814
2814
|
let { key: n, value: a } = i;
|
|
2815
2815
|
if (n.status === "aborted" || a.status === "aborted")
|
|
2816
2816
|
return x.INVALID;
|
|
2817
2817
|
n.status === "dirty" && e.dirty(), a.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof a.value < "u" || i.alwaysSet) &&
|
|
2818
|
-
(
|
|
2818
|
+
(s[n.value] = a.value);
|
|
2819
2819
|
}
|
|
2820
|
-
return { status: e.value, value:
|
|
2820
|
+
return { status: e.value, value: s };
|
|
2821
2821
|
}
|
|
2822
2822
|
};
|
|
2823
2823
|
x.ParseStatus = Zt;
|
|
2824
2824
|
x.INVALID = Object.freeze({
|
|
2825
2825
|
status: "aborted"
|
|
2826
2826
|
});
|
|
2827
|
-
var
|
|
2828
|
-
x.DIRTY =
|
|
2829
|
-
var
|
|
2830
|
-
x.OK =
|
|
2831
|
-
var
|
|
2832
|
-
x.isAborted =
|
|
2833
|
-
var
|
|
2834
|
-
x.isDirty =
|
|
2835
|
-
var
|
|
2836
|
-
x.isValid =
|
|
2837
|
-
var
|
|
2838
|
-
x.isAsync =
|
|
2827
|
+
var kr = /* @__PURE__ */ d((r) => ({ status: "dirty", value: r }), "DIRTY");
|
|
2828
|
+
x.DIRTY = kr;
|
|
2829
|
+
var Ir = /* @__PURE__ */ d((r) => ({ status: "valid", value: r }), "OK");
|
|
2830
|
+
x.OK = Ir;
|
|
2831
|
+
var Tr = /* @__PURE__ */ d((r) => r.status === "aborted", "isAborted");
|
|
2832
|
+
x.isAborted = Tr;
|
|
2833
|
+
var Or = /* @__PURE__ */ d((r) => r.status === "dirty", "isDirty");
|
|
2834
|
+
x.isDirty = Or;
|
|
2835
|
+
var Ar = /* @__PURE__ */ d((r) => r.status === "valid", "isValid");
|
|
2836
|
+
x.isValid = Ar;
|
|
2837
|
+
var Zr = /* @__PURE__ */ d((r) => typeof Promise < "u" && r instanceof Promise, "isAsync");
|
|
2838
|
+
x.isAsync = Zr;
|
|
2839
2839
|
});
|
|
2840
2840
|
|
|
2841
2841
|
// ../node_modules/zod/lib/helpers/typeAliases.js
|
|
2842
|
-
var
|
|
2842
|
+
var ms = T((fs) => {
|
|
2843
2843
|
"use strict";
|
|
2844
|
-
Object.defineProperty(
|
|
2844
|
+
Object.defineProperty(fs, "__esModule", { value: !0 });
|
|
2845
2845
|
});
|
|
2846
2846
|
|
|
2847
2847
|
// ../node_modules/zod/lib/helpers/errorUtil.js
|
|
2848
|
-
var
|
|
2848
|
+
var ys = T((ze) => {
|
|
2849
2849
|
"use strict";
|
|
2850
2850
|
Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
2851
2851
|
ze.errorUtil = void 0;
|
|
2852
|
-
var
|
|
2853
|
-
(function(
|
|
2854
|
-
|
|
2855
|
-
})(
|
|
2852
|
+
var gs;
|
|
2853
|
+
(function(r) {
|
|
2854
|
+
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2855
|
+
})(gs || (ze.errorUtil = gs = {}));
|
|
2856
2856
|
});
|
|
2857
2857
|
|
|
2858
2858
|
// ../node_modules/zod/lib/types.js
|
|
2859
|
-
var
|
|
2859
|
+
var js = T((l) => {
|
|
2860
2860
|
"use strict";
|
|
2861
|
-
var Je =
|
|
2862
|
-
if (t === "a" && !
|
|
2863
|
-
if (typeof e == "function" ?
|
|
2861
|
+
var Je = l && l.__classPrivateFieldGet || function(r, e, t, s) {
|
|
2862
|
+
if (t === "a" && !s) throw new TypeError("Private accessor was defined without a getter");
|
|
2863
|
+
if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did n\
|
|
2864
2864
|
ot declare it");
|
|
2865
|
-
return t === "m" ?
|
|
2866
|
-
},
|
|
2867
|
-
if (
|
|
2868
|
-
if (
|
|
2869
|
-
if (typeof e == "function" ?
|
|
2865
|
+
return t === "m" ? s : t === "a" ? s.call(r) : s ? s.value : e.get(r);
|
|
2866
|
+
}, bs = l && l.__classPrivateFieldSet || function(r, e, t, s, i) {
|
|
2867
|
+
if (s === "m") throw new TypeError("Private method is not writable");
|
|
2868
|
+
if (s === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
|
|
2869
|
+
if (typeof e == "function" ? r !== e || !i : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did no\
|
|
2870
2870
|
t declare it");
|
|
2871
|
-
return
|
|
2871
|
+
return s === "a" ? i.call(r, t) : i ? i.value = t : e.set(r, t), t;
|
|
2872
2872
|
}, Se, Ee;
|
|
2873
|
-
Object.defineProperty(
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
ZodIntersection =
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
var Ge = We(), g =
|
|
2873
|
+
Object.defineProperty(l, "__esModule", { value: !0 });
|
|
2874
|
+
l.boolean = l.bigint = l.array = l.any = l.coerce = l.ZodFirstPartyTypeKind = l.late = l.ZodSchema = l.Schema = l.custom = l.ZodReadonly =
|
|
2875
|
+
l.ZodPipeline = l.ZodBranded = l.BRAND = l.ZodNaN = l.ZodCatch = l.ZodDefault = l.ZodNullable = l.ZodOptional = l.ZodTransformer = l.ZodEffects =
|
|
2876
|
+
l.ZodPromise = l.ZodNativeEnum = l.ZodEnum = l.ZodLiteral = l.ZodLazy = l.ZodFunction = l.ZodSet = l.ZodMap = l.ZodRecord = l.ZodTuple = l.
|
|
2877
|
+
ZodIntersection = l.ZodDiscriminatedUnion = l.ZodUnion = l.ZodObject = l.ZodArray = l.ZodVoid = l.ZodNever = l.ZodUnknown = l.ZodAny = l.ZodNull =
|
|
2878
|
+
l.ZodUndefined = l.ZodSymbol = l.ZodDate = l.ZodBoolean = l.ZodBigInt = l.ZodNumber = l.ZodString = l.datetimeRegex = l.ZodType = void 0;
|
|
2879
|
+
l.NEVER = l.void = l.unknown = l.union = l.undefined = l.tuple = l.transformer = l.symbol = l.string = l.strictObject = l.set = l.record =
|
|
2880
|
+
l.promise = l.preprocess = l.pipeline = l.ostring = l.optional = l.onumber = l.oboolean = l.object = l.number = l.nullable = l.null = l.never =
|
|
2881
|
+
l.nativeEnum = l.nan = l.map = l.literal = l.lazy = l.intersection = l.instanceof = l.function = l.enum = l.effect = l.discriminatedUnion =
|
|
2882
|
+
l.date = void 0;
|
|
2883
|
+
var Ge = We(), g = ys(), u = jt(), m = Ze(), f = Be(), N = class {
|
|
2884
2884
|
static {
|
|
2885
2885
|
d(this, "ParseInputLazyPath");
|
|
2886
2886
|
}
|
|
2887
|
-
constructor(e, t,
|
|
2888
|
-
this._cachedPath = [], this.parent = e, this.data = t, this._path =
|
|
2887
|
+
constructor(e, t, s, i) {
|
|
2888
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = i;
|
|
2889
2889
|
}
|
|
2890
2890
|
get path() {
|
|
2891
2891
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.
|
|
2892
2892
|
push(...this._path, this._key)), this._cachedPath;
|
|
2893
2893
|
}
|
|
2894
|
-
},
|
|
2895
|
-
if ((0,
|
|
2894
|
+
}, _s = /* @__PURE__ */ d((r, e) => {
|
|
2895
|
+
if ((0, u.isValid)(e))
|
|
2896
2896
|
return { success: !0, data: e.value };
|
|
2897
|
-
if (!
|
|
2897
|
+
if (!r.common.issues.length)
|
|
2898
2898
|
throw new Error("Validation failed but no issues detected.");
|
|
2899
2899
|
return {
|
|
2900
2900
|
success: !1,
|
|
2901
2901
|
get error() {
|
|
2902
2902
|
if (this._error)
|
|
2903
2903
|
return this._error;
|
|
2904
|
-
let t = new f.ZodError(
|
|
2904
|
+
let t = new f.ZodError(r.common.issues);
|
|
2905
2905
|
return this._error = t, this._error;
|
|
2906
2906
|
}
|
|
2907
2907
|
};
|
|
2908
2908
|
}, "handleResult");
|
|
2909
|
-
function v(
|
|
2910
|
-
if (!
|
|
2909
|
+
function v(r) {
|
|
2910
|
+
if (!r)
|
|
2911
2911
|
return {};
|
|
2912
|
-
let { errorMap: e, invalid_type_error: t, required_error:
|
|
2913
|
-
if (e && (t ||
|
|
2912
|
+
let { errorMap: e, invalid_type_error: t, required_error: s, description: i } = r;
|
|
2913
|
+
if (e && (t || s))
|
|
2914
2914
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2915
2915
|
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((a, o) => {
|
|
2916
2916
|
var c, h;
|
|
2917
|
-
let { message: p } =
|
|
2918
|
-
return a.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (c = p ??
|
|
2917
|
+
let { message: p } = r;
|
|
2918
|
+
return a.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (c = p ?? s) !== null && c !==
|
|
2919
2919
|
void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (h = p ?? t) !== null && h !== void 0 ?
|
|
2920
2920
|
h : o.defaultError };
|
|
2921
2921
|
}, "customMap"), description: i };
|
|
@@ -2943,7 +2943,7 @@ t declare it");
|
|
|
2943
2943
|
}
|
|
2944
2944
|
_processInputParams(e) {
|
|
2945
2945
|
return {
|
|
2946
|
-
status: new
|
|
2946
|
+
status: new u.ParseStatus(),
|
|
2947
2947
|
ctx: {
|
|
2948
2948
|
common: e.parent.common,
|
|
2949
2949
|
data: e.data,
|
|
@@ -2956,7 +2956,7 @@ t declare it");
|
|
|
2956
2956
|
}
|
|
2957
2957
|
_parseSync(e) {
|
|
2958
2958
|
let t = this._parse(e);
|
|
2959
|
-
if ((0,
|
|
2959
|
+
if ((0, u.isAsync)(t))
|
|
2960
2960
|
throw new Error("Synchronous parse encountered promise.");
|
|
2961
2961
|
return t;
|
|
2962
2962
|
}
|
|
@@ -2965,17 +2965,17 @@ t declare it");
|
|
|
2965
2965
|
return Promise.resolve(t);
|
|
2966
2966
|
}
|
|
2967
2967
|
parse(e, t) {
|
|
2968
|
-
let
|
|
2969
|
-
if (
|
|
2970
|
-
return
|
|
2971
|
-
throw
|
|
2968
|
+
let s = this.safeParse(e, t);
|
|
2969
|
+
if (s.success)
|
|
2970
|
+
return s.data;
|
|
2971
|
+
throw s.error;
|
|
2972
2972
|
}
|
|
2973
2973
|
safeParse(e, t) {
|
|
2974
|
-
var
|
|
2974
|
+
var s;
|
|
2975
2975
|
let i = {
|
|
2976
2976
|
common: {
|
|
2977
2977
|
issues: [],
|
|
2978
|
-
async: (
|
|
2978
|
+
async: (s = t?.async) !== null && s !== void 0 ? s : !1,
|
|
2979
2979
|
contextualErrorMap: t?.errorMap
|
|
2980
2980
|
},
|
|
2981
2981
|
path: t?.path || [],
|
|
@@ -2984,10 +2984,10 @@ t declare it");
|
|
|
2984
2984
|
data: e,
|
|
2985
2985
|
parsedType: (0, m.getParsedType)(e)
|
|
2986
2986
|
}, n = this._parseSync({ data: e, path: i.path, parent: i });
|
|
2987
|
-
return
|
|
2987
|
+
return _s(i, n);
|
|
2988
2988
|
}
|
|
2989
2989
|
"~validate"(e) {
|
|
2990
|
-
var t,
|
|
2990
|
+
var t, s;
|
|
2991
2991
|
let i = {
|
|
2992
2992
|
common: {
|
|
2993
2993
|
issues: [],
|
|
@@ -3002,32 +3002,32 @@ t declare it");
|
|
|
3002
3002
|
if (!this["~standard"].async)
|
|
3003
3003
|
try {
|
|
3004
3004
|
let n = this._parseSync({ data: e, path: [], parent: i });
|
|
3005
|
-
return (0,
|
|
3005
|
+
return (0, u.isValid)(n) ? {
|
|
3006
3006
|
value: n.value
|
|
3007
3007
|
} : {
|
|
3008
3008
|
issues: i.common.issues
|
|
3009
3009
|
};
|
|
3010
3010
|
} catch (n) {
|
|
3011
|
-
!((
|
|
3011
|
+
!((s = (t = n?.message) === null || t === void 0 ? void 0 : t.toLowerCase()) === null || s === void 0) && s.includes("encountered") &&
|
|
3012
3012
|
(this["~standard"].async = !0), i.common = {
|
|
3013
3013
|
issues: [],
|
|
3014
3014
|
async: !0
|
|
3015
3015
|
};
|
|
3016
3016
|
}
|
|
3017
|
-
return this._parseAsync({ data: e, path: [], parent: i }).then((n) => (0,
|
|
3017
|
+
return this._parseAsync({ data: e, path: [], parent: i }).then((n) => (0, u.isValid)(n) ? {
|
|
3018
3018
|
value: n.value
|
|
3019
3019
|
} : {
|
|
3020
3020
|
issues: i.common.issues
|
|
3021
3021
|
});
|
|
3022
3022
|
}
|
|
3023
3023
|
async parseAsync(e, t) {
|
|
3024
|
-
let
|
|
3025
|
-
if (
|
|
3026
|
-
return
|
|
3027
|
-
throw
|
|
3024
|
+
let s = await this.safeParseAsync(e, t);
|
|
3025
|
+
if (s.success)
|
|
3026
|
+
return s.data;
|
|
3027
|
+
throw s.error;
|
|
3028
3028
|
}
|
|
3029
3029
|
async safeParseAsync(e, t) {
|
|
3030
|
-
let
|
|
3030
|
+
let s = {
|
|
3031
3031
|
common: {
|
|
3032
3032
|
issues: [],
|
|
3033
3033
|
contextualErrorMap: t?.errorMap,
|
|
@@ -3038,22 +3038,22 @@ t declare it");
|
|
|
3038
3038
|
parent: null,
|
|
3039
3039
|
data: e,
|
|
3040
3040
|
parsedType: (0, m.getParsedType)(e)
|
|
3041
|
-
}, i = this._parse({ data: e, path:
|
|
3042
|
-
return
|
|
3041
|
+
}, i = this._parse({ data: e, path: s.path, parent: s }), n = await ((0, u.isAsync)(i) ? i : Promise.resolve(i));
|
|
3042
|
+
return _s(s, n);
|
|
3043
3043
|
}
|
|
3044
3044
|
refine(e, t) {
|
|
3045
|
-
let
|
|
3045
|
+
let s = /* @__PURE__ */ d((i) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(i) : t, "getIssu\
|
|
3046
3046
|
eProperties");
|
|
3047
3047
|
return this._refinement((i, n) => {
|
|
3048
3048
|
let a = e(i), o = /* @__PURE__ */ d(() => n.addIssue({
|
|
3049
3049
|
code: f.ZodIssueCode.custom,
|
|
3050
|
-
...
|
|
3050
|
+
...s(i)
|
|
3051
3051
|
}), "setError");
|
|
3052
3052
|
return typeof Promise < "u" && a instanceof Promise ? a.then((c) => c ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
3053
3053
|
});
|
|
3054
3054
|
}
|
|
3055
3055
|
refinement(e, t) {
|
|
3056
|
-
return this._refinement((
|
|
3056
|
+
return this._refinement((s, i) => e(s) ? !0 : (i.addIssue(typeof t == "function" ? t(s, i) : t), !1));
|
|
3057
3057
|
}
|
|
3058
3058
|
_refinement(e) {
|
|
3059
3059
|
return new S({
|
|
@@ -3098,7 +3098,7 @@ eProperties");
|
|
|
3098
3098
|
return de.create([this, e], this._def);
|
|
3099
3099
|
}
|
|
3100
3100
|
and(e) {
|
|
3101
|
-
return
|
|
3101
|
+
return le.create(this, e, this._def);
|
|
3102
3102
|
}
|
|
3103
3103
|
transform(e) {
|
|
3104
3104
|
return new S({
|
|
@@ -3153,222 +3153,222 @@ eProperties");
|
|
|
3153
3153
|
return this.safeParse(null).success;
|
|
3154
3154
|
}
|
|
3155
3155
|
};
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
var
|
|
3160
|
-
|
|
3161
|
-
$
|
|
3162
|
-
onent})+$", St,
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
|
|
3168
|
-
function
|
|
3156
|
+
l.ZodType = b;
|
|
3157
|
+
l.Schema = b;
|
|
3158
|
+
l.ZodSchema = b;
|
|
3159
|
+
var jr = /^c[^\s-]{8,}$/i, Sr = /^[0-9a-z]+$/, Er = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Pr = /^[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,
|
|
3160
|
+
Nr = /^[a-z0-9_-]{21}$/i, Vr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Dr = /^[-+]?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)?)??$/,
|
|
3161
|
+
$r = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Rr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
|
|
3162
|
+
onent})+$", St, Mr = /^(?:(?: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])$/, Lr = /^(?:(?: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])$/,
|
|
3163
|
+
qr = /^(([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]))$/,
|
|
3164
|
+
Ur = /^(([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])$/,
|
|
3165
|
+
Fr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Hr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
3166
|
+
xs = "((\\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\
|
|
3167
|
+
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Br = new RegExp(`^${xs}$`);
|
|
3168
|
+
function ws(r) {
|
|
3169
3169
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
3170
|
-
return
|
|
3170
|
+
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
3171
3171
|
}
|
|
3172
|
-
d(
|
|
3173
|
-
function
|
|
3174
|
-
return new RegExp(`^${
|
|
3172
|
+
d(ws, "timeRegexSource");
|
|
3173
|
+
function Wr(r) {
|
|
3174
|
+
return new RegExp(`^${ws(r)}$`);
|
|
3175
3175
|
}
|
|
3176
|
-
d(
|
|
3177
|
-
function
|
|
3178
|
-
let e = `${
|
|
3179
|
-
return t.push(
|
|
3176
|
+
d(Wr, "timeRegex");
|
|
3177
|
+
function Cs(r) {
|
|
3178
|
+
let e = `${xs}T${ws(r)}`, t = [];
|
|
3179
|
+
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
3180
3180
|
}
|
|
3181
|
-
d(
|
|
3182
|
-
|
|
3183
|
-
function
|
|
3184
|
-
return !!((e === "v4" || !e) &&
|
|
3181
|
+
d(Cs, "datetimeRegex");
|
|
3182
|
+
l.datetimeRegex = Cs;
|
|
3183
|
+
function zr(r, e) {
|
|
3184
|
+
return !!((e === "v4" || !e) && Mr.test(r) || (e === "v6" || !e) && qr.test(r));
|
|
3185
3185
|
}
|
|
3186
|
-
d(
|
|
3187
|
-
function
|
|
3188
|
-
if (!
|
|
3186
|
+
d(zr, "isValidIP");
|
|
3187
|
+
function Gr(r, e) {
|
|
3188
|
+
if (!Vr.test(r))
|
|
3189
3189
|
return !1;
|
|
3190
3190
|
try {
|
|
3191
|
-
let [t] =
|
|
3192
|
-
|
|
3191
|
+
let [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), i = JSON.parse(atob(
|
|
3192
|
+
s));
|
|
3193
3193
|
return !(typeof i != "object" || i === null || !i.typ || !i.alg || e && i.alg !== e);
|
|
3194
3194
|
} catch {
|
|
3195
3195
|
return !1;
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
|
-
d(
|
|
3199
|
-
function
|
|
3200
|
-
return !!((e === "v4" || !e) &&
|
|
3198
|
+
d(Gr, "isValidJWT");
|
|
3199
|
+
function Jr(r, e) {
|
|
3200
|
+
return !!((e === "v4" || !e) && Lr.test(r) || (e === "v6" || !e) && Ur.test(r));
|
|
3201
3201
|
}
|
|
3202
|
-
d(
|
|
3203
|
-
var K = class
|
|
3202
|
+
d(Jr, "isValidCidr");
|
|
3203
|
+
var K = class r extends b {
|
|
3204
3204
|
static {
|
|
3205
3205
|
d(this, "ZodString");
|
|
3206
3206
|
}
|
|
3207
3207
|
_parse(e) {
|
|
3208
3208
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== m.ZodParsedType.string) {
|
|
3209
3209
|
let n = this._getOrReturnCtx(e);
|
|
3210
|
-
return (0,
|
|
3210
|
+
return (0, u.addIssueToContext)(n, {
|
|
3211
3211
|
code: f.ZodIssueCode.invalid_type,
|
|
3212
3212
|
expected: m.ZodParsedType.string,
|
|
3213
3213
|
received: n.parsedType
|
|
3214
|
-
}),
|
|
3214
|
+
}), u.INVALID;
|
|
3215
3215
|
}
|
|
3216
|
-
let
|
|
3216
|
+
let s = new u.ParseStatus(), i;
|
|
3217
3217
|
for (let n of this._def.checks)
|
|
3218
3218
|
if (n.kind === "min")
|
|
3219
|
-
e.data.length < n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3219
|
+
e.data.length < n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3220
3220
|
code: f.ZodIssueCode.too_small,
|
|
3221
3221
|
minimum: n.value,
|
|
3222
3222
|
type: "string",
|
|
3223
3223
|
inclusive: !0,
|
|
3224
3224
|
exact: !1,
|
|
3225
3225
|
message: n.message
|
|
3226
|
-
}),
|
|
3226
|
+
}), s.dirty());
|
|
3227
3227
|
else if (n.kind === "max")
|
|
3228
|
-
e.data.length > n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3228
|
+
e.data.length > n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3229
3229
|
code: f.ZodIssueCode.too_big,
|
|
3230
3230
|
maximum: n.value,
|
|
3231
3231
|
type: "string",
|
|
3232
3232
|
inclusive: !0,
|
|
3233
3233
|
exact: !1,
|
|
3234
3234
|
message: n.message
|
|
3235
|
-
}),
|
|
3235
|
+
}), s.dirty());
|
|
3236
3236
|
else if (n.kind === "length") {
|
|
3237
3237
|
let a = e.data.length > n.value, o = e.data.length < n.value;
|
|
3238
|
-
(a || o) && (i = this._getOrReturnCtx(e, i), a ? (0,
|
|
3238
|
+
(a || o) && (i = this._getOrReturnCtx(e, i), a ? (0, u.addIssueToContext)(i, {
|
|
3239
3239
|
code: f.ZodIssueCode.too_big,
|
|
3240
3240
|
maximum: n.value,
|
|
3241
3241
|
type: "string",
|
|
3242
3242
|
inclusive: !0,
|
|
3243
3243
|
exact: !0,
|
|
3244
3244
|
message: n.message
|
|
3245
|
-
}) : o && (0,
|
|
3245
|
+
}) : o && (0, u.addIssueToContext)(i, {
|
|
3246
3246
|
code: f.ZodIssueCode.too_small,
|
|
3247
3247
|
minimum: n.value,
|
|
3248
3248
|
type: "string",
|
|
3249
3249
|
inclusive: !0,
|
|
3250
3250
|
exact: !0,
|
|
3251
3251
|
message: n.message
|
|
3252
|
-
}),
|
|
3252
|
+
}), s.dirty());
|
|
3253
3253
|
} else if (n.kind === "email")
|
|
3254
|
-
$
|
|
3254
|
+
$r.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3255
3255
|
validation: "email",
|
|
3256
3256
|
code: f.ZodIssueCode.invalid_string,
|
|
3257
3257
|
message: n.message
|
|
3258
|
-
}),
|
|
3258
|
+
}), s.dirty());
|
|
3259
3259
|
else if (n.kind === "emoji")
|
|
3260
|
-
St || (St = new RegExp(
|
|
3260
|
+
St || (St = new RegExp(Rr, "u")), St.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3261
3261
|
validation: "emoji",
|
|
3262
3262
|
code: f.ZodIssueCode.invalid_string,
|
|
3263
3263
|
message: n.message
|
|
3264
|
-
}),
|
|
3264
|
+
}), s.dirty());
|
|
3265
3265
|
else if (n.kind === "uuid")
|
|
3266
|
-
|
|
3266
|
+
Pr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3267
3267
|
validation: "uuid",
|
|
3268
3268
|
code: f.ZodIssueCode.invalid_string,
|
|
3269
3269
|
message: n.message
|
|
3270
|
-
}),
|
|
3270
|
+
}), s.dirty());
|
|
3271
3271
|
else if (n.kind === "nanoid")
|
|
3272
|
-
|
|
3272
|
+
Nr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3273
3273
|
validation: "nanoid",
|
|
3274
3274
|
code: f.ZodIssueCode.invalid_string,
|
|
3275
3275
|
message: n.message
|
|
3276
|
-
}),
|
|
3276
|
+
}), s.dirty());
|
|
3277
3277
|
else if (n.kind === "cuid")
|
|
3278
|
-
|
|
3278
|
+
jr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3279
3279
|
validation: "cuid",
|
|
3280
3280
|
code: f.ZodIssueCode.invalid_string,
|
|
3281
3281
|
message: n.message
|
|
3282
|
-
}),
|
|
3282
|
+
}), s.dirty());
|
|
3283
3283
|
else if (n.kind === "cuid2")
|
|
3284
|
-
|
|
3284
|
+
Sr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3285
3285
|
validation: "cuid2",
|
|
3286
3286
|
code: f.ZodIssueCode.invalid_string,
|
|
3287
3287
|
message: n.message
|
|
3288
|
-
}),
|
|
3288
|
+
}), s.dirty());
|
|
3289
3289
|
else if (n.kind === "ulid")
|
|
3290
|
-
|
|
3290
|
+
Er.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3291
3291
|
validation: "ulid",
|
|
3292
3292
|
code: f.ZodIssueCode.invalid_string,
|
|
3293
3293
|
message: n.message
|
|
3294
|
-
}),
|
|
3294
|
+
}), s.dirty());
|
|
3295
3295
|
else if (n.kind === "url")
|
|
3296
3296
|
try {
|
|
3297
3297
|
new URL(e.data);
|
|
3298
3298
|
} catch {
|
|
3299
|
-
i = this._getOrReturnCtx(e, i), (0,
|
|
3299
|
+
i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3300
3300
|
validation: "url",
|
|
3301
3301
|
code: f.ZodIssueCode.invalid_string,
|
|
3302
3302
|
message: n.message
|
|
3303
|
-
}),
|
|
3303
|
+
}), s.dirty();
|
|
3304
3304
|
}
|
|
3305
|
-
else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), (0,
|
|
3305
|
+
else n.kind === "regex" ? (n.regex.lastIndex = 0, n.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(
|
|
3306
3306
|
i, {
|
|
3307
3307
|
validation: "regex",
|
|
3308
3308
|
code: f.ZodIssueCode.invalid_string,
|
|
3309
3309
|
message: n.message
|
|
3310
|
-
}),
|
|
3311
|
-
_getOrReturnCtx(e, i), (0,
|
|
3310
|
+
}), s.dirty())) : n.kind === "trim" ? e.data = e.data.trim() : n.kind === "includes" ? e.data.includes(n.value, n.position) || (i = this.
|
|
3311
|
+
_getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3312
3312
|
code: f.ZodIssueCode.invalid_string,
|
|
3313
3313
|
validation: { includes: n.value, position: n.position },
|
|
3314
3314
|
message: n.message
|
|
3315
|
-
}),
|
|
3316
|
-
n.kind === "startsWith" ? e.data.startsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0,
|
|
3315
|
+
}), s.dirty()) : n.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : n.kind === "toUpperCase" ? e.data = e.data.toUpperCase() :
|
|
3316
|
+
n.kind === "startsWith" ? e.data.startsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3317
3317
|
code: f.ZodIssueCode.invalid_string,
|
|
3318
3318
|
validation: { startsWith: n.value },
|
|
3319
3319
|
message: n.message
|
|
3320
|
-
}),
|
|
3320
|
+
}), s.dirty()) : n.kind === "endsWith" ? e.data.endsWith(n.value) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3321
3321
|
code: f.ZodIssueCode.invalid_string,
|
|
3322
3322
|
validation: { endsWith: n.value },
|
|
3323
3323
|
message: n.message
|
|
3324
|
-
}),
|
|
3324
|
+
}), s.dirty()) : n.kind === "datetime" ? Cs(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3325
3325
|
code: f.ZodIssueCode.invalid_string,
|
|
3326
3326
|
validation: "datetime",
|
|
3327
3327
|
message: n.message
|
|
3328
|
-
}),
|
|
3328
|
+
}), s.dirty()) : n.kind === "date" ? Br.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3329
3329
|
code: f.ZodIssueCode.invalid_string,
|
|
3330
3330
|
validation: "date",
|
|
3331
3331
|
message: n.message
|
|
3332
|
-
}),
|
|
3332
|
+
}), s.dirty()) : n.kind === "time" ? Wr(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3333
3333
|
code: f.ZodIssueCode.invalid_string,
|
|
3334
3334
|
validation: "time",
|
|
3335
3335
|
message: n.message
|
|
3336
|
-
}),
|
|
3336
|
+
}), s.dirty()) : n.kind === "duration" ? Dr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3337
3337
|
validation: "duration",
|
|
3338
3338
|
code: f.ZodIssueCode.invalid_string,
|
|
3339
3339
|
message: n.message
|
|
3340
|
-
}),
|
|
3340
|
+
}), s.dirty()) : n.kind === "ip" ? zr(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3341
3341
|
validation: "ip",
|
|
3342
3342
|
code: f.ZodIssueCode.invalid_string,
|
|
3343
3343
|
message: n.message
|
|
3344
|
-
}),
|
|
3344
|
+
}), s.dirty()) : n.kind === "jwt" ? Gr(e.data, n.alg) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3345
3345
|
validation: "jwt",
|
|
3346
3346
|
code: f.ZodIssueCode.invalid_string,
|
|
3347
3347
|
message: n.message
|
|
3348
|
-
}),
|
|
3348
|
+
}), s.dirty()) : n.kind === "cidr" ? Jr(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3349
3349
|
validation: "cidr",
|
|
3350
3350
|
code: f.ZodIssueCode.invalid_string,
|
|
3351
3351
|
message: n.message
|
|
3352
|
-
}),
|
|
3352
|
+
}), s.dirty()) : n.kind === "base64" ? Fr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3353
3353
|
validation: "base64",
|
|
3354
3354
|
code: f.ZodIssueCode.invalid_string,
|
|
3355
3355
|
message: n.message
|
|
3356
|
-
}),
|
|
3356
|
+
}), s.dirty()) : n.kind === "base64url" ? Hr.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3357
3357
|
validation: "base64url",
|
|
3358
3358
|
code: f.ZodIssueCode.invalid_string,
|
|
3359
3359
|
message: n.message
|
|
3360
|
-
}),
|
|
3361
|
-
return { status:
|
|
3360
|
+
}), s.dirty()) : m.util.assertNever(n);
|
|
3361
|
+
return { status: s.value, value: e.data };
|
|
3362
3362
|
}
|
|
3363
|
-
_regex(e, t,
|
|
3363
|
+
_regex(e, t, s) {
|
|
3364
3364
|
return this.refinement((i) => e.test(i), {
|
|
3365
3365
|
validation: t,
|
|
3366
3366
|
code: f.ZodIssueCode.invalid_string,
|
|
3367
|
-
...g.errorUtil.errToObj(
|
|
3367
|
+
...g.errorUtil.errToObj(s)
|
|
3368
3368
|
});
|
|
3369
3369
|
}
|
|
3370
3370
|
_addCheck(e) {
|
|
3371
|
-
return new
|
|
3371
|
+
return new r({
|
|
3372
3372
|
...this._def,
|
|
3373
3373
|
checks: [...this._def.checks, e]
|
|
3374
3374
|
});
|
|
@@ -3416,7 +3416,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3416
3416
|
return this._addCheck({ kind: "cidr", ...g.errorUtil.errToObj(e) });
|
|
3417
3417
|
}
|
|
3418
3418
|
datetime(e) {
|
|
3419
|
-
var t,
|
|
3419
|
+
var t, s;
|
|
3420
3420
|
return typeof e == "string" ? this._addCheck({
|
|
3421
3421
|
kind: "datetime",
|
|
3422
3422
|
precision: null,
|
|
@@ -3427,7 +3427,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3427
3427
|
kind: "datetime",
|
|
3428
3428
|
precision: typeof e?.precision > "u" ? null : e?.precision,
|
|
3429
3429
|
offset: (t = e?.offset) !== null && t !== void 0 ? t : !1,
|
|
3430
|
-
local: (
|
|
3430
|
+
local: (s = e?.local) !== null && s !== void 0 ? s : !1,
|
|
3431
3431
|
...g.errorUtil.errToObj(e?.message)
|
|
3432
3432
|
});
|
|
3433
3433
|
}
|
|
@@ -3505,19 +3505,19 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3505
3505
|
return this.min(1, g.errorUtil.errToObj(e));
|
|
3506
3506
|
}
|
|
3507
3507
|
trim() {
|
|
3508
|
-
return new
|
|
3508
|
+
return new r({
|
|
3509
3509
|
...this._def,
|
|
3510
3510
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
3511
3511
|
});
|
|
3512
3512
|
}
|
|
3513
3513
|
toLowerCase() {
|
|
3514
|
-
return new
|
|
3514
|
+
return new r({
|
|
3515
3515
|
...this._def,
|
|
3516
3516
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
3517
3517
|
});
|
|
3518
3518
|
}
|
|
3519
3519
|
toUpperCase() {
|
|
3520
|
-
return new
|
|
3520
|
+
return new r({
|
|
3521
3521
|
...this._def,
|
|
3522
3522
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
3523
3523
|
});
|
|
@@ -3583,23 +3583,23 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3583
3583
|
return e;
|
|
3584
3584
|
}
|
|
3585
3585
|
};
|
|
3586
|
-
|
|
3587
|
-
K.create = (
|
|
3586
|
+
l.ZodString = K;
|
|
3587
|
+
K.create = (r) => {
|
|
3588
3588
|
var e;
|
|
3589
3589
|
return new K({
|
|
3590
3590
|
checks: [],
|
|
3591
3591
|
typeName: _.ZodString,
|
|
3592
|
-
coerce: (e =
|
|
3593
|
-
...v(
|
|
3592
|
+
coerce: (e = r?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3593
|
+
...v(r)
|
|
3594
3594
|
});
|
|
3595
3595
|
};
|
|
3596
|
-
function
|
|
3597
|
-
let t = (
|
|
3596
|
+
function Yr(r, e) {
|
|
3597
|
+
let t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, i = t > s ? t : s, n = parseInt(r.toFixed(
|
|
3598
3598
|
i).replace(".", "")), a = parseInt(e.toFixed(i).replace(".", ""));
|
|
3599
3599
|
return n % a / Math.pow(10, i);
|
|
3600
3600
|
}
|
|
3601
|
-
d(
|
|
3602
|
-
var
|
|
3601
|
+
d(Yr, "floatSafeRemainder");
|
|
3602
|
+
var se = class r extends b {
|
|
3603
3603
|
static {
|
|
3604
3604
|
d(this, "ZodNumber");
|
|
3605
3605
|
}
|
|
@@ -3609,41 +3609,41 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3609
3609
|
_parse(e) {
|
|
3610
3610
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== m.ZodParsedType.number) {
|
|
3611
3611
|
let n = this._getOrReturnCtx(e);
|
|
3612
|
-
return (0,
|
|
3612
|
+
return (0, u.addIssueToContext)(n, {
|
|
3613
3613
|
code: f.ZodIssueCode.invalid_type,
|
|
3614
3614
|
expected: m.ZodParsedType.number,
|
|
3615
3615
|
received: n.parsedType
|
|
3616
|
-
}),
|
|
3616
|
+
}), u.INVALID;
|
|
3617
3617
|
}
|
|
3618
|
-
let
|
|
3618
|
+
let s, i = new u.ParseStatus();
|
|
3619
3619
|
for (let n of this._def.checks)
|
|
3620
|
-
n.kind === "int" ? m.util.isInteger(e.data) || (
|
|
3620
|
+
n.kind === "int" ? m.util.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(s, {
|
|
3621
3621
|
code: f.ZodIssueCode.invalid_type,
|
|
3622
3622
|
expected: "integer",
|
|
3623
3623
|
received: "float",
|
|
3624
3624
|
message: n.message
|
|
3625
|
-
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (
|
|
3626
|
-
|
|
3625
|
+
}), i.dirty()) : n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(
|
|
3626
|
+
s, {
|
|
3627
3627
|
code: f.ZodIssueCode.too_small,
|
|
3628
3628
|
minimum: n.value,
|
|
3629
3629
|
type: "number",
|
|
3630
3630
|
inclusive: n.inclusive,
|
|
3631
3631
|
exact: !1,
|
|
3632
3632
|
message: n.message
|
|
3633
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (
|
|
3634
|
-
|
|
3633
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(
|
|
3634
|
+
s, {
|
|
3635
3635
|
code: f.ZodIssueCode.too_big,
|
|
3636
3636
|
maximum: n.value,
|
|
3637
3637
|
type: "number",
|
|
3638
3638
|
inclusive: n.inclusive,
|
|
3639
3639
|
exact: !1,
|
|
3640
3640
|
message: n.message
|
|
3641
|
-
}), i.dirty()) : n.kind === "multipleOf" ?
|
|
3641
|
+
}), i.dirty()) : n.kind === "multipleOf" ? Yr(e.data, n.value) !== 0 && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(s,
|
|
3642
3642
|
{
|
|
3643
3643
|
code: f.ZodIssueCode.not_multiple_of,
|
|
3644
3644
|
multipleOf: n.value,
|
|
3645
3645
|
message: n.message
|
|
3646
|
-
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (
|
|
3646
|
+
}), i.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(s, {
|
|
3647
3647
|
code: f.ZodIssueCode.not_finite,
|
|
3648
3648
|
message: n.message
|
|
3649
3649
|
}), i.dirty()) : m.util.assertNever(n);
|
|
@@ -3661,22 +3661,22 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3661
3661
|
lt(e, t) {
|
|
3662
3662
|
return this.setLimit("max", e, !1, g.errorUtil.toString(t));
|
|
3663
3663
|
}
|
|
3664
|
-
setLimit(e, t,
|
|
3665
|
-
return new
|
|
3664
|
+
setLimit(e, t, s, i) {
|
|
3665
|
+
return new r({
|
|
3666
3666
|
...this._def,
|
|
3667
3667
|
checks: [
|
|
3668
3668
|
...this._def.checks,
|
|
3669
3669
|
{
|
|
3670
3670
|
kind: e,
|
|
3671
3671
|
value: t,
|
|
3672
|
-
inclusive:
|
|
3672
|
+
inclusive: s,
|
|
3673
3673
|
message: g.errorUtil.toString(i)
|
|
3674
3674
|
}
|
|
3675
3675
|
]
|
|
3676
3676
|
});
|
|
3677
3677
|
}
|
|
3678
3678
|
_addCheck(e) {
|
|
3679
|
-
return new
|
|
3679
|
+
return new r({
|
|
3680
3680
|
...this._def,
|
|
3681
3681
|
checks: [...this._def.checks, e]
|
|
3682
3682
|
});
|
|
@@ -3762,22 +3762,22 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3762
3762
|
}
|
|
3763
3763
|
get isFinite() {
|
|
3764
3764
|
let e = null, t = null;
|
|
3765
|
-
for (let
|
|
3766
|
-
if (
|
|
3765
|
+
for (let s of this._def.checks) {
|
|
3766
|
+
if (s.kind === "finite" || s.kind === "int" || s.kind === "multipleOf")
|
|
3767
3767
|
return !0;
|
|
3768
|
-
|
|
3768
|
+
s.kind === "min" ? (t === null || s.value > t) && (t = s.value) : s.kind === "max" && (e === null || s.value < e) && (e = s.value);
|
|
3769
3769
|
}
|
|
3770
3770
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3771
3771
|
}
|
|
3772
3772
|
};
|
|
3773
|
-
|
|
3774
|
-
|
|
3773
|
+
l.ZodNumber = se;
|
|
3774
|
+
se.create = (r) => new se({
|
|
3775
3775
|
checks: [],
|
|
3776
3776
|
typeName: _.ZodNumber,
|
|
3777
|
-
coerce:
|
|
3778
|
-
...v(
|
|
3777
|
+
coerce: r?.coerce || !1,
|
|
3778
|
+
...v(r)
|
|
3779
3779
|
});
|
|
3780
|
-
var
|
|
3780
|
+
var re = class r extends b {
|
|
3781
3781
|
static {
|
|
3782
3782
|
d(this, "ZodBigInt");
|
|
3783
3783
|
}
|
|
@@ -3793,24 +3793,24 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3793
3793
|
}
|
|
3794
3794
|
if (this._getType(e) !== m.ZodParsedType.bigint)
|
|
3795
3795
|
return this._getInvalidInput(e);
|
|
3796
|
-
let
|
|
3796
|
+
let s, i = new u.ParseStatus();
|
|
3797
3797
|
for (let n of this._def.checks)
|
|
3798
|
-
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (
|
|
3799
|
-
|
|
3798
|
+
n.kind === "min" ? (n.inclusive ? e.data < n.value : e.data <= n.value) && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(
|
|
3799
|
+
s, {
|
|
3800
3800
|
code: f.ZodIssueCode.too_small,
|
|
3801
3801
|
type: "bigint",
|
|
3802
3802
|
minimum: n.value,
|
|
3803
3803
|
inclusive: n.inclusive,
|
|
3804
3804
|
message: n.message
|
|
3805
|
-
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (
|
|
3806
|
-
|
|
3805
|
+
}), i.dirty()) : n.kind === "max" ? (n.inclusive ? e.data > n.value : e.data >= n.value) && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(
|
|
3806
|
+
s, {
|
|
3807
3807
|
code: f.ZodIssueCode.too_big,
|
|
3808
3808
|
type: "bigint",
|
|
3809
3809
|
maximum: n.value,
|
|
3810
3810
|
inclusive: n.inclusive,
|
|
3811
3811
|
message: n.message
|
|
3812
|
-
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (
|
|
3813
|
-
|
|
3812
|
+
}), i.dirty()) : n.kind === "multipleOf" ? e.data % n.value !== BigInt(0) && (s = this._getOrReturnCtx(e, s), (0, u.addIssueToContext)(
|
|
3813
|
+
s, {
|
|
3814
3814
|
code: f.ZodIssueCode.not_multiple_of,
|
|
3815
3815
|
multipleOf: n.value,
|
|
3816
3816
|
message: n.message
|
|
@@ -3819,11 +3819,11 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3819
3819
|
}
|
|
3820
3820
|
_getInvalidInput(e) {
|
|
3821
3821
|
let t = this._getOrReturnCtx(e);
|
|
3822
|
-
return (0,
|
|
3822
|
+
return (0, u.addIssueToContext)(t, {
|
|
3823
3823
|
code: f.ZodIssueCode.invalid_type,
|
|
3824
3824
|
expected: m.ZodParsedType.bigint,
|
|
3825
3825
|
received: t.parsedType
|
|
3826
|
-
}),
|
|
3826
|
+
}), u.INVALID;
|
|
3827
3827
|
}
|
|
3828
3828
|
gte(e, t) {
|
|
3829
3829
|
return this.setLimit("min", e, !0, g.errorUtil.toString(t));
|
|
@@ -3837,22 +3837,22 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3837
3837
|
lt(e, t) {
|
|
3838
3838
|
return this.setLimit("max", e, !1, g.errorUtil.toString(t));
|
|
3839
3839
|
}
|
|
3840
|
-
setLimit(e, t,
|
|
3841
|
-
return new
|
|
3840
|
+
setLimit(e, t, s, i) {
|
|
3841
|
+
return new r({
|
|
3842
3842
|
...this._def,
|
|
3843
3843
|
checks: [
|
|
3844
3844
|
...this._def.checks,
|
|
3845
3845
|
{
|
|
3846
3846
|
kind: e,
|
|
3847
3847
|
value: t,
|
|
3848
|
-
inclusive:
|
|
3848
|
+
inclusive: s,
|
|
3849
3849
|
message: g.errorUtil.toString(i)
|
|
3850
3850
|
}
|
|
3851
3851
|
]
|
|
3852
3852
|
});
|
|
3853
3853
|
}
|
|
3854
3854
|
_addCheck(e) {
|
|
3855
|
-
return new
|
|
3855
|
+
return new r({
|
|
3856
3856
|
...this._def,
|
|
3857
3857
|
checks: [...this._def.checks, e]
|
|
3858
3858
|
});
|
|
@@ -3909,14 +3909,14 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3909
3909
|
return e;
|
|
3910
3910
|
}
|
|
3911
3911
|
};
|
|
3912
|
-
|
|
3913
|
-
|
|
3912
|
+
l.ZodBigInt = re;
|
|
3913
|
+
re.create = (r) => {
|
|
3914
3914
|
var e;
|
|
3915
|
-
return new
|
|
3915
|
+
return new re({
|
|
3916
3916
|
checks: [],
|
|
3917
3917
|
typeName: _.ZodBigInt,
|
|
3918
|
-
coerce: (e =
|
|
3919
|
-
...v(
|
|
3918
|
+
coerce: (e = r?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3919
|
+
...v(r)
|
|
3920
3920
|
});
|
|
3921
3921
|
};
|
|
3922
3922
|
var ie = class extends b {
|
|
@@ -3925,65 +3925,65 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3925
3925
|
}
|
|
3926
3926
|
_parse(e) {
|
|
3927
3927
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== m.ZodParsedType.boolean) {
|
|
3928
|
-
let
|
|
3929
|
-
return (0,
|
|
3928
|
+
let s = this._getOrReturnCtx(e);
|
|
3929
|
+
return (0, u.addIssueToContext)(s, {
|
|
3930
3930
|
code: f.ZodIssueCode.invalid_type,
|
|
3931
3931
|
expected: m.ZodParsedType.boolean,
|
|
3932
|
-
received:
|
|
3933
|
-
}),
|
|
3932
|
+
received: s.parsedType
|
|
3933
|
+
}), u.INVALID;
|
|
3934
3934
|
}
|
|
3935
|
-
return (0,
|
|
3935
|
+
return (0, u.OK)(e.data);
|
|
3936
3936
|
}
|
|
3937
3937
|
};
|
|
3938
|
-
|
|
3939
|
-
ie.create = (
|
|
3938
|
+
l.ZodBoolean = ie;
|
|
3939
|
+
ie.create = (r) => new ie({
|
|
3940
3940
|
typeName: _.ZodBoolean,
|
|
3941
|
-
coerce:
|
|
3942
|
-
...v(
|
|
3941
|
+
coerce: r?.coerce || !1,
|
|
3942
|
+
...v(r)
|
|
3943
3943
|
});
|
|
3944
|
-
var ne = class
|
|
3944
|
+
var ne = class r extends b {
|
|
3945
3945
|
static {
|
|
3946
3946
|
d(this, "ZodDate");
|
|
3947
3947
|
}
|
|
3948
3948
|
_parse(e) {
|
|
3949
3949
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== m.ZodParsedType.date) {
|
|
3950
3950
|
let n = this._getOrReturnCtx(e);
|
|
3951
|
-
return (0,
|
|
3951
|
+
return (0, u.addIssueToContext)(n, {
|
|
3952
3952
|
code: f.ZodIssueCode.invalid_type,
|
|
3953
3953
|
expected: m.ZodParsedType.date,
|
|
3954
3954
|
received: n.parsedType
|
|
3955
|
-
}),
|
|
3955
|
+
}), u.INVALID;
|
|
3956
3956
|
}
|
|
3957
3957
|
if (isNaN(e.data.getTime())) {
|
|
3958
3958
|
let n = this._getOrReturnCtx(e);
|
|
3959
|
-
return (0,
|
|
3959
|
+
return (0, u.addIssueToContext)(n, {
|
|
3960
3960
|
code: f.ZodIssueCode.invalid_date
|
|
3961
|
-
}),
|
|
3961
|
+
}), u.INVALID;
|
|
3962
3962
|
}
|
|
3963
|
-
let
|
|
3963
|
+
let s = new u.ParseStatus(), i;
|
|
3964
3964
|
for (let n of this._def.checks)
|
|
3965
|
-
n.kind === "min" ? e.data.getTime() < n.value && (i = this._getOrReturnCtx(e, i), (0,
|
|
3965
|
+
n.kind === "min" ? e.data.getTime() < n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3966
3966
|
code: f.ZodIssueCode.too_small,
|
|
3967
3967
|
message: n.message,
|
|
3968
3968
|
inclusive: !0,
|
|
3969
3969
|
exact: !1,
|
|
3970
3970
|
minimum: n.value,
|
|
3971
3971
|
type: "date"
|
|
3972
|
-
}),
|
|
3972
|
+
}), s.dirty()) : n.kind === "max" ? e.data.getTime() > n.value && (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3973
3973
|
code: f.ZodIssueCode.too_big,
|
|
3974
3974
|
message: n.message,
|
|
3975
3975
|
inclusive: !0,
|
|
3976
3976
|
exact: !1,
|
|
3977
3977
|
maximum: n.value,
|
|
3978
3978
|
type: "date"
|
|
3979
|
-
}),
|
|
3979
|
+
}), s.dirty()) : m.util.assertNever(n);
|
|
3980
3980
|
return {
|
|
3981
|
-
status:
|
|
3981
|
+
status: s.value,
|
|
3982
3982
|
value: new Date(e.data.getTime())
|
|
3983
3983
|
};
|
|
3984
3984
|
}
|
|
3985
3985
|
_addCheck(e) {
|
|
3986
|
-
return new
|
|
3986
|
+
return new r({
|
|
3987
3987
|
...this._def,
|
|
3988
3988
|
checks: [...this._def.checks, e]
|
|
3989
3989
|
});
|
|
@@ -4015,12 +4015,12 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4015
4015
|
return e != null ? new Date(e) : null;
|
|
4016
4016
|
}
|
|
4017
4017
|
};
|
|
4018
|
-
|
|
4019
|
-
ne.create = (
|
|
4018
|
+
l.ZodDate = ne;
|
|
4019
|
+
ne.create = (r) => new ne({
|
|
4020
4020
|
checks: [],
|
|
4021
|
-
coerce:
|
|
4021
|
+
coerce: r?.coerce || !1,
|
|
4022
4022
|
typeName: _.ZodDate,
|
|
4023
|
-
...v(
|
|
4023
|
+
...v(r)
|
|
4024
4024
|
});
|
|
4025
4025
|
var ve = class extends b {
|
|
4026
4026
|
static {
|
|
@@ -4028,20 +4028,20 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4028
4028
|
}
|
|
4029
4029
|
_parse(e) {
|
|
4030
4030
|
if (this._getType(e) !== m.ZodParsedType.symbol) {
|
|
4031
|
-
let
|
|
4032
|
-
return (0,
|
|
4031
|
+
let s = this._getOrReturnCtx(e);
|
|
4032
|
+
return (0, u.addIssueToContext)(s, {
|
|
4033
4033
|
code: f.ZodIssueCode.invalid_type,
|
|
4034
4034
|
expected: m.ZodParsedType.symbol,
|
|
4035
|
-
received:
|
|
4036
|
-
}),
|
|
4035
|
+
received: s.parsedType
|
|
4036
|
+
}), u.INVALID;
|
|
4037
4037
|
}
|
|
4038
|
-
return (0,
|
|
4038
|
+
return (0, u.OK)(e.data);
|
|
4039
4039
|
}
|
|
4040
4040
|
};
|
|
4041
|
-
|
|
4042
|
-
ve.create = (
|
|
4041
|
+
l.ZodSymbol = ve;
|
|
4042
|
+
ve.create = (r) => new ve({
|
|
4043
4043
|
typeName: _.ZodSymbol,
|
|
4044
|
-
...v(
|
|
4044
|
+
...v(r)
|
|
4045
4045
|
});
|
|
4046
4046
|
var ae = class extends b {
|
|
4047
4047
|
static {
|
|
@@ -4049,20 +4049,20 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4049
4049
|
}
|
|
4050
4050
|
_parse(e) {
|
|
4051
4051
|
if (this._getType(e) !== m.ZodParsedType.undefined) {
|
|
4052
|
-
let
|
|
4053
|
-
return (0,
|
|
4052
|
+
let s = this._getOrReturnCtx(e);
|
|
4053
|
+
return (0, u.addIssueToContext)(s, {
|
|
4054
4054
|
code: f.ZodIssueCode.invalid_type,
|
|
4055
4055
|
expected: m.ZodParsedType.undefined,
|
|
4056
|
-
received:
|
|
4057
|
-
}),
|
|
4056
|
+
received: s.parsedType
|
|
4057
|
+
}), u.INVALID;
|
|
4058
4058
|
}
|
|
4059
|
-
return (0,
|
|
4059
|
+
return (0, u.OK)(e.data);
|
|
4060
4060
|
}
|
|
4061
4061
|
};
|
|
4062
|
-
|
|
4063
|
-
ae.create = (
|
|
4062
|
+
l.ZodUndefined = ae;
|
|
4063
|
+
ae.create = (r) => new ae({
|
|
4064
4064
|
typeName: _.ZodUndefined,
|
|
4065
|
-
...v(
|
|
4065
|
+
...v(r)
|
|
4066
4066
|
});
|
|
4067
4067
|
var oe = class extends b {
|
|
4068
4068
|
static {
|
|
@@ -4070,20 +4070,20 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4070
4070
|
}
|
|
4071
4071
|
_parse(e) {
|
|
4072
4072
|
if (this._getType(e) !== m.ZodParsedType.null) {
|
|
4073
|
-
let
|
|
4074
|
-
return (0,
|
|
4073
|
+
let s = this._getOrReturnCtx(e);
|
|
4074
|
+
return (0, u.addIssueToContext)(s, {
|
|
4075
4075
|
code: f.ZodIssueCode.invalid_type,
|
|
4076
4076
|
expected: m.ZodParsedType.null,
|
|
4077
|
-
received:
|
|
4078
|
-
}),
|
|
4077
|
+
received: s.parsedType
|
|
4078
|
+
}), u.INVALID;
|
|
4079
4079
|
}
|
|
4080
|
-
return (0,
|
|
4080
|
+
return (0, u.OK)(e.data);
|
|
4081
4081
|
}
|
|
4082
4082
|
};
|
|
4083
|
-
|
|
4084
|
-
oe.create = (
|
|
4083
|
+
l.ZodNull = oe;
|
|
4084
|
+
oe.create = (r) => new oe({
|
|
4085
4085
|
typeName: _.ZodNull,
|
|
4086
|
-
...v(
|
|
4086
|
+
...v(r)
|
|
4087
4087
|
});
|
|
4088
4088
|
var X = class extends b {
|
|
4089
4089
|
static {
|
|
@@ -4093,13 +4093,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4093
4093
|
super(...arguments), this._any = !0;
|
|
4094
4094
|
}
|
|
4095
4095
|
_parse(e) {
|
|
4096
|
-
return (0,
|
|
4096
|
+
return (0, u.OK)(e.data);
|
|
4097
4097
|
}
|
|
4098
4098
|
};
|
|
4099
|
-
|
|
4100
|
-
X.create = (
|
|
4099
|
+
l.ZodAny = X;
|
|
4100
|
+
X.create = (r) => new X({
|
|
4101
4101
|
typeName: _.ZodAny,
|
|
4102
|
-
...v(
|
|
4102
|
+
...v(r)
|
|
4103
4103
|
});
|
|
4104
4104
|
var H = class extends b {
|
|
4105
4105
|
static {
|
|
@@ -4109,13 +4109,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4109
4109
|
super(...arguments), this._unknown = !0;
|
|
4110
4110
|
}
|
|
4111
4111
|
_parse(e) {
|
|
4112
|
-
return (0,
|
|
4112
|
+
return (0, u.OK)(e.data);
|
|
4113
4113
|
}
|
|
4114
4114
|
};
|
|
4115
|
-
|
|
4116
|
-
H.create = (
|
|
4115
|
+
l.ZodUnknown = H;
|
|
4116
|
+
H.create = (r) => new H({
|
|
4117
4117
|
typeName: _.ZodUnknown,
|
|
4118
|
-
...v(
|
|
4118
|
+
...v(r)
|
|
4119
4119
|
});
|
|
4120
4120
|
var $ = class extends b {
|
|
4121
4121
|
static {
|
|
@@ -4123,17 +4123,17 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4123
4123
|
}
|
|
4124
4124
|
_parse(e) {
|
|
4125
4125
|
let t = this._getOrReturnCtx(e);
|
|
4126
|
-
return (0,
|
|
4126
|
+
return (0, u.addIssueToContext)(t, {
|
|
4127
4127
|
code: f.ZodIssueCode.invalid_type,
|
|
4128
4128
|
expected: m.ZodParsedType.never,
|
|
4129
4129
|
received: t.parsedType
|
|
4130
|
-
}),
|
|
4130
|
+
}), u.INVALID;
|
|
4131
4131
|
}
|
|
4132
4132
|
};
|
|
4133
|
-
|
|
4134
|
-
$.create = (
|
|
4133
|
+
l.ZodNever = $;
|
|
4134
|
+
$.create = (r) => new $({
|
|
4135
4135
|
typeName: _.ZodNever,
|
|
4136
|
-
...v(
|
|
4136
|
+
...v(r)
|
|
4137
4137
|
});
|
|
4138
4138
|
var be = class extends b {
|
|
4139
4139
|
static {
|
|
@@ -4141,36 +4141,36 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4141
4141
|
}
|
|
4142
4142
|
_parse(e) {
|
|
4143
4143
|
if (this._getType(e) !== m.ZodParsedType.undefined) {
|
|
4144
|
-
let
|
|
4145
|
-
return (0,
|
|
4144
|
+
let s = this._getOrReturnCtx(e);
|
|
4145
|
+
return (0, u.addIssueToContext)(s, {
|
|
4146
4146
|
code: f.ZodIssueCode.invalid_type,
|
|
4147
4147
|
expected: m.ZodParsedType.void,
|
|
4148
|
-
received:
|
|
4149
|
-
}),
|
|
4148
|
+
received: s.parsedType
|
|
4149
|
+
}), u.INVALID;
|
|
4150
4150
|
}
|
|
4151
|
-
return (0,
|
|
4151
|
+
return (0, u.OK)(e.data);
|
|
4152
4152
|
}
|
|
4153
4153
|
};
|
|
4154
|
-
|
|
4155
|
-
be.create = (
|
|
4154
|
+
l.ZodVoid = be;
|
|
4155
|
+
be.create = (r) => new be({
|
|
4156
4156
|
typeName: _.ZodVoid,
|
|
4157
|
-
...v(
|
|
4157
|
+
...v(r)
|
|
4158
4158
|
});
|
|
4159
|
-
var B = class
|
|
4159
|
+
var B = class r extends b {
|
|
4160
4160
|
static {
|
|
4161
4161
|
d(this, "ZodArray");
|
|
4162
4162
|
}
|
|
4163
4163
|
_parse(e) {
|
|
4164
|
-
let { ctx: t, status:
|
|
4164
|
+
let { ctx: t, status: s } = this._processInputParams(e), i = this._def;
|
|
4165
4165
|
if (t.parsedType !== m.ZodParsedType.array)
|
|
4166
|
-
return (0,
|
|
4166
|
+
return (0, u.addIssueToContext)(t, {
|
|
4167
4167
|
code: f.ZodIssueCode.invalid_type,
|
|
4168
4168
|
expected: m.ZodParsedType.array,
|
|
4169
4169
|
received: t.parsedType
|
|
4170
|
-
}),
|
|
4170
|
+
}), u.INVALID;
|
|
4171
4171
|
if (i.exactLength !== null) {
|
|
4172
4172
|
let a = t.data.length > i.exactLength.value, o = t.data.length < i.exactLength.value;
|
|
4173
|
-
(a || o) && ((0,
|
|
4173
|
+
(a || o) && ((0, u.addIssueToContext)(t, {
|
|
4174
4174
|
code: a ? f.ZodIssueCode.too_big : f.ZodIssueCode.too_small,
|
|
4175
4175
|
minimum: o ? i.exactLength.value : void 0,
|
|
4176
4176
|
maximum: a ? i.exactLength.value : void 0,
|
|
@@ -4178,44 +4178,44 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4178
4178
|
inclusive: !0,
|
|
4179
4179
|
exact: !0,
|
|
4180
4180
|
message: i.exactLength.message
|
|
4181
|
-
}),
|
|
4181
|
+
}), s.dirty());
|
|
4182
4182
|
}
|
|
4183
|
-
if (i.minLength !== null && t.data.length < i.minLength.value && ((0,
|
|
4183
|
+
if (i.minLength !== null && t.data.length < i.minLength.value && ((0, u.addIssueToContext)(t, {
|
|
4184
4184
|
code: f.ZodIssueCode.too_small,
|
|
4185
4185
|
minimum: i.minLength.value,
|
|
4186
4186
|
type: "array",
|
|
4187
4187
|
inclusive: !0,
|
|
4188
4188
|
exact: !1,
|
|
4189
4189
|
message: i.minLength.message
|
|
4190
|
-
}),
|
|
4190
|
+
}), s.dirty()), i.maxLength !== null && t.data.length > i.maxLength.value && ((0, u.addIssueToContext)(t, {
|
|
4191
4191
|
code: f.ZodIssueCode.too_big,
|
|
4192
4192
|
maximum: i.maxLength.value,
|
|
4193
4193
|
type: "array",
|
|
4194
4194
|
inclusive: !0,
|
|
4195
4195
|
exact: !1,
|
|
4196
4196
|
message: i.maxLength.message
|
|
4197
|
-
}),
|
|
4198
|
-
return Promise.all([...t.data].map((a, o) => i.type._parseAsync(new N(t, a, t.path, o)))).then((a) =>
|
|
4197
|
+
}), s.dirty()), t.common.async)
|
|
4198
|
+
return Promise.all([...t.data].map((a, o) => i.type._parseAsync(new N(t, a, t.path, o)))).then((a) => u.ParseStatus.mergeArray(s, a));
|
|
4199
4199
|
let n = [...t.data].map((a, o) => i.type._parseSync(new N(t, a, t.path, o)));
|
|
4200
|
-
return
|
|
4200
|
+
return u.ParseStatus.mergeArray(s, n);
|
|
4201
4201
|
}
|
|
4202
4202
|
get element() {
|
|
4203
4203
|
return this._def.type;
|
|
4204
4204
|
}
|
|
4205
4205
|
min(e, t) {
|
|
4206
|
-
return new
|
|
4206
|
+
return new r({
|
|
4207
4207
|
...this._def,
|
|
4208
4208
|
minLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4209
4209
|
});
|
|
4210
4210
|
}
|
|
4211
4211
|
max(e, t) {
|
|
4212
|
-
return new
|
|
4212
|
+
return new r({
|
|
4213
4213
|
...this._def,
|
|
4214
4214
|
maxLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4215
4215
|
});
|
|
4216
4216
|
}
|
|
4217
4217
|
length(e, t) {
|
|
4218
|
-
return new
|
|
4218
|
+
return new r({
|
|
4219
4219
|
...this._def,
|
|
4220
4220
|
exactLength: { value: e, message: g.errorUtil.toString(t) }
|
|
4221
4221
|
});
|
|
@@ -4224,34 +4224,34 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4224
4224
|
return this.min(1, e);
|
|
4225
4225
|
}
|
|
4226
4226
|
};
|
|
4227
|
-
|
|
4228
|
-
B.create = (
|
|
4229
|
-
type:
|
|
4227
|
+
l.ZodArray = B;
|
|
4228
|
+
B.create = (r, e) => new B({
|
|
4229
|
+
type: r,
|
|
4230
4230
|
minLength: null,
|
|
4231
4231
|
maxLength: null,
|
|
4232
4232
|
exactLength: null,
|
|
4233
4233
|
typeName: _.ZodArray,
|
|
4234
4234
|
...v(e)
|
|
4235
4235
|
});
|
|
4236
|
-
function _e(
|
|
4237
|
-
if (
|
|
4236
|
+
function _e(r) {
|
|
4237
|
+
if (r instanceof A) {
|
|
4238
4238
|
let e = {};
|
|
4239
|
-
for (let t in
|
|
4240
|
-
let
|
|
4241
|
-
e[t] = P.create(_e(
|
|
4239
|
+
for (let t in r.shape) {
|
|
4240
|
+
let s = r.shape[t];
|
|
4241
|
+
e[t] = P.create(_e(s));
|
|
4242
4242
|
}
|
|
4243
4243
|
return new A({
|
|
4244
|
-
...
|
|
4244
|
+
...r._def,
|
|
4245
4245
|
shape: /* @__PURE__ */ d(() => e, "shape")
|
|
4246
4246
|
});
|
|
4247
|
-
} else return
|
|
4248
|
-
...
|
|
4249
|
-
type: _e(
|
|
4250
|
-
}) :
|
|
4251
|
-
e))) :
|
|
4247
|
+
} else return r instanceof B ? new B({
|
|
4248
|
+
...r._def,
|
|
4249
|
+
type: _e(r.element)
|
|
4250
|
+
}) : r instanceof P ? P.create(_e(r.unwrap())) : r instanceof q ? q.create(_e(r.unwrap())) : r instanceof L ? L.create(r.items.map((e) => _e(
|
|
4251
|
+
e))) : r;
|
|
4252
4252
|
}
|
|
4253
4253
|
d(_e, "deepPartialify");
|
|
4254
|
-
var A = class
|
|
4254
|
+
var A = class r extends b {
|
|
4255
4255
|
static {
|
|
4256
4256
|
d(this, "ZodObject");
|
|
4257
4257
|
}
|
|
@@ -4267,13 +4267,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4267
4267
|
_parse(e) {
|
|
4268
4268
|
if (this._getType(e) !== m.ZodParsedType.object) {
|
|
4269
4269
|
let h = this._getOrReturnCtx(e);
|
|
4270
|
-
return (0,
|
|
4270
|
+
return (0, u.addIssueToContext)(h, {
|
|
4271
4271
|
code: f.ZodIssueCode.invalid_type,
|
|
4272
4272
|
expected: m.ZodParsedType.object,
|
|
4273
4273
|
received: h.parsedType
|
|
4274
|
-
}),
|
|
4274
|
+
}), u.INVALID;
|
|
4275
4275
|
}
|
|
4276
|
-
let { status:
|
|
4276
|
+
let { status: s, ctx: i } = this._processInputParams(e), { shape: n, keys: a } = this._getCached(), o = [];
|
|
4277
4277
|
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
4278
4278
|
for (let h in i.data)
|
|
4279
4279
|
a.includes(h) || o.push(h);
|
|
@@ -4295,10 +4295,10 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4295
4295
|
value: { status: "valid", value: i.data[p] }
|
|
4296
4296
|
});
|
|
4297
4297
|
else if (h === "strict")
|
|
4298
|
-
o.length > 0 && ((0,
|
|
4298
|
+
o.length > 0 && ((0, u.addIssueToContext)(i, {
|
|
4299
4299
|
code: f.ZodIssueCode.unrecognized_keys,
|
|
4300
4300
|
keys: o
|
|
4301
|
-
}),
|
|
4301
|
+
}), s.dirty());
|
|
4302
4302
|
else if (h !== "strip")
|
|
4303
4303
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
4304
4304
|
} else {
|
|
@@ -4326,20 +4326,20 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4326
4326
|
});
|
|
4327
4327
|
}
|
|
4328
4328
|
return h;
|
|
4329
|
-
}).then((h) =>
|
|
4329
|
+
}).then((h) => u.ParseStatus.mergeObjectSync(s, h)) : u.ParseStatus.mergeObjectSync(s, c);
|
|
4330
4330
|
}
|
|
4331
4331
|
get shape() {
|
|
4332
4332
|
return this._def.shape();
|
|
4333
4333
|
}
|
|
4334
4334
|
strict(e) {
|
|
4335
|
-
return g.errorUtil.errToObj, new
|
|
4335
|
+
return g.errorUtil.errToObj, new r({
|
|
4336
4336
|
...this._def,
|
|
4337
4337
|
unknownKeys: "strict",
|
|
4338
4338
|
...e !== void 0 ? {
|
|
4339
|
-
errorMap: /* @__PURE__ */ d((t,
|
|
4339
|
+
errorMap: /* @__PURE__ */ d((t, s) => {
|
|
4340
4340
|
var i, n, a, o;
|
|
4341
|
-
let c = (a = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t,
|
|
4342
|
-
a :
|
|
4341
|
+
let c = (a = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t, s).message) !== null && a !== void 0 ?
|
|
4342
|
+
a : s.defaultError;
|
|
4343
4343
|
return t.code === "unrecognized_keys" ? {
|
|
4344
4344
|
message: (o = g.errorUtil.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
4345
4345
|
} : {
|
|
@@ -4350,13 +4350,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4350
4350
|
});
|
|
4351
4351
|
}
|
|
4352
4352
|
strip() {
|
|
4353
|
-
return new
|
|
4353
|
+
return new r({
|
|
4354
4354
|
...this._def,
|
|
4355
4355
|
unknownKeys: "strip"
|
|
4356
4356
|
});
|
|
4357
4357
|
}
|
|
4358
4358
|
passthrough() {
|
|
4359
|
-
return new
|
|
4359
|
+
return new r({
|
|
4360
4360
|
...this._def,
|
|
4361
4361
|
unknownKeys: "passthrough"
|
|
4362
4362
|
});
|
|
@@ -4379,7 +4379,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4379
4379
|
// }) as any;
|
|
4380
4380
|
// };
|
|
4381
4381
|
extend(e) {
|
|
4382
|
-
return new
|
|
4382
|
+
return new r({
|
|
4383
4383
|
...this._def,
|
|
4384
4384
|
shape: /* @__PURE__ */ d(() => ({
|
|
4385
4385
|
...this._def.shape(),
|
|
@@ -4393,7 +4393,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4393
4393
|
* upgrade if you are experiencing issues.
|
|
4394
4394
|
*/
|
|
4395
4395
|
merge(e) {
|
|
4396
|
-
return new
|
|
4396
|
+
return new r({
|
|
4397
4397
|
unknownKeys: e._def.unknownKeys,
|
|
4398
4398
|
catchall: e._def.catchall,
|
|
4399
4399
|
shape: /* @__PURE__ */ d(() => ({
|
|
@@ -4463,25 +4463,25 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4463
4463
|
// return merged;
|
|
4464
4464
|
// }
|
|
4465
4465
|
catchall(e) {
|
|
4466
|
-
return new
|
|
4466
|
+
return new r({
|
|
4467
4467
|
...this._def,
|
|
4468
4468
|
catchall: e
|
|
4469
4469
|
});
|
|
4470
4470
|
}
|
|
4471
4471
|
pick(e) {
|
|
4472
4472
|
let t = {};
|
|
4473
|
-
return m.util.objectKeys(e).forEach((
|
|
4474
|
-
e[
|
|
4475
|
-
}), new
|
|
4473
|
+
return m.util.objectKeys(e).forEach((s) => {
|
|
4474
|
+
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
4475
|
+
}), new r({
|
|
4476
4476
|
...this._def,
|
|
4477
4477
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4478
4478
|
});
|
|
4479
4479
|
}
|
|
4480
4480
|
omit(e) {
|
|
4481
4481
|
let t = {};
|
|
4482
|
-
return m.util.objectKeys(this.shape).forEach((
|
|
4483
|
-
e[
|
|
4484
|
-
}), new
|
|
4482
|
+
return m.util.objectKeys(this.shape).forEach((s) => {
|
|
4483
|
+
e[s] || (t[s] = this.shape[s]);
|
|
4484
|
+
}), new r({
|
|
4485
4485
|
...this._def,
|
|
4486
4486
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4487
4487
|
});
|
|
@@ -4494,51 +4494,51 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4494
4494
|
}
|
|
4495
4495
|
partial(e) {
|
|
4496
4496
|
let t = {};
|
|
4497
|
-
return m.util.objectKeys(this.shape).forEach((
|
|
4498
|
-
let i = this.shape[
|
|
4499
|
-
e && !e[
|
|
4500
|
-
}), new
|
|
4497
|
+
return m.util.objectKeys(this.shape).forEach((s) => {
|
|
4498
|
+
let i = this.shape[s];
|
|
4499
|
+
e && !e[s] ? t[s] = i : t[s] = i.optional();
|
|
4500
|
+
}), new r({
|
|
4501
4501
|
...this._def,
|
|
4502
4502
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4503
4503
|
});
|
|
4504
4504
|
}
|
|
4505
4505
|
required(e) {
|
|
4506
4506
|
let t = {};
|
|
4507
|
-
return m.util.objectKeys(this.shape).forEach((
|
|
4508
|
-
if (e && !e[
|
|
4509
|
-
t[
|
|
4507
|
+
return m.util.objectKeys(this.shape).forEach((s) => {
|
|
4508
|
+
if (e && !e[s])
|
|
4509
|
+
t[s] = this.shape[s];
|
|
4510
4510
|
else {
|
|
4511
|
-
let n = this.shape[
|
|
4511
|
+
let n = this.shape[s];
|
|
4512
4512
|
for (; n instanceof P; )
|
|
4513
4513
|
n = n._def.innerType;
|
|
4514
|
-
t[
|
|
4514
|
+
t[s] = n;
|
|
4515
4515
|
}
|
|
4516
|
-
}), new
|
|
4516
|
+
}), new r({
|
|
4517
4517
|
...this._def,
|
|
4518
4518
|
shape: /* @__PURE__ */ d(() => t, "shape")
|
|
4519
4519
|
});
|
|
4520
4520
|
}
|
|
4521
4521
|
keyof() {
|
|
4522
|
-
return
|
|
4522
|
+
return ks(m.util.objectKeys(this.shape));
|
|
4523
4523
|
}
|
|
4524
4524
|
};
|
|
4525
|
-
|
|
4526
|
-
A.create = (
|
|
4527
|
-
shape: /* @__PURE__ */ d(() =>
|
|
4525
|
+
l.ZodObject = A;
|
|
4526
|
+
A.create = (r, e) => new A({
|
|
4527
|
+
shape: /* @__PURE__ */ d(() => r, "shape"),
|
|
4528
4528
|
unknownKeys: "strip",
|
|
4529
4529
|
catchall: $.create(),
|
|
4530
4530
|
typeName: _.ZodObject,
|
|
4531
4531
|
...v(e)
|
|
4532
4532
|
});
|
|
4533
|
-
A.strictCreate = (
|
|
4534
|
-
shape: /* @__PURE__ */ d(() =>
|
|
4533
|
+
A.strictCreate = (r, e) => new A({
|
|
4534
|
+
shape: /* @__PURE__ */ d(() => r, "shape"),
|
|
4535
4535
|
unknownKeys: "strict",
|
|
4536
4536
|
catchall: $.create(),
|
|
4537
4537
|
typeName: _.ZodObject,
|
|
4538
4538
|
...v(e)
|
|
4539
4539
|
});
|
|
4540
|
-
A.lazycreate = (
|
|
4541
|
-
shape:
|
|
4540
|
+
A.lazycreate = (r, e) => new A({
|
|
4541
|
+
shape: r,
|
|
4542
4542
|
unknownKeys: "strip",
|
|
4543
4543
|
catchall: $.create(),
|
|
4544
4544
|
typeName: _.ZodObject,
|
|
@@ -4549,7 +4549,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4549
4549
|
d(this, "ZodUnion");
|
|
4550
4550
|
}
|
|
4551
4551
|
_parse(e) {
|
|
4552
|
-
let { ctx: t } = this._processInputParams(e),
|
|
4552
|
+
let { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
4553
4553
|
function i(n) {
|
|
4554
4554
|
for (let o of n)
|
|
4555
4555
|
if (o.result.status === "valid")
|
|
@@ -4558,13 +4558,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4558
4558
|
if (o.result.status === "dirty")
|
|
4559
4559
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
4560
4560
|
let a = n.map((o) => new f.ZodError(o.ctx.common.issues));
|
|
4561
|
-
return (0,
|
|
4561
|
+
return (0, u.addIssueToContext)(t, {
|
|
4562
4562
|
code: f.ZodIssueCode.invalid_union,
|
|
4563
4563
|
unionErrors: a
|
|
4564
|
-
}),
|
|
4564
|
+
}), u.INVALID;
|
|
4565
4565
|
}
|
|
4566
4566
|
if (d(i, "handleResults"), t.common.async)
|
|
4567
|
-
return Promise.all(
|
|
4567
|
+
return Promise.all(s.map(async (n) => {
|
|
4568
4568
|
let a = {
|
|
4569
4569
|
...t,
|
|
4570
4570
|
common: {
|
|
@@ -4584,7 +4584,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4584
4584
|
})).then(i);
|
|
4585
4585
|
{
|
|
4586
4586
|
let n, a = [];
|
|
4587
|
-
for (let c of
|
|
4587
|
+
for (let c of s) {
|
|
4588
4588
|
let h = {
|
|
4589
4589
|
...t,
|
|
4590
4590
|
common: {
|
|
@@ -4604,38 +4604,38 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4604
4604
|
if (n)
|
|
4605
4605
|
return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
4606
4606
|
let o = a.map((c) => new f.ZodError(c));
|
|
4607
|
-
return (0,
|
|
4607
|
+
return (0, u.addIssueToContext)(t, {
|
|
4608
4608
|
code: f.ZodIssueCode.invalid_union,
|
|
4609
4609
|
unionErrors: o
|
|
4610
|
-
}),
|
|
4610
|
+
}), u.INVALID;
|
|
4611
4611
|
}
|
|
4612
4612
|
}
|
|
4613
4613
|
get options() {
|
|
4614
4614
|
return this._def.options;
|
|
4615
4615
|
}
|
|
4616
4616
|
};
|
|
4617
|
-
|
|
4618
|
-
de.create = (
|
|
4619
|
-
options:
|
|
4617
|
+
l.ZodUnion = de;
|
|
4618
|
+
de.create = (r, e) => new de({
|
|
4619
|
+
options: r,
|
|
4620
4620
|
typeName: _.ZodUnion,
|
|
4621
4621
|
...v(e)
|
|
4622
4622
|
});
|
|
4623
|
-
var F = /* @__PURE__ */ d((
|
|
4624
|
-
he ?
|
|
4625
|
-
oe ? [null] :
|
|
4626
|
-
F(
|
|
4623
|
+
var F = /* @__PURE__ */ d((r) => r instanceof ue ? F(r.schema) : r instanceof S ? F(r.innerType()) : r instanceof ce ? [r.value] : r instanceof
|
|
4624
|
+
he ? r.options : r instanceof pe ? m.util.objectValues(r.enum) : r instanceof fe ? F(r._def.innerType) : r instanceof ae ? [void 0] : r instanceof
|
|
4625
|
+
oe ? [null] : r instanceof P ? [void 0, ...F(r.unwrap())] : r instanceof q ? [null, ...F(r.unwrap())] : r instanceof Pe || r instanceof ge ?
|
|
4626
|
+
F(r.unwrap()) : r instanceof me ? F(r._def.innerType) : [], "getDiscriminator"), Ye = class r extends b {
|
|
4627
4627
|
static {
|
|
4628
4628
|
d(this, "ZodDiscriminatedUnion");
|
|
4629
4629
|
}
|
|
4630
4630
|
_parse(e) {
|
|
4631
4631
|
let { ctx: t } = this._processInputParams(e);
|
|
4632
4632
|
if (t.parsedType !== m.ZodParsedType.object)
|
|
4633
|
-
return (0,
|
|
4633
|
+
return (0, u.addIssueToContext)(t, {
|
|
4634
4634
|
code: f.ZodIssueCode.invalid_type,
|
|
4635
4635
|
expected: m.ZodParsedType.object,
|
|
4636
4636
|
received: t.parsedType
|
|
4637
|
-
}),
|
|
4638
|
-
let
|
|
4637
|
+
}), u.INVALID;
|
|
4638
|
+
let s = this.discriminator, i = t.data[s], n = this.optionsMap.get(i);
|
|
4639
4639
|
return n ? t.common.async ? n._parseAsync({
|
|
4640
4640
|
data: t.data,
|
|
4641
4641
|
path: t.path,
|
|
@@ -4644,11 +4644,11 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4644
4644
|
data: t.data,
|
|
4645
4645
|
path: t.path,
|
|
4646
4646
|
parent: t
|
|
4647
|
-
}) : ((0,
|
|
4647
|
+
}) : ((0, u.addIssueToContext)(t, {
|
|
4648
4648
|
code: f.ZodIssueCode.invalid_union_discriminator,
|
|
4649
4649
|
options: Array.from(this.optionsMap.keys()),
|
|
4650
|
-
path: [
|
|
4651
|
-
}),
|
|
4650
|
+
path: [s]
|
|
4651
|
+
}), u.INVALID);
|
|
4652
4652
|
}
|
|
4653
4653
|
get discriminator() {
|
|
4654
4654
|
return this._def.discriminator;
|
|
@@ -4667,7 +4667,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4667
4667
|
* @param types an array of object schemas
|
|
4668
4668
|
* @param params
|
|
4669
4669
|
*/
|
|
4670
|
-
static create(e, t,
|
|
4670
|
+
static create(e, t, s) {
|
|
4671
4671
|
let i = /* @__PURE__ */ new Map();
|
|
4672
4672
|
for (let n of t) {
|
|
4673
4673
|
let a = F(n.shape[e]);
|
|
@@ -4679,141 +4679,141 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4679
4679
|
i.set(o, n);
|
|
4680
4680
|
}
|
|
4681
4681
|
}
|
|
4682
|
-
return new
|
|
4682
|
+
return new r({
|
|
4683
4683
|
typeName: _.ZodDiscriminatedUnion,
|
|
4684
4684
|
discriminator: e,
|
|
4685
4685
|
options: t,
|
|
4686
4686
|
optionsMap: i,
|
|
4687
|
-
...v(
|
|
4687
|
+
...v(s)
|
|
4688
4688
|
});
|
|
4689
4689
|
}
|
|
4690
4690
|
};
|
|
4691
|
-
|
|
4692
|
-
function Et(
|
|
4693
|
-
let t = (0, m.getParsedType)(
|
|
4694
|
-
if (
|
|
4695
|
-
return { valid: !0, data:
|
|
4696
|
-
if (t === m.ZodParsedType.object &&
|
|
4697
|
-
let i = m.util.objectKeys(e), n = m.util.objectKeys(
|
|
4691
|
+
l.ZodDiscriminatedUnion = Ye;
|
|
4692
|
+
function Et(r, e) {
|
|
4693
|
+
let t = (0, m.getParsedType)(r), s = (0, m.getParsedType)(e);
|
|
4694
|
+
if (r === e)
|
|
4695
|
+
return { valid: !0, data: r };
|
|
4696
|
+
if (t === m.ZodParsedType.object && s === m.ZodParsedType.object) {
|
|
4697
|
+
let i = m.util.objectKeys(e), n = m.util.objectKeys(r).filter((o) => i.indexOf(o) !== -1), a = { ...r, ...e };
|
|
4698
4698
|
for (let o of n) {
|
|
4699
|
-
let c = Et(
|
|
4699
|
+
let c = Et(r[o], e[o]);
|
|
4700
4700
|
if (!c.valid)
|
|
4701
4701
|
return { valid: !1 };
|
|
4702
4702
|
a[o] = c.data;
|
|
4703
4703
|
}
|
|
4704
4704
|
return { valid: !0, data: a };
|
|
4705
|
-
} else if (t === m.ZodParsedType.array &&
|
|
4706
|
-
if (
|
|
4705
|
+
} else if (t === m.ZodParsedType.array && s === m.ZodParsedType.array) {
|
|
4706
|
+
if (r.length !== e.length)
|
|
4707
4707
|
return { valid: !1 };
|
|
4708
4708
|
let i = [];
|
|
4709
|
-
for (let n = 0; n <
|
|
4710
|
-
let a =
|
|
4709
|
+
for (let n = 0; n < r.length; n++) {
|
|
4710
|
+
let a = r[n], o = e[n], c = Et(a, o);
|
|
4711
4711
|
if (!c.valid)
|
|
4712
4712
|
return { valid: !1 };
|
|
4713
4713
|
i.push(c.data);
|
|
4714
4714
|
}
|
|
4715
4715
|
return { valid: !0, data: i };
|
|
4716
|
-
} else return t === m.ZodParsedType.date &&
|
|
4716
|
+
} else return t === m.ZodParsedType.date && s === m.ZodParsedType.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
4717
4717
|
}
|
|
4718
4718
|
d(Et, "mergeValues");
|
|
4719
|
-
var
|
|
4719
|
+
var le = class extends b {
|
|
4720
4720
|
static {
|
|
4721
4721
|
d(this, "ZodIntersection");
|
|
4722
4722
|
}
|
|
4723
4723
|
_parse(e) {
|
|
4724
|
-
let { status: t, ctx:
|
|
4725
|
-
if ((0,
|
|
4726
|
-
return
|
|
4724
|
+
let { status: t, ctx: s } = this._processInputParams(e), i = /* @__PURE__ */ d((n, a) => {
|
|
4725
|
+
if ((0, u.isAborted)(n) || (0, u.isAborted)(a))
|
|
4726
|
+
return u.INVALID;
|
|
4727
4727
|
let o = Et(n.value, a.value);
|
|
4728
|
-
return o.valid ? (((0,
|
|
4729
|
-
|
|
4728
|
+
return o.valid ? (((0, u.isDirty)(n) || (0, u.isDirty)(a)) && t.dirty(), { status: t.value, value: o.data }) : ((0, u.addIssueToContext)(
|
|
4729
|
+
s, {
|
|
4730
4730
|
code: f.ZodIssueCode.invalid_intersection_types
|
|
4731
|
-
}),
|
|
4731
|
+
}), u.INVALID);
|
|
4732
4732
|
}, "handleParsed");
|
|
4733
|
-
return
|
|
4733
|
+
return s.common.async ? Promise.all([
|
|
4734
4734
|
this._def.left._parseAsync({
|
|
4735
|
-
data:
|
|
4736
|
-
path:
|
|
4737
|
-
parent:
|
|
4735
|
+
data: s.data,
|
|
4736
|
+
path: s.path,
|
|
4737
|
+
parent: s
|
|
4738
4738
|
}),
|
|
4739
4739
|
this._def.right._parseAsync({
|
|
4740
|
-
data:
|
|
4741
|
-
path:
|
|
4742
|
-
parent:
|
|
4740
|
+
data: s.data,
|
|
4741
|
+
path: s.path,
|
|
4742
|
+
parent: s
|
|
4743
4743
|
})
|
|
4744
4744
|
]).then(([n, a]) => i(n, a)) : i(this._def.left._parseSync({
|
|
4745
|
-
data:
|
|
4746
|
-
path:
|
|
4747
|
-
parent:
|
|
4745
|
+
data: s.data,
|
|
4746
|
+
path: s.path,
|
|
4747
|
+
parent: s
|
|
4748
4748
|
}), this._def.right._parseSync({
|
|
4749
|
-
data:
|
|
4750
|
-
path:
|
|
4751
|
-
parent:
|
|
4749
|
+
data: s.data,
|
|
4750
|
+
path: s.path,
|
|
4751
|
+
parent: s
|
|
4752
4752
|
}));
|
|
4753
4753
|
}
|
|
4754
4754
|
};
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
left:
|
|
4755
|
+
l.ZodIntersection = le;
|
|
4756
|
+
le.create = (r, e, t) => new le({
|
|
4757
|
+
left: r,
|
|
4758
4758
|
right: e,
|
|
4759
4759
|
typeName: _.ZodIntersection,
|
|
4760
4760
|
...v(t)
|
|
4761
4761
|
});
|
|
4762
|
-
var L = class
|
|
4762
|
+
var L = class r extends b {
|
|
4763
4763
|
static {
|
|
4764
4764
|
d(this, "ZodTuple");
|
|
4765
4765
|
}
|
|
4766
4766
|
_parse(e) {
|
|
4767
|
-
let { status: t, ctx:
|
|
4768
|
-
if (
|
|
4769
|
-
return (0,
|
|
4767
|
+
let { status: t, ctx: s } = this._processInputParams(e);
|
|
4768
|
+
if (s.parsedType !== m.ZodParsedType.array)
|
|
4769
|
+
return (0, u.addIssueToContext)(s, {
|
|
4770
4770
|
code: f.ZodIssueCode.invalid_type,
|
|
4771
4771
|
expected: m.ZodParsedType.array,
|
|
4772
|
-
received:
|
|
4773
|
-
}),
|
|
4774
|
-
if (
|
|
4775
|
-
return (0,
|
|
4772
|
+
received: s.parsedType
|
|
4773
|
+
}), u.INVALID;
|
|
4774
|
+
if (s.data.length < this._def.items.length)
|
|
4775
|
+
return (0, u.addIssueToContext)(s, {
|
|
4776
4776
|
code: f.ZodIssueCode.too_small,
|
|
4777
4777
|
minimum: this._def.items.length,
|
|
4778
4778
|
inclusive: !0,
|
|
4779
4779
|
exact: !1,
|
|
4780
4780
|
type: "array"
|
|
4781
|
-
}),
|
|
4782
|
-
!this._def.rest &&
|
|
4781
|
+
}), u.INVALID;
|
|
4782
|
+
!this._def.rest && s.data.length > this._def.items.length && ((0, u.addIssueToContext)(s, {
|
|
4783
4783
|
code: f.ZodIssueCode.too_big,
|
|
4784
4784
|
maximum: this._def.items.length,
|
|
4785
4785
|
inclusive: !0,
|
|
4786
4786
|
exact: !1,
|
|
4787
4787
|
type: "array"
|
|
4788
4788
|
}), t.dirty());
|
|
4789
|
-
let n = [...
|
|
4789
|
+
let n = [...s.data].map((a, o) => {
|
|
4790
4790
|
let c = this._def.items[o] || this._def.rest;
|
|
4791
|
-
return c ? c._parse(new N(
|
|
4791
|
+
return c ? c._parse(new N(s, a, s.path, o)) : null;
|
|
4792
4792
|
}).filter((a) => !!a);
|
|
4793
|
-
return
|
|
4793
|
+
return s.common.async ? Promise.all(n).then((a) => u.ParseStatus.mergeArray(t, a)) : u.ParseStatus.mergeArray(t, n);
|
|
4794
4794
|
}
|
|
4795
4795
|
get items() {
|
|
4796
4796
|
return this._def.items;
|
|
4797
4797
|
}
|
|
4798
4798
|
rest(e) {
|
|
4799
|
-
return new
|
|
4799
|
+
return new r({
|
|
4800
4800
|
...this._def,
|
|
4801
4801
|
rest: e
|
|
4802
4802
|
});
|
|
4803
4803
|
}
|
|
4804
4804
|
};
|
|
4805
|
-
|
|
4806
|
-
L.create = (
|
|
4807
|
-
if (!Array.isArray(
|
|
4805
|
+
l.ZodTuple = L;
|
|
4806
|
+
L.create = (r, e) => {
|
|
4807
|
+
if (!Array.isArray(r))
|
|
4808
4808
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4809
4809
|
return new L({
|
|
4810
|
-
items:
|
|
4810
|
+
items: r,
|
|
4811
4811
|
typeName: _.ZodTuple,
|
|
4812
4812
|
rest: null,
|
|
4813
4813
|
...v(e)
|
|
4814
4814
|
});
|
|
4815
4815
|
};
|
|
4816
|
-
var Ke = class
|
|
4816
|
+
var Ke = class r extends b {
|
|
4817
4817
|
static {
|
|
4818
4818
|
d(this, "ZodRecord");
|
|
4819
4819
|
}
|
|
@@ -4824,32 +4824,32 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4824
4824
|
return this._def.valueType;
|
|
4825
4825
|
}
|
|
4826
4826
|
_parse(e) {
|
|
4827
|
-
let { status: t, ctx:
|
|
4828
|
-
if (
|
|
4829
|
-
return (0,
|
|
4827
|
+
let { status: t, ctx: s } = this._processInputParams(e);
|
|
4828
|
+
if (s.parsedType !== m.ZodParsedType.object)
|
|
4829
|
+
return (0, u.addIssueToContext)(s, {
|
|
4830
4830
|
code: f.ZodIssueCode.invalid_type,
|
|
4831
4831
|
expected: m.ZodParsedType.object,
|
|
4832
|
-
received:
|
|
4833
|
-
}),
|
|
4832
|
+
received: s.parsedType
|
|
4833
|
+
}), u.INVALID;
|
|
4834
4834
|
let i = [], n = this._def.keyType, a = this._def.valueType;
|
|
4835
|
-
for (let o in
|
|
4835
|
+
for (let o in s.data)
|
|
4836
4836
|
i.push({
|
|
4837
|
-
key: n._parse(new N(
|
|
4838
|
-
value: a._parse(new N(
|
|
4839
|
-
alwaysSet: o in
|
|
4837
|
+
key: n._parse(new N(s, o, s.path, o)),
|
|
4838
|
+
value: a._parse(new N(s, s.data[o], s.path, o)),
|
|
4839
|
+
alwaysSet: o in s.data
|
|
4840
4840
|
});
|
|
4841
|
-
return
|
|
4841
|
+
return s.common.async ? u.ParseStatus.mergeObjectAsync(t, i) : u.ParseStatus.mergeObjectSync(t, i);
|
|
4842
4842
|
}
|
|
4843
4843
|
get element() {
|
|
4844
4844
|
return this._def.valueType;
|
|
4845
4845
|
}
|
|
4846
|
-
static create(e, t,
|
|
4847
|
-
return t instanceof b ? new
|
|
4846
|
+
static create(e, t, s) {
|
|
4847
|
+
return t instanceof b ? new r({
|
|
4848
4848
|
keyType: e,
|
|
4849
4849
|
valueType: t,
|
|
4850
4850
|
typeName: _.ZodRecord,
|
|
4851
|
-
...v(
|
|
4852
|
-
}) : new
|
|
4851
|
+
...v(s)
|
|
4852
|
+
}) : new r({
|
|
4853
4853
|
keyType: K.create(),
|
|
4854
4854
|
valueType: e,
|
|
4855
4855
|
typeName: _.ZodRecord,
|
|
@@ -4857,7 +4857,7 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4857
4857
|
});
|
|
4858
4858
|
}
|
|
4859
4859
|
};
|
|
4860
|
-
|
|
4860
|
+
l.ZodRecord = Ke;
|
|
4861
4861
|
var xe = class extends b {
|
|
4862
4862
|
static {
|
|
4863
4863
|
d(this, "ZodMap");
|
|
@@ -4869,24 +4869,24 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4869
4869
|
return this._def.valueType;
|
|
4870
4870
|
}
|
|
4871
4871
|
_parse(e) {
|
|
4872
|
-
let { status: t, ctx:
|
|
4873
|
-
if (
|
|
4874
|
-
return (0,
|
|
4872
|
+
let { status: t, ctx: s } = this._processInputParams(e);
|
|
4873
|
+
if (s.parsedType !== m.ZodParsedType.map)
|
|
4874
|
+
return (0, u.addIssueToContext)(s, {
|
|
4875
4875
|
code: f.ZodIssueCode.invalid_type,
|
|
4876
4876
|
expected: m.ZodParsedType.map,
|
|
4877
|
-
received:
|
|
4878
|
-
}),
|
|
4879
|
-
let i = this._def.keyType, n = this._def.valueType, a = [...
|
|
4880
|
-
key: i._parse(new N(
|
|
4881
|
-
value: n._parse(new N(
|
|
4877
|
+
received: s.parsedType
|
|
4878
|
+
}), u.INVALID;
|
|
4879
|
+
let i = this._def.keyType, n = this._def.valueType, a = [...s.data.entries()].map(([o, c], h) => ({
|
|
4880
|
+
key: i._parse(new N(s, o, s.path, [h, "key"])),
|
|
4881
|
+
value: n._parse(new N(s, c, s.path, [h, "value"]))
|
|
4882
4882
|
}));
|
|
4883
|
-
if (
|
|
4883
|
+
if (s.common.async) {
|
|
4884
4884
|
let o = /* @__PURE__ */ new Map();
|
|
4885
4885
|
return Promise.resolve().then(async () => {
|
|
4886
4886
|
for (let c of a) {
|
|
4887
4887
|
let h = await c.key, p = await c.value;
|
|
4888
4888
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4889
|
-
return
|
|
4889
|
+
return u.INVALID;
|
|
4890
4890
|
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4891
4891
|
}
|
|
4892
4892
|
return { status: t.value, value: o };
|
|
@@ -4896,41 +4896,41 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4896
4896
|
for (let c of a) {
|
|
4897
4897
|
let h = c.key, p = c.value;
|
|
4898
4898
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4899
|
-
return
|
|
4899
|
+
return u.INVALID;
|
|
4900
4900
|
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4901
4901
|
}
|
|
4902
4902
|
return { status: t.value, value: o };
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
4905
|
};
|
|
4906
|
-
|
|
4907
|
-
xe.create = (
|
|
4906
|
+
l.ZodMap = xe;
|
|
4907
|
+
xe.create = (r, e, t) => new xe({
|
|
4908
4908
|
valueType: e,
|
|
4909
|
-
keyType:
|
|
4909
|
+
keyType: r,
|
|
4910
4910
|
typeName: _.ZodMap,
|
|
4911
4911
|
...v(t)
|
|
4912
4912
|
});
|
|
4913
|
-
var we = class
|
|
4913
|
+
var we = class r extends b {
|
|
4914
4914
|
static {
|
|
4915
4915
|
d(this, "ZodSet");
|
|
4916
4916
|
}
|
|
4917
4917
|
_parse(e) {
|
|
4918
|
-
let { status: t, ctx:
|
|
4919
|
-
if (
|
|
4920
|
-
return (0,
|
|
4918
|
+
let { status: t, ctx: s } = this._processInputParams(e);
|
|
4919
|
+
if (s.parsedType !== m.ZodParsedType.set)
|
|
4920
|
+
return (0, u.addIssueToContext)(s, {
|
|
4921
4921
|
code: f.ZodIssueCode.invalid_type,
|
|
4922
4922
|
expected: m.ZodParsedType.set,
|
|
4923
|
-
received:
|
|
4924
|
-
}),
|
|
4923
|
+
received: s.parsedType
|
|
4924
|
+
}), u.INVALID;
|
|
4925
4925
|
let i = this._def;
|
|
4926
|
-
i.minSize !== null &&
|
|
4926
|
+
i.minSize !== null && s.data.size < i.minSize.value && ((0, u.addIssueToContext)(s, {
|
|
4927
4927
|
code: f.ZodIssueCode.too_small,
|
|
4928
4928
|
minimum: i.minSize.value,
|
|
4929
4929
|
type: "set",
|
|
4930
4930
|
inclusive: !0,
|
|
4931
4931
|
exact: !1,
|
|
4932
4932
|
message: i.minSize.message
|
|
4933
|
-
}), t.dirty()), i.maxSize !== null &&
|
|
4933
|
+
}), t.dirty()), i.maxSize !== null && s.data.size > i.maxSize.value && ((0, u.addIssueToContext)(s, {
|
|
4934
4934
|
code: f.ZodIssueCode.too_big,
|
|
4935
4935
|
maximum: i.maxSize.value,
|
|
4936
4936
|
type: "set",
|
|
@@ -4943,23 +4943,23 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4943
4943
|
let h = /* @__PURE__ */ new Set();
|
|
4944
4944
|
for (let p of c) {
|
|
4945
4945
|
if (p.status === "aborted")
|
|
4946
|
-
return
|
|
4946
|
+
return u.INVALID;
|
|
4947
4947
|
p.status === "dirty" && t.dirty(), h.add(p.value);
|
|
4948
4948
|
}
|
|
4949
4949
|
return { status: t.value, value: h };
|
|
4950
4950
|
}
|
|
4951
4951
|
d(a, "finalizeSet");
|
|
4952
|
-
let o = [...
|
|
4953
|
-
return
|
|
4952
|
+
let o = [...s.data.values()].map((c, h) => n._parse(new N(s, c, s.path, h)));
|
|
4953
|
+
return s.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
4954
4954
|
}
|
|
4955
4955
|
min(e, t) {
|
|
4956
|
-
return new
|
|
4956
|
+
return new r({
|
|
4957
4957
|
...this._def,
|
|
4958
4958
|
minSize: { value: e, message: g.errorUtil.toString(t) }
|
|
4959
4959
|
});
|
|
4960
4960
|
}
|
|
4961
4961
|
max(e, t) {
|
|
4962
|
-
return new
|
|
4962
|
+
return new r({
|
|
4963
4963
|
...this._def,
|
|
4964
4964
|
maxSize: { value: e, message: g.errorUtil.toString(t) }
|
|
4965
4965
|
});
|
|
@@ -4971,15 +4971,15 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4971
4971
|
return this.min(1, e);
|
|
4972
4972
|
}
|
|
4973
4973
|
};
|
|
4974
|
-
|
|
4975
|
-
we.create = (
|
|
4976
|
-
valueType:
|
|
4974
|
+
l.ZodSet = we;
|
|
4975
|
+
we.create = (r, e) => new we({
|
|
4976
|
+
valueType: r,
|
|
4977
4977
|
minSize: null,
|
|
4978
4978
|
maxSize: null,
|
|
4979
4979
|
typeName: _.ZodSet,
|
|
4980
4980
|
...v(e)
|
|
4981
4981
|
});
|
|
4982
|
-
var Xe = class
|
|
4982
|
+
var Xe = class r extends b {
|
|
4983
4983
|
static {
|
|
4984
4984
|
d(this, "ZodFunction");
|
|
4985
4985
|
}
|
|
@@ -4989,13 +4989,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4989
4989
|
_parse(e) {
|
|
4990
4990
|
let { ctx: t } = this._processInputParams(e);
|
|
4991
4991
|
if (t.parsedType !== m.ZodParsedType.function)
|
|
4992
|
-
return (0,
|
|
4992
|
+
return (0, u.addIssueToContext)(t, {
|
|
4993
4993
|
code: f.ZodIssueCode.invalid_type,
|
|
4994
4994
|
expected: m.ZodParsedType.function,
|
|
4995
4995
|
received: t.parsedType
|
|
4996
|
-
}),
|
|
4997
|
-
function
|
|
4998
|
-
return (0,
|
|
4996
|
+
}), u.INVALID;
|
|
4997
|
+
function s(o, c) {
|
|
4998
|
+
return (0, u.makeIssue)({
|
|
4999
4999
|
data: o,
|
|
5000
5000
|
path: t.path,
|
|
5001
5001
|
errorMaps: [
|
|
@@ -5010,9 +5010,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5010
5010
|
}
|
|
5011
5011
|
});
|
|
5012
5012
|
}
|
|
5013
|
-
d(
|
|
5013
|
+
d(s, "makeArgsIssue");
|
|
5014
5014
|
function i(o, c) {
|
|
5015
|
-
return (0,
|
|
5015
|
+
return (0, u.makeIssue)({
|
|
5016
5016
|
data: o,
|
|
5017
5017
|
path: t.path,
|
|
5018
5018
|
errorMaps: [
|
|
@@ -5031,9 +5031,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5031
5031
|
let n = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
5032
5032
|
if (this._def.returns instanceof Q) {
|
|
5033
5033
|
let o = this;
|
|
5034
|
-
return (0,
|
|
5034
|
+
return (0, u.OK)(async function(...c) {
|
|
5035
5035
|
let h = new f.ZodError([]), p = await o._def.args.parseAsync(c, n).catch((j) => {
|
|
5036
|
-
throw h.addIssue(
|
|
5036
|
+
throw h.addIssue(s(c, j)), h;
|
|
5037
5037
|
}), y = await Reflect.apply(a, this, p);
|
|
5038
5038
|
return await o._def.returns._def.type.parseAsync(y, n).catch((j) => {
|
|
5039
5039
|
throw h.addIssue(i(y, j)), h;
|
|
@@ -5041,10 +5041,10 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5041
5041
|
});
|
|
5042
5042
|
} else {
|
|
5043
5043
|
let o = this;
|
|
5044
|
-
return (0,
|
|
5044
|
+
return (0, u.OK)(function(...c) {
|
|
5045
5045
|
let h = o._def.args.safeParse(c, n);
|
|
5046
5046
|
if (!h.success)
|
|
5047
|
-
throw new f.ZodError([
|
|
5047
|
+
throw new f.ZodError([s(c, h.error)]);
|
|
5048
5048
|
let p = Reflect.apply(a, this, h.data), y = o._def.returns.safeParse(p, n);
|
|
5049
5049
|
if (!y.success)
|
|
5050
5050
|
throw new f.ZodError([i(p, y.error)]);
|
|
@@ -5059,13 +5059,13 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5059
5059
|
return this._def.returns;
|
|
5060
5060
|
}
|
|
5061
5061
|
args(...e) {
|
|
5062
|
-
return new
|
|
5062
|
+
return new r({
|
|
5063
5063
|
...this._def,
|
|
5064
5064
|
args: L.create(e).rest(H.create())
|
|
5065
5065
|
});
|
|
5066
5066
|
}
|
|
5067
5067
|
returns(e) {
|
|
5068
|
-
return new
|
|
5068
|
+
return new r({
|
|
5069
5069
|
...this._def,
|
|
5070
5070
|
returns: e
|
|
5071
5071
|
});
|
|
@@ -5076,17 +5076,17 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5076
5076
|
strictImplement(e) {
|
|
5077
5077
|
return this.parse(e);
|
|
5078
5078
|
}
|
|
5079
|
-
static create(e, t,
|
|
5080
|
-
return new
|
|
5079
|
+
static create(e, t, s) {
|
|
5080
|
+
return new r({
|
|
5081
5081
|
args: e || L.create([]).rest(H.create()),
|
|
5082
5082
|
returns: t || H.create(),
|
|
5083
5083
|
typeName: _.ZodFunction,
|
|
5084
|
-
...v(
|
|
5084
|
+
...v(s)
|
|
5085
5085
|
});
|
|
5086
5086
|
}
|
|
5087
5087
|
};
|
|
5088
|
-
|
|
5089
|
-
var
|
|
5088
|
+
l.ZodFunction = Xe;
|
|
5089
|
+
var ue = class extends b {
|
|
5090
5090
|
static {
|
|
5091
5091
|
d(this, "ZodLazy");
|
|
5092
5092
|
}
|
|
@@ -5098,9 +5098,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5098
5098
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
5099
5099
|
}
|
|
5100
5100
|
};
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
getter:
|
|
5101
|
+
l.ZodLazy = ue;
|
|
5102
|
+
ue.create = (r, e) => new ue({
|
|
5103
|
+
getter: r,
|
|
5104
5104
|
typeName: _.ZodLazy,
|
|
5105
5105
|
...v(e)
|
|
5106
5106
|
});
|
|
@@ -5111,11 +5111,11 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5111
5111
|
_parse(e) {
|
|
5112
5112
|
if (e.data !== this._def.value) {
|
|
5113
5113
|
let t = this._getOrReturnCtx(e);
|
|
5114
|
-
return (0,
|
|
5114
|
+
return (0, u.addIssueToContext)(t, {
|
|
5115
5115
|
received: t.data,
|
|
5116
5116
|
code: f.ZodIssueCode.invalid_literal,
|
|
5117
5117
|
expected: this._def.value
|
|
5118
|
-
}),
|
|
5118
|
+
}), u.INVALID;
|
|
5119
5119
|
}
|
|
5120
5120
|
return { status: "valid", value: e.data };
|
|
5121
5121
|
}
|
|
@@ -5123,21 +5123,21 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5123
5123
|
return this._def.value;
|
|
5124
5124
|
}
|
|
5125
5125
|
};
|
|
5126
|
-
|
|
5127
|
-
ce.create = (
|
|
5128
|
-
value:
|
|
5126
|
+
l.ZodLiteral = ce;
|
|
5127
|
+
ce.create = (r, e) => new ce({
|
|
5128
|
+
value: r,
|
|
5129
5129
|
typeName: _.ZodLiteral,
|
|
5130
5130
|
...v(e)
|
|
5131
5131
|
});
|
|
5132
|
-
function
|
|
5132
|
+
function ks(r, e) {
|
|
5133
5133
|
return new he({
|
|
5134
|
-
values:
|
|
5134
|
+
values: r,
|
|
5135
5135
|
typeName: _.ZodEnum,
|
|
5136
5136
|
...v(e)
|
|
5137
5137
|
});
|
|
5138
5138
|
}
|
|
5139
|
-
d(
|
|
5140
|
-
var he = class
|
|
5139
|
+
d(ks, "createZodEnum");
|
|
5140
|
+
var he = class r extends b {
|
|
5141
5141
|
static {
|
|
5142
5142
|
d(this, "ZodEnum");
|
|
5143
5143
|
}
|
|
@@ -5146,22 +5146,22 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5146
5146
|
}
|
|
5147
5147
|
_parse(e) {
|
|
5148
5148
|
if (typeof e.data != "string") {
|
|
5149
|
-
let t = this._getOrReturnCtx(e),
|
|
5150
|
-
return (0,
|
|
5151
|
-
expected: m.util.joinValues(
|
|
5149
|
+
let t = this._getOrReturnCtx(e), s = this._def.values;
|
|
5150
|
+
return (0, u.addIssueToContext)(t, {
|
|
5151
|
+
expected: m.util.joinValues(s),
|
|
5152
5152
|
received: t.parsedType,
|
|
5153
5153
|
code: f.ZodIssueCode.invalid_type
|
|
5154
|
-
}),
|
|
5154
|
+
}), u.INVALID;
|
|
5155
5155
|
}
|
|
5156
|
-
if (Je(this, Se, "f") ||
|
|
5157
|
-
let t = this._getOrReturnCtx(e),
|
|
5158
|
-
return (0,
|
|
5156
|
+
if (Je(this, Se, "f") || bs(this, Se, new Set(this._def.values), "f"), !Je(this, Se, "f").has(e.data)) {
|
|
5157
|
+
let t = this._getOrReturnCtx(e), s = this._def.values;
|
|
5158
|
+
return (0, u.addIssueToContext)(t, {
|
|
5159
5159
|
received: t.data,
|
|
5160
5160
|
code: f.ZodIssueCode.invalid_enum_value,
|
|
5161
|
-
options:
|
|
5162
|
-
}),
|
|
5161
|
+
options: s
|
|
5162
|
+
}), u.INVALID;
|
|
5163
5163
|
}
|
|
5164
|
-
return (0,
|
|
5164
|
+
return (0, u.OK)(e.data);
|
|
5165
5165
|
}
|
|
5166
5166
|
get options() {
|
|
5167
5167
|
return this._def.values;
|
|
@@ -5185,21 +5185,21 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5185
5185
|
return e;
|
|
5186
5186
|
}
|
|
5187
5187
|
extract(e, t = this._def) {
|
|
5188
|
-
return
|
|
5188
|
+
return r.create(e, {
|
|
5189
5189
|
...this._def,
|
|
5190
5190
|
...t
|
|
5191
5191
|
});
|
|
5192
5192
|
}
|
|
5193
5193
|
exclude(e, t = this._def) {
|
|
5194
|
-
return
|
|
5194
|
+
return r.create(this.options.filter((s) => !e.includes(s)), {
|
|
5195
5195
|
...this._def,
|
|
5196
5196
|
...t
|
|
5197
5197
|
});
|
|
5198
5198
|
}
|
|
5199
5199
|
};
|
|
5200
|
-
|
|
5200
|
+
l.ZodEnum = he;
|
|
5201
5201
|
Se = /* @__PURE__ */ new WeakMap();
|
|
5202
|
-
he.create =
|
|
5202
|
+
he.create = ks;
|
|
5203
5203
|
var pe = class extends b {
|
|
5204
5204
|
static {
|
|
5205
5205
|
d(this, "ZodNativeEnum");
|
|
@@ -5208,33 +5208,33 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5208
5208
|
super(...arguments), Ee.set(this, void 0);
|
|
5209
5209
|
}
|
|
5210
5210
|
_parse(e) {
|
|
5211
|
-
let t = m.util.getValidEnumValues(this._def.values),
|
|
5212
|
-
if (
|
|
5211
|
+
let t = m.util.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
5212
|
+
if (s.parsedType !== m.ZodParsedType.string && s.parsedType !== m.ZodParsedType.number) {
|
|
5213
5213
|
let i = m.util.objectValues(t);
|
|
5214
|
-
return (0,
|
|
5214
|
+
return (0, u.addIssueToContext)(s, {
|
|
5215
5215
|
expected: m.util.joinValues(i),
|
|
5216
|
-
received:
|
|
5216
|
+
received: s.parsedType,
|
|
5217
5217
|
code: f.ZodIssueCode.invalid_type
|
|
5218
|
-
}),
|
|
5218
|
+
}), u.INVALID;
|
|
5219
5219
|
}
|
|
5220
|
-
if (Je(this, Ee, "f") ||
|
|
5220
|
+
if (Je(this, Ee, "f") || bs(this, Ee, new Set(m.util.getValidEnumValues(this._def.values)), "f"), !Je(this, Ee, "f").has(e.data)) {
|
|
5221
5221
|
let i = m.util.objectValues(t);
|
|
5222
|
-
return (0,
|
|
5223
|
-
received:
|
|
5222
|
+
return (0, u.addIssueToContext)(s, {
|
|
5223
|
+
received: s.data,
|
|
5224
5224
|
code: f.ZodIssueCode.invalid_enum_value,
|
|
5225
5225
|
options: i
|
|
5226
|
-
}),
|
|
5226
|
+
}), u.INVALID;
|
|
5227
5227
|
}
|
|
5228
|
-
return (0,
|
|
5228
|
+
return (0, u.OK)(e.data);
|
|
5229
5229
|
}
|
|
5230
5230
|
get enum() {
|
|
5231
5231
|
return this._def.values;
|
|
5232
5232
|
}
|
|
5233
5233
|
};
|
|
5234
|
-
|
|
5234
|
+
l.ZodNativeEnum = pe;
|
|
5235
5235
|
Ee = /* @__PURE__ */ new WeakMap();
|
|
5236
|
-
pe.create = (
|
|
5237
|
-
values:
|
|
5236
|
+
pe.create = (r, e) => new pe({
|
|
5237
|
+
values: r,
|
|
5238
5238
|
typeName: _.ZodNativeEnum,
|
|
5239
5239
|
...v(e)
|
|
5240
5240
|
});
|
|
@@ -5248,21 +5248,21 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5248
5248
|
_parse(e) {
|
|
5249
5249
|
let { ctx: t } = this._processInputParams(e);
|
|
5250
5250
|
if (t.parsedType !== m.ZodParsedType.promise && t.common.async === !1)
|
|
5251
|
-
return (0,
|
|
5251
|
+
return (0, u.addIssueToContext)(t, {
|
|
5252
5252
|
code: f.ZodIssueCode.invalid_type,
|
|
5253
5253
|
expected: m.ZodParsedType.promise,
|
|
5254
5254
|
received: t.parsedType
|
|
5255
|
-
}),
|
|
5256
|
-
let
|
|
5257
|
-
return (0,
|
|
5255
|
+
}), u.INVALID;
|
|
5256
|
+
let s = t.parsedType === m.ZodParsedType.promise ? t.data : Promise.resolve(t.data);
|
|
5257
|
+
return (0, u.OK)(s.then((i) => this._def.type.parseAsync(i, {
|
|
5258
5258
|
path: t.path,
|
|
5259
5259
|
errorMap: t.common.contextualErrorMap
|
|
5260
5260
|
})));
|
|
5261
5261
|
}
|
|
5262
5262
|
};
|
|
5263
|
-
|
|
5264
|
-
Q.create = (
|
|
5265
|
-
type:
|
|
5263
|
+
l.ZodPromise = Q;
|
|
5264
|
+
Q.create = (r, e) => new Q({
|
|
5265
|
+
type: r,
|
|
5266
5266
|
typeName: _.ZodPromise,
|
|
5267
5267
|
...v(e)
|
|
5268
5268
|
});
|
|
@@ -5277,88 +5277,88 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5277
5277
|
return this._def.schema._def.typeName === _.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
5278
5278
|
}
|
|
5279
5279
|
_parse(e) {
|
|
5280
|
-
let { status: t, ctx:
|
|
5280
|
+
let { status: t, ctx: s } = this._processInputParams(e), i = this._def.effect || null, n = {
|
|
5281
5281
|
addIssue: /* @__PURE__ */ d((a) => {
|
|
5282
|
-
(0,
|
|
5282
|
+
(0, u.addIssueToContext)(s, a), a.fatal ? t.abort() : t.dirty();
|
|
5283
5283
|
}, "addIssue"),
|
|
5284
5284
|
get path() {
|
|
5285
|
-
return
|
|
5285
|
+
return s.path;
|
|
5286
5286
|
}
|
|
5287
5287
|
};
|
|
5288
5288
|
if (n.addIssue = n.addIssue.bind(n), i.type === "preprocess") {
|
|
5289
|
-
let a = i.transform(
|
|
5290
|
-
if (
|
|
5289
|
+
let a = i.transform(s.data, n);
|
|
5290
|
+
if (s.common.async)
|
|
5291
5291
|
return Promise.resolve(a).then(async (o) => {
|
|
5292
5292
|
if (t.value === "aborted")
|
|
5293
|
-
return
|
|
5293
|
+
return u.INVALID;
|
|
5294
5294
|
let c = await this._def.schema._parseAsync({
|
|
5295
5295
|
data: o,
|
|
5296
|
-
path:
|
|
5297
|
-
parent:
|
|
5296
|
+
path: s.path,
|
|
5297
|
+
parent: s
|
|
5298
5298
|
});
|
|
5299
|
-
return c.status === "aborted" ?
|
|
5299
|
+
return c.status === "aborted" ? u.INVALID : c.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(c.value) : c;
|
|
5300
5300
|
});
|
|
5301
5301
|
{
|
|
5302
5302
|
if (t.value === "aborted")
|
|
5303
|
-
return
|
|
5303
|
+
return u.INVALID;
|
|
5304
5304
|
let o = this._def.schema._parseSync({
|
|
5305
5305
|
data: a,
|
|
5306
|
-
path:
|
|
5307
|
-
parent:
|
|
5306
|
+
path: s.path,
|
|
5307
|
+
parent: s
|
|
5308
5308
|
});
|
|
5309
|
-
return o.status === "aborted" ?
|
|
5309
|
+
return o.status === "aborted" ? u.INVALID : o.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(o.value) : o;
|
|
5310
5310
|
}
|
|
5311
5311
|
}
|
|
5312
5312
|
if (i.type === "refinement") {
|
|
5313
5313
|
let a = /* @__PURE__ */ d((o) => {
|
|
5314
5314
|
let c = i.refinement(o, n);
|
|
5315
|
-
if (
|
|
5315
|
+
if (s.common.async)
|
|
5316
5316
|
return Promise.resolve(c);
|
|
5317
5317
|
if (c instanceof Promise)
|
|
5318
5318
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5319
5319
|
return o;
|
|
5320
5320
|
}, "executeRefinement");
|
|
5321
|
-
if (
|
|
5321
|
+
if (s.common.async === !1) {
|
|
5322
5322
|
let o = this._def.schema._parseSync({
|
|
5323
|
-
data:
|
|
5324
|
-
path:
|
|
5325
|
-
parent:
|
|
5323
|
+
data: s.data,
|
|
5324
|
+
path: s.path,
|
|
5325
|
+
parent: s
|
|
5326
5326
|
});
|
|
5327
|
-
return o.status === "aborted" ?
|
|
5327
|
+
return o.status === "aborted" ? u.INVALID : (o.status === "dirty" && t.dirty(), a(o.value), { status: t.value, value: o.value });
|
|
5328
5328
|
} else
|
|
5329
|
-
return this._def.schema._parseAsync({ data:
|
|
5329
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => o.status === "aborted" ? u.INVALID : (o.
|
|
5330
5330
|
status === "dirty" && t.dirty(), a(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
5331
5331
|
}
|
|
5332
5332
|
if (i.type === "transform")
|
|
5333
|
-
if (
|
|
5333
|
+
if (s.common.async === !1) {
|
|
5334
5334
|
let a = this._def.schema._parseSync({
|
|
5335
|
-
data:
|
|
5336
|
-
path:
|
|
5337
|
-
parent:
|
|
5335
|
+
data: s.data,
|
|
5336
|
+
path: s.path,
|
|
5337
|
+
parent: s
|
|
5338
5338
|
});
|
|
5339
|
-
if (!(0,
|
|
5339
|
+
if (!(0, u.isValid)(a))
|
|
5340
5340
|
return a;
|
|
5341
5341
|
let o = i.transform(a.value, n);
|
|
5342
5342
|
if (o instanceof Promise)
|
|
5343
5343
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5344
5344
|
return { status: t.value, value: o };
|
|
5345
5345
|
} else
|
|
5346
|
-
return this._def.schema._parseAsync({ data:
|
|
5346
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((a) => (0, u.isValid)(a) ? Promise.resolve(i.transform(
|
|
5347
5347
|
a.value, n)).then((o) => ({ status: t.value, value: o })) : a);
|
|
5348
5348
|
m.util.assertNever(i);
|
|
5349
5349
|
}
|
|
5350
5350
|
};
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
S.create = (
|
|
5354
|
-
schema:
|
|
5351
|
+
l.ZodEffects = S;
|
|
5352
|
+
l.ZodTransformer = S;
|
|
5353
|
+
S.create = (r, e, t) => new S({
|
|
5354
|
+
schema: r,
|
|
5355
5355
|
typeName: _.ZodEffects,
|
|
5356
5356
|
effect: e,
|
|
5357
5357
|
...v(t)
|
|
5358
5358
|
});
|
|
5359
|
-
S.createWithPreprocess = (
|
|
5359
|
+
S.createWithPreprocess = (r, e, t) => new S({
|
|
5360
5360
|
schema: e,
|
|
5361
|
-
effect: { type: "preprocess", transform:
|
|
5361
|
+
effect: { type: "preprocess", transform: r },
|
|
5362
5362
|
typeName: _.ZodEffects,
|
|
5363
5363
|
...v(t)
|
|
5364
5364
|
});
|
|
@@ -5367,15 +5367,15 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5367
5367
|
d(this, "ZodOptional");
|
|
5368
5368
|
}
|
|
5369
5369
|
_parse(e) {
|
|
5370
|
-
return this._getType(e) === m.ZodParsedType.undefined ? (0,
|
|
5370
|
+
return this._getType(e) === m.ZodParsedType.undefined ? (0, u.OK)(void 0) : this._def.innerType._parse(e);
|
|
5371
5371
|
}
|
|
5372
5372
|
unwrap() {
|
|
5373
5373
|
return this._def.innerType;
|
|
5374
5374
|
}
|
|
5375
5375
|
};
|
|
5376
|
-
|
|
5377
|
-
P.create = (
|
|
5378
|
-
innerType:
|
|
5376
|
+
l.ZodOptional = P;
|
|
5377
|
+
P.create = (r, e) => new P({
|
|
5378
|
+
innerType: r,
|
|
5379
5379
|
typeName: _.ZodOptional,
|
|
5380
5380
|
...v(e)
|
|
5381
5381
|
});
|
|
@@ -5384,15 +5384,15 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5384
5384
|
d(this, "ZodNullable");
|
|
5385
5385
|
}
|
|
5386
5386
|
_parse(e) {
|
|
5387
|
-
return this._getType(e) === m.ZodParsedType.null ? (0,
|
|
5387
|
+
return this._getType(e) === m.ZodParsedType.null ? (0, u.OK)(null) : this._def.innerType._parse(e);
|
|
5388
5388
|
}
|
|
5389
5389
|
unwrap() {
|
|
5390
5390
|
return this._def.innerType;
|
|
5391
5391
|
}
|
|
5392
5392
|
};
|
|
5393
|
-
|
|
5394
|
-
q.create = (
|
|
5395
|
-
innerType:
|
|
5393
|
+
l.ZodNullable = q;
|
|
5394
|
+
q.create = (r, e) => new q({
|
|
5395
|
+
innerType: r,
|
|
5396
5396
|
typeName: _.ZodNullable,
|
|
5397
5397
|
...v(e)
|
|
5398
5398
|
});
|
|
@@ -5401,9 +5401,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5401
5401
|
d(this, "ZodDefault");
|
|
5402
5402
|
}
|
|
5403
5403
|
_parse(e) {
|
|
5404
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5405
|
-
return t.parsedType === m.ZodParsedType.undefined && (
|
|
5406
|
-
data:
|
|
5404
|
+
let { ctx: t } = this._processInputParams(e), s = t.data;
|
|
5405
|
+
return t.parsedType === m.ZodParsedType.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
5406
|
+
data: s,
|
|
5407
5407
|
path: t.path,
|
|
5408
5408
|
parent: t
|
|
5409
5409
|
});
|
|
@@ -5412,9 +5412,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5412
5412
|
return this._def.innerType;
|
|
5413
5413
|
}
|
|
5414
5414
|
};
|
|
5415
|
-
|
|
5416
|
-
fe.create = (
|
|
5417
|
-
innerType:
|
|
5415
|
+
l.ZodDefault = fe;
|
|
5416
|
+
fe.create = (r, e) => new fe({
|
|
5417
|
+
innerType: r,
|
|
5418
5418
|
typeName: _.ZodDefault,
|
|
5419
5419
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
5420
5420
|
...v(e)
|
|
@@ -5424,34 +5424,34 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5424
5424
|
d(this, "ZodCatch");
|
|
5425
5425
|
}
|
|
5426
5426
|
_parse(e) {
|
|
5427
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5427
|
+
let { ctx: t } = this._processInputParams(e), s = {
|
|
5428
5428
|
...t,
|
|
5429
5429
|
common: {
|
|
5430
5430
|
...t.common,
|
|
5431
5431
|
issues: []
|
|
5432
5432
|
}
|
|
5433
5433
|
}, i = this._def.innerType._parse({
|
|
5434
|
-
data:
|
|
5435
|
-
path:
|
|
5434
|
+
data: s.data,
|
|
5435
|
+
path: s.path,
|
|
5436
5436
|
parent: {
|
|
5437
|
-
...
|
|
5437
|
+
...s
|
|
5438
5438
|
}
|
|
5439
5439
|
});
|
|
5440
|
-
return (0,
|
|
5440
|
+
return (0, u.isAsync)(i) ? i.then((n) => ({
|
|
5441
5441
|
status: "valid",
|
|
5442
5442
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
5443
5443
|
get error() {
|
|
5444
|
-
return new f.ZodError(
|
|
5444
|
+
return new f.ZodError(s.common.issues);
|
|
5445
5445
|
},
|
|
5446
|
-
input:
|
|
5446
|
+
input: s.data
|
|
5447
5447
|
})
|
|
5448
5448
|
})) : {
|
|
5449
5449
|
status: "valid",
|
|
5450
5450
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
5451
5451
|
get error() {
|
|
5452
|
-
return new f.ZodError(
|
|
5452
|
+
return new f.ZodError(s.common.issues);
|
|
5453
5453
|
},
|
|
5454
|
-
input:
|
|
5454
|
+
input: s.data
|
|
5455
5455
|
})
|
|
5456
5456
|
};
|
|
5457
5457
|
}
|
|
@@ -5459,9 +5459,9 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5459
5459
|
return this._def.innerType;
|
|
5460
5460
|
}
|
|
5461
5461
|
};
|
|
5462
|
-
|
|
5463
|
-
me.create = (
|
|
5464
|
-
innerType:
|
|
5462
|
+
l.ZodCatch = me;
|
|
5463
|
+
me.create = (r, e) => new me({
|
|
5464
|
+
innerType: r,
|
|
5465
5465
|
typeName: _.ZodCatch,
|
|
5466
5466
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
5467
5467
|
...v(e)
|
|
@@ -5472,30 +5472,30 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5472
5472
|
}
|
|
5473
5473
|
_parse(e) {
|
|
5474
5474
|
if (this._getType(e) !== m.ZodParsedType.nan) {
|
|
5475
|
-
let
|
|
5476
|
-
return (0,
|
|
5475
|
+
let s = this._getOrReturnCtx(e);
|
|
5476
|
+
return (0, u.addIssueToContext)(s, {
|
|
5477
5477
|
code: f.ZodIssueCode.invalid_type,
|
|
5478
5478
|
expected: m.ZodParsedType.nan,
|
|
5479
|
-
received:
|
|
5480
|
-
}),
|
|
5479
|
+
received: s.parsedType
|
|
5480
|
+
}), u.INVALID;
|
|
5481
5481
|
}
|
|
5482
5482
|
return { status: "valid", value: e.data };
|
|
5483
5483
|
}
|
|
5484
5484
|
};
|
|
5485
|
-
|
|
5486
|
-
Ce.create = (
|
|
5485
|
+
l.ZodNaN = Ce;
|
|
5486
|
+
Ce.create = (r) => new Ce({
|
|
5487
5487
|
typeName: _.ZodNaN,
|
|
5488
|
-
...v(
|
|
5488
|
+
...v(r)
|
|
5489
5489
|
});
|
|
5490
|
-
|
|
5490
|
+
l.BRAND = Symbol("zod_brand");
|
|
5491
5491
|
var Pe = class extends b {
|
|
5492
5492
|
static {
|
|
5493
5493
|
d(this, "ZodBranded");
|
|
5494
5494
|
}
|
|
5495
5495
|
_parse(e) {
|
|
5496
|
-
let { ctx: t } = this._processInputParams(e),
|
|
5496
|
+
let { ctx: t } = this._processInputParams(e), s = t.data;
|
|
5497
5497
|
return this._def.type._parse({
|
|
5498
|
-
data:
|
|
5498
|
+
data: s,
|
|
5499
5499
|
path: t.path,
|
|
5500
5500
|
parent: t
|
|
5501
5501
|
});
|
|
@@ -5504,280 +5504,280 @@ onent})+$", St, Ms = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5504
5504
|
return this._def.type;
|
|
5505
5505
|
}
|
|
5506
5506
|
};
|
|
5507
|
-
|
|
5508
|
-
var Ne = class
|
|
5507
|
+
l.ZodBranded = Pe;
|
|
5508
|
+
var Ne = class r extends b {
|
|
5509
5509
|
static {
|
|
5510
5510
|
d(this, "ZodPipeline");
|
|
5511
5511
|
}
|
|
5512
5512
|
_parse(e) {
|
|
5513
|
-
let { status: t, ctx:
|
|
5514
|
-
if (
|
|
5513
|
+
let { status: t, ctx: s } = this._processInputParams(e);
|
|
5514
|
+
if (s.common.async)
|
|
5515
5515
|
return (/* @__PURE__ */ d(async () => {
|
|
5516
5516
|
let n = await this._def.in._parseAsync({
|
|
5517
|
-
data:
|
|
5518
|
-
path:
|
|
5519
|
-
parent:
|
|
5517
|
+
data: s.data,
|
|
5518
|
+
path: s.path,
|
|
5519
|
+
parent: s
|
|
5520
5520
|
});
|
|
5521
|
-
return n.status === "aborted" ?
|
|
5521
|
+
return n.status === "aborted" ? u.INVALID : n.status === "dirty" ? (t.dirty(), (0, u.DIRTY)(n.value)) : this._def.out._parseAsync(
|
|
5522
5522
|
{
|
|
5523
5523
|
data: n.value,
|
|
5524
|
-
path:
|
|
5525
|
-
parent:
|
|
5524
|
+
path: s.path,
|
|
5525
|
+
parent: s
|
|
5526
5526
|
});
|
|
5527
5527
|
}, "handleAsync"))();
|
|
5528
5528
|
{
|
|
5529
5529
|
let i = this._def.in._parseSync({
|
|
5530
|
-
data:
|
|
5531
|
-
path:
|
|
5532
|
-
parent:
|
|
5530
|
+
data: s.data,
|
|
5531
|
+
path: s.path,
|
|
5532
|
+
parent: s
|
|
5533
5533
|
});
|
|
5534
|
-
return i.status === "aborted" ?
|
|
5534
|
+
return i.status === "aborted" ? u.INVALID : i.status === "dirty" ? (t.dirty(), {
|
|
5535
5535
|
status: "dirty",
|
|
5536
5536
|
value: i.value
|
|
5537
5537
|
}) : this._def.out._parseSync({
|
|
5538
5538
|
data: i.value,
|
|
5539
|
-
path:
|
|
5540
|
-
parent:
|
|
5539
|
+
path: s.path,
|
|
5540
|
+
parent: s
|
|
5541
5541
|
});
|
|
5542
5542
|
}
|
|
5543
5543
|
}
|
|
5544
5544
|
static create(e, t) {
|
|
5545
|
-
return new
|
|
5545
|
+
return new r({
|
|
5546
5546
|
in: e,
|
|
5547
5547
|
out: t,
|
|
5548
5548
|
typeName: _.ZodPipeline
|
|
5549
5549
|
});
|
|
5550
5550
|
}
|
|
5551
5551
|
};
|
|
5552
|
-
|
|
5552
|
+
l.ZodPipeline = Ne;
|
|
5553
5553
|
var ge = class extends b {
|
|
5554
5554
|
static {
|
|
5555
5555
|
d(this, "ZodReadonly");
|
|
5556
5556
|
}
|
|
5557
5557
|
_parse(e) {
|
|
5558
|
-
let t = this._def.innerType._parse(e),
|
|
5558
|
+
let t = this._def.innerType._parse(e), s = /* @__PURE__ */ d((i) => ((0, u.isValid)(i) && (i.value = Object.freeze(i.value)), i), "fre\
|
|
5559
5559
|
eze");
|
|
5560
|
-
return (0,
|
|
5560
|
+
return (0, u.isAsync)(t) ? t.then((i) => s(i)) : s(t);
|
|
5561
5561
|
}
|
|
5562
5562
|
unwrap() {
|
|
5563
5563
|
return this._def.innerType;
|
|
5564
5564
|
}
|
|
5565
5565
|
};
|
|
5566
|
-
|
|
5567
|
-
ge.create = (
|
|
5568
|
-
innerType:
|
|
5566
|
+
l.ZodReadonly = ge;
|
|
5567
|
+
ge.create = (r, e) => new ge({
|
|
5568
|
+
innerType: r,
|
|
5569
5569
|
typeName: _.ZodReadonly,
|
|
5570
5570
|
...v(e)
|
|
5571
5571
|
});
|
|
5572
|
-
function
|
|
5573
|
-
let t = typeof
|
|
5572
|
+
function vs(r, e) {
|
|
5573
|
+
let t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
5574
5574
|
return typeof t == "string" ? { message: t } : t;
|
|
5575
5575
|
}
|
|
5576
|
-
d(
|
|
5577
|
-
function
|
|
5578
|
-
return
|
|
5576
|
+
d(vs, "cleanParams");
|
|
5577
|
+
function Is(r, e = {}, t) {
|
|
5578
|
+
return r ? X.create().superRefine((s, i) => {
|
|
5579
5579
|
var n, a;
|
|
5580
|
-
let o = s
|
|
5580
|
+
let o = r(s);
|
|
5581
5581
|
if (o instanceof Promise)
|
|
5582
5582
|
return o.then((c) => {
|
|
5583
5583
|
var h, p;
|
|
5584
5584
|
if (!c) {
|
|
5585
|
-
let y =
|
|
5585
|
+
let y = vs(e, s), C = (p = (h = y.fatal) !== null && h !== void 0 ? h : t) !== null && p !== void 0 ? p : !0;
|
|
5586
5586
|
i.addIssue({ code: "custom", ...y, fatal: C });
|
|
5587
5587
|
}
|
|
5588
5588
|
});
|
|
5589
5589
|
if (!o) {
|
|
5590
|
-
let c =
|
|
5590
|
+
let c = vs(e, s), h = (a = (n = c.fatal) !== null && n !== void 0 ? n : t) !== null && a !== void 0 ? a : !0;
|
|
5591
5591
|
i.addIssue({ code: "custom", ...c, fatal: h });
|
|
5592
5592
|
}
|
|
5593
5593
|
}) : X.create();
|
|
5594
5594
|
}
|
|
5595
|
-
d(
|
|
5596
|
-
|
|
5597
|
-
|
|
5595
|
+
d(Is, "custom");
|
|
5596
|
+
l.custom = Is;
|
|
5597
|
+
l.late = {
|
|
5598
5598
|
object: A.lazycreate
|
|
5599
5599
|
};
|
|
5600
5600
|
var _;
|
|
5601
|
-
(function(
|
|
5602
|
-
|
|
5603
|
-
"ZodDate",
|
|
5604
|
-
known",
|
|
5605
|
-
"ZodDiscriminatedUnion",
|
|
5606
|
-
|
|
5607
|
-
"ZodEffects",
|
|
5608
|
-
t",
|
|
5601
|
+
(function(r) {
|
|
5602
|
+
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate =
|
|
5603
|
+
"ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUn\
|
|
5604
|
+
known", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion =
|
|
5605
|
+
"ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap",
|
|
5606
|
+
r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects =
|
|
5607
|
+
"ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefaul\
|
|
5608
|
+
t", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodRe\
|
|
5609
5609
|
adonly";
|
|
5610
|
-
})(_ || (
|
|
5611
|
-
var
|
|
5612
|
-
message: `Input not instance of ${
|
|
5613
|
-
}) =>
|
|
5614
|
-
|
|
5615
|
-
var
|
|
5616
|
-
|
|
5617
|
-
var
|
|
5618
|
-
|
|
5619
|
-
var
|
|
5620
|
-
|
|
5621
|
-
var
|
|
5622
|
-
|
|
5623
|
-
var
|
|
5624
|
-
|
|
5610
|
+
})(_ || (l.ZodFirstPartyTypeKind = _ = {}));
|
|
5611
|
+
var Kr = /* @__PURE__ */ d((r, e = {
|
|
5612
|
+
message: `Input not instance of ${r.name}`
|
|
5613
|
+
}) => Is((t) => t instanceof r, e), "instanceOfType");
|
|
5614
|
+
l.instanceof = Kr;
|
|
5615
|
+
var Ts = K.create;
|
|
5616
|
+
l.string = Ts;
|
|
5617
|
+
var Os = se.create;
|
|
5618
|
+
l.number = Os;
|
|
5619
|
+
var Xr = Ce.create;
|
|
5620
|
+
l.nan = Xr;
|
|
5621
|
+
var Qr = re.create;
|
|
5622
|
+
l.bigint = Qr;
|
|
5623
|
+
var As = ie.create;
|
|
5624
|
+
l.boolean = As;
|
|
5625
5625
|
var ei = ne.create;
|
|
5626
|
-
|
|
5626
|
+
l.date = ei;
|
|
5627
5627
|
var ti = ve.create;
|
|
5628
|
-
|
|
5629
|
-
var
|
|
5630
|
-
|
|
5631
|
-
var
|
|
5632
|
-
|
|
5628
|
+
l.symbol = ti;
|
|
5629
|
+
var si = ae.create;
|
|
5630
|
+
l.undefined = si;
|
|
5631
|
+
var ri = oe.create;
|
|
5632
|
+
l.null = ri;
|
|
5633
5633
|
var ii = X.create;
|
|
5634
|
-
|
|
5634
|
+
l.any = ii;
|
|
5635
5635
|
var ni = H.create;
|
|
5636
|
-
|
|
5636
|
+
l.unknown = ni;
|
|
5637
5637
|
var ai = $.create;
|
|
5638
|
-
|
|
5638
|
+
l.never = ai;
|
|
5639
5639
|
var oi = be.create;
|
|
5640
|
-
|
|
5640
|
+
l.void = oi;
|
|
5641
5641
|
var di = B.create;
|
|
5642
|
-
|
|
5643
|
-
var
|
|
5644
|
-
|
|
5645
|
-
var
|
|
5646
|
-
|
|
5642
|
+
l.array = di;
|
|
5643
|
+
var li = A.create;
|
|
5644
|
+
l.object = li;
|
|
5645
|
+
var ui = A.strictCreate;
|
|
5646
|
+
l.strictObject = ui;
|
|
5647
5647
|
var ci = de.create;
|
|
5648
|
-
|
|
5648
|
+
l.union = ci;
|
|
5649
5649
|
var hi = Ye.create;
|
|
5650
|
-
|
|
5651
|
-
var pi =
|
|
5652
|
-
|
|
5650
|
+
l.discriminatedUnion = hi;
|
|
5651
|
+
var pi = le.create;
|
|
5652
|
+
l.intersection = pi;
|
|
5653
5653
|
var fi = L.create;
|
|
5654
|
-
|
|
5654
|
+
l.tuple = fi;
|
|
5655
5655
|
var mi = Ke.create;
|
|
5656
|
-
|
|
5656
|
+
l.record = mi;
|
|
5657
5657
|
var gi = xe.create;
|
|
5658
|
-
|
|
5658
|
+
l.map = gi;
|
|
5659
5659
|
var yi = we.create;
|
|
5660
|
-
|
|
5660
|
+
l.set = yi;
|
|
5661
5661
|
var _i = Xe.create;
|
|
5662
|
-
|
|
5663
|
-
var vi =
|
|
5664
|
-
|
|
5662
|
+
l.function = _i;
|
|
5663
|
+
var vi = ue.create;
|
|
5664
|
+
l.lazy = vi;
|
|
5665
5665
|
var bi = ce.create;
|
|
5666
|
-
|
|
5666
|
+
l.literal = bi;
|
|
5667
5667
|
var xi = he.create;
|
|
5668
|
-
|
|
5668
|
+
l.enum = xi;
|
|
5669
5669
|
var wi = pe.create;
|
|
5670
|
-
|
|
5670
|
+
l.nativeEnum = wi;
|
|
5671
5671
|
var Ci = Q.create;
|
|
5672
|
-
|
|
5673
|
-
var
|
|
5674
|
-
|
|
5675
|
-
|
|
5672
|
+
l.promise = Ci;
|
|
5673
|
+
var Zs = S.create;
|
|
5674
|
+
l.effect = Zs;
|
|
5675
|
+
l.transformer = Zs;
|
|
5676
5676
|
var ki = P.create;
|
|
5677
|
-
|
|
5677
|
+
l.optional = ki;
|
|
5678
5678
|
var Ii = q.create;
|
|
5679
|
-
|
|
5679
|
+
l.nullable = Ii;
|
|
5680
5680
|
var Ti = S.createWithPreprocess;
|
|
5681
|
-
|
|
5681
|
+
l.preprocess = Ti;
|
|
5682
5682
|
var Oi = Ne.create;
|
|
5683
|
-
|
|
5684
|
-
var Ai = /* @__PURE__ */ d(() =>
|
|
5685
|
-
|
|
5686
|
-
var Zi = /* @__PURE__ */ d(() =>
|
|
5687
|
-
|
|
5688
|
-
var ji = /* @__PURE__ */ d(() =>
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
string: /* @__PURE__ */ d((
|
|
5692
|
-
number: /* @__PURE__ */ d((
|
|
5693
|
-
boolean: /* @__PURE__ */ d((
|
|
5694
|
-
...
|
|
5683
|
+
l.pipeline = Oi;
|
|
5684
|
+
var Ai = /* @__PURE__ */ d(() => Ts().optional(), "ostring");
|
|
5685
|
+
l.ostring = Ai;
|
|
5686
|
+
var Zi = /* @__PURE__ */ d(() => Os().optional(), "onumber");
|
|
5687
|
+
l.onumber = Zi;
|
|
5688
|
+
var ji = /* @__PURE__ */ d(() => As().optional(), "oboolean");
|
|
5689
|
+
l.oboolean = ji;
|
|
5690
|
+
l.coerce = {
|
|
5691
|
+
string: /* @__PURE__ */ d((r) => K.create({ ...r, coerce: !0 }), "string"),
|
|
5692
|
+
number: /* @__PURE__ */ d((r) => se.create({ ...r, coerce: !0 }), "number"),
|
|
5693
|
+
boolean: /* @__PURE__ */ d((r) => ie.create({
|
|
5694
|
+
...r,
|
|
5695
5695
|
coerce: !0
|
|
5696
5696
|
}), "boolean"),
|
|
5697
|
-
bigint: /* @__PURE__ */ d((
|
|
5698
|
-
date: /* @__PURE__ */ d((
|
|
5697
|
+
bigint: /* @__PURE__ */ d((r) => re.create({ ...r, coerce: !0 }), "bigint"),
|
|
5698
|
+
date: /* @__PURE__ */ d((r) => ne.create({ ...r, coerce: !0 }), "date")
|
|
5699
5699
|
};
|
|
5700
|
-
|
|
5700
|
+
l.NEVER = u.INVALID;
|
|
5701
5701
|
});
|
|
5702
5702
|
|
|
5703
5703
|
// ../node_modules/zod/lib/external.js
|
|
5704
5704
|
var Pt = T((V) => {
|
|
5705
5705
|
"use strict";
|
|
5706
|
-
var Si = V && V.__createBinding || (Object.create ? function(
|
|
5707
|
-
|
|
5706
|
+
var Si = V && V.__createBinding || (Object.create ? function(r, e, t, s) {
|
|
5707
|
+
s === void 0 && (s = t);
|
|
5708
5708
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5709
5709
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
5710
5710
|
return e[t];
|
|
5711
|
-
}, "get") }), Object.defineProperty(
|
|
5712
|
-
} : function(
|
|
5713
|
-
|
|
5714
|
-
}), ke = V && V.__exportStar || function(
|
|
5715
|
-
for (var t in
|
|
5711
|
+
}, "get") }), Object.defineProperty(r, s, i);
|
|
5712
|
+
} : function(r, e, t, s) {
|
|
5713
|
+
s === void 0 && (s = t), r[s] = e[t];
|
|
5714
|
+
}), ke = V && V.__exportStar || function(r, e) {
|
|
5715
|
+
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Si(e, r, t);
|
|
5716
5716
|
};
|
|
5717
5717
|
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
5718
5718
|
ke(We(), V);
|
|
5719
5719
|
ke(jt(), V);
|
|
5720
|
-
ke(
|
|
5720
|
+
ke(ms(), V);
|
|
5721
5721
|
ke(Ze(), V);
|
|
5722
|
-
ke(
|
|
5722
|
+
ke(js(), V);
|
|
5723
5723
|
ke(Be(), V);
|
|
5724
5724
|
});
|
|
5725
5725
|
|
|
5726
5726
|
// ../node_modules/zod/lib/index.js
|
|
5727
|
-
var
|
|
5727
|
+
var Ps = T((Z) => {
|
|
5728
5728
|
"use strict";
|
|
5729
|
-
var
|
|
5730
|
-
|
|
5729
|
+
var Ss = Z && Z.__createBinding || (Object.create ? function(r, e, t, s) {
|
|
5730
|
+
s === void 0 && (s = t);
|
|
5731
5731
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5732
5732
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
5733
5733
|
return e[t];
|
|
5734
|
-
}, "get") }), Object.defineProperty(
|
|
5735
|
-
} : function(
|
|
5736
|
-
|
|
5737
|
-
}), Ei = Z && Z.__setModuleDefault || (Object.create ? function(
|
|
5738
|
-
Object.defineProperty(
|
|
5739
|
-
} : function(
|
|
5740
|
-
|
|
5741
|
-
}), Pi = Z && Z.__importStar || function(
|
|
5742
|
-
if (
|
|
5734
|
+
}, "get") }), Object.defineProperty(r, s, i);
|
|
5735
|
+
} : function(r, e, t, s) {
|
|
5736
|
+
s === void 0 && (s = t), r[s] = e[t];
|
|
5737
|
+
}), Ei = Z && Z.__setModuleDefault || (Object.create ? function(r, e) {
|
|
5738
|
+
Object.defineProperty(r, "default", { enumerable: !0, value: e });
|
|
5739
|
+
} : function(r, e) {
|
|
5740
|
+
r.default = e;
|
|
5741
|
+
}), Pi = Z && Z.__importStar || function(r) {
|
|
5742
|
+
if (r && r.__esModule) return r;
|
|
5743
5743
|
var e = {};
|
|
5744
|
-
if (
|
|
5745
|
-
return Ei(e,
|
|
5746
|
-
}, Ni = Z && Z.__exportStar || function(
|
|
5747
|
-
for (var t in
|
|
5744
|
+
if (r != null) for (var t in r) t !== "default" && Object.prototype.hasOwnProperty.call(r, t) && Ss(e, r, t);
|
|
5745
|
+
return Ei(e, r), e;
|
|
5746
|
+
}, Ni = Z && Z.__exportStar || function(r, e) {
|
|
5747
|
+
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Ss(e, r, t);
|
|
5748
5748
|
};
|
|
5749
5749
|
Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
5750
5750
|
Z.z = void 0;
|
|
5751
|
-
var
|
|
5752
|
-
Z.z =
|
|
5751
|
+
var Es = Pi(Pt());
|
|
5752
|
+
Z.z = Es;
|
|
5753
5753
|
Ni(Pt(), Z);
|
|
5754
|
-
Z.default =
|
|
5754
|
+
Z.default = Es;
|
|
5755
5755
|
});
|
|
5756
5756
|
|
|
5757
5757
|
// src/cli/bin/index.ts
|
|
5758
|
-
var W = require("storybook/internal/common"), D = require("storybook/internal/node-logger"), $
|
|
5758
|
+
var W = require("storybook/internal/common"), D = require("storybook/internal/node-logger"), $s = require("storybook/internal/telemetry"), Ve = ee(Wt(), 1);
|
|
5759
5759
|
|
|
5760
5760
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
5761
5761
|
var Jt = ee(Gt(), 1), Yt = require("node:path"), Me = require("node:fs/promises"), Kt = require("node:fs");
|
|
5762
|
-
async function
|
|
5762
|
+
async function ar(r) {
|
|
5763
5763
|
try {
|
|
5764
|
-
return (await (0, Me.stat)(
|
|
5764
|
+
return (await (0, Me.stat)(r)).isFile();
|
|
5765
5765
|
} catch {
|
|
5766
5766
|
return !1;
|
|
5767
5767
|
}
|
|
5768
5768
|
}
|
|
5769
|
-
d(
|
|
5770
|
-
async function
|
|
5771
|
-
for (let e of (0, Jt.walkUp)(
|
|
5769
|
+
d(ar, "fileExists");
|
|
5770
|
+
async function or(r) {
|
|
5771
|
+
for (let e of (0, Jt.walkUp)(r)) {
|
|
5772
5772
|
let t = (0, Yt.resolve)(e, "package.json");
|
|
5773
|
-
if (await
|
|
5773
|
+
if (await ar(t))
|
|
5774
5774
|
return t;
|
|
5775
5775
|
}
|
|
5776
5776
|
return null;
|
|
5777
5777
|
}
|
|
5778
|
-
d(
|
|
5779
|
-
async function G(
|
|
5780
|
-
let e = await
|
|
5778
|
+
d(or, "findPackagePath");
|
|
5779
|
+
async function G(r) {
|
|
5780
|
+
let e = await or(r);
|
|
5781
5781
|
if (!e)
|
|
5782
5782
|
return null;
|
|
5783
5783
|
try {
|
|
@@ -5791,95 +5791,95 @@ d(G, "findPackage");
|
|
|
5791
5791
|
|
|
5792
5792
|
// ../node_modules/leven/index.js
|
|
5793
5793
|
var vt = [], Xt = [];
|
|
5794
|
-
function bt(
|
|
5795
|
-
if (
|
|
5794
|
+
function bt(r, e) {
|
|
5795
|
+
if (r === e)
|
|
5796
5796
|
return 0;
|
|
5797
|
-
let t =
|
|
5798
|
-
|
|
5799
|
-
let
|
|
5800
|
-
for (;
|
|
5801
|
-
|
|
5797
|
+
let t = r;
|
|
5798
|
+
r.length > e.length && (r = e, e = t);
|
|
5799
|
+
let s = r.length, i = e.length;
|
|
5800
|
+
for (; s > 0 && r.charCodeAt(~-s) === e.charCodeAt(~-i); )
|
|
5801
|
+
s--, i--;
|
|
5802
5802
|
let n = 0;
|
|
5803
|
-
for (; n <
|
|
5803
|
+
for (; n < s && r.charCodeAt(n) === e.charCodeAt(n); )
|
|
5804
5804
|
n++;
|
|
5805
|
-
if (
|
|
5805
|
+
if (s -= n, i -= n, s === 0)
|
|
5806
5806
|
return i;
|
|
5807
5807
|
let a, o, c, h, p = 0, y = 0;
|
|
5808
|
-
for (; p <
|
|
5809
|
-
Xt[p] =
|
|
5808
|
+
for (; p < s; )
|
|
5809
|
+
Xt[p] = r.charCodeAt(n + p), vt[p] = ++p;
|
|
5810
5810
|
for (; y < i; )
|
|
5811
|
-
for (a = e.charCodeAt(n + y), c = y++, o = y, p = 0; p <
|
|
5811
|
+
for (a = e.charCodeAt(n + y), c = y++, o = y, p = 0; p < s; p++)
|
|
5812
5812
|
h = a === Xt[p] ? c : c + 1, c = vt[p], o = vt[p] = c > o ? h > o ? o + 1 : h : h > c ? c + 1 : h;
|
|
5813
5813
|
return o;
|
|
5814
5814
|
}
|
|
5815
5815
|
d(bt, "leven");
|
|
5816
5816
|
|
|
5817
5817
|
// src/cli/bin/index.ts
|
|
5818
|
-
var ye = ee(
|
|
5818
|
+
var ye = ee(ts(), 1);
|
|
5819
5819
|
|
|
5820
5820
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
5821
|
-
var
|
|
5822
|
-
function J(
|
|
5823
|
-
if (!
|
|
5824
|
-
if (
|
|
5821
|
+
var cr = process.env.NODE_ENV === "production", wt = "Invariant failed";
|
|
5822
|
+
function J(r, e) {
|
|
5823
|
+
if (!r) {
|
|
5824
|
+
if (cr)
|
|
5825
5825
|
throw new Error(wt);
|
|
5826
|
-
var t = typeof e == "function" ? e() : e,
|
|
5827
|
-
throw new Error(
|
|
5826
|
+
var t = typeof e == "function" ? e() : e, s = t ? "".concat(wt, ": ").concat(t) : wt;
|
|
5827
|
+
throw new Error(s);
|
|
5828
5828
|
}
|
|
5829
5829
|
}
|
|
5830
5830
|
d(J, "invariant");
|
|
5831
5831
|
|
|
5832
5832
|
// package.json
|
|
5833
|
-
var Ct = "9.1.
|
|
5833
|
+
var Ct = "9.1.3";
|
|
5834
5834
|
|
|
5835
5835
|
// src/cli/build.ts
|
|
5836
|
-
var
|
|
5837
|
-
var
|
|
5836
|
+
var ss = require("storybook/internal/common"), Ue = require("storybook/internal/core-server");
|
|
5837
|
+
var rs = /* @__PURE__ */ d(async (r) => {
|
|
5838
5838
|
let e = await G(__dirname);
|
|
5839
5839
|
J(e, "Failed to find the closest package.json file.");
|
|
5840
5840
|
let t = {
|
|
5841
|
-
...
|
|
5842
|
-
configDir:
|
|
5843
|
-
outputDir:
|
|
5844
|
-
ignorePreview: !!
|
|
5841
|
+
...r,
|
|
5842
|
+
configDir: r.configDir || "./.storybook",
|
|
5843
|
+
outputDir: r.outputDir || "./storybook-static",
|
|
5844
|
+
ignorePreview: !!r.previewUrl && !r.forceBuildPreview,
|
|
5845
5845
|
configType: "PRODUCTION",
|
|
5846
|
-
cache:
|
|
5846
|
+
cache: ss.cache,
|
|
5847
5847
|
packageJson: e
|
|
5848
5848
|
};
|
|
5849
5849
|
await (0, Ue.withTelemetry)(
|
|
5850
5850
|
"build",
|
|
5851
|
-
{ cliOptions:
|
|
5851
|
+
{ cliOptions: r, presetOptions: t },
|
|
5852
5852
|
() => (0, Ue.buildStaticStandalone)(t)
|
|
5853
5853
|
);
|
|
5854
5854
|
}, "build");
|
|
5855
5855
|
|
|
5856
5856
|
// src/cli/buildIndex.ts
|
|
5857
|
-
var
|
|
5858
|
-
var
|
|
5857
|
+
var is = require("storybook/internal/common"), Fe = require("storybook/internal/core-server");
|
|
5858
|
+
var ns = /* @__PURE__ */ d(async (r) => {
|
|
5859
5859
|
let e = {
|
|
5860
|
-
...
|
|
5861
|
-
configDir:
|
|
5862
|
-
outputFile:
|
|
5860
|
+
...r,
|
|
5861
|
+
configDir: r.configDir || ".storybook",
|
|
5862
|
+
outputFile: r.outputFile || "index.json",
|
|
5863
5863
|
ignorePreview: !0,
|
|
5864
5864
|
configType: "PRODUCTION",
|
|
5865
|
-
cache:
|
|
5866
|
-
packageJson:
|
|
5865
|
+
cache: is.cache,
|
|
5866
|
+
packageJson: r.packageJson
|
|
5867
5867
|
}, t = {
|
|
5868
5868
|
...e,
|
|
5869
5869
|
corePresets: [],
|
|
5870
5870
|
overridePresets: []
|
|
5871
5871
|
};
|
|
5872
|
-
await (0, Fe.withTelemetry)("index", { cliOptions:
|
|
5872
|
+
await (0, Fe.withTelemetry)("index", { cliOptions: r, presetOptions: t }, () => (0, Fe.buildIndexStandalone)(e));
|
|
5873
5873
|
}, "buildIndex");
|
|
5874
5874
|
|
|
5875
5875
|
// src/cli/dev.ts
|
|
5876
|
-
var
|
|
5876
|
+
var os = require("storybook/internal/common"), He = require("storybook/internal/core-server"), R = require("storybook/internal/node-logger");
|
|
5877
5877
|
var It = ee(kt(), 1);
|
|
5878
|
-
function
|
|
5879
|
-
R.instance.heading = "",
|
|
5880
|
-
errors.forEach((e) => R.logger.plain(e)) : R.logger.error(
|
|
5878
|
+
function pr(r) {
|
|
5879
|
+
R.instance.heading = "", r instanceof Error ? r.error ? R.logger.error(r.error) : r.stats && r.stats.compilation.errors ? r.stats.compilation.
|
|
5880
|
+
errors.forEach((e) => R.logger.plain(e)) : R.logger.error(r) : r.compilation?.errors && r.compilation.errors.forEach((e) => R.logger.plain(
|
|
5881
5881
|
e)), R.logger.line(), R.logger.warn(
|
|
5882
|
-
|
|
5882
|
+
r.close ? It.dedent`
|
|
5883
5883
|
FATAL broken build!, will close the process,
|
|
5884
5884
|
Fix the error below and restart storybook.
|
|
5885
5885
|
` : It.dedent`
|
|
@@ -5888,52 +5888,52 @@ function ps(s) {
|
|
|
5888
5888
|
`
|
|
5889
5889
|
), R.logger.line();
|
|
5890
5890
|
}
|
|
5891
|
-
d(
|
|
5892
|
-
var
|
|
5891
|
+
d(pr, "printError");
|
|
5892
|
+
var ds = /* @__PURE__ */ d(async (r) => {
|
|
5893
5893
|
let { env: e } = process;
|
|
5894
5894
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
5895
5895
|
let t = await G(__dirname);
|
|
5896
5896
|
J(t, "Failed to find the closest package.json file.");
|
|
5897
|
-
let
|
|
5898
|
-
...
|
|
5899
|
-
configDir:
|
|
5897
|
+
let s = {
|
|
5898
|
+
...r,
|
|
5899
|
+
configDir: r.configDir || "./.storybook",
|
|
5900
5900
|
configType: "DEVELOPMENT",
|
|
5901
|
-
ignorePreview: !!
|
|
5902
|
-
cache:
|
|
5901
|
+
ignorePreview: !!r.previewUrl && !r.forceBuildPreview,
|
|
5902
|
+
cache: os.cache,
|
|
5903
5903
|
packageJson: t
|
|
5904
5904
|
};
|
|
5905
5905
|
await (0, He.withTelemetry)(
|
|
5906
5906
|
"dev",
|
|
5907
5907
|
{
|
|
5908
|
-
cliOptions:
|
|
5909
|
-
presetOptions:
|
|
5910
|
-
printError:
|
|
5908
|
+
cliOptions: r,
|
|
5909
|
+
presetOptions: s,
|
|
5910
|
+
printError: pr
|
|
5911
5911
|
},
|
|
5912
|
-
() => (0, He.buildDevStandalone)(
|
|
5912
|
+
() => (0, He.buildDevStandalone)(s)
|
|
5913
5913
|
);
|
|
5914
5914
|
}, "dev");
|
|
5915
5915
|
|
|
5916
5916
|
// src/cli/globalSettings.ts
|
|
5917
|
-
var Qe = ee(require("node:fs/promises"), 1),
|
|
5918
|
-
var Vi = (0, tt.join)((0,
|
|
5917
|
+
var Qe = ee(require("node:fs/promises"), 1), Ns = require("node:os"), tt = require("node:path"), Vs = ee(kt(), 1), Te = ee(Ps(), 1);
|
|
5918
|
+
var Vi = (0, tt.join)((0, Ns.homedir)(), ".storybook", "settings.json"), Di = 1, $i = Te.z.object({
|
|
5919
5919
|
version: Te.z.number(),
|
|
5920
5920
|
// NOTE: every key (and subkey) below must be optional, for forwards compatibility reasons
|
|
5921
5921
|
// (we can remove keys once they are deprecated)
|
|
5922
5922
|
userSince: Te.z.number().optional(),
|
|
5923
5923
|
init: Te.z.object({ skipOnboarding: Te.z.boolean().optional() }).optional()
|
|
5924
5924
|
}), Ie;
|
|
5925
|
-
async function
|
|
5925
|
+
async function Ds(r = Vi) {
|
|
5926
5926
|
if (Ie)
|
|
5927
5927
|
return Ie;
|
|
5928
5928
|
try {
|
|
5929
|
-
let e = await Qe.default.readFile(
|
|
5930
|
-
Ie = new et(
|
|
5929
|
+
let e = await Qe.default.readFile(r, "utf8"), t = $i.parse(JSON.parse(e));
|
|
5930
|
+
Ie = new et(r, t);
|
|
5931
5931
|
} catch {
|
|
5932
|
-
Ie = new et(
|
|
5932
|
+
Ie = new et(r, { version: Di, userSince: Date.now() }), await Ie.save();
|
|
5933
5933
|
}
|
|
5934
5934
|
return Ie;
|
|
5935
5935
|
}
|
|
5936
|
-
d(
|
|
5936
|
+
d(Ds, "globalSettings");
|
|
5937
5937
|
var et = class {
|
|
5938
5938
|
static {
|
|
5939
5939
|
d(this, "Settings");
|
|
@@ -5953,7 +5953,7 @@ var et = class {
|
|
|
5953
5953
|
await Qe.default.mkdir((0, tt.dirname)(this.filePath), { recursive: !0 }), await Qe.default.writeFile(this.filePath, JSON.stringify(this.
|
|
5954
5954
|
value, null, 2));
|
|
5955
5955
|
} catch (e) {
|
|
5956
|
-
console.warn(
|
|
5956
|
+
console.warn(Vs.dedent`
|
|
5957
5957
|
Unable to save global settings file to ${this.filePath}
|
|
5958
5958
|
${e && `Reason: ${e.message ?? e}`}`);
|
|
5959
5959
|
}
|
|
@@ -5961,8 +5961,8 @@ var et = class {
|
|
|
5961
5961
|
};
|
|
5962
5962
|
|
|
5963
5963
|
// src/cli/bin/index.ts
|
|
5964
|
-
(0, $
|
|
5965
|
-
var Nt = /* @__PURE__ */ d((
|
|
5964
|
+
(0, $s.addToGlobalContext)("cliVersion", Ct);
|
|
5965
|
+
var Nt = /* @__PURE__ */ d((r) => Ve.program.command(r).option(
|
|
5966
5966
|
"--disable-telemetry",
|
|
5967
5967
|
"Disable sending telemetry data",
|
|
5968
5968
|
(0, W.optionalEnvToBoolean)(process.env.STORYBOOK_DISABLE_TELEMETRY)
|
|
@@ -5971,7 +5971,7 @@ var Nt = /* @__PURE__ */ d((s) => Ve.program.command(s).option(
|
|
|
5971
5971
|
ile at the end of the run").hook("preAction", async (e) => {
|
|
5972
5972
|
try {
|
|
5973
5973
|
let t = e.opts();
|
|
5974
|
-
t.loglevel && D.logger.setLogLevel(t.loglevel), t.writeLogs && D.logTracker.enableLogWriting(), await
|
|
5974
|
+
t.loglevel && D.logger.setLogLevel(t.loglevel), t.writeLogs && D.logTracker.enableLogWriting(), await Ds();
|
|
5975
5975
|
} catch (t) {
|
|
5976
5976
|
D.logger.error(`Error loading global settings:
|
|
5977
5977
|
` + String(t));
|
|
@@ -5982,7 +5982,7 @@ ile at the end of the run").hook("preAction", async (e) => {
|
|
|
5982
5982
|
D.logger.outro(`Storybook debug logs can be found at: ${e}`);
|
|
5983
5983
|
}
|
|
5984
5984
|
}), "command");
|
|
5985
|
-
Nt("dev").option("-p, --port <number>", "Port to run Storybook", (
|
|
5985
|
+
Nt("dev").option("-p, --port <number>", "Port to run Storybook", (r) => parseInt(r, 10)).option("-h, --host <string>", "Host to run Storyboo\
|
|
5986
5986
|
k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option(
|
|
5987
5987
|
"--https",
|
|
5988
5988
|
"Serve Storybook over HTTPS. Note: You must provide your own certificate information."
|
|
@@ -6003,16 +6003,16 @@ no-version-updates", "Suppress update check", !0).option("--debug-webpack", "Dis
|
|
|
6003
6003
|
ly site using addon-docs").option("--exact-port", "Exit early if the desired port is not available").option(
|
|
6004
6004
|
"--initial-path [path]",
|
|
6005
6005
|
"URL path to be appended when visiting Storybook for the first time"
|
|
6006
|
-
).option("--preview-only", "Use the preview without the manager UI").action(async (
|
|
6006
|
+
).option("--preview-only", "Use the preview without the manager UI").action(async (r) => {
|
|
6007
6007
|
let e = await G(__dirname);
|
|
6008
6008
|
J(e, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${e.name} v${e.version}`) + ye.default.reset(`
|
|
6009
|
-
`)), (0, W.getEnvConfig)(
|
|
6009
|
+
`)), (0, W.getEnvConfig)(r, {
|
|
6010
6010
|
port: "SBCONFIG_PORT",
|
|
6011
6011
|
host: "SBCONFIG_HOSTNAME",
|
|
6012
6012
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6013
6013
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6014
6014
|
ci: "CI"
|
|
6015
|
-
}), parseInt(`${
|
|
6015
|
+
}), parseInt(`${r.port}`, 10) && (r.port = parseInt(`${r.port}`, 10)), await ds({ ...r, packageJson: e }).catch(() => process.exit(1));
|
|
6016
6016
|
});
|
|
6017
6017
|
Nt("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
6018
6018
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final web\
|
|
@@ -6024,39 +6024,39 @@ pack configurations for debugging purposes").option(
|
|
|
6024
6024
|
"Disables the default storybook preview and lets your use your own"
|
|
6025
6025
|
).option("--force-build-preview", "Build the preview iframe even if you are using --preview-url").option("--docs", "Build a documentation-on\
|
|
6026
6026
|
ly site using addon-docs").option("--test", "Build stories optimized for testing purposes.").option("--preview-only", "Use the preview witho\
|
|
6027
|
-
ut the manager UI").action(async (
|
|
6027
|
+
ut the manager UI").action(async (r) => {
|
|
6028
6028
|
let { env: e } = process;
|
|
6029
6029
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6030
6030
|
let t = await G(__dirname);
|
|
6031
6031
|
J(t, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${t.name} v${t.version}
|
|
6032
|
-
`)), (0, W.getEnvConfig)(
|
|
6032
|
+
`)), (0, W.getEnvConfig)(r, {
|
|
6033
6033
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6034
6034
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
6035
6035
|
configDir: "SBCONFIG_CONFIG_DIR"
|
|
6036
|
-
}), await
|
|
6037
|
-
...
|
|
6036
|
+
}), await rs({
|
|
6037
|
+
...r,
|
|
6038
6038
|
packageJson: t,
|
|
6039
|
-
test: !!
|
|
6039
|
+
test: !!r.test || (0, W.optionalEnvToBoolean)(process.env.SB_TESTBUILD)
|
|
6040
6040
|
}).catch(() => process.exit(1));
|
|
6041
6041
|
});
|
|
6042
6042
|
Nt("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
|
|
6043
|
-
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (
|
|
6043
|
+
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (r) => {
|
|
6044
6044
|
let { env: e } = process;
|
|
6045
6045
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6046
6046
|
let t = await G(__dirname);
|
|
6047
6047
|
J(t, "Failed to find the closest package.json file."), D.logger.log(ye.default.bold(`${t.name} v${t.version}
|
|
6048
|
-
`)), (0, W.getEnvConfig)(
|
|
6048
|
+
`)), (0, W.getEnvConfig)(r, {
|
|
6049
6049
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6050
6050
|
outputFile: "SBCONFIG_OUTPUT_FILE"
|
|
6051
|
-
}), await
|
|
6052
|
-
...
|
|
6051
|
+
}), await ns({
|
|
6052
|
+
...r,
|
|
6053
6053
|
packageJson: t
|
|
6054
6054
|
}).catch(() => process.exit(1));
|
|
6055
6055
|
});
|
|
6056
|
-
Ve.program.on("command:*", ([
|
|
6057
|
-
let e = ` Invalid command: ${ye.default.bold(
|
|
6058
|
-
See --help for a list of available commands.`,
|
|
6059
|
-
|
|
6060
|
-
Did you mean ${ye.default.yellow(
|
|
6056
|
+
Ve.program.on("command:*", ([r]) => {
|
|
6057
|
+
let e = ` Invalid command: ${ye.default.bold(r)}.
|
|
6058
|
+
See --help for a list of available commands.`, s = Ve.program.commands.map((i) => i.name()).find((i) => bt(i, r) < 3);
|
|
6059
|
+
s && (e += `
|
|
6060
|
+
Did you mean ${ye.default.yellow(s)}?`), D.logger.error(e), process.exit(1);
|
|
6061
6061
|
});
|
|
6062
6062
|
Ve.program.usage("<command> [options]").version(String(Ct)).parse(process.argv);
|