storybook 9.1.0 → 9.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.cjs +66 -66
- package/dist/bin/index.js +65 -65
- package/dist/cli/bin/index.cjs +1068 -1142
- package/dist/cli/bin/index.js +1031 -1105
- package/dist/cli/index.cjs +13411 -13484
- package/dist/cli/index.js +13434 -13507
- package/dist/common/index.cjs +2927 -2911
- package/dist/common/index.d.ts +11 -3
- package/dist/common/index.js +3129 -3114
- package/dist/core-server/index.cjs +20539 -14418
- package/dist/core-server/index.js +20882 -14724
- package/dist/core-server/presets/common-preset.cjs +9137 -9141
- package/dist/core-server/presets/common-preset.js +8358 -8362
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager-api/index.cjs +76 -76
- package/dist/manager-api/index.d.ts +8 -534
- package/dist/manager-api/index.js +133 -133
- package/dist/node-logger/index.cjs +1218 -1212
- package/dist/node-logger/index.js +1235 -1228
- package/dist/server-errors.cjs +45 -60
- package/dist/server-errors.d.ts +1 -11
- package/dist/server-errors.js +27 -42
- package/dist/telemetry/index.cjs +1713 -1786
- package/dist/telemetry/index.js +1768 -1839
- package/package.json +1 -1
package/dist/cli/bin/index.js
CHANGED
|
@@ -4,37 +4,37 @@ import { dirname as ESM_COMPAT_dirname } from 'node:path';
|
|
|
4
4
|
const __filename = ESM_COMPAT_fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = ESM_COMPAT_dirname(__filename);
|
|
6
6
|
const require = ESM_COMPAT_Module.createRequire(import.meta.url);
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var d = (s, e) =>
|
|
7
|
+
var Zr = Object.create;
|
|
8
|
+
var Ke = Object.defineProperty;
|
|
9
|
+
var jr = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var Sr = Object.getOwnPropertyNames;
|
|
11
|
+
var Er = Object.getPrototypeOf, Pr = Object.prototype.hasOwnProperty;
|
|
12
|
+
var d = (s, e) => Ke(s, "name", { value: e, configurable: !0 }), ge = /* @__PURE__ */ ((s) => typeof require < "u" ? require : typeof Proxy <
|
|
13
13
|
"u" ? new Proxy(s, {
|
|
14
14
|
get: (e, t) => (typeof require < "u" ? require : e)[t]
|
|
15
15
|
}) : s)(function(s) {
|
|
16
16
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
17
17
|
throw Error('Dynamic require of "' + s + '" is not supported');
|
|
18
18
|
});
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var T = (s, e) => () => (e || s((e = { exports: {} }).exports, e), e.exports);
|
|
20
|
+
var Nr = (s, e, t, r) => {
|
|
21
21
|
if (e && typeof e == "object" || typeof e == "function")
|
|
22
|
-
for (let i of
|
|
23
|
-
!
|
|
22
|
+
for (let i of Sr(e))
|
|
23
|
+
!Pr.call(s, i) && i !== t && Ke(s, i, { get: () => e[i], enumerable: !(r = jr(e, i)) || r.enumerable });
|
|
24
24
|
return s;
|
|
25
25
|
};
|
|
26
|
-
var ye = (s, e, t) => (t = s != null ?
|
|
26
|
+
var ye = (s, e, t) => (t = s != null ? Zr(Er(s)) : {}, Nr(
|
|
27
27
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
28
|
// file that has been converted to a CommonJS file using a Babel-
|
|
29
29
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
30
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
e || !s || !s.__esModule ?
|
|
31
|
+
e || !s || !s.__esModule ? Ke(t, "default", { value: s, enumerable: !0 }) : t,
|
|
32
32
|
s
|
|
33
33
|
));
|
|
34
34
|
|
|
35
35
|
// ../node_modules/commander/lib/error.js
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var Oe = T((Qe) => {
|
|
37
|
+
var De = class extends Error {
|
|
38
38
|
static {
|
|
39
39
|
d(this, "CommanderError");
|
|
40
40
|
}
|
|
@@ -48,7 +48,7 @@ var Te = O((tt) => {
|
|
|
48
48
|
super(r), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.code = t, this.exitCode = e, this.nestedError =
|
|
49
49
|
void 0;
|
|
50
50
|
}
|
|
51
|
-
},
|
|
51
|
+
}, Xe = class extends De {
|
|
52
52
|
static {
|
|
53
53
|
d(this, "InvalidArgumentError");
|
|
54
54
|
}
|
|
@@ -60,13 +60,13 @@ var Te = O((tt) => {
|
|
|
60
60
|
super(1, "commander.invalidArgument", e), Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
Qe.CommanderError = De;
|
|
64
|
+
Qe.InvalidArgumentError = Xe;
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
// ../node_modules/commander/lib/argument.js
|
|
68
|
-
var
|
|
69
|
-
var { InvalidArgumentError:
|
|
68
|
+
var $e = T((tt) => {
|
|
69
|
+
var { InvalidArgumentError: Vr } = Oe(), et = class {
|
|
70
70
|
static {
|
|
71
71
|
d(this, "Argument");
|
|
72
72
|
}
|
|
@@ -135,7 +135,7 @@ var De = O((st) => {
|
|
|
135
135
|
choices(e) {
|
|
136
136
|
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
137
137
|
if (!this.argChoices.includes(t))
|
|
138
|
-
throw new
|
|
138
|
+
throw new Vr(
|
|
139
139
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
140
140
|
);
|
|
141
141
|
return this.variadic ? this._concatValue(t, r) : t;
|
|
@@ -158,18 +158,18 @@ var De = O((st) => {
|
|
|
158
158
|
return this.required = !1, this;
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
function
|
|
161
|
+
function Dr(s) {
|
|
162
162
|
let e = s.name() + (s.variadic === !0 ? "..." : "");
|
|
163
163
|
return s.required ? "<" + e + ">" : "[" + e + "]";
|
|
164
164
|
}
|
|
165
|
-
d(
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
d(Dr, "humanReadableArgName");
|
|
166
|
+
tt.Argument = et;
|
|
167
|
+
tt.humanReadableArgName = Dr;
|
|
168
168
|
});
|
|
169
169
|
|
|
170
170
|
// ../node_modules/commander/lib/help.js
|
|
171
|
-
var
|
|
172
|
-
var { humanReadableArgName:
|
|
171
|
+
var st = T((Et) => {
|
|
172
|
+
var { humanReadableArgName: $r } = $e(), rt = class {
|
|
173
173
|
static {
|
|
174
174
|
d(this, "Help");
|
|
175
175
|
}
|
|
@@ -250,7 +250,7 @@ var nt = O((Pt) => {
|
|
|
250
250
|
* @returns {string}
|
|
251
251
|
*/
|
|
252
252
|
subcommandTerm(e) {
|
|
253
|
-
let t = e.registeredArguments.map((r) =>
|
|
253
|
+
let t = e.registeredArguments.map((r) => $r(r)).join(" ");
|
|
254
254
|
return e._name + (e._aliases[0] ? "|" + e._aliases[0] : "") + (e.options.length ? " [options]" : "") + // simplistic check for non-help option
|
|
255
255
|
(t ? " " + t : "");
|
|
256
256
|
}
|
|
@@ -388,54 +388,54 @@ var nt = O((Pt) => {
|
|
|
388
388
|
* @returns {string}
|
|
389
389
|
*/
|
|
390
390
|
formatHelp(e, t) {
|
|
391
|
-
let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2,
|
|
392
|
-
function
|
|
393
|
-
if (
|
|
394
|
-
let
|
|
391
|
+
let r = t.padWidth(e, t), i = t.helpWidth || 80, n = 2, a = 2;
|
|
392
|
+
function o(I, H) {
|
|
393
|
+
if (H) {
|
|
394
|
+
let Ye = `${I.padEnd(r + a)}${H}`;
|
|
395
395
|
return t.wrap(
|
|
396
|
-
|
|
396
|
+
Ye,
|
|
397
397
|
i - n,
|
|
398
|
-
r +
|
|
398
|
+
r + a
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
401
|
return I;
|
|
402
402
|
}
|
|
403
|
-
d(
|
|
404
|
-
function
|
|
403
|
+
d(o, "formatItem");
|
|
404
|
+
function c(I) {
|
|
405
405
|
return I.join(`
|
|
406
406
|
`).replace(/^/gm, " ".repeat(n));
|
|
407
407
|
}
|
|
408
|
-
d(
|
|
408
|
+
d(c, "formatList");
|
|
409
409
|
let h = [`Usage: ${t.commandUsage(e)}`, ""], p = t.commandDescription(e);
|
|
410
410
|
p.length > 0 && (h = h.concat([
|
|
411
411
|
t.wrap(p, i, 0),
|
|
412
412
|
""
|
|
413
413
|
]));
|
|
414
|
-
let y = t.visibleArguments(e).map((I) =>
|
|
414
|
+
let y = t.visibleArguments(e).map((I) => o(
|
|
415
415
|
t.argumentTerm(I),
|
|
416
416
|
t.argumentDescription(I)
|
|
417
417
|
));
|
|
418
|
-
y.length > 0 && (h = h.concat(["Arguments:",
|
|
419
|
-
let
|
|
418
|
+
y.length > 0 && (h = h.concat(["Arguments:", c(y), ""]));
|
|
419
|
+
let C = t.visibleOptions(e).map((I) => o(
|
|
420
420
|
t.optionTerm(I),
|
|
421
421
|
t.optionDescription(I)
|
|
422
422
|
));
|
|
423
|
-
if (
|
|
424
|
-
let I = t.visibleGlobalOptions(e).map((
|
|
425
|
-
t.optionTerm(
|
|
426
|
-
t.optionDescription(
|
|
423
|
+
if (C.length > 0 && (h = h.concat(["Options:", c(C), ""])), this.showGlobalOptions) {
|
|
424
|
+
let I = t.visibleGlobalOptions(e).map((H) => o(
|
|
425
|
+
t.optionTerm(H),
|
|
426
|
+
t.optionDescription(H)
|
|
427
427
|
));
|
|
428
428
|
I.length > 0 && (h = h.concat([
|
|
429
429
|
"Global Options:",
|
|
430
|
-
|
|
430
|
+
c(I),
|
|
431
431
|
""
|
|
432
432
|
]));
|
|
433
433
|
}
|
|
434
|
-
let
|
|
434
|
+
let j = t.visibleCommands(e).map((I) => o(
|
|
435
435
|
t.subcommandTerm(I),
|
|
436
436
|
t.subcommandDescription(I)
|
|
437
437
|
));
|
|
438
|
-
return
|
|
438
|
+
return j.length > 0 && (h = h.concat(["Commands:", c(j), ""])), h.join(`
|
|
439
439
|
`);
|
|
440
440
|
}
|
|
441
441
|
/**
|
|
@@ -465,28 +465,28 @@ var nt = O((Pt) => {
|
|
|
465
465
|
*
|
|
466
466
|
*/
|
|
467
467
|
wrap(e, t, r, i = 40) {
|
|
468
|
-
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",
|
|
469
|
-
if (e.match(
|
|
470
|
-
let
|
|
471
|
-
if (
|
|
472
|
-
let
|
|
468
|
+
let n = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF", a = new RegExp(`[\\n][${n}]+`);
|
|
469
|
+
if (e.match(a)) return e;
|
|
470
|
+
let o = t - r;
|
|
471
|
+
if (o < i) return e;
|
|
472
|
+
let c = e.slice(0, r), h = e.slice(r).replace(`\r
|
|
473
473
|
`, `
|
|
474
|
-
`), p = " ".repeat(r),
|
|
474
|
+
`), p = " ".repeat(r), C = "\\s\u200B", j = new RegExp(
|
|
475
475
|
`
|
|
476
|
-
|.{1,${
|
|
476
|
+
|.{1,${o - 1}}([${C}]|$)|[^${C}]+?([${C}]|$)`,
|
|
477
477
|
"g"
|
|
478
|
-
), I = h.match(
|
|
479
|
-
return
|
|
480
|
-
` ? "" : (
|
|
478
|
+
), I = h.match(j) || [];
|
|
479
|
+
return c + I.map((H, Ye) => H === `
|
|
480
|
+
` ? "" : (Ye > 0 ? p : "") + H.trimEnd()).join(`
|
|
481
481
|
`);
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
|
|
484
|
+
Et.Help = rt;
|
|
485
485
|
});
|
|
486
486
|
|
|
487
487
|
// ../node_modules/commander/lib/option.js
|
|
488
|
-
var
|
|
489
|
-
var { InvalidArgumentError:
|
|
488
|
+
var ot = T((at) => {
|
|
489
|
+
var { InvalidArgumentError: Rr } = Oe(), it = class {
|
|
490
490
|
static {
|
|
491
491
|
d(this, "Option");
|
|
492
492
|
}
|
|
@@ -499,7 +499,7 @@ var ct = O((dt) => {
|
|
|
499
499
|
constructor(e, t) {
|
|
500
500
|
this.flags = e, this.description = t || "", this.required = e.includes("<"), this.optional = e.includes("["), this.variadic = /\w\.\.\.[>\]]$/.
|
|
501
501
|
test(e), this.mandatory = !1;
|
|
502
|
-
let r =
|
|
502
|
+
let r = Lr(e);
|
|
503
503
|
this.short = r.shortFlag, this.long = r.longFlag, this.negate = !1, this.long && (this.negate = this.long.startsWith("--no-")), this.defaultValue =
|
|
504
504
|
void 0, this.defaultValueDescription = void 0, this.presetArg = void 0, this.envVar = void 0, this.parseArg = void 0, this.hidden = !1,
|
|
505
505
|
this.argChoices = void 0, this.conflictsWith = [], this.implied = void 0;
|
|
@@ -613,7 +613,7 @@ var ct = O((dt) => {
|
|
|
613
613
|
choices(e) {
|
|
614
614
|
return this.argChoices = e.slice(), this.parseArg = (t, r) => {
|
|
615
615
|
if (!this.argChoices.includes(t))
|
|
616
|
-
throw new
|
|
616
|
+
throw new Rr(
|
|
617
617
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
618
618
|
);
|
|
619
619
|
return this.variadic ? this._concatValue(t, r) : t;
|
|
@@ -634,7 +634,7 @@ var ct = O((dt) => {
|
|
|
634
634
|
* @return {string}
|
|
635
635
|
*/
|
|
636
636
|
attributeName() {
|
|
637
|
-
return
|
|
637
|
+
return Mr(this.name().replace(/^no-/, ""));
|
|
638
638
|
}
|
|
639
639
|
/**
|
|
640
640
|
* Check if `arg` matches the short or long flag.
|
|
@@ -657,7 +657,7 @@ var ct = O((dt) => {
|
|
|
657
657
|
isBoolean() {
|
|
658
658
|
return !this.required && !this.optional && !this.negate;
|
|
659
659
|
}
|
|
660
|
-
},
|
|
660
|
+
}, nt = class {
|
|
661
661
|
static {
|
|
662
662
|
d(this, "DualOptions");
|
|
663
663
|
}
|
|
@@ -686,22 +686,22 @@ var ct = O((dt) => {
|
|
|
686
686
|
return t.negate === (n === e);
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
|
-
function
|
|
689
|
+
function Mr(s) {
|
|
690
690
|
return s.split("-").reduce((e, t) => e + t[0].toUpperCase() + t.slice(1));
|
|
691
691
|
}
|
|
692
|
-
d(
|
|
693
|
-
function
|
|
692
|
+
d(Mr, "camelcase");
|
|
693
|
+
function Lr(s) {
|
|
694
694
|
let e, t, r = s.split(/[ |,]+/);
|
|
695
695
|
return r.length > 1 && !/^[[<]/.test(r[1]) && (e = r.shift()), t = r.shift(), !e && /^-[^-]$/.test(t) && (e = t, t = void 0), { shortFlag: e,
|
|
696
696
|
longFlag: t };
|
|
697
697
|
}
|
|
698
|
-
d(
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
d(Lr, "splitOptionFlags");
|
|
699
|
+
at.Option = it;
|
|
700
|
+
at.DualOptions = nt;
|
|
701
701
|
});
|
|
702
702
|
|
|
703
703
|
// ../node_modules/commander/lib/suggestSimilar.js
|
|
704
|
-
var
|
|
704
|
+
var Nt = T((Pt) => {
|
|
705
705
|
function qr(s, e) {
|
|
706
706
|
if (Math.abs(s.length - e.length) > 3)
|
|
707
707
|
return Math.max(s.length, e.length);
|
|
@@ -725,29 +725,29 @@ var Vt = O((Nt) => {
|
|
|
725
725
|
return t[s.length][e.length];
|
|
726
726
|
}
|
|
727
727
|
d(qr, "editDistance");
|
|
728
|
-
function
|
|
728
|
+
function Ur(s, e) {
|
|
729
729
|
if (!e || e.length === 0) return "";
|
|
730
730
|
e = Array.from(new Set(e));
|
|
731
731
|
let t = s.startsWith("--");
|
|
732
|
-
t && (s = s.slice(2), e = e.map((
|
|
732
|
+
t && (s = s.slice(2), e = e.map((a) => a.slice(2)));
|
|
733
733
|
let r = [], i = 3, n = 0.4;
|
|
734
|
-
return e.forEach((
|
|
735
|
-
if (
|
|
736
|
-
let
|
|
737
|
-
(
|
|
738
|
-
}), r.sort((
|
|
734
|
+
return e.forEach((a) => {
|
|
735
|
+
if (a.length <= 1) return;
|
|
736
|
+
let o = qr(s, a), c = Math.max(s.length, a.length);
|
|
737
|
+
(c - o) / c > n && (o < i ? (i = o, r = [a]) : o === i && r.push(a));
|
|
738
|
+
}), r.sort((a, o) => a.localeCompare(o)), t && (r = r.map((a) => `--${a}`)), r.length > 1 ? `
|
|
739
739
|
(Did you mean one of ${r.join(", ")}?)` : r.length === 1 ? `
|
|
740
740
|
(Did you mean ${r[0]}?)` : "";
|
|
741
741
|
}
|
|
742
|
-
d(
|
|
743
|
-
|
|
742
|
+
d(Ur, "suggestSimilar");
|
|
743
|
+
Pt.suggestSimilar = Ur;
|
|
744
744
|
});
|
|
745
745
|
|
|
746
746
|
// ../node_modules/commander/lib/command.js
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
Argument: Hr, humanReadableArgName:
|
|
750
|
-
{ suggestSimilar:
|
|
747
|
+
var Mt = T((Rt) => {
|
|
748
|
+
var Fr = ge("node:events").EventEmitter, dt = ge("node:child_process"), L = ge("node:path"), lt = ge("node:fs"), k = ge("node:process"), {
|
|
749
|
+
Argument: Hr, humanReadableArgName: Br } = $e(), { CommanderError: ut } = Oe(), { Help: Wr } = st(), { Option: Vt, DualOptions: zr } = ot(),
|
|
750
|
+
{ suggestSimilar: Dt } = Nt(), ct = class s extends Fr {
|
|
751
751
|
static {
|
|
752
752
|
d(this, "Command");
|
|
753
753
|
}
|
|
@@ -764,10 +764,10 @@ var Ut = O((Lt) => {
|
|
|
764
764
|
null, this._aliases = [], this._combineFlagAndOptionalValue = !0, this._description = "", this._summary = "", this._argsDescription = void 0,
|
|
765
765
|
this._enablePositionalOptions = !1, this._passThroughOptions = !1, this._lifeCycleHooks = {}, this._showHelpAfterError = !1, this._showSuggestionAfterError =
|
|
766
766
|
!0, this._outputConfiguration = {
|
|
767
|
-
writeOut: /* @__PURE__ */ d((t) =>
|
|
768
|
-
writeErr: /* @__PURE__ */ d((t) =>
|
|
769
|
-
getOutHelpWidth: /* @__PURE__ */ d(() =>
|
|
770
|
-
getErrHelpWidth: /* @__PURE__ */ d(() =>
|
|
767
|
+
writeOut: /* @__PURE__ */ d((t) => k.stdout.write(t), "writeOut"),
|
|
768
|
+
writeErr: /* @__PURE__ */ d((t) => k.stderr.write(t), "writeErr"),
|
|
769
|
+
getOutHelpWidth: /* @__PURE__ */ d(() => k.stdout.isTTY ? k.stdout.columns : void 0, "getOutHelpWidth"),
|
|
770
|
+
getErrHelpWidth: /* @__PURE__ */ d(() => k.stderr.isTTY ? k.stderr.columns : void 0, "getErrHelpWidth"),
|
|
771
771
|
outputError: /* @__PURE__ */ d((t, r) => r(t), "outputError")
|
|
772
772
|
}, this._hidden = !1, this._helpOption = void 0, this._addImplicitHelpCommand = void 0, this._helpCommand = void 0, this._helpConfiguration =
|
|
773
773
|
{};
|
|
@@ -824,10 +824,10 @@ var Ut = O((Lt) => {
|
|
|
824
824
|
command(e, t, r) {
|
|
825
825
|
let i = t, n = r;
|
|
826
826
|
typeof i == "object" && i !== null && (n = i, i = null), n = n || {};
|
|
827
|
-
let [,
|
|
828
|
-
return i && (
|
|
829
|
-
n.hidden),
|
|
830
|
-
this), i ? this :
|
|
827
|
+
let [, a, o] = e.match(/([^ ]+) *(.*)/), c = this.createCommand(a);
|
|
828
|
+
return i && (c.description(i), c._executableHandler = !0), n.isDefault && (this._defaultCommandName = c._name), c._hidden = !!(n.noHelp ||
|
|
829
|
+
n.hidden), c._executableFile = n.executableFile || null, o && c.arguments(o), this._registerCommand(c), c.parent = this, c.copyInheritedSettings(
|
|
830
|
+
this), i ? this : c;
|
|
831
831
|
}
|
|
832
832
|
/**
|
|
833
833
|
* Factory routine to create a new unattached command.
|
|
@@ -848,7 +848,7 @@ var Ut = O((Lt) => {
|
|
|
848
848
|
* @return {Help}
|
|
849
849
|
*/
|
|
850
850
|
createHelp() {
|
|
851
|
-
return Object.assign(new
|
|
851
|
+
return Object.assign(new Wr(), this.configureHelp());
|
|
852
852
|
}
|
|
853
853
|
/**
|
|
854
854
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -999,8 +999,8 @@ var Ut = O((Lt) => {
|
|
|
999
999
|
if (typeof e == "boolean")
|
|
1000
1000
|
return this._addImplicitHelpCommand = e, this;
|
|
1001
1001
|
e = e ?? "help [command]";
|
|
1002
|
-
let [, r, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command",
|
|
1003
|
-
return
|
|
1002
|
+
let [, r, i] = e.match(/([^ ]+) *(.*)/), n = t ?? "display help for command", a = this.createCommand(r);
|
|
1003
|
+
return a.helpOption(!1), i && a.arguments(i), n && a.description(n), this._addImplicitHelpCommand = !0, this._helpCommand = a, this;
|
|
1004
1004
|
}
|
|
1005
1005
|
/**
|
|
1006
1006
|
* Add prepared custom help command.
|
|
@@ -1058,7 +1058,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1058
1058
|
* @private
|
|
1059
1059
|
*/
|
|
1060
1060
|
_exit(e, t, r) {
|
|
1061
|
-
this._exitCallback && this._exitCallback(new
|
|
1061
|
+
this._exitCallback && this._exitCallback(new ut(e, t, r)), k.exit(e);
|
|
1062
1062
|
}
|
|
1063
1063
|
/**
|
|
1064
1064
|
* Register callback `fn` for the command.
|
|
@@ -1092,7 +1092,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1092
1092
|
* @return {Option} new option
|
|
1093
1093
|
*/
|
|
1094
1094
|
createOption(e, t) {
|
|
1095
|
-
return new
|
|
1095
|
+
return new Vt(e, t);
|
|
1096
1096
|
}
|
|
1097
1097
|
/**
|
|
1098
1098
|
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
@@ -1108,8 +1108,8 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1108
1108
|
return e.parseArg(t, r);
|
|
1109
1109
|
} catch (n) {
|
|
1110
1110
|
if (n.code === "commander.invalidArgument") {
|
|
1111
|
-
let
|
|
1112
|
-
this.error(
|
|
1111
|
+
let a = `${i} ${n.message}`;
|
|
1112
|
+
this.error(a, { exitCode: n.exitCode, code: n.code });
|
|
1113
1113
|
}
|
|
1114
1114
|
throw n;
|
|
1115
1115
|
}
|
|
@@ -1166,18 +1166,18 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1166
1166
|
"default"
|
|
1167
1167
|
);
|
|
1168
1168
|
} else e.defaultValue !== void 0 && this.setOptionValueWithSource(r, e.defaultValue, "default");
|
|
1169
|
-
let i = /* @__PURE__ */ d((n,
|
|
1169
|
+
let i = /* @__PURE__ */ d((n, a, o) => {
|
|
1170
1170
|
n == null && e.presetArg !== void 0 && (n = e.presetArg);
|
|
1171
|
-
let
|
|
1172
|
-
n !== null && e.parseArg ? n = this._callParseArg(e, n,
|
|
1173
|
-
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(r, n,
|
|
1171
|
+
let c = this.getOptionValue(r);
|
|
1172
|
+
n !== null && e.parseArg ? n = this._callParseArg(e, n, c, a) : n !== null && e.variadic && (n = e._concatValue(n, c)), n == null &&
|
|
1173
|
+
(e.negate ? n = !1 : e.isBoolean() || e.optional ? n = !0 : n = ""), this.setOptionValueWithSource(r, n, o);
|
|
1174
1174
|
}, "handleOptionValue");
|
|
1175
1175
|
return this.on("option:" + t, (n) => {
|
|
1176
|
-
let
|
|
1177
|
-
i(n,
|
|
1176
|
+
let a = `error: option '${e.flags}' argument '${n}' is invalid.`;
|
|
1177
|
+
i(n, a, "cli");
|
|
1178
1178
|
}), e.envVar && this.on("optionEnv:" + t, (n) => {
|
|
1179
|
-
let
|
|
1180
|
-
i(n,
|
|
1179
|
+
let a = `error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;
|
|
1180
|
+
i(n, a, "env");
|
|
1181
1181
|
}), this;
|
|
1182
1182
|
}
|
|
1183
1183
|
/**
|
|
@@ -1187,22 +1187,22 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1187
1187
|
* @private
|
|
1188
1188
|
*/
|
|
1189
1189
|
_optionEx(e, t, r, i, n) {
|
|
1190
|
-
if (typeof t == "object" && t instanceof
|
|
1190
|
+
if (typeof t == "object" && t instanceof Vt)
|
|
1191
1191
|
throw new Error(
|
|
1192
1192
|
"To add an Option object use addOption() instead of option() or requiredOption()"
|
|
1193
1193
|
);
|
|
1194
|
-
let
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1194
|
+
let a = this.createOption(t, r);
|
|
1195
|
+
if (a.makeOptionMandatory(!!e.mandatory), typeof i == "function")
|
|
1196
|
+
a.default(n).argParser(i);
|
|
1197
1197
|
else if (i instanceof RegExp) {
|
|
1198
|
-
let
|
|
1199
|
-
i = /* @__PURE__ */ d((
|
|
1200
|
-
let p =
|
|
1198
|
+
let o = i;
|
|
1199
|
+
i = /* @__PURE__ */ d((c, h) => {
|
|
1200
|
+
let p = o.exec(c);
|
|
1201
1201
|
return p ? p[0] : h;
|
|
1202
|
-
}, "fn"),
|
|
1202
|
+
}, "fn"), a.default(n).argParser(i);
|
|
1203
1203
|
} else
|
|
1204
|
-
|
|
1205
|
-
return this.addOption(
|
|
1204
|
+
a.default(i);
|
|
1205
|
+
return this.addOption(a);
|
|
1206
1206
|
}
|
|
1207
1207
|
/**
|
|
1208
1208
|
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
@@ -1392,11 +1392,11 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1392
1392
|
if (e !== void 0 && !Array.isArray(e))
|
|
1393
1393
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1394
1394
|
if (t = t || {}, e === void 0 && t.from === void 0) {
|
|
1395
|
-
|
|
1396
|
-
let i =
|
|
1395
|
+
k.versions?.electron && (t.from = "electron");
|
|
1396
|
+
let i = k.execArgv ?? [];
|
|
1397
1397
|
(i.includes("-e") || i.includes("--eval") || i.includes("-p") || i.includes("--print")) && (t.from = "eval");
|
|
1398
1398
|
}
|
|
1399
|
-
e === void 0 && (e =
|
|
1399
|
+
e === void 0 && (e = k.argv), this.rawArgs = e.slice();
|
|
1400
1400
|
let r;
|
|
1401
1401
|
switch (t.from) {
|
|
1402
1402
|
case void 0:
|
|
@@ -1404,7 +1404,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1404
1404
|
this._scriptPath = e[1], r = e.slice(2);
|
|
1405
1405
|
break;
|
|
1406
1406
|
case "electron":
|
|
1407
|
-
|
|
1407
|
+
k.defaultApp ? (this._scriptPath = e[1], r = e.slice(2)) : r = e.slice(1);
|
|
1408
1408
|
break;
|
|
1409
1409
|
case "user":
|
|
1410
1410
|
r = e.slice(0);
|
|
@@ -1478,16 +1478,16 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1478
1478
|
t = t.slice();
|
|
1479
1479
|
let r = !1, i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1480
1480
|
function n(p, y) {
|
|
1481
|
-
let
|
|
1482
|
-
if (lt.existsSync(
|
|
1481
|
+
let C = L.resolve(p, y);
|
|
1482
|
+
if (lt.existsSync(C)) return C;
|
|
1483
1483
|
if (i.includes(L.extname(y))) return;
|
|
1484
|
-
let
|
|
1485
|
-
(I) => lt.existsSync(`${
|
|
1484
|
+
let j = i.find(
|
|
1485
|
+
(I) => lt.existsSync(`${C}${I}`)
|
|
1486
1486
|
);
|
|
1487
|
-
if (
|
|
1487
|
+
if (j) return `${C}${j}`;
|
|
1488
1488
|
}
|
|
1489
1489
|
d(n, "findFile"), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
|
|
1490
|
-
let
|
|
1490
|
+
let a = e._executableFile || `${this._name}-${e._name}`, o = this._executableDir || "";
|
|
1491
1491
|
if (this._scriptPath) {
|
|
1492
1492
|
let p;
|
|
1493
1493
|
try {
|
|
@@ -1495,65 +1495,65 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
1495
1495
|
} catch {
|
|
1496
1496
|
p = this._scriptPath;
|
|
1497
1497
|
}
|
|
1498
|
-
|
|
1498
|
+
o = L.resolve(
|
|
1499
1499
|
L.dirname(p),
|
|
1500
|
-
|
|
1500
|
+
o
|
|
1501
1501
|
);
|
|
1502
1502
|
}
|
|
1503
|
-
if (
|
|
1504
|
-
let p = n(
|
|
1503
|
+
if (o) {
|
|
1504
|
+
let p = n(o, a);
|
|
1505
1505
|
if (!p && !e._executableFile && this._scriptPath) {
|
|
1506
1506
|
let y = L.basename(
|
|
1507
1507
|
this._scriptPath,
|
|
1508
1508
|
L.extname(this._scriptPath)
|
|
1509
1509
|
);
|
|
1510
1510
|
y !== this._name && (p = n(
|
|
1511
|
-
|
|
1511
|
+
o,
|
|
1512
1512
|
`${y}-${e._name}`
|
|
1513
1513
|
));
|
|
1514
1514
|
}
|
|
1515
|
-
|
|
1515
|
+
a = p || a;
|
|
1516
1516
|
}
|
|
1517
|
-
r = i.includes(L.extname(
|
|
1518
|
-
let
|
|
1519
|
-
|
|
1520
|
-
|
|
1517
|
+
r = i.includes(L.extname(a));
|
|
1518
|
+
let c;
|
|
1519
|
+
k.platform !== "win32" ? r ? (t.unshift(a), t = $t(k.execArgv).concat(t), c = dt.spawn(k.argv[0], t, { stdio: "inherit" })) : c = dt.spawn(
|
|
1520
|
+
a, t, { stdio: "inherit" }) : (t.unshift(a), t = $t(k.execArgv).concat(t), c = dt.spawn(k.execPath, t, { stdio: "inherit" })), c.killed ||
|
|
1521
1521
|
["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"].forEach((y) => {
|
|
1522
|
-
|
|
1523
|
-
|
|
1522
|
+
k.on(y, () => {
|
|
1523
|
+
c.killed === !1 && c.exitCode === null && c.kill(y);
|
|
1524
1524
|
});
|
|
1525
1525
|
});
|
|
1526
1526
|
let h = this._exitCallback;
|
|
1527
|
-
|
|
1527
|
+
c.on("close", (p) => {
|
|
1528
1528
|
p = p ?? 1, h ? h(
|
|
1529
|
-
new
|
|
1529
|
+
new ut(
|
|
1530
1530
|
p,
|
|
1531
1531
|
"commander.executeSubCommandAsync",
|
|
1532
1532
|
"(close)"
|
|
1533
1533
|
)
|
|
1534
|
-
) :
|
|
1535
|
-
}),
|
|
1534
|
+
) : k.exit(p);
|
|
1535
|
+
}), c.on("error", (p) => {
|
|
1536
1536
|
if (p.code === "ENOENT") {
|
|
1537
|
-
let y =
|
|
1538
|
-
cutableDir() to supply a custom directory",
|
|
1537
|
+
let y = o ? `searched for local subcommand relative to directory '${o}'` : "no directory for search for local subcommand, use .exe\
|
|
1538
|
+
cutableDir() to supply a custom directory", C = `'${a}' does not exist
|
|
1539
1539
|
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\
|
|
1540
1540
|
|
|
1541
1541
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
1542
1542
|
- ${y}`;
|
|
1543
|
-
throw new Error(
|
|
1543
|
+
throw new Error(C);
|
|
1544
1544
|
} else if (p.code === "EACCES")
|
|
1545
|
-
throw new Error(`'${
|
|
1545
|
+
throw new Error(`'${a}' not executable`);
|
|
1546
1546
|
if (!h)
|
|
1547
|
-
|
|
1547
|
+
k.exit(1);
|
|
1548
1548
|
else {
|
|
1549
|
-
let y = new
|
|
1549
|
+
let y = new ut(
|
|
1550
1550
|
1,
|
|
1551
1551
|
"commander.executeSubCommandAsync",
|
|
1552
1552
|
"(error)"
|
|
1553
1553
|
);
|
|
1554
1554
|
y.nestedError = p, h(y);
|
|
1555
1555
|
}
|
|
1556
|
-
}), this.runningCommand =
|
|
1556
|
+
}), this.runningCommand = c;
|
|
1557
1557
|
}
|
|
1558
1558
|
/**
|
|
1559
1559
|
* @private
|
|
@@ -1606,23 +1606,23 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1606
1606
|
*/
|
|
1607
1607
|
_processArguments() {
|
|
1608
1608
|
let e = /* @__PURE__ */ d((r, i, n) => {
|
|
1609
|
-
let
|
|
1609
|
+
let a = i;
|
|
1610
1610
|
if (i !== null && r.parseArg) {
|
|
1611
|
-
let
|
|
1612
|
-
|
|
1611
|
+
let o = `error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;
|
|
1612
|
+
a = this._callParseArg(
|
|
1613
1613
|
r,
|
|
1614
1614
|
i,
|
|
1615
1615
|
n,
|
|
1616
|
-
|
|
1616
|
+
o
|
|
1617
1617
|
);
|
|
1618
1618
|
}
|
|
1619
|
-
return
|
|
1619
|
+
return a;
|
|
1620
1620
|
}, "myParseArg");
|
|
1621
1621
|
this._checkNumberOfArguments();
|
|
1622
1622
|
let t = [];
|
|
1623
1623
|
this.registeredArguments.forEach((r, i) => {
|
|
1624
1624
|
let n = r.defaultValue;
|
|
1625
|
-
r.variadic ? i < this.args.length ? (n = this.args.slice(i), r.parseArg && (n = n.reduce((
|
|
1625
|
+
r.variadic ? i < this.args.length ? (n = this.args.slice(i), r.parseArg && (n = n.reduce((a, o) => e(r, o, a), r.defaultValue))) : n ===
|
|
1626
1626
|
void 0 && (n = []) : i < this.args.length && (n = this.args[i], r.parseArg && (n = e(r, n, r.defaultValue))), t[i] = n;
|
|
1627
1627
|
}), this.processedArgs = t;
|
|
1628
1628
|
}
|
|
@@ -1647,8 +1647,8 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1647
1647
|
_chainOrCallHooks(e, t) {
|
|
1648
1648
|
let r = e, i = [];
|
|
1649
1649
|
return this._getCommandAndAncestors().reverse().filter((n) => n._lifeCycleHooks[t] !== void 0).forEach((n) => {
|
|
1650
|
-
n._lifeCycleHooks[t].forEach((
|
|
1651
|
-
i.push({ hookedCommand: n, callback:
|
|
1650
|
+
n._lifeCycleHooks[t].forEach((a) => {
|
|
1651
|
+
i.push({ hookedCommand: n, callback: a });
|
|
1652
1652
|
});
|
|
1653
1653
|
}), t === "postAction" && i.reverse(), i.forEach((n) => {
|
|
1654
1654
|
r = this._chainOrCall(r, () => n.callback(n.hookedCommand, this));
|
|
@@ -1694,13 +1694,13 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1694
1694
|
}, "checkForUnknownOptions"), n = `command:${this.name()}`;
|
|
1695
1695
|
if (this._actionHandler) {
|
|
1696
1696
|
i(), this._processArguments();
|
|
1697
|
-
let
|
|
1698
|
-
return
|
|
1699
|
-
|
|
1697
|
+
let a;
|
|
1698
|
+
return a = this._chainOrCallHooks(a, "preAction"), a = this._chainOrCall(
|
|
1699
|
+
a,
|
|
1700
1700
|
() => this._actionHandler(this.processedArgs)
|
|
1701
|
-
), this.parent && (
|
|
1701
|
+
), this.parent && (a = this._chainOrCall(a, () => {
|
|
1702
1702
|
this.parent.emit(n, e, t);
|
|
1703
|
-
})),
|
|
1703
|
+
})), a = this._chainOrCallHooks(a, "postAction"), a;
|
|
1704
1704
|
}
|
|
1705
1705
|
if (this.parent && this.parent.listenerCount(n))
|
|
1706
1706
|
i(), this._processArguments(), this.parent.emit(n, e, t);
|
|
@@ -1792,68 +1792,68 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1792
1792
|
*/
|
|
1793
1793
|
parseOptions(e) {
|
|
1794
1794
|
let t = [], r = [], i = t, n = e.slice();
|
|
1795
|
-
function
|
|
1796
|
-
return
|
|
1795
|
+
function a(c) {
|
|
1796
|
+
return c.length > 1 && c[0] === "-";
|
|
1797
1797
|
}
|
|
1798
|
-
d(
|
|
1799
|
-
let
|
|
1798
|
+
d(a, "maybeOption");
|
|
1799
|
+
let o = null;
|
|
1800
1800
|
for (; n.length; ) {
|
|
1801
|
-
let
|
|
1802
|
-
if (
|
|
1803
|
-
i === r && i.push(
|
|
1801
|
+
let c = n.shift();
|
|
1802
|
+
if (c === "--") {
|
|
1803
|
+
i === r && i.push(c), i.push(...n);
|
|
1804
1804
|
break;
|
|
1805
1805
|
}
|
|
1806
|
-
if (
|
|
1807
|
-
this.emit(`option:${
|
|
1806
|
+
if (o && !a(c)) {
|
|
1807
|
+
this.emit(`option:${o.name()}`, c);
|
|
1808
1808
|
continue;
|
|
1809
1809
|
}
|
|
1810
|
-
if (
|
|
1811
|
-
let h = this._findOption(
|
|
1810
|
+
if (o = null, a(c)) {
|
|
1811
|
+
let h = this._findOption(c);
|
|
1812
1812
|
if (h) {
|
|
1813
1813
|
if (h.required) {
|
|
1814
1814
|
let p = n.shift();
|
|
1815
1815
|
p === void 0 && this.optionMissingArgument(h), this.emit(`option:${h.name()}`, p);
|
|
1816
1816
|
} else if (h.optional) {
|
|
1817
1817
|
let p = null;
|
|
1818
|
-
n.length > 0 && !
|
|
1818
|
+
n.length > 0 && !a(n[0]) && (p = n.shift()), this.emit(`option:${h.name()}`, p);
|
|
1819
1819
|
} else
|
|
1820
1820
|
this.emit(`option:${h.name()}`);
|
|
1821
|
-
|
|
1821
|
+
o = h.variadic ? h : null;
|
|
1822
1822
|
continue;
|
|
1823
1823
|
}
|
|
1824
1824
|
}
|
|
1825
|
-
if (
|
|
1826
|
-
let h = this._findOption(`-${
|
|
1825
|
+
if (c.length > 2 && c[0] === "-" && c[1] !== "-") {
|
|
1826
|
+
let h = this._findOption(`-${c[1]}`);
|
|
1827
1827
|
if (h) {
|
|
1828
|
-
h.required || h.optional && this._combineFlagAndOptionalValue ? this.emit(`option:${h.name()}`,
|
|
1829
|
-
:${h.name()}`), n.unshift(`-${
|
|
1828
|
+
h.required || h.optional && this._combineFlagAndOptionalValue ? this.emit(`option:${h.name()}`, c.slice(2)) : (this.emit(`option\
|
|
1829
|
+
:${h.name()}`), n.unshift(`-${c.slice(2)}`));
|
|
1830
1830
|
continue;
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
|
-
if (/^--[^=]+=/.test(
|
|
1834
|
-
let h =
|
|
1833
|
+
if (/^--[^=]+=/.test(c)) {
|
|
1834
|
+
let h = c.indexOf("="), p = this._findOption(c.slice(0, h));
|
|
1835
1835
|
if (p && (p.required || p.optional)) {
|
|
1836
|
-
this.emit(`option:${p.name()}`,
|
|
1836
|
+
this.emit(`option:${p.name()}`, c.slice(h + 1));
|
|
1837
1837
|
continue;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
|
-
if (
|
|
1841
|
-
if (this._findCommand(
|
|
1842
|
-
t.push(
|
|
1840
|
+
if (a(c) && (i = r), (this._enablePositionalOptions || this._passThroughOptions) && t.length === 0 && r.length === 0) {
|
|
1841
|
+
if (this._findCommand(c)) {
|
|
1842
|
+
t.push(c), n.length > 0 && r.push(...n);
|
|
1843
1843
|
break;
|
|
1844
|
-
} else if (this._getHelpCommand() &&
|
|
1845
|
-
t.push(
|
|
1844
|
+
} else if (this._getHelpCommand() && c === this._getHelpCommand().name()) {
|
|
1845
|
+
t.push(c), n.length > 0 && t.push(...n);
|
|
1846
1846
|
break;
|
|
1847
1847
|
} else if (this._defaultCommandName) {
|
|
1848
|
-
r.push(
|
|
1848
|
+
r.push(c), n.length > 0 && r.push(...n);
|
|
1849
1849
|
break;
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
1852
1852
|
if (this._passThroughOptions) {
|
|
1853
|
-
i.push(
|
|
1853
|
+
i.push(c), n.length > 0 && i.push(...n);
|
|
1854
1854
|
break;
|
|
1855
1855
|
}
|
|
1856
|
-
i.push(
|
|
1856
|
+
i.push(c);
|
|
1857
1857
|
}
|
|
1858
1858
|
return { operands: t, unknown: r };
|
|
1859
1859
|
}
|
|
@@ -1911,11 +1911,11 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1911
1911
|
*/
|
|
1912
1912
|
_parseOptionsEnv() {
|
|
1913
1913
|
this.options.forEach((e) => {
|
|
1914
|
-
if (e.envVar && e.envVar in
|
|
1914
|
+
if (e.envVar && e.envVar in k.env) {
|
|
1915
1915
|
let t = e.attributeName();
|
|
1916
1916
|
(this.getOptionValue(t) === void 0 || ["default", "config", "env"].includes(
|
|
1917
1917
|
this.getOptionValueSource(t)
|
|
1918
|
-
)) && (e.required || e.optional ? this.emit(`optionEnv:${e.name()}`,
|
|
1918
|
+
)) && (e.required || e.optional ? this.emit(`optionEnv:${e.name()}`, k.env[e.envVar]) : this.emit(`optionEnv:${e.name()}`));
|
|
1919
1919
|
}
|
|
1920
1920
|
});
|
|
1921
1921
|
}
|
|
@@ -1925,7 +1925,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1925
1925
|
* @private
|
|
1926
1926
|
*/
|
|
1927
1927
|
_parseOptionsImplied() {
|
|
1928
|
-
let e = new
|
|
1928
|
+
let e = new zr(this.options), t = /* @__PURE__ */ d((r) => this.getOptionValue(r) !== void 0 && !["default", "implied"].includes(this.
|
|
1929
1929
|
getOptionValueSource(r)), "hasCustomOptionValue");
|
|
1930
1930
|
this.options.filter(
|
|
1931
1931
|
(r) => r.implied !== void 0 && t(r.attributeName()) && e.valueFromOption(
|
|
@@ -1980,16 +1980,16 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
1980
1980
|
* @private
|
|
1981
1981
|
*/
|
|
1982
1982
|
_conflictingOption(e, t) {
|
|
1983
|
-
let r = /* @__PURE__ */ d((
|
|
1984
|
-
let
|
|
1985
|
-
(y) => y.negate &&
|
|
1983
|
+
let r = /* @__PURE__ */ d((a) => {
|
|
1984
|
+
let o = a.attributeName(), c = this.getOptionValue(o), h = this.options.find(
|
|
1985
|
+
(y) => y.negate && o === y.attributeName()
|
|
1986
1986
|
), p = this.options.find(
|
|
1987
|
-
(y) => !y.negate &&
|
|
1987
|
+
(y) => !y.negate && o === y.attributeName()
|
|
1988
1988
|
);
|
|
1989
|
-
return h && (h.presetArg === void 0 &&
|
|
1990
|
-
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((
|
|
1991
|
-
let
|
|
1992
|
-
return this.getOptionValueSource(
|
|
1989
|
+
return h && (h.presetArg === void 0 && c === !1 || h.presetArg !== void 0 && c === h.presetArg) ? h : p || a;
|
|
1990
|
+
}, "findBestOptionFromValue"), i = /* @__PURE__ */ d((a) => {
|
|
1991
|
+
let o = r(a), c = o.attributeName();
|
|
1992
|
+
return this.getOptionValueSource(c) === "env" ? `environment variable '${o.envVar}'` : `option '${o.flags}'`;
|
|
1993
1993
|
}, "getErrorMessage"), n = `error: ${i(e)} cannot be used with ${i(t)}`;
|
|
1994
1994
|
this.error(n, { code: "commander.conflictingOption" });
|
|
1995
1995
|
}
|
|
@@ -2005,10 +2005,10 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2005
2005
|
if (e.startsWith("--") && this._showSuggestionAfterError) {
|
|
2006
2006
|
let i = [], n = this;
|
|
2007
2007
|
do {
|
|
2008
|
-
let
|
|
2009
|
-
i = i.concat(
|
|
2008
|
+
let a = n.createHelp().visibleOptions(n).filter((o) => o.long).map((o) => o.long);
|
|
2009
|
+
i = i.concat(a), n = n.parent;
|
|
2010
2010
|
} while (n && !n._enablePositionalOptions);
|
|
2011
|
-
t =
|
|
2011
|
+
t = Dt(e, i);
|
|
2012
2012
|
}
|
|
2013
2013
|
let r = `error: unknown option '${e}'${t}`;
|
|
2014
2014
|
this.error(r, { code: "commander.unknownOption" });
|
|
@@ -2036,7 +2036,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2036
2036
|
let i = [];
|
|
2037
2037
|
this.createHelp().visibleCommands(this).forEach((n) => {
|
|
2038
2038
|
i.push(n.name()), n.alias() && i.push(n.alias());
|
|
2039
|
-
}), t =
|
|
2039
|
+
}), t = Dt(e, i);
|
|
2040
2040
|
}
|
|
2041
2041
|
let r = `error: unknown command '${e}'${t}`;
|
|
2042
2042
|
this.error(r, { code: "commander.unknownCommand" });
|
|
@@ -2124,7 +2124,7 @@ cutableDir() to supply a custom directory", w = `'${o}' does not exist
|
|
|
2124
2124
|
usage(e) {
|
|
2125
2125
|
if (e === void 0) {
|
|
2126
2126
|
if (this._usage) return this._usage;
|
|
2127
|
-
let t = this.registeredArguments.map((r) =>
|
|
2127
|
+
let t = this.registeredArguments.map((r) => Br(r));
|
|
2128
2128
|
return [].concat(
|
|
2129
2129
|
this.options.length || this._helpOption !== null ? "[options]" : [],
|
|
2130
2130
|
this.commands.length ? "[command]" : [],
|
|
@@ -2256,7 +2256,7 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2256
2256
|
*/
|
|
2257
2257
|
help(e) {
|
|
2258
2258
|
this.outputHelp(e);
|
|
2259
|
-
let t =
|
|
2259
|
+
let t = k.exitCode || 0;
|
|
2260
2260
|
t === 0 && e && typeof e != "function" && e.error && (t = 1), this._exit(t, "commander.help", "(outputHelp)");
|
|
2261
2261
|
}
|
|
2262
2262
|
/**
|
|
@@ -2276,8 +2276,8 @@ help", t = t ?? "display help for command", this._helpOption = this.createOption
|
|
|
2276
2276
|
Expecting one of '${r.join("', '")}'`);
|
|
2277
2277
|
let i = `${e}Help`;
|
|
2278
2278
|
return this.on(i, (n) => {
|
|
2279
|
-
let
|
|
2280
|
-
typeof t == "function" ?
|
|
2279
|
+
let a;
|
|
2280
|
+
typeof t == "function" ? a = t({ error: n.error, command: n.command }) : a = t, a && n.write(`${a}
|
|
2281
2281
|
`);
|
|
2282
2282
|
}), this;
|
|
2283
2283
|
}
|
|
@@ -2292,7 +2292,7 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2292
2292
|
t && e.find((i) => t.is(i)) && (this.outputHelp(), this._exit(0, "commander.helpDisplayed", "(outputHelp)"));
|
|
2293
2293
|
}
|
|
2294
2294
|
};
|
|
2295
|
-
function
|
|
2295
|
+
function $t(s) {
|
|
2296
2296
|
return s.map((e) => {
|
|
2297
2297
|
if (!e.startsWith("--inspect"))
|
|
2298
2298
|
return e;
|
|
@@ -2302,32 +2302,32 @@ Expecting one of '${r.join("', '")}'`);
|
|
|
2302
2302
|
n[3], i = n[4]), t && i !== "0" ? `${t}=${r}:${parseInt(i) + 1}` : e;
|
|
2303
2303
|
});
|
|
2304
2304
|
}
|
|
2305
|
-
d(
|
|
2306
|
-
|
|
2305
|
+
d($t, "incrementNodeInspectorPort");
|
|
2306
|
+
Rt.Command = ct;
|
|
2307
2307
|
});
|
|
2308
2308
|
|
|
2309
2309
|
// ../node_modules/commander/index.js
|
|
2310
|
-
var
|
|
2311
|
-
var { Argument:
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2310
|
+
var Ft = T((E) => {
|
|
2311
|
+
var { Argument: Lt } = $e(), { Command: ht } = Mt(), { CommanderError: Gr, InvalidArgumentError: qt } = Oe(), { Help: Jr } = st(), { Option: Ut } = ot();
|
|
2312
|
+
E.program = new ht();
|
|
2313
|
+
E.createCommand = (s) => new ht(s);
|
|
2314
|
+
E.createOption = (s, e) => new Ut(s, e);
|
|
2315
|
+
E.createArgument = (s, e) => new Lt(s, e);
|
|
2316
|
+
E.Command = ht;
|
|
2317
|
+
E.Option = Ut;
|
|
2318
|
+
E.Argument = Lt;
|
|
2319
|
+
E.Help = Jr;
|
|
2320
|
+
E.CommanderError = Gr;
|
|
2321
|
+
E.InvalidArgumentError = qt;
|
|
2322
|
+
E.InvalidOptionArgumentError = qt;
|
|
2323
2323
|
});
|
|
2324
2324
|
|
|
2325
2325
|
// ../node_modules/walk-up-path/dist/cjs/index.js
|
|
2326
|
-
var
|
|
2326
|
+
var Bt = T((Re) => {
|
|
2327
2327
|
"use strict";
|
|
2328
|
-
Object.defineProperty(
|
|
2329
|
-
|
|
2330
|
-
var Ht = ge("path"),
|
|
2328
|
+
Object.defineProperty(Re, "__esModule", { value: !0 });
|
|
2329
|
+
Re.walkUp = void 0;
|
|
2330
|
+
var Ht = ge("path"), Yr = /* @__PURE__ */ d(function* (s) {
|
|
2331
2331
|
for (s = (0, Ht.resolve)(s); s; ) {
|
|
2332
2332
|
yield s;
|
|
2333
2333
|
let e = (0, Ht.dirname)(s);
|
|
@@ -2336,23 +2336,23 @@ var Kt = O(($e) => {
|
|
|
2336
2336
|
s = e;
|
|
2337
2337
|
}
|
|
2338
2338
|
}, "walkUp");
|
|
2339
|
-
|
|
2339
|
+
Re.walkUp = Yr;
|
|
2340
2340
|
});
|
|
2341
2341
|
|
|
2342
2342
|
// ../node_modules/picocolors/picocolors.js
|
|
2343
|
-
var
|
|
2344
|
-
var Le = process || {},
|
|
2345
|
-
includes("--color") || Le.platform === "win32" || (Le.stdout || {}).isTTY && Me.TERM !== "dumb" || !!Me.CI),
|
|
2343
|
+
var Yt = T((vn, mt) => {
|
|
2344
|
+
var Le = process || {}, Gt = Le.argv || [], Me = Le.env || {}, rs = !(Me.NO_COLOR || Gt.includes("--no-color")) && (!!Me.FORCE_COLOR || Gt.
|
|
2345
|
+
includes("--color") || Le.platform === "win32" || (Le.stdout || {}).isTTY && Me.TERM !== "dumb" || !!Me.CI), ss = /* @__PURE__ */ d((s, e, t = s) => (r) => {
|
|
2346
2346
|
let i = "" + r, n = i.indexOf(e, s.length);
|
|
2347
|
-
return ~n ? s +
|
|
2348
|
-
}, "formatter"),
|
|
2347
|
+
return ~n ? s + is(i, e, t, n) + e : s + i + e;
|
|
2348
|
+
}, "formatter"), is = /* @__PURE__ */ d((s, e, t, r) => {
|
|
2349
2349
|
let i = "", n = 0;
|
|
2350
2350
|
do
|
|
2351
2351
|
i += s.substring(n, r) + t, n = r + e.length, r = s.indexOf(e, n);
|
|
2352
2352
|
while (~r);
|
|
2353
2353
|
return i + s.substring(n);
|
|
2354
|
-
}, "replaceClose"),
|
|
2355
|
-
let e = s ?
|
|
2354
|
+
}, "replaceClose"), Jt = /* @__PURE__ */ d((s = rs) => {
|
|
2355
|
+
let e = s ? ss : () => String;
|
|
2356
2356
|
return {
|
|
2357
2357
|
isColorSupported: s,
|
|
2358
2358
|
reset: e("\x1B[0m", "\x1B[0m"),
|
|
@@ -2398,58 +2398,58 @@ var Xt = O((xn, yt) => {
|
|
|
2398
2398
|
bgWhiteBright: e("\x1B[107m", "\x1B[49m")
|
|
2399
2399
|
};
|
|
2400
2400
|
}, "createColors");
|
|
2401
|
-
|
|
2402
|
-
|
|
2401
|
+
mt.exports = Jt();
|
|
2402
|
+
mt.exports.createColors = Jt;
|
|
2403
2403
|
});
|
|
2404
2404
|
|
|
2405
2405
|
// ../node_modules/ts-dedent/dist/index.js
|
|
2406
|
-
var
|
|
2406
|
+
var _t = T((Ae) => {
|
|
2407
2407
|
"use strict";
|
|
2408
|
-
Object.defineProperty(
|
|
2409
|
-
|
|
2410
|
-
function
|
|
2408
|
+
Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
2409
|
+
Ae.dedent = void 0;
|
|
2410
|
+
function Qt(s) {
|
|
2411
2411
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
2412
2412
|
e[t - 1] = arguments[t];
|
|
2413
2413
|
var r = Array.from(typeof s == "string" ? [s] : s);
|
|
2414
2414
|
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
2415
|
-
var i = r.reduce(function(
|
|
2416
|
-
var h =
|
|
2417
|
-
return h ?
|
|
2418
|
-
var y,
|
|
2419
|
-
return (
|
|
2420
|
-
})) :
|
|
2415
|
+
var i = r.reduce(function(o, c) {
|
|
2416
|
+
var h = c.match(/\n([\t ]+|(?!\s).)/g);
|
|
2417
|
+
return h ? o.concat(h.map(function(p) {
|
|
2418
|
+
var y, C;
|
|
2419
|
+
return (C = (y = p.match(/[\t ]/g)) === null || y === void 0 ? void 0 : y.length) !== null && C !== void 0 ? C : 0;
|
|
2420
|
+
})) : o;
|
|
2421
2421
|
}, []);
|
|
2422
2422
|
if (i.length) {
|
|
2423
2423
|
var n = new RegExp(`
|
|
2424
2424
|
[ ]{` + Math.min.apply(Math, i) + "}", "g");
|
|
2425
|
-
r = r.map(function(
|
|
2426
|
-
return
|
|
2425
|
+
r = r.map(function(o) {
|
|
2426
|
+
return o.replace(n, `
|
|
2427
2427
|
`);
|
|
2428
2428
|
});
|
|
2429
2429
|
}
|
|
2430
2430
|
r[0] = r[0].replace(/^\r?\n/, "");
|
|
2431
|
-
var
|
|
2432
|
-
return e.forEach(function(
|
|
2433
|
-
var h =
|
|
2434
|
-
typeof
|
|
2435
|
-
`) && (y = String(
|
|
2436
|
-
`).map(function(
|
|
2437
|
-
return
|
|
2431
|
+
var a = r[0];
|
|
2432
|
+
return e.forEach(function(o, c) {
|
|
2433
|
+
var h = a.match(/(?:^|\n)( *)$/), p = h ? h[1] : "", y = o;
|
|
2434
|
+
typeof o == "string" && o.includes(`
|
|
2435
|
+
`) && (y = String(o).split(`
|
|
2436
|
+
`).map(function(C, j) {
|
|
2437
|
+
return j === 0 ? C : "" + p + C;
|
|
2438
2438
|
}).join(`
|
|
2439
|
-
`)),
|
|
2440
|
-
}),
|
|
2439
|
+
`)), a += y + r[c + 1];
|
|
2440
|
+
}), a;
|
|
2441
2441
|
}
|
|
2442
|
-
d(
|
|
2443
|
-
|
|
2444
|
-
|
|
2442
|
+
d(Qt, "dedent");
|
|
2443
|
+
Ae.dedent = Qt;
|
|
2444
|
+
Ae.default = Qt;
|
|
2445
2445
|
});
|
|
2446
2446
|
|
|
2447
2447
|
// ../node_modules/zod/lib/helpers/util.js
|
|
2448
|
-
var
|
|
2448
|
+
var Ze = T((w) => {
|
|
2449
2449
|
"use strict";
|
|
2450
|
-
Object.defineProperty(
|
|
2451
|
-
|
|
2452
|
-
var
|
|
2450
|
+
Object.defineProperty(w, "__esModule", { value: !0 });
|
|
2451
|
+
w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
|
|
2452
|
+
var bt;
|
|
2453
2453
|
(function(s) {
|
|
2454
2454
|
s.assertEqual = (i) => i;
|
|
2455
2455
|
function e(i) {
|
|
@@ -2460,41 +2460,41 @@ var Ae = O((k) => {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
d(t, "assertNever"), s.assertNever = t, s.arrayToEnum = (i) => {
|
|
2462
2462
|
let n = {};
|
|
2463
|
-
for (let
|
|
2464
|
-
n[
|
|
2463
|
+
for (let a of i)
|
|
2464
|
+
n[a] = a;
|
|
2465
2465
|
return n;
|
|
2466
2466
|
}, s.getValidEnumValues = (i) => {
|
|
2467
|
-
let n = s.objectKeys(i).filter((
|
|
2468
|
-
for (let
|
|
2469
|
-
o
|
|
2470
|
-
return s.objectValues(
|
|
2467
|
+
let n = s.objectKeys(i).filter((o) => typeof i[i[o]] != "number"), a = {};
|
|
2468
|
+
for (let o of n)
|
|
2469
|
+
a[o] = i[o];
|
|
2470
|
+
return s.objectValues(a);
|
|
2471
2471
|
}, s.objectValues = (i) => s.objectKeys(i).map(function(n) {
|
|
2472
2472
|
return i[n];
|
|
2473
2473
|
}), s.objectKeys = typeof Object.keys == "function" ? (i) => Object.keys(i) : (i) => {
|
|
2474
2474
|
let n = [];
|
|
2475
|
-
for (let
|
|
2476
|
-
Object.prototype.hasOwnProperty.call(i,
|
|
2475
|
+
for (let a in i)
|
|
2476
|
+
Object.prototype.hasOwnProperty.call(i, a) && n.push(a);
|
|
2477
2477
|
return n;
|
|
2478
2478
|
}, s.find = (i, n) => {
|
|
2479
|
-
for (let
|
|
2480
|
-
if (n(
|
|
2481
|
-
return
|
|
2479
|
+
for (let a of i)
|
|
2480
|
+
if (n(a))
|
|
2481
|
+
return a;
|
|
2482
2482
|
}, s.isInteger = typeof Number.isInteger == "function" ? (i) => Number.isInteger(i) : (i) => typeof i == "number" && isFinite(i) && Math.
|
|
2483
2483
|
floor(i) === i;
|
|
2484
2484
|
function r(i, n = " | ") {
|
|
2485
|
-
return i.map((
|
|
2485
|
+
return i.map((a) => typeof a == "string" ? `'${a}'` : a).join(n);
|
|
2486
2486
|
}
|
|
2487
2487
|
d(r, "joinValues"), s.joinValues = r, s.jsonStringifyReplacer = (i, n) => typeof n == "bigint" ? n.toString() : n;
|
|
2488
|
-
})(
|
|
2489
|
-
var
|
|
2488
|
+
})(bt || (w.util = bt = {}));
|
|
2489
|
+
var tr;
|
|
2490
2490
|
(function(s) {
|
|
2491
2491
|
s.mergeShapes = (e, t) => ({
|
|
2492
2492
|
...e,
|
|
2493
2493
|
...t
|
|
2494
2494
|
// second overwrites first
|
|
2495
2495
|
});
|
|
2496
|
-
})(
|
|
2497
|
-
|
|
2496
|
+
})(tr || (w.objectUtil = tr = {}));
|
|
2497
|
+
w.ZodParsedType = bt.arrayToEnum([
|
|
2498
2498
|
"string",
|
|
2499
2499
|
"nan",
|
|
2500
2500
|
"number",
|
|
@@ -2516,40 +2516,40 @@ var Ae = O((k) => {
|
|
|
2516
2516
|
"map",
|
|
2517
2517
|
"set"
|
|
2518
2518
|
]);
|
|
2519
|
-
var
|
|
2519
|
+
var _s = /* @__PURE__ */ d((s) => {
|
|
2520
2520
|
switch (typeof s) {
|
|
2521
2521
|
case "undefined":
|
|
2522
|
-
return
|
|
2522
|
+
return w.ZodParsedType.undefined;
|
|
2523
2523
|
case "string":
|
|
2524
|
-
return
|
|
2524
|
+
return w.ZodParsedType.string;
|
|
2525
2525
|
case "number":
|
|
2526
|
-
return isNaN(s) ?
|
|
2526
|
+
return isNaN(s) ? w.ZodParsedType.nan : w.ZodParsedType.number;
|
|
2527
2527
|
case "boolean":
|
|
2528
|
-
return
|
|
2528
|
+
return w.ZodParsedType.boolean;
|
|
2529
2529
|
case "function":
|
|
2530
|
-
return
|
|
2530
|
+
return w.ZodParsedType.function;
|
|
2531
2531
|
case "bigint":
|
|
2532
|
-
return
|
|
2532
|
+
return w.ZodParsedType.bigint;
|
|
2533
2533
|
case "symbol":
|
|
2534
|
-
return
|
|
2534
|
+
return w.ZodParsedType.symbol;
|
|
2535
2535
|
case "object":
|
|
2536
|
-
return Array.isArray(s) ?
|
|
2537
|
-
typeof s.catch == "function" ?
|
|
2538
|
-
u" && s instanceof Set ?
|
|
2536
|
+
return Array.isArray(s) ? w.ZodParsedType.array : s === null ? w.ZodParsedType.null : s.then && typeof s.then == "function" && s.catch &&
|
|
2537
|
+
typeof s.catch == "function" ? w.ZodParsedType.promise : typeof Map < "u" && s instanceof Map ? w.ZodParsedType.map : typeof Set < "\
|
|
2538
|
+
u" && s instanceof Set ? w.ZodParsedType.set : typeof Date < "u" && s instanceof Date ? w.ZodParsedType.date : w.ZodParsedType.object;
|
|
2539
2539
|
default:
|
|
2540
|
-
return
|
|
2540
|
+
return w.ZodParsedType.unknown;
|
|
2541
2541
|
}
|
|
2542
2542
|
}, "getParsedType");
|
|
2543
|
-
|
|
2543
|
+
w.getParsedType = _s;
|
|
2544
2544
|
});
|
|
2545
2545
|
|
|
2546
2546
|
// ../node_modules/zod/lib/ZodError.js
|
|
2547
|
-
var
|
|
2547
|
+
var qe = T((z) => {
|
|
2548
2548
|
"use strict";
|
|
2549
|
-
Object.defineProperty(
|
|
2550
|
-
|
|
2551
|
-
var
|
|
2552
|
-
|
|
2549
|
+
Object.defineProperty(z, "__esModule", { value: !0 });
|
|
2550
|
+
z.ZodError = z.quotelessJson = z.ZodIssueCode = void 0;
|
|
2551
|
+
var rr = Ze();
|
|
2552
|
+
z.ZodIssueCode = rr.util.arrayToEnum([
|
|
2553
2553
|
"invalid_type",
|
|
2554
2554
|
"invalid_literal",
|
|
2555
2555
|
"custom",
|
|
@@ -2567,9 +2567,9 @@ var Ue = O((K) => {
|
|
|
2567
2567
|
"not_multiple_of",
|
|
2568
2568
|
"not_finite"
|
|
2569
2569
|
]);
|
|
2570
|
-
var
|
|
2571
|
-
|
|
2572
|
-
var
|
|
2570
|
+
var vs = /* @__PURE__ */ d((s) => JSON.stringify(s, null, 2).replace(/"([^"]+)":/g, "$1:"), "quotelessJson");
|
|
2571
|
+
z.quotelessJson = vs;
|
|
2572
|
+
var je = class s extends Error {
|
|
2573
2573
|
static {
|
|
2574
2574
|
d(this, "ZodError");
|
|
2575
2575
|
}
|
|
@@ -2589,21 +2589,21 @@ var Ue = O((K) => {
|
|
|
2589
2589
|
let t = e || function(n) {
|
|
2590
2590
|
return n.message;
|
|
2591
2591
|
}, r = { _errors: [] }, i = /* @__PURE__ */ d((n) => {
|
|
2592
|
-
for (let
|
|
2593
|
-
if (
|
|
2594
|
-
|
|
2595
|
-
else if (
|
|
2596
|
-
i(
|
|
2597
|
-
else if (
|
|
2598
|
-
i(
|
|
2599
|
-
else if (
|
|
2600
|
-
r._errors.push(t(
|
|
2592
|
+
for (let a of n.issues)
|
|
2593
|
+
if (a.code === "invalid_union")
|
|
2594
|
+
a.unionErrors.map(i);
|
|
2595
|
+
else if (a.code === "invalid_return_type")
|
|
2596
|
+
i(a.returnTypeError);
|
|
2597
|
+
else if (a.code === "invalid_arguments")
|
|
2598
|
+
i(a.argumentsError);
|
|
2599
|
+
else if (a.path.length === 0)
|
|
2600
|
+
r._errors.push(t(a));
|
|
2601
2601
|
else {
|
|
2602
|
-
let
|
|
2603
|
-
for (;
|
|
2604
|
-
let h =
|
|
2605
|
-
|
|
2606
|
-
|
|
2602
|
+
let o = r, c = 0;
|
|
2603
|
+
for (; c < a.path.length; ) {
|
|
2604
|
+
let h = a.path[c];
|
|
2605
|
+
c === a.path.length - 1 ? (o[h] = o[h] || { _errors: [] }, o[h]._errors.push(t(a))) : o[h] = o[h] || { _errors: [] }, o = o[h],
|
|
2606
|
+
c++;
|
|
2607
2607
|
}
|
|
2608
2608
|
}
|
|
2609
2609
|
}, "processError");
|
|
@@ -2617,7 +2617,7 @@ var Ue = O((K) => {
|
|
|
2617
2617
|
return this.message;
|
|
2618
2618
|
}
|
|
2619
2619
|
get message() {
|
|
2620
|
-
return JSON.stringify(this.issues,
|
|
2620
|
+
return JSON.stringify(this.issues, rr.util.jsonStringifyReplacer, 2);
|
|
2621
2621
|
}
|
|
2622
2622
|
get isEmpty() {
|
|
2623
2623
|
return this.issues.length === 0;
|
|
@@ -2632,59 +2632,59 @@ var Ue = O((K) => {
|
|
|
2632
2632
|
return this.flatten();
|
|
2633
2633
|
}
|
|
2634
2634
|
};
|
|
2635
|
-
|
|
2636
|
-
|
|
2635
|
+
z.ZodError = je;
|
|
2636
|
+
je.create = (s) => new je(s);
|
|
2637
2637
|
});
|
|
2638
2638
|
|
|
2639
2639
|
// ../node_modules/zod/lib/locales/en.js
|
|
2640
|
-
var
|
|
2640
|
+
var wt = T((xt) => {
|
|
2641
2641
|
"use strict";
|
|
2642
|
-
Object.defineProperty(
|
|
2643
|
-
var X =
|
|
2642
|
+
Object.defineProperty(xt, "__esModule", { value: !0 });
|
|
2643
|
+
var X = Ze(), O = qe(), bs = /* @__PURE__ */ d((s, e) => {
|
|
2644
2644
|
let t;
|
|
2645
2645
|
switch (s.code) {
|
|
2646
|
-
case
|
|
2646
|
+
case O.ZodIssueCode.invalid_type:
|
|
2647
2647
|
s.received === X.ZodParsedType.undefined ? t = "Required" : t = `Expected ${s.expected}, received ${s.received}`;
|
|
2648
2648
|
break;
|
|
2649
|
-
case
|
|
2649
|
+
case O.ZodIssueCode.invalid_literal:
|
|
2650
2650
|
t = `Invalid literal value, expected ${JSON.stringify(s.expected, X.util.jsonStringifyReplacer)}`;
|
|
2651
2651
|
break;
|
|
2652
|
-
case
|
|
2652
|
+
case O.ZodIssueCode.unrecognized_keys:
|
|
2653
2653
|
t = `Unrecognized key(s) in object: ${X.util.joinValues(s.keys, ", ")}`;
|
|
2654
2654
|
break;
|
|
2655
|
-
case
|
|
2655
|
+
case O.ZodIssueCode.invalid_union:
|
|
2656
2656
|
t = "Invalid input";
|
|
2657
2657
|
break;
|
|
2658
|
-
case
|
|
2658
|
+
case O.ZodIssueCode.invalid_union_discriminator:
|
|
2659
2659
|
t = `Invalid discriminator value. Expected ${X.util.joinValues(s.options)}`;
|
|
2660
2660
|
break;
|
|
2661
|
-
case
|
|
2661
|
+
case O.ZodIssueCode.invalid_enum_value:
|
|
2662
2662
|
t = `Invalid enum value. Expected ${X.util.joinValues(s.options)}, received '${s.received}'`;
|
|
2663
2663
|
break;
|
|
2664
|
-
case
|
|
2664
|
+
case O.ZodIssueCode.invalid_arguments:
|
|
2665
2665
|
t = "Invalid function arguments";
|
|
2666
2666
|
break;
|
|
2667
|
-
case
|
|
2667
|
+
case O.ZodIssueCode.invalid_return_type:
|
|
2668
2668
|
t = "Invalid function return type";
|
|
2669
2669
|
break;
|
|
2670
|
-
case
|
|
2670
|
+
case O.ZodIssueCode.invalid_date:
|
|
2671
2671
|
t = "Invalid date";
|
|
2672
2672
|
break;
|
|
2673
|
-
case
|
|
2673
|
+
case O.ZodIssueCode.invalid_string:
|
|
2674
2674
|
typeof s.validation == "object" ? "includes" in s.validation ? (t = `Invalid input: must include "${s.validation.includes}"`, typeof s.
|
|
2675
2675
|
validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${s.validation.position}`)) : "start\
|
|
2676
2676
|
sWith" in s.validation ? t = `Invalid input: must start with "${s.validation.startsWith}"` : "endsWith" in s.validation ? t = `Invalid input\
|
|
2677
2677
|
: must end with "${s.validation.endsWith}"` : X.util.assertNever(s.validation) : s.validation !== "regex" ? t = `Invalid ${s.validation}` : t =
|
|
2678
2678
|
"Invalid";
|
|
2679
2679
|
break;
|
|
2680
|
-
case
|
|
2680
|
+
case O.ZodIssueCode.too_small:
|
|
2681
2681
|
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "more than"} ${s.minimum} element(s)` :
|
|
2682
2682
|
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at least" : "over"} ${s.minimum} character(s)` :
|
|
2683
2683
|
s.type === "number" ? t = `Number must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "greater tha\
|
|
2684
2684
|
n "}${s.minimum}` : s.type === "date" ? t = `Date must be ${s.exact ? "exactly equal to " : s.inclusive ? "greater than or equal to " : "gre\
|
|
2685
2685
|
ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
2686
2686
|
break;
|
|
2687
|
-
case
|
|
2687
|
+
case O.ZodIssueCode.too_big:
|
|
2688
2688
|
s.type === "array" ? t = `Array must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "less than"} ${s.maximum} element(s)` :
|
|
2689
2689
|
s.type === "string" ? t = `String must contain ${s.exact ? "exactly" : s.inclusive ? "at most" : "under"} ${s.maximum} character(s)` :
|
|
2690
2690
|
s.type === "number" ? t = `Number must be ${s.exact ? "exactly" : s.inclusive ? "less than or equal to" : "less than"} ${s.maximum}` :
|
|
@@ -2692,16 +2692,16 @@ ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
|
2692
2692
|
s.type === "date" ? t = `Date must be ${s.exact ? "exactly" : s.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(
|
|
2693
2693
|
Number(s.maximum))}` : t = "Invalid input";
|
|
2694
2694
|
break;
|
|
2695
|
-
case
|
|
2695
|
+
case O.ZodIssueCode.custom:
|
|
2696
2696
|
t = "Invalid input";
|
|
2697
2697
|
break;
|
|
2698
|
-
case
|
|
2698
|
+
case O.ZodIssueCode.invalid_intersection_types:
|
|
2699
2699
|
t = "Intersection results could not be merged";
|
|
2700
2700
|
break;
|
|
2701
|
-
case
|
|
2701
|
+
case O.ZodIssueCode.not_multiple_of:
|
|
2702
2702
|
t = `Number must be a multiple of ${s.multipleOf}`;
|
|
2703
2703
|
break;
|
|
2704
|
-
case
|
|
2704
|
+
case O.ZodIssueCode.not_finite:
|
|
2705
2705
|
t = "Number must be finite";
|
|
2706
2706
|
break;
|
|
2707
2707
|
default:
|
|
@@ -2709,43 +2709,43 @@ ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
|
|
|
2709
2709
|
}
|
|
2710
2710
|
return { message: t };
|
|
2711
2711
|
}, "errorMap");
|
|
2712
|
-
|
|
2712
|
+
xt.default = bs;
|
|
2713
2713
|
});
|
|
2714
2714
|
|
|
2715
2715
|
// ../node_modules/zod/lib/errors.js
|
|
2716
|
-
var
|
|
2716
|
+
var Ue = T(($) => {
|
|
2717
2717
|
"use strict";
|
|
2718
|
-
var
|
|
2718
|
+
var xs = $ && $.__importDefault || function(s) {
|
|
2719
2719
|
return s && s.__esModule ? s : { default: s };
|
|
2720
2720
|
};
|
|
2721
|
-
Object.defineProperty(
|
|
2722
|
-
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2725
|
-
var
|
|
2726
|
-
function
|
|
2727
|
-
|
|
2721
|
+
Object.defineProperty($, "__esModule", { value: !0 });
|
|
2722
|
+
$.getErrorMap = $.setErrorMap = $.defaultErrorMap = void 0;
|
|
2723
|
+
var sr = xs(wt());
|
|
2724
|
+
$.defaultErrorMap = sr.default;
|
|
2725
|
+
var ir = sr.default;
|
|
2726
|
+
function ws(s) {
|
|
2727
|
+
ir = s;
|
|
2728
2728
|
}
|
|
2729
|
-
d(
|
|
2730
|
-
|
|
2731
|
-
function
|
|
2732
|
-
return
|
|
2729
|
+
d(ws, "setErrorMap");
|
|
2730
|
+
$.setErrorMap = ws;
|
|
2731
|
+
function Cs() {
|
|
2732
|
+
return ir;
|
|
2733
2733
|
}
|
|
2734
|
-
d(
|
|
2735
|
-
|
|
2734
|
+
d(Cs, "getErrorMap");
|
|
2735
|
+
$.getErrorMap = Cs;
|
|
2736
2736
|
});
|
|
2737
2737
|
|
|
2738
2738
|
// ../node_modules/zod/lib/helpers/parseUtil.js
|
|
2739
|
-
var
|
|
2739
|
+
var kt = T((x) => {
|
|
2740
2740
|
"use strict";
|
|
2741
|
-
var
|
|
2741
|
+
var ks = x && x.__importDefault || function(s) {
|
|
2742
2742
|
return s && s.__esModule ? s : { default: s };
|
|
2743
2743
|
};
|
|
2744
2744
|
Object.defineProperty(x, "__esModule", { value: !0 });
|
|
2745
2745
|
x.isAsync = x.isValid = x.isDirty = x.isAborted = x.OK = x.DIRTY = x.INVALID = x.ParseStatus = x.addIssueToContext = x.EMPTY_PATH = x.makeIssue =
|
|
2746
2746
|
void 0;
|
|
2747
|
-
var
|
|
2748
|
-
let { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []],
|
|
2747
|
+
var Is = Ue(), nr = ks(wt()), Ts = /* @__PURE__ */ d((s) => {
|
|
2748
|
+
let { data: e, path: t, errorMaps: r, issueData: i } = s, n = [...t, ...i.path || []], a = {
|
|
2749
2749
|
...i,
|
|
2750
2750
|
path: n
|
|
2751
2751
|
};
|
|
@@ -2755,19 +2755,19 @@ var Ot = O((x) => {
|
|
|
2755
2755
|
path: n,
|
|
2756
2756
|
message: i.message
|
|
2757
2757
|
};
|
|
2758
|
-
let
|
|
2759
|
-
for (let h of
|
|
2760
|
-
|
|
2758
|
+
let o = "", c = r.filter((h) => !!h).slice().reverse();
|
|
2759
|
+
for (let h of c)
|
|
2760
|
+
o = h(a, { data: e, defaultError: o }).message;
|
|
2761
2761
|
return {
|
|
2762
2762
|
...i,
|
|
2763
2763
|
path: n,
|
|
2764
|
-
message:
|
|
2764
|
+
message: o
|
|
2765
2765
|
};
|
|
2766
2766
|
}, "makeIssue");
|
|
2767
|
-
x.makeIssue =
|
|
2767
|
+
x.makeIssue = Ts;
|
|
2768
2768
|
x.EMPTY_PATH = [];
|
|
2769
|
-
function
|
|
2770
|
-
let t = (0,
|
|
2769
|
+
function Os(s, e) {
|
|
2770
|
+
let t = (0, Is.getErrorMap)(), r = (0, x.makeIssue)({
|
|
2771
2771
|
issueData: e,
|
|
2772
2772
|
data: s.data,
|
|
2773
2773
|
path: s.path,
|
|
@@ -2778,15 +2778,15 @@ var Ot = O((x) => {
|
|
|
2778
2778
|
// then schema-bound map if available
|
|
2779
2779
|
t,
|
|
2780
2780
|
// then global override map
|
|
2781
|
-
t ===
|
|
2781
|
+
t === nr.default ? void 0 : nr.default
|
|
2782
2782
|
// then global default map
|
|
2783
2783
|
].filter((i) => !!i)
|
|
2784
2784
|
});
|
|
2785
2785
|
s.common.issues.push(r);
|
|
2786
2786
|
}
|
|
2787
|
-
d(
|
|
2788
|
-
x.addIssueToContext =
|
|
2789
|
-
var
|
|
2787
|
+
d(Os, "addIssueToContext");
|
|
2788
|
+
x.addIssueToContext = Os;
|
|
2789
|
+
var Ct = class s {
|
|
2790
2790
|
static {
|
|
2791
2791
|
d(this, "ParseStatus");
|
|
2792
2792
|
}
|
|
@@ -2811,10 +2811,10 @@ var Ot = O((x) => {
|
|
|
2811
2811
|
static async mergeObjectAsync(e, t) {
|
|
2812
2812
|
let r = [];
|
|
2813
2813
|
for (let i of t) {
|
|
2814
|
-
let n = await i.key,
|
|
2814
|
+
let n = await i.key, a = await i.value;
|
|
2815
2815
|
r.push({
|
|
2816
2816
|
key: n,
|
|
2817
|
-
value:
|
|
2817
|
+
value: a
|
|
2818
2818
|
});
|
|
2819
2819
|
}
|
|
2820
2820
|
return s.mergeObjectSync(e, r);
|
|
@@ -2822,76 +2822,76 @@ var Ot = O((x) => {
|
|
|
2822
2822
|
static mergeObjectSync(e, t) {
|
|
2823
2823
|
let r = {};
|
|
2824
2824
|
for (let i of t) {
|
|
2825
|
-
let { key: n, value:
|
|
2826
|
-
if (n.status === "aborted" ||
|
|
2825
|
+
let { key: n, value: a } = i;
|
|
2826
|
+
if (n.status === "aborted" || a.status === "aborted")
|
|
2827
2827
|
return x.INVALID;
|
|
2828
|
-
n.status === "dirty" && e.dirty(),
|
|
2829
|
-
(r[n.value] =
|
|
2828
|
+
n.status === "dirty" && e.dirty(), a.status === "dirty" && e.dirty(), n.value !== "__proto__" && (typeof a.value < "u" || i.alwaysSet) &&
|
|
2829
|
+
(r[n.value] = a.value);
|
|
2830
2830
|
}
|
|
2831
2831
|
return { status: e.value, value: r };
|
|
2832
2832
|
}
|
|
2833
2833
|
};
|
|
2834
|
-
x.ParseStatus =
|
|
2834
|
+
x.ParseStatus = Ct;
|
|
2835
2835
|
x.INVALID = Object.freeze({
|
|
2836
2836
|
status: "aborted"
|
|
2837
2837
|
});
|
|
2838
|
-
var
|
|
2839
|
-
x.DIRTY =
|
|
2840
|
-
var
|
|
2841
|
-
x.OK =
|
|
2842
|
-
var
|
|
2843
|
-
x.isAborted =
|
|
2844
|
-
var
|
|
2845
|
-
x.isDirty =
|
|
2846
|
-
var
|
|
2847
|
-
x.isValid =
|
|
2848
|
-
var
|
|
2849
|
-
x.isAsync =
|
|
2838
|
+
var As = /* @__PURE__ */ d((s) => ({ status: "dirty", value: s }), "DIRTY");
|
|
2839
|
+
x.DIRTY = As;
|
|
2840
|
+
var Zs = /* @__PURE__ */ d((s) => ({ status: "valid", value: s }), "OK");
|
|
2841
|
+
x.OK = Zs;
|
|
2842
|
+
var js = /* @__PURE__ */ d((s) => s.status === "aborted", "isAborted");
|
|
2843
|
+
x.isAborted = js;
|
|
2844
|
+
var Ss = /* @__PURE__ */ d((s) => s.status === "dirty", "isDirty");
|
|
2845
|
+
x.isDirty = Ss;
|
|
2846
|
+
var Es = /* @__PURE__ */ d((s) => s.status === "valid", "isValid");
|
|
2847
|
+
x.isValid = Es;
|
|
2848
|
+
var Ps = /* @__PURE__ */ d((s) => typeof Promise < "u" && s instanceof Promise, "isAsync");
|
|
2849
|
+
x.isAsync = Ps;
|
|
2850
2850
|
});
|
|
2851
2851
|
|
|
2852
2852
|
// ../node_modules/zod/lib/helpers/typeAliases.js
|
|
2853
|
-
var
|
|
2853
|
+
var or = T((ar) => {
|
|
2854
2854
|
"use strict";
|
|
2855
|
-
Object.defineProperty(
|
|
2855
|
+
Object.defineProperty(ar, "__esModule", { value: !0 });
|
|
2856
2856
|
});
|
|
2857
2857
|
|
|
2858
2858
|
// ../node_modules/zod/lib/helpers/errorUtil.js
|
|
2859
|
-
var lr =
|
|
2859
|
+
var lr = T((Fe) => {
|
|
2860
2860
|
"use strict";
|
|
2861
|
-
Object.defineProperty(
|
|
2862
|
-
|
|
2863
|
-
var
|
|
2861
|
+
Object.defineProperty(Fe, "__esModule", { value: !0 });
|
|
2862
|
+
Fe.errorUtil = void 0;
|
|
2863
|
+
var dr;
|
|
2864
2864
|
(function(s) {
|
|
2865
2865
|
s.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, s.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2866
|
-
})(
|
|
2866
|
+
})(dr || (Fe.errorUtil = dr = {}));
|
|
2867
2867
|
});
|
|
2868
2868
|
|
|
2869
2869
|
// ../node_modules/zod/lib/types.js
|
|
2870
|
-
var
|
|
2870
|
+
var wr = T((l) => {
|
|
2871
2871
|
"use strict";
|
|
2872
|
-
var Be =
|
|
2872
|
+
var Be = l && l.__classPrivateFieldGet || function(s, e, t, r) {
|
|
2873
2873
|
if (t === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
2874
2874
|
if (typeof e == "function" ? s !== e || !r : !e.has(s)) throw new TypeError("Cannot read private member from an object whose class did n\
|
|
2875
2875
|
ot declare it");
|
|
2876
2876
|
return t === "m" ? r : t === "a" ? r.call(s) : r ? r.value : e.get(s);
|
|
2877
|
-
},
|
|
2877
|
+
}, hr = l && l.__classPrivateFieldSet || function(s, e, t, r, i) {
|
|
2878
2878
|
if (r === "m") throw new TypeError("Private method is not writable");
|
|
2879
2879
|
if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
|
|
2880
2880
|
if (typeof e == "function" ? s !== e || !i : !e.has(s)) throw new TypeError("Cannot write private member to an object whose class did no\
|
|
2881
2881
|
t declare it");
|
|
2882
2882
|
return r === "a" ? i.call(s, t) : i ? i.value = t : e.set(s, t), t;
|
|
2883
|
-
},
|
|
2884
|
-
Object.defineProperty(
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
ZodIntersection =
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
var
|
|
2883
|
+
}, Se, Ee;
|
|
2884
|
+
Object.defineProperty(l, "__esModule", { value: !0 });
|
|
2885
|
+
l.boolean = l.bigint = l.array = l.any = l.coerce = l.ZodFirstPartyTypeKind = l.late = l.ZodSchema = l.Schema = l.custom = l.ZodReadonly =
|
|
2886
|
+
l.ZodPipeline = l.ZodBranded = l.BRAND = l.ZodNaN = l.ZodCatch = l.ZodDefault = l.ZodNullable = l.ZodOptional = l.ZodTransformer = l.ZodEffects =
|
|
2887
|
+
l.ZodPromise = l.ZodNativeEnum = l.ZodEnum = l.ZodLiteral = l.ZodLazy = l.ZodFunction = l.ZodSet = l.ZodMap = l.ZodRecord = l.ZodTuple = l.
|
|
2888
|
+
ZodIntersection = l.ZodDiscriminatedUnion = l.ZodUnion = l.ZodObject = l.ZodArray = l.ZodVoid = l.ZodNever = l.ZodUnknown = l.ZodAny = l.ZodNull =
|
|
2889
|
+
l.ZodUndefined = l.ZodSymbol = l.ZodDate = l.ZodBoolean = l.ZodBigInt = l.ZodNumber = l.ZodString = l.datetimeRegex = l.ZodType = void 0;
|
|
2890
|
+
l.NEVER = l.void = l.unknown = l.union = l.undefined = l.tuple = l.transformer = l.symbol = l.string = l.strictObject = l.set = l.record =
|
|
2891
|
+
l.promise = l.preprocess = l.pipeline = l.ostring = l.optional = l.onumber = l.oboolean = l.object = l.number = l.nullable = l.null = l.never =
|
|
2892
|
+
l.nativeEnum = l.nan = l.map = l.literal = l.lazy = l.intersection = l.instanceof = l.function = l.enum = l.effect = l.discriminatedUnion =
|
|
2893
|
+
l.date = void 0;
|
|
2894
|
+
var He = Ue(), g = lr(), u = kt(), m = Ze(), f = qe(), N = class {
|
|
2895
2895
|
static {
|
|
2896
2896
|
d(this, "ParseInputLazyPath");
|
|
2897
2897
|
}
|
|
@@ -2902,7 +2902,7 @@ t declare it");
|
|
|
2902
2902
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.
|
|
2903
2903
|
push(...this._path, this._key)), this._cachedPath;
|
|
2904
2904
|
}
|
|
2905
|
-
},
|
|
2905
|
+
}, ur = /* @__PURE__ */ d((s, e) => {
|
|
2906
2906
|
if ((0, u.isValid)(e))
|
|
2907
2907
|
return { success: !0, data: e.value };
|
|
2908
2908
|
if (!s.common.issues.length)
|
|
@@ -2917,22 +2917,22 @@ t declare it");
|
|
|
2917
2917
|
}
|
|
2918
2918
|
};
|
|
2919
2919
|
}, "handleResult");
|
|
2920
|
-
function
|
|
2920
|
+
function v(s) {
|
|
2921
2921
|
if (!s)
|
|
2922
2922
|
return {};
|
|
2923
2923
|
let { errorMap: e, invalid_type_error: t, required_error: r, description: i } = s;
|
|
2924
2924
|
if (e && (t || r))
|
|
2925
2925
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
2926
|
-
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((
|
|
2927
|
-
var
|
|
2926
|
+
return e ? { errorMap: e, description: i } : { errorMap: /* @__PURE__ */ d((a, o) => {
|
|
2927
|
+
var c, h;
|
|
2928
2928
|
let { message: p } = s;
|
|
2929
|
-
return
|
|
2930
|
-
void 0 ?
|
|
2931
|
-
h :
|
|
2929
|
+
return a.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (c = p ?? r) !== null && c !==
|
|
2930
|
+
void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (h = p ?? t) !== null && h !== void 0 ?
|
|
2931
|
+
h : o.defaultError };
|
|
2932
2932
|
}, "customMap"), description: i };
|
|
2933
2933
|
}
|
|
2934
|
-
d(
|
|
2935
|
-
var
|
|
2934
|
+
d(v, "processCreateParams");
|
|
2935
|
+
var b = class {
|
|
2936
2936
|
static {
|
|
2937
2937
|
d(this, "ZodType");
|
|
2938
2938
|
}
|
|
@@ -2995,7 +2995,7 @@ t declare it");
|
|
|
2995
2995
|
data: e,
|
|
2996
2996
|
parsedType: (0, m.getParsedType)(e)
|
|
2997
2997
|
}, n = this._parseSync({ data: e, path: i.path, parent: i });
|
|
2998
|
-
return
|
|
2998
|
+
return ur(i, n);
|
|
2999
2999
|
}
|
|
3000
3000
|
"~validate"(e) {
|
|
3001
3001
|
var t, r;
|
|
@@ -3050,24 +3050,24 @@ t declare it");
|
|
|
3050
3050
|
data: e,
|
|
3051
3051
|
parsedType: (0, m.getParsedType)(e)
|
|
3052
3052
|
}, i = this._parse({ data: e, path: r.path, parent: r }), n = await ((0, u.isAsync)(i) ? i : Promise.resolve(i));
|
|
3053
|
-
return
|
|
3053
|
+
return ur(r, n);
|
|
3054
3054
|
}
|
|
3055
3055
|
refine(e, t) {
|
|
3056
3056
|
let r = /* @__PURE__ */ d((i) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(i) : t, "getIssu\
|
|
3057
3057
|
eProperties");
|
|
3058
3058
|
return this._refinement((i, n) => {
|
|
3059
|
-
let
|
|
3059
|
+
let a = e(i), o = /* @__PURE__ */ d(() => n.addIssue({
|
|
3060
3060
|
code: f.ZodIssueCode.custom,
|
|
3061
3061
|
...r(i)
|
|
3062
3062
|
}), "setError");
|
|
3063
|
-
return typeof Promise < "u" &&
|
|
3063
|
+
return typeof Promise < "u" && a instanceof Promise ? a.then((c) => c ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
3064
3064
|
});
|
|
3065
3065
|
}
|
|
3066
3066
|
refinement(e, t) {
|
|
3067
3067
|
return this._refinement((r, i) => e(r) ? !0 : (i.addIssue(typeof t == "function" ? t(r, i) : t), !1));
|
|
3068
3068
|
}
|
|
3069
3069
|
_refinement(e) {
|
|
3070
|
-
return new
|
|
3070
|
+
return new S({
|
|
3071
3071
|
schema: this,
|
|
3072
3072
|
typeName: _.ZodEffects,
|
|
3073
3073
|
effect: { type: "refinement", refinement: e }
|
|
@@ -3091,7 +3091,7 @@ eProperties");
|
|
|
3091
3091
|
};
|
|
3092
3092
|
}
|
|
3093
3093
|
optional() {
|
|
3094
|
-
return
|
|
3094
|
+
return P.create(this, this._def);
|
|
3095
3095
|
}
|
|
3096
3096
|
nullable() {
|
|
3097
3097
|
return M.create(this, this._def);
|
|
@@ -3100,20 +3100,20 @@ eProperties");
|
|
|
3100
3100
|
return this.nullable().optional();
|
|
3101
3101
|
}
|
|
3102
3102
|
array() {
|
|
3103
|
-
return
|
|
3103
|
+
return F.create(this);
|
|
3104
3104
|
}
|
|
3105
3105
|
promise() {
|
|
3106
|
-
return
|
|
3106
|
+
return Y.create(this, this._def);
|
|
3107
3107
|
}
|
|
3108
3108
|
or(e) {
|
|
3109
3109
|
return ne.create([this, e], this._def);
|
|
3110
3110
|
}
|
|
3111
3111
|
and(e) {
|
|
3112
|
-
return
|
|
3112
|
+
return ae.create(this, e, this._def);
|
|
3113
3113
|
}
|
|
3114
3114
|
transform(e) {
|
|
3115
|
-
return new
|
|
3116
|
-
...
|
|
3115
|
+
return new S({
|
|
3116
|
+
...v(this._def),
|
|
3117
3117
|
schema: this,
|
|
3118
3118
|
typeName: _.ZodEffects,
|
|
3119
3119
|
effect: { type: "transform", transform: e }
|
|
@@ -3121,24 +3121,24 @@ eProperties");
|
|
|
3121
3121
|
}
|
|
3122
3122
|
default(e) {
|
|
3123
3123
|
let t = typeof e == "function" ? e : () => e;
|
|
3124
|
-
return new
|
|
3125
|
-
...
|
|
3124
|
+
return new ce({
|
|
3125
|
+
...v(this._def),
|
|
3126
3126
|
innerType: this,
|
|
3127
3127
|
defaultValue: t,
|
|
3128
3128
|
typeName: _.ZodDefault
|
|
3129
3129
|
});
|
|
3130
3130
|
}
|
|
3131
3131
|
brand() {
|
|
3132
|
-
return new
|
|
3132
|
+
return new Pe({
|
|
3133
3133
|
typeName: _.ZodBranded,
|
|
3134
3134
|
type: this,
|
|
3135
|
-
...
|
|
3135
|
+
...v(this._def)
|
|
3136
3136
|
});
|
|
3137
3137
|
}
|
|
3138
3138
|
catch(e) {
|
|
3139
3139
|
let t = typeof e == "function" ? e : () => e;
|
|
3140
3140
|
return new he({
|
|
3141
|
-
...
|
|
3141
|
+
...v(this._def),
|
|
3142
3142
|
innerType: this,
|
|
3143
3143
|
catchValue: t,
|
|
3144
3144
|
typeName: _.ZodCatch
|
|
@@ -3152,7 +3152,7 @@ eProperties");
|
|
|
3152
3152
|
});
|
|
3153
3153
|
}
|
|
3154
3154
|
pipe(e) {
|
|
3155
|
-
return
|
|
3155
|
+
return Ne.create(this, e);
|
|
3156
3156
|
}
|
|
3157
3157
|
readonly() {
|
|
3158
3158
|
return pe.create(this);
|
|
@@ -3164,39 +3164,39 @@ eProperties");
|
|
|
3164
3164
|
return this.safeParse(null).success;
|
|
3165
3165
|
}
|
|
3166
3166
|
};
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
var
|
|
3171
|
-
|
|
3172
|
-
qs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,
|
|
3173
|
-
onent})+$",
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
|
|
3179
|
-
function
|
|
3167
|
+
l.ZodType = b;
|
|
3168
|
+
l.Schema = b;
|
|
3169
|
+
l.ZodSchema = b;
|
|
3170
|
+
var Ns = /^c[^\s-]{8,}$/i, Vs = /^[0-9a-z]+$/, Ds = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $s = /^[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,
|
|
3171
|
+
Rs = /^[a-z0-9_-]{21}$/i, Ms = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ls = /^[-+]?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)?)??$/,
|
|
3172
|
+
qs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Comp\
|
|
3173
|
+
onent})+$", It, Fs = /^(?:(?: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])$/, Hs = /^(?:(?: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])$/,
|
|
3174
|
+
Bs = /^(([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]))$/,
|
|
3175
|
+
Ws = /^(([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])$/,
|
|
3176
|
+
zs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Gs = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
3177
|
+
pr = "((\\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\
|
|
3178
|
+
]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Js = new RegExp(`^${pr}$`);
|
|
3179
|
+
function fr(s) {
|
|
3180
3180
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
3181
3181
|
return s.precision ? e = `${e}\\.\\d{${s.precision}}` : s.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
3182
3182
|
}
|
|
3183
|
-
d(
|
|
3184
|
-
function
|
|
3185
|
-
return new RegExp(`^${
|
|
3183
|
+
d(fr, "timeRegexSource");
|
|
3184
|
+
function Ys(s) {
|
|
3185
|
+
return new RegExp(`^${fr(s)}$`);
|
|
3186
3186
|
}
|
|
3187
|
-
d(
|
|
3188
|
-
function
|
|
3189
|
-
let e = `${
|
|
3187
|
+
d(Ys, "timeRegex");
|
|
3188
|
+
function mr(s) {
|
|
3189
|
+
let e = `${pr}T${fr(s)}`, t = [];
|
|
3190
3190
|
return t.push(s.local ? "Z?" : "Z"), s.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
3191
3191
|
}
|
|
3192
|
-
d(
|
|
3193
|
-
|
|
3194
|
-
function
|
|
3195
|
-
return !!((e === "v4" || !e) &&
|
|
3192
|
+
d(mr, "datetimeRegex");
|
|
3193
|
+
l.datetimeRegex = mr;
|
|
3194
|
+
function Ks(s, e) {
|
|
3195
|
+
return !!((e === "v4" || !e) && Fs.test(s) || (e === "v6" || !e) && Bs.test(s));
|
|
3196
3196
|
}
|
|
3197
|
-
d(
|
|
3198
|
-
function
|
|
3199
|
-
if (!
|
|
3197
|
+
d(Ks, "isValidIP");
|
|
3198
|
+
function Xs(s, e) {
|
|
3199
|
+
if (!Ms.test(s))
|
|
3200
3200
|
return !1;
|
|
3201
3201
|
try {
|
|
3202
3202
|
let [t] = s.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), i = JSON.parse(atob(
|
|
@@ -3206,12 +3206,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3206
3206
|
return !1;
|
|
3207
3207
|
}
|
|
3208
3208
|
}
|
|
3209
|
-
d(
|
|
3210
|
-
function
|
|
3211
|
-
return !!((e === "v4" || !e) && Hs.test(s) || (e === "v6" || !e) &&
|
|
3209
|
+
d(Xs, "isValidJWT");
|
|
3210
|
+
function Qs(s, e) {
|
|
3211
|
+
return !!((e === "v4" || !e) && Hs.test(s) || (e === "v6" || !e) && Ws.test(s));
|
|
3212
3212
|
}
|
|
3213
|
-
d(
|
|
3214
|
-
var
|
|
3213
|
+
d(Qs, "isValidCidr");
|
|
3214
|
+
var G = class s extends b {
|
|
3215
3215
|
static {
|
|
3216
3216
|
d(this, "ZodString");
|
|
3217
3217
|
}
|
|
@@ -3245,15 +3245,15 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3245
3245
|
message: n.message
|
|
3246
3246
|
}), r.dirty());
|
|
3247
3247
|
else if (n.kind === "length") {
|
|
3248
|
-
let
|
|
3249
|
-
(
|
|
3248
|
+
let a = e.data.length > n.value, o = e.data.length < n.value;
|
|
3249
|
+
(a || o) && (i = this._getOrReturnCtx(e, i), a ? (0, u.addIssueToContext)(i, {
|
|
3250
3250
|
code: f.ZodIssueCode.too_big,
|
|
3251
3251
|
maximum: n.value,
|
|
3252
3252
|
type: "string",
|
|
3253
3253
|
inclusive: !0,
|
|
3254
3254
|
exact: !0,
|
|
3255
3255
|
message: n.message
|
|
3256
|
-
}) :
|
|
3256
|
+
}) : o && (0, u.addIssueToContext)(i, {
|
|
3257
3257
|
code: f.ZodIssueCode.too_small,
|
|
3258
3258
|
minimum: n.value,
|
|
3259
3259
|
type: "string",
|
|
@@ -3268,37 +3268,37 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3268
3268
|
message: n.message
|
|
3269
3269
|
}), r.dirty());
|
|
3270
3270
|
else if (n.kind === "emoji")
|
|
3271
|
-
|
|
3271
|
+
It || (It = new RegExp(Us, "u")), It.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3272
3272
|
validation: "emoji",
|
|
3273
3273
|
code: f.ZodIssueCode.invalid_string,
|
|
3274
3274
|
message: n.message
|
|
3275
3275
|
}), r.dirty());
|
|
3276
3276
|
else if (n.kind === "uuid")
|
|
3277
|
-
|
|
3277
|
+
$s.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3278
3278
|
validation: "uuid",
|
|
3279
3279
|
code: f.ZodIssueCode.invalid_string,
|
|
3280
3280
|
message: n.message
|
|
3281
3281
|
}), r.dirty());
|
|
3282
3282
|
else if (n.kind === "nanoid")
|
|
3283
|
-
|
|
3283
|
+
Rs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3284
3284
|
validation: "nanoid",
|
|
3285
3285
|
code: f.ZodIssueCode.invalid_string,
|
|
3286
3286
|
message: n.message
|
|
3287
3287
|
}), r.dirty());
|
|
3288
3288
|
else if (n.kind === "cuid")
|
|
3289
|
-
|
|
3289
|
+
Ns.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3290
3290
|
validation: "cuid",
|
|
3291
3291
|
code: f.ZodIssueCode.invalid_string,
|
|
3292
3292
|
message: n.message
|
|
3293
3293
|
}), r.dirty());
|
|
3294
3294
|
else if (n.kind === "cuid2")
|
|
3295
|
-
|
|
3295
|
+
Vs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3296
3296
|
validation: "cuid2",
|
|
3297
3297
|
code: f.ZodIssueCode.invalid_string,
|
|
3298
3298
|
message: n.message
|
|
3299
3299
|
}), r.dirty());
|
|
3300
3300
|
else if (n.kind === "ulid")
|
|
3301
|
-
|
|
3301
|
+
Ds.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3302
3302
|
validation: "ulid",
|
|
3303
3303
|
code: f.ZodIssueCode.invalid_string,
|
|
3304
3304
|
message: n.message
|
|
@@ -3332,39 +3332,39 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3332
3332
|
code: f.ZodIssueCode.invalid_string,
|
|
3333
3333
|
validation: { endsWith: n.value },
|
|
3334
3334
|
message: n.message
|
|
3335
|
-
}), r.dirty()) : n.kind === "datetime" ?
|
|
3335
|
+
}), r.dirty()) : n.kind === "datetime" ? mr(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3336
3336
|
code: f.ZodIssueCode.invalid_string,
|
|
3337
3337
|
validation: "datetime",
|
|
3338
3338
|
message: n.message
|
|
3339
|
-
}), r.dirty()) : n.kind === "date" ?
|
|
3339
|
+
}), r.dirty()) : n.kind === "date" ? Js.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3340
3340
|
code: f.ZodIssueCode.invalid_string,
|
|
3341
3341
|
validation: "date",
|
|
3342
3342
|
message: n.message
|
|
3343
|
-
}), r.dirty()) : n.kind === "time" ?
|
|
3343
|
+
}), r.dirty()) : n.kind === "time" ? Ys(n).test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3344
3344
|
code: f.ZodIssueCode.invalid_string,
|
|
3345
3345
|
validation: "time",
|
|
3346
3346
|
message: n.message
|
|
3347
|
-
}), r.dirty()) : n.kind === "duration" ?
|
|
3347
|
+
}), r.dirty()) : n.kind === "duration" ? Ls.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3348
3348
|
validation: "duration",
|
|
3349
3349
|
code: f.ZodIssueCode.invalid_string,
|
|
3350
3350
|
message: n.message
|
|
3351
|
-
}), r.dirty()) : n.kind === "ip" ?
|
|
3351
|
+
}), r.dirty()) : n.kind === "ip" ? Ks(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3352
3352
|
validation: "ip",
|
|
3353
3353
|
code: f.ZodIssueCode.invalid_string,
|
|
3354
3354
|
message: n.message
|
|
3355
|
-
}), r.dirty()) : n.kind === "jwt" ?
|
|
3355
|
+
}), r.dirty()) : n.kind === "jwt" ? Xs(e.data, n.alg) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3356
3356
|
validation: "jwt",
|
|
3357
3357
|
code: f.ZodIssueCode.invalid_string,
|
|
3358
3358
|
message: n.message
|
|
3359
|
-
}), r.dirty()) : n.kind === "cidr" ?
|
|
3359
|
+
}), r.dirty()) : n.kind === "cidr" ? Qs(e.data, n.version) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3360
3360
|
validation: "cidr",
|
|
3361
3361
|
code: f.ZodIssueCode.invalid_string,
|
|
3362
3362
|
message: n.message
|
|
3363
|
-
}), r.dirty()) : n.kind === "base64" ?
|
|
3363
|
+
}), r.dirty()) : n.kind === "base64" ? zs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3364
3364
|
validation: "base64",
|
|
3365
3365
|
code: f.ZodIssueCode.invalid_string,
|
|
3366
3366
|
message: n.message
|
|
3367
|
-
}), r.dirty()) : n.kind === "base64url" ?
|
|
3367
|
+
}), r.dirty()) : n.kind === "base64url" ? Gs.test(e.data) || (i = this._getOrReturnCtx(e, i), (0, u.addIssueToContext)(i, {
|
|
3368
3368
|
validation: "base64url",
|
|
3369
3369
|
code: f.ZodIssueCode.invalid_string,
|
|
3370
3370
|
message: n.message
|
|
@@ -3594,23 +3594,23 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3594
3594
|
return e;
|
|
3595
3595
|
}
|
|
3596
3596
|
};
|
|
3597
|
-
|
|
3598
|
-
|
|
3597
|
+
l.ZodString = G;
|
|
3598
|
+
G.create = (s) => {
|
|
3599
3599
|
var e;
|
|
3600
|
-
return new
|
|
3600
|
+
return new G({
|
|
3601
3601
|
checks: [],
|
|
3602
3602
|
typeName: _.ZodString,
|
|
3603
3603
|
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3604
|
-
...
|
|
3604
|
+
...v(s)
|
|
3605
3605
|
});
|
|
3606
3606
|
};
|
|
3607
|
-
function
|
|
3607
|
+
function ei(s, e) {
|
|
3608
3608
|
let t = (s.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, i = t > r ? t : r, n = parseInt(s.toFixed(
|
|
3609
|
-
i).replace(".", "")),
|
|
3610
|
-
return n %
|
|
3609
|
+
i).replace(".", "")), a = parseInt(e.toFixed(i).replace(".", ""));
|
|
3610
|
+
return n % a / Math.pow(10, i);
|
|
3611
3611
|
}
|
|
3612
|
-
d(
|
|
3613
|
-
var Q = class s extends
|
|
3612
|
+
d(ei, "floatSafeRemainder");
|
|
3613
|
+
var Q = class s extends b {
|
|
3614
3614
|
static {
|
|
3615
3615
|
d(this, "ZodNumber");
|
|
3616
3616
|
}
|
|
@@ -3649,7 +3649,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3649
3649
|
inclusive: n.inclusive,
|
|
3650
3650
|
exact: !1,
|
|
3651
3651
|
message: n.message
|
|
3652
|
-
}), i.dirty()) : n.kind === "multipleOf" ?
|
|
3652
|
+
}), i.dirty()) : n.kind === "multipleOf" ? ei(e.data, n.value) !== 0 && (r = this._getOrReturnCtx(e, r), (0, u.addIssueToContext)(r,
|
|
3653
3653
|
{
|
|
3654
3654
|
code: f.ZodIssueCode.not_multiple_of,
|
|
3655
3655
|
multipleOf: n.value,
|
|
@@ -3781,14 +3781,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3781
3781
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
3782
3782
|
}
|
|
3783
3783
|
};
|
|
3784
|
-
|
|
3784
|
+
l.ZodNumber = Q;
|
|
3785
3785
|
Q.create = (s) => new Q({
|
|
3786
3786
|
checks: [],
|
|
3787
3787
|
typeName: _.ZodNumber,
|
|
3788
3788
|
coerce: s?.coerce || !1,
|
|
3789
|
-
...
|
|
3789
|
+
...v(s)
|
|
3790
3790
|
});
|
|
3791
|
-
var ee = class s extends
|
|
3791
|
+
var ee = class s extends b {
|
|
3792
3792
|
static {
|
|
3793
3793
|
d(this, "ZodBigInt");
|
|
3794
3794
|
}
|
|
@@ -3920,17 +3920,17 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3920
3920
|
return e;
|
|
3921
3921
|
}
|
|
3922
3922
|
};
|
|
3923
|
-
|
|
3923
|
+
l.ZodBigInt = ee;
|
|
3924
3924
|
ee.create = (s) => {
|
|
3925
3925
|
var e;
|
|
3926
3926
|
return new ee({
|
|
3927
3927
|
checks: [],
|
|
3928
3928
|
typeName: _.ZodBigInt,
|
|
3929
3929
|
coerce: (e = s?.coerce) !== null && e !== void 0 ? e : !1,
|
|
3930
|
-
...
|
|
3930
|
+
...v(s)
|
|
3931
3931
|
});
|
|
3932
3932
|
};
|
|
3933
|
-
var te = class extends
|
|
3933
|
+
var te = class extends b {
|
|
3934
3934
|
static {
|
|
3935
3935
|
d(this, "ZodBoolean");
|
|
3936
3936
|
}
|
|
@@ -3946,13 +3946,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
3946
3946
|
return (0, u.OK)(e.data);
|
|
3947
3947
|
}
|
|
3948
3948
|
};
|
|
3949
|
-
|
|
3949
|
+
l.ZodBoolean = te;
|
|
3950
3950
|
te.create = (s) => new te({
|
|
3951
3951
|
typeName: _.ZodBoolean,
|
|
3952
3952
|
coerce: s?.coerce || !1,
|
|
3953
|
-
...
|
|
3953
|
+
...v(s)
|
|
3954
3954
|
});
|
|
3955
|
-
var re = class s extends
|
|
3955
|
+
var re = class s extends b {
|
|
3956
3956
|
static {
|
|
3957
3957
|
d(this, "ZodDate");
|
|
3958
3958
|
}
|
|
@@ -4026,14 +4026,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4026
4026
|
return e != null ? new Date(e) : null;
|
|
4027
4027
|
}
|
|
4028
4028
|
};
|
|
4029
|
-
|
|
4029
|
+
l.ZodDate = re;
|
|
4030
4030
|
re.create = (s) => new re({
|
|
4031
4031
|
checks: [],
|
|
4032
4032
|
coerce: s?.coerce || !1,
|
|
4033
4033
|
typeName: _.ZodDate,
|
|
4034
|
-
...
|
|
4034
|
+
...v(s)
|
|
4035
4035
|
});
|
|
4036
|
-
var
|
|
4036
|
+
var ve = class extends b {
|
|
4037
4037
|
static {
|
|
4038
4038
|
d(this, "ZodSymbol");
|
|
4039
4039
|
}
|
|
@@ -4049,12 +4049,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4049
4049
|
return (0, u.OK)(e.data);
|
|
4050
4050
|
}
|
|
4051
4051
|
};
|
|
4052
|
-
|
|
4053
|
-
|
|
4052
|
+
l.ZodSymbol = ve;
|
|
4053
|
+
ve.create = (s) => new ve({
|
|
4054
4054
|
typeName: _.ZodSymbol,
|
|
4055
|
-
...
|
|
4055
|
+
...v(s)
|
|
4056
4056
|
});
|
|
4057
|
-
var se = class extends
|
|
4057
|
+
var se = class extends b {
|
|
4058
4058
|
static {
|
|
4059
4059
|
d(this, "ZodUndefined");
|
|
4060
4060
|
}
|
|
@@ -4070,12 +4070,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4070
4070
|
return (0, u.OK)(e.data);
|
|
4071
4071
|
}
|
|
4072
4072
|
};
|
|
4073
|
-
|
|
4073
|
+
l.ZodUndefined = se;
|
|
4074
4074
|
se.create = (s) => new se({
|
|
4075
4075
|
typeName: _.ZodUndefined,
|
|
4076
|
-
...
|
|
4076
|
+
...v(s)
|
|
4077
4077
|
});
|
|
4078
|
-
var ie = class extends
|
|
4078
|
+
var ie = class extends b {
|
|
4079
4079
|
static {
|
|
4080
4080
|
d(this, "ZodNull");
|
|
4081
4081
|
}
|
|
@@ -4091,12 +4091,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4091
4091
|
return (0, u.OK)(e.data);
|
|
4092
4092
|
}
|
|
4093
4093
|
};
|
|
4094
|
-
|
|
4094
|
+
l.ZodNull = ie;
|
|
4095
4095
|
ie.create = (s) => new ie({
|
|
4096
4096
|
typeName: _.ZodNull,
|
|
4097
|
-
...
|
|
4097
|
+
...v(s)
|
|
4098
4098
|
});
|
|
4099
|
-
var
|
|
4099
|
+
var J = class extends b {
|
|
4100
4100
|
static {
|
|
4101
4101
|
d(this, "ZodAny");
|
|
4102
4102
|
}
|
|
@@ -4107,12 +4107,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4107
4107
|
return (0, u.OK)(e.data);
|
|
4108
4108
|
}
|
|
4109
4109
|
};
|
|
4110
|
-
|
|
4111
|
-
|
|
4110
|
+
l.ZodAny = J;
|
|
4111
|
+
J.create = (s) => new J({
|
|
4112
4112
|
typeName: _.ZodAny,
|
|
4113
|
-
...
|
|
4113
|
+
...v(s)
|
|
4114
4114
|
});
|
|
4115
|
-
var
|
|
4115
|
+
var U = class extends b {
|
|
4116
4116
|
static {
|
|
4117
4117
|
d(this, "ZodUnknown");
|
|
4118
4118
|
}
|
|
@@ -4123,12 +4123,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4123
4123
|
return (0, u.OK)(e.data);
|
|
4124
4124
|
}
|
|
4125
4125
|
};
|
|
4126
|
-
|
|
4127
|
-
|
|
4126
|
+
l.ZodUnknown = U;
|
|
4127
|
+
U.create = (s) => new U({
|
|
4128
4128
|
typeName: _.ZodUnknown,
|
|
4129
|
-
...
|
|
4129
|
+
...v(s)
|
|
4130
4130
|
});
|
|
4131
|
-
var
|
|
4131
|
+
var D = class extends b {
|
|
4132
4132
|
static {
|
|
4133
4133
|
d(this, "ZodNever");
|
|
4134
4134
|
}
|
|
@@ -4141,12 +4141,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4141
4141
|
}), u.INVALID;
|
|
4142
4142
|
}
|
|
4143
4143
|
};
|
|
4144
|
-
|
|
4145
|
-
|
|
4144
|
+
l.ZodNever = D;
|
|
4145
|
+
D.create = (s) => new D({
|
|
4146
4146
|
typeName: _.ZodNever,
|
|
4147
|
-
...
|
|
4147
|
+
...v(s)
|
|
4148
4148
|
});
|
|
4149
|
-
var
|
|
4149
|
+
var be = class extends b {
|
|
4150
4150
|
static {
|
|
4151
4151
|
d(this, "ZodVoid");
|
|
4152
4152
|
}
|
|
@@ -4162,12 +4162,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4162
4162
|
return (0, u.OK)(e.data);
|
|
4163
4163
|
}
|
|
4164
4164
|
};
|
|
4165
|
-
|
|
4166
|
-
|
|
4165
|
+
l.ZodVoid = be;
|
|
4166
|
+
be.create = (s) => new be({
|
|
4167
4167
|
typeName: _.ZodVoid,
|
|
4168
|
-
...
|
|
4168
|
+
...v(s)
|
|
4169
4169
|
});
|
|
4170
|
-
var
|
|
4170
|
+
var F = class s extends b {
|
|
4171
4171
|
static {
|
|
4172
4172
|
d(this, "ZodArray");
|
|
4173
4173
|
}
|
|
@@ -4180,11 +4180,11 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4180
4180
|
received: t.parsedType
|
|
4181
4181
|
}), u.INVALID;
|
|
4182
4182
|
if (i.exactLength !== null) {
|
|
4183
|
-
let
|
|
4184
|
-
(
|
|
4185
|
-
code:
|
|
4186
|
-
minimum:
|
|
4187
|
-
maximum:
|
|
4183
|
+
let a = t.data.length > i.exactLength.value, o = t.data.length < i.exactLength.value;
|
|
4184
|
+
(a || o) && ((0, u.addIssueToContext)(t, {
|
|
4185
|
+
code: a ? f.ZodIssueCode.too_big : f.ZodIssueCode.too_small,
|
|
4186
|
+
minimum: o ? i.exactLength.value : void 0,
|
|
4187
|
+
maximum: a ? i.exactLength.value : void 0,
|
|
4188
4188
|
type: "array",
|
|
4189
4189
|
inclusive: !0,
|
|
4190
4190
|
exact: !0,
|
|
@@ -4206,8 +4206,8 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4206
4206
|
exact: !1,
|
|
4207
4207
|
message: i.maxLength.message
|
|
4208
4208
|
}), r.dirty()), t.common.async)
|
|
4209
|
-
return Promise.all([...t.data].map((
|
|
4210
|
-
let n = [...t.data].map((
|
|
4209
|
+
return Promise.all([...t.data].map((a, o) => i.type._parseAsync(new N(t, a, t.path, o)))).then((a) => u.ParseStatus.mergeArray(r, a));
|
|
4210
|
+
let n = [...t.data].map((a, o) => i.type._parseSync(new N(t, a, t.path, o)));
|
|
4211
4211
|
return u.ParseStatus.mergeArray(r, n);
|
|
4212
4212
|
}
|
|
4213
4213
|
get element() {
|
|
@@ -4235,34 +4235,34 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4235
4235
|
return this.min(1, e);
|
|
4236
4236
|
}
|
|
4237
4237
|
};
|
|
4238
|
-
|
|
4239
|
-
|
|
4238
|
+
l.ZodArray = F;
|
|
4239
|
+
F.create = (s, e) => new F({
|
|
4240
4240
|
type: s,
|
|
4241
4241
|
minLength: null,
|
|
4242
4242
|
maxLength: null,
|
|
4243
4243
|
exactLength: null,
|
|
4244
4244
|
typeName: _.ZodArray,
|
|
4245
|
-
...
|
|
4245
|
+
...v(e)
|
|
4246
4246
|
});
|
|
4247
4247
|
function _e(s) {
|
|
4248
|
-
if (s instanceof
|
|
4248
|
+
if (s instanceof A) {
|
|
4249
4249
|
let e = {};
|
|
4250
4250
|
for (let t in s.shape) {
|
|
4251
4251
|
let r = s.shape[t];
|
|
4252
|
-
e[t] =
|
|
4252
|
+
e[t] = P.create(_e(r));
|
|
4253
4253
|
}
|
|
4254
|
-
return new
|
|
4254
|
+
return new A({
|
|
4255
4255
|
...s._def,
|
|
4256
4256
|
shape: /* @__PURE__ */ d(() => e, "shape")
|
|
4257
4257
|
});
|
|
4258
|
-
} else return s instanceof
|
|
4258
|
+
} else return s instanceof F ? new F({
|
|
4259
4259
|
...s._def,
|
|
4260
4260
|
type: _e(s.element)
|
|
4261
|
-
}) : s instanceof
|
|
4261
|
+
}) : s instanceof P ? P.create(_e(s.unwrap())) : s instanceof M ? M.create(_e(s.unwrap())) : s instanceof R ? R.create(s.items.map((e) => _e(
|
|
4262
4262
|
e))) : s;
|
|
4263
4263
|
}
|
|
4264
4264
|
d(_e, "deepPartialify");
|
|
4265
|
-
var
|
|
4265
|
+
var A = class s extends b {
|
|
4266
4266
|
static {
|
|
4267
4267
|
d(this, "ZodObject");
|
|
4268
4268
|
}
|
|
@@ -4284,42 +4284,42 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4284
4284
|
received: h.parsedType
|
|
4285
4285
|
}), u.INVALID;
|
|
4286
4286
|
}
|
|
4287
|
-
let { status: r, ctx: i } = this._processInputParams(e), { shape: n, keys:
|
|
4288
|
-
if (!(this._def.catchall instanceof
|
|
4287
|
+
let { status: r, ctx: i } = this._processInputParams(e), { shape: n, keys: a } = this._getCached(), o = [];
|
|
4288
|
+
if (!(this._def.catchall instanceof D && this._def.unknownKeys === "strip"))
|
|
4289
4289
|
for (let h in i.data)
|
|
4290
|
-
|
|
4291
|
-
let
|
|
4292
|
-
for (let h of
|
|
4290
|
+
a.includes(h) || o.push(h);
|
|
4291
|
+
let c = [];
|
|
4292
|
+
for (let h of a) {
|
|
4293
4293
|
let p = n[h], y = i.data[h];
|
|
4294
|
-
|
|
4294
|
+
c.push({
|
|
4295
4295
|
key: { status: "valid", value: h },
|
|
4296
|
-
value: p._parse(new
|
|
4296
|
+
value: p._parse(new N(i, y, i.path, h)),
|
|
4297
4297
|
alwaysSet: h in i.data
|
|
4298
4298
|
});
|
|
4299
4299
|
}
|
|
4300
|
-
if (this._def.catchall instanceof
|
|
4300
|
+
if (this._def.catchall instanceof D) {
|
|
4301
4301
|
let h = this._def.unknownKeys;
|
|
4302
4302
|
if (h === "passthrough")
|
|
4303
|
-
for (let p of
|
|
4304
|
-
|
|
4303
|
+
for (let p of o)
|
|
4304
|
+
c.push({
|
|
4305
4305
|
key: { status: "valid", value: p },
|
|
4306
4306
|
value: { status: "valid", value: i.data[p] }
|
|
4307
4307
|
});
|
|
4308
4308
|
else if (h === "strict")
|
|
4309
|
-
|
|
4309
|
+
o.length > 0 && ((0, u.addIssueToContext)(i, {
|
|
4310
4310
|
code: f.ZodIssueCode.unrecognized_keys,
|
|
4311
|
-
keys:
|
|
4311
|
+
keys: o
|
|
4312
4312
|
}), r.dirty());
|
|
4313
4313
|
else if (h !== "strip")
|
|
4314
4314
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
4315
4315
|
} else {
|
|
4316
4316
|
let h = this._def.catchall;
|
|
4317
|
-
for (let p of
|
|
4317
|
+
for (let p of o) {
|
|
4318
4318
|
let y = i.data[p];
|
|
4319
|
-
|
|
4319
|
+
c.push({
|
|
4320
4320
|
key: { status: "valid", value: p },
|
|
4321
4321
|
value: h._parse(
|
|
4322
|
-
new
|
|
4322
|
+
new N(i, y, i.path, p)
|
|
4323
4323
|
//, ctx.child(key), value, getParsedType(value)
|
|
4324
4324
|
),
|
|
4325
4325
|
alwaysSet: p in i.data
|
|
@@ -4328,16 +4328,16 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4328
4328
|
}
|
|
4329
4329
|
return i.common.async ? Promise.resolve().then(async () => {
|
|
4330
4330
|
let h = [];
|
|
4331
|
-
for (let p of
|
|
4332
|
-
let y = await p.key,
|
|
4331
|
+
for (let p of c) {
|
|
4332
|
+
let y = await p.key, C = await p.value;
|
|
4333
4333
|
h.push({
|
|
4334
4334
|
key: y,
|
|
4335
|
-
value:
|
|
4335
|
+
value: C,
|
|
4336
4336
|
alwaysSet: p.alwaysSet
|
|
4337
4337
|
});
|
|
4338
4338
|
}
|
|
4339
4339
|
return h;
|
|
4340
|
-
}).then((h) => u.ParseStatus.mergeObjectSync(r, h)) : u.ParseStatus.mergeObjectSync(r,
|
|
4340
|
+
}).then((h) => u.ParseStatus.mergeObjectSync(r, h)) : u.ParseStatus.mergeObjectSync(r, c);
|
|
4341
4341
|
}
|
|
4342
4342
|
get shape() {
|
|
4343
4343
|
return this._def.shape();
|
|
@@ -4348,13 +4348,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4348
4348
|
unknownKeys: "strict",
|
|
4349
4349
|
...e !== void 0 ? {
|
|
4350
4350
|
errorMap: /* @__PURE__ */ d((t, r) => {
|
|
4351
|
-
var i, n,
|
|
4352
|
-
let
|
|
4353
|
-
|
|
4351
|
+
var i, n, a, o;
|
|
4352
|
+
let c = (a = (n = (i = this._def).errorMap) === null || n === void 0 ? void 0 : n.call(i, t, r).message) !== null && a !== void 0 ?
|
|
4353
|
+
a : r.defaultError;
|
|
4354
4354
|
return t.code === "unrecognized_keys" ? {
|
|
4355
|
-
message: (
|
|
4355
|
+
message: (o = g.errorUtil.errToObj(e).message) !== null && o !== void 0 ? o : c
|
|
4356
4356
|
} : {
|
|
4357
|
-
message:
|
|
4357
|
+
message: c
|
|
4358
4358
|
};
|
|
4359
4359
|
}, "errorMap")
|
|
4360
4360
|
} : {}
|
|
@@ -4520,7 +4520,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4520
4520
|
t[r] = this.shape[r];
|
|
4521
4521
|
else {
|
|
4522
4522
|
let n = this.shape[r];
|
|
4523
|
-
for (; n instanceof
|
|
4523
|
+
for (; n instanceof P; )
|
|
4524
4524
|
n = n._def.innerType;
|
|
4525
4525
|
t[r] = n;
|
|
4526
4526
|
}
|
|
@@ -4530,53 +4530,53 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4530
4530
|
});
|
|
4531
4531
|
}
|
|
4532
4532
|
keyof() {
|
|
4533
|
-
return
|
|
4533
|
+
return gr(m.util.objectKeys(this.shape));
|
|
4534
4534
|
}
|
|
4535
4535
|
};
|
|
4536
|
-
|
|
4537
|
-
|
|
4536
|
+
l.ZodObject = A;
|
|
4537
|
+
A.create = (s, e) => new A({
|
|
4538
4538
|
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4539
4539
|
unknownKeys: "strip",
|
|
4540
|
-
catchall:
|
|
4540
|
+
catchall: D.create(),
|
|
4541
4541
|
typeName: _.ZodObject,
|
|
4542
|
-
...
|
|
4542
|
+
...v(e)
|
|
4543
4543
|
});
|
|
4544
|
-
|
|
4544
|
+
A.strictCreate = (s, e) => new A({
|
|
4545
4545
|
shape: /* @__PURE__ */ d(() => s, "shape"),
|
|
4546
4546
|
unknownKeys: "strict",
|
|
4547
|
-
catchall:
|
|
4547
|
+
catchall: D.create(),
|
|
4548
4548
|
typeName: _.ZodObject,
|
|
4549
|
-
...
|
|
4549
|
+
...v(e)
|
|
4550
4550
|
});
|
|
4551
|
-
|
|
4551
|
+
A.lazycreate = (s, e) => new A({
|
|
4552
4552
|
shape: s,
|
|
4553
4553
|
unknownKeys: "strip",
|
|
4554
|
-
catchall:
|
|
4554
|
+
catchall: D.create(),
|
|
4555
4555
|
typeName: _.ZodObject,
|
|
4556
|
-
...
|
|
4556
|
+
...v(e)
|
|
4557
4557
|
});
|
|
4558
|
-
var ne = class extends
|
|
4558
|
+
var ne = class extends b {
|
|
4559
4559
|
static {
|
|
4560
4560
|
d(this, "ZodUnion");
|
|
4561
4561
|
}
|
|
4562
4562
|
_parse(e) {
|
|
4563
4563
|
let { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
4564
4564
|
function i(n) {
|
|
4565
|
-
for (let
|
|
4566
|
-
if (
|
|
4567
|
-
return
|
|
4568
|
-
for (let
|
|
4569
|
-
if (
|
|
4570
|
-
return t.common.issues.push(...
|
|
4571
|
-
let
|
|
4565
|
+
for (let o of n)
|
|
4566
|
+
if (o.result.status === "valid")
|
|
4567
|
+
return o.result;
|
|
4568
|
+
for (let o of n)
|
|
4569
|
+
if (o.result.status === "dirty")
|
|
4570
|
+
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
4571
|
+
let a = n.map((o) => new f.ZodError(o.ctx.common.issues));
|
|
4572
4572
|
return (0, u.addIssueToContext)(t, {
|
|
4573
4573
|
code: f.ZodIssueCode.invalid_union,
|
|
4574
|
-
unionErrors:
|
|
4574
|
+
unionErrors: a
|
|
4575
4575
|
}), u.INVALID;
|
|
4576
4576
|
}
|
|
4577
4577
|
if (d(i, "handleResults"), t.common.async)
|
|
4578
4578
|
return Promise.all(r.map(async (n) => {
|
|
4579
|
-
let
|
|
4579
|
+
let a = {
|
|
4580
4580
|
...t,
|
|
4581
4581
|
common: {
|
|
4582
4582
|
...t.common,
|
|
@@ -4588,14 +4588,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4588
4588
|
result: await n._parseAsync({
|
|
4589
4589
|
data: t.data,
|
|
4590
4590
|
path: t.path,
|
|
4591
|
-
parent:
|
|
4591
|
+
parent: a
|
|
4592
4592
|
}),
|
|
4593
|
-
ctx:
|
|
4593
|
+
ctx: a
|
|
4594
4594
|
};
|
|
4595
4595
|
})).then(i);
|
|
4596
4596
|
{
|
|
4597
|
-
let n,
|
|
4598
|
-
for (let
|
|
4597
|
+
let n, a = [];
|
|
4598
|
+
for (let c of r) {
|
|
4599
4599
|
let h = {
|
|
4600
4600
|
...t,
|
|
4601
4601
|
common: {
|
|
@@ -4603,21 +4603,21 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4603
4603
|
issues: []
|
|
4604
4604
|
},
|
|
4605
4605
|
parent: null
|
|
4606
|
-
}, p =
|
|
4606
|
+
}, p = c._parseSync({
|
|
4607
4607
|
data: t.data,
|
|
4608
4608
|
path: t.path,
|
|
4609
4609
|
parent: h
|
|
4610
4610
|
});
|
|
4611
4611
|
if (p.status === "valid")
|
|
4612
4612
|
return p;
|
|
4613
|
-
p.status === "dirty" && !n && (n = { result: p, ctx: h }), h.common.issues.length &&
|
|
4613
|
+
p.status === "dirty" && !n && (n = { result: p, ctx: h }), h.common.issues.length && a.push(h.common.issues);
|
|
4614
4614
|
}
|
|
4615
4615
|
if (n)
|
|
4616
4616
|
return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
4617
|
-
let
|
|
4617
|
+
let o = a.map((c) => new f.ZodError(c));
|
|
4618
4618
|
return (0, u.addIssueToContext)(t, {
|
|
4619
4619
|
code: f.ZodIssueCode.invalid_union,
|
|
4620
|
-
unionErrors:
|
|
4620
|
+
unionErrors: o
|
|
4621
4621
|
}), u.INVALID;
|
|
4622
4622
|
}
|
|
4623
4623
|
}
|
|
@@ -4625,16 +4625,16 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4625
4625
|
return this._def.options;
|
|
4626
4626
|
}
|
|
4627
4627
|
};
|
|
4628
|
-
|
|
4628
|
+
l.ZodUnion = ne;
|
|
4629
4629
|
ne.create = (s, e) => new ne({
|
|
4630
4630
|
options: s,
|
|
4631
4631
|
typeName: _.ZodUnion,
|
|
4632
|
-
...
|
|
4632
|
+
...v(e)
|
|
4633
4633
|
});
|
|
4634
|
-
var
|
|
4635
|
-
|
|
4636
|
-
ie ? [null] : s instanceof
|
|
4637
|
-
|
|
4634
|
+
var q = /* @__PURE__ */ d((s) => s instanceof oe ? q(s.schema) : s instanceof S ? q(s.innerType()) : s instanceof de ? [s.value] : s instanceof
|
|
4635
|
+
le ? s.options : s instanceof ue ? m.util.objectValues(s.enum) : s instanceof ce ? q(s._def.innerType) : s instanceof se ? [void 0] : s instanceof
|
|
4636
|
+
ie ? [null] : s instanceof P ? [void 0, ...q(s.unwrap())] : s instanceof M ? [null, ...q(s.unwrap())] : s instanceof Pe || s instanceof pe ?
|
|
4637
|
+
q(s.unwrap()) : s instanceof he ? q(s._def.innerType) : [], "getDiscriminator"), We = class s extends b {
|
|
4638
4638
|
static {
|
|
4639
4639
|
d(this, "ZodDiscriminatedUnion");
|
|
4640
4640
|
}
|
|
@@ -4681,13 +4681,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4681
4681
|
static create(e, t, r) {
|
|
4682
4682
|
let i = /* @__PURE__ */ new Map();
|
|
4683
4683
|
for (let n of t) {
|
|
4684
|
-
let
|
|
4685
|
-
if (!
|
|
4684
|
+
let a = q(n.shape[e]);
|
|
4685
|
+
if (!a.length)
|
|
4686
4686
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
4687
|
-
for (let
|
|
4688
|
-
if (i.has(
|
|
4689
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
4690
|
-
i.set(
|
|
4687
|
+
for (let o of a) {
|
|
4688
|
+
if (i.has(o))
|
|
4689
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
|
|
4690
|
+
i.set(o, n);
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
4693
|
return new s({
|
|
@@ -4695,48 +4695,48 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4695
4695
|
discriminator: e,
|
|
4696
4696
|
options: t,
|
|
4697
4697
|
optionsMap: i,
|
|
4698
|
-
...
|
|
4698
|
+
...v(r)
|
|
4699
4699
|
});
|
|
4700
4700
|
}
|
|
4701
4701
|
};
|
|
4702
|
-
|
|
4703
|
-
function
|
|
4702
|
+
l.ZodDiscriminatedUnion = We;
|
|
4703
|
+
function Tt(s, e) {
|
|
4704
4704
|
let t = (0, m.getParsedType)(s), r = (0, m.getParsedType)(e);
|
|
4705
4705
|
if (s === e)
|
|
4706
4706
|
return { valid: !0, data: s };
|
|
4707
4707
|
if (t === m.ZodParsedType.object && r === m.ZodParsedType.object) {
|
|
4708
|
-
let i = m.util.objectKeys(e), n = m.util.objectKeys(s).filter((
|
|
4709
|
-
for (let
|
|
4710
|
-
let
|
|
4711
|
-
if (!
|
|
4708
|
+
let i = m.util.objectKeys(e), n = m.util.objectKeys(s).filter((o) => i.indexOf(o) !== -1), a = { ...s, ...e };
|
|
4709
|
+
for (let o of n) {
|
|
4710
|
+
let c = Tt(s[o], e[o]);
|
|
4711
|
+
if (!c.valid)
|
|
4712
4712
|
return { valid: !1 };
|
|
4713
|
-
o
|
|
4713
|
+
a[o] = c.data;
|
|
4714
4714
|
}
|
|
4715
|
-
return { valid: !0, data:
|
|
4715
|
+
return { valid: !0, data: a };
|
|
4716
4716
|
} else if (t === m.ZodParsedType.array && r === m.ZodParsedType.array) {
|
|
4717
4717
|
if (s.length !== e.length)
|
|
4718
4718
|
return { valid: !1 };
|
|
4719
4719
|
let i = [];
|
|
4720
4720
|
for (let n = 0; n < s.length; n++) {
|
|
4721
|
-
let
|
|
4722
|
-
if (!
|
|
4721
|
+
let a = s[n], o = e[n], c = Tt(a, o);
|
|
4722
|
+
if (!c.valid)
|
|
4723
4723
|
return { valid: !1 };
|
|
4724
|
-
i.push(
|
|
4724
|
+
i.push(c.data);
|
|
4725
4725
|
}
|
|
4726
4726
|
return { valid: !0, data: i };
|
|
4727
4727
|
} else return t === m.ZodParsedType.date && r === m.ZodParsedType.date && +s == +e ? { valid: !0, data: s } : { valid: !1 };
|
|
4728
4728
|
}
|
|
4729
|
-
d(
|
|
4730
|
-
var
|
|
4729
|
+
d(Tt, "mergeValues");
|
|
4730
|
+
var ae = class extends b {
|
|
4731
4731
|
static {
|
|
4732
4732
|
d(this, "ZodIntersection");
|
|
4733
4733
|
}
|
|
4734
4734
|
_parse(e) {
|
|
4735
|
-
let { status: t, ctx: r } = this._processInputParams(e), i = /* @__PURE__ */ d((n,
|
|
4736
|
-
if ((0, u.isAborted)(n) || (0, u.isAborted)(
|
|
4735
|
+
let { status: t, ctx: r } = this._processInputParams(e), i = /* @__PURE__ */ d((n, a) => {
|
|
4736
|
+
if ((0, u.isAborted)(n) || (0, u.isAborted)(a))
|
|
4737
4737
|
return u.INVALID;
|
|
4738
|
-
let
|
|
4739
|
-
return
|
|
4738
|
+
let o = Tt(n.value, a.value);
|
|
4739
|
+
return o.valid ? (((0, u.isDirty)(n) || (0, u.isDirty)(a)) && t.dirty(), { status: t.value, value: o.data }) : ((0, u.addIssueToContext)(
|
|
4740
4740
|
r, {
|
|
4741
4741
|
code: f.ZodIssueCode.invalid_intersection_types
|
|
4742
4742
|
}), u.INVALID);
|
|
@@ -4752,7 +4752,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4752
4752
|
path: r.path,
|
|
4753
4753
|
parent: r
|
|
4754
4754
|
})
|
|
4755
|
-
]).then(([n,
|
|
4755
|
+
]).then(([n, a]) => i(n, a)) : i(this._def.left._parseSync({
|
|
4756
4756
|
data: r.data,
|
|
4757
4757
|
path: r.path,
|
|
4758
4758
|
parent: r
|
|
@@ -4763,14 +4763,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4763
4763
|
}));
|
|
4764
4764
|
}
|
|
4765
4765
|
};
|
|
4766
|
-
|
|
4767
|
-
|
|
4766
|
+
l.ZodIntersection = ae;
|
|
4767
|
+
ae.create = (s, e, t) => new ae({
|
|
4768
4768
|
left: s,
|
|
4769
4769
|
right: e,
|
|
4770
4770
|
typeName: _.ZodIntersection,
|
|
4771
|
-
...
|
|
4771
|
+
...v(t)
|
|
4772
4772
|
});
|
|
4773
|
-
var
|
|
4773
|
+
var R = class s extends b {
|
|
4774
4774
|
static {
|
|
4775
4775
|
d(this, "ZodTuple");
|
|
4776
4776
|
}
|
|
@@ -4797,11 +4797,11 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4797
4797
|
exact: !1,
|
|
4798
4798
|
type: "array"
|
|
4799
4799
|
}), t.dirty());
|
|
4800
|
-
let n = [...r.data].map((
|
|
4801
|
-
let
|
|
4802
|
-
return
|
|
4803
|
-
}).filter((
|
|
4804
|
-
return r.common.async ? Promise.all(n).then((
|
|
4800
|
+
let n = [...r.data].map((a, o) => {
|
|
4801
|
+
let c = this._def.items[o] || this._def.rest;
|
|
4802
|
+
return c ? c._parse(new N(r, a, r.path, o)) : null;
|
|
4803
|
+
}).filter((a) => !!a);
|
|
4804
|
+
return r.common.async ? Promise.all(n).then((a) => u.ParseStatus.mergeArray(t, a)) : u.ParseStatus.mergeArray(t, n);
|
|
4805
4805
|
}
|
|
4806
4806
|
get items() {
|
|
4807
4807
|
return this._def.items;
|
|
@@ -4813,18 +4813,18 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4813
4813
|
});
|
|
4814
4814
|
}
|
|
4815
4815
|
};
|
|
4816
|
-
|
|
4817
|
-
|
|
4816
|
+
l.ZodTuple = R;
|
|
4817
|
+
R.create = (s, e) => {
|
|
4818
4818
|
if (!Array.isArray(s))
|
|
4819
4819
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4820
|
-
return new
|
|
4820
|
+
return new R({
|
|
4821
4821
|
items: s,
|
|
4822
4822
|
typeName: _.ZodTuple,
|
|
4823
4823
|
rest: null,
|
|
4824
|
-
...
|
|
4824
|
+
...v(e)
|
|
4825
4825
|
});
|
|
4826
4826
|
};
|
|
4827
|
-
var
|
|
4827
|
+
var ze = class s extends b {
|
|
4828
4828
|
static {
|
|
4829
4829
|
d(this, "ZodRecord");
|
|
4830
4830
|
}
|
|
@@ -4842,12 +4842,12 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4842
4842
|
expected: m.ZodParsedType.object,
|
|
4843
4843
|
received: r.parsedType
|
|
4844
4844
|
}), u.INVALID;
|
|
4845
|
-
let i = [], n = this._def.keyType,
|
|
4846
|
-
for (let
|
|
4845
|
+
let i = [], n = this._def.keyType, a = this._def.valueType;
|
|
4846
|
+
for (let o in r.data)
|
|
4847
4847
|
i.push({
|
|
4848
|
-
key: n._parse(new
|
|
4849
|
-
value:
|
|
4850
|
-
alwaysSet:
|
|
4848
|
+
key: n._parse(new N(r, o, r.path, o)),
|
|
4849
|
+
value: a._parse(new N(r, r.data[o], r.path, o)),
|
|
4850
|
+
alwaysSet: o in r.data
|
|
4851
4851
|
});
|
|
4852
4852
|
return r.common.async ? u.ParseStatus.mergeObjectAsync(t, i) : u.ParseStatus.mergeObjectSync(t, i);
|
|
4853
4853
|
}
|
|
@@ -4855,21 +4855,21 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4855
4855
|
return this._def.valueType;
|
|
4856
4856
|
}
|
|
4857
4857
|
static create(e, t, r) {
|
|
4858
|
-
return t instanceof
|
|
4858
|
+
return t instanceof b ? new s({
|
|
4859
4859
|
keyType: e,
|
|
4860
4860
|
valueType: t,
|
|
4861
4861
|
typeName: _.ZodRecord,
|
|
4862
|
-
...
|
|
4862
|
+
...v(r)
|
|
4863
4863
|
}) : new s({
|
|
4864
|
-
keyType:
|
|
4864
|
+
keyType: G.create(),
|
|
4865
4865
|
valueType: e,
|
|
4866
4866
|
typeName: _.ZodRecord,
|
|
4867
|
-
...
|
|
4867
|
+
...v(t)
|
|
4868
4868
|
});
|
|
4869
4869
|
}
|
|
4870
4870
|
};
|
|
4871
|
-
|
|
4872
|
-
var xe = class extends
|
|
4871
|
+
l.ZodRecord = ze;
|
|
4872
|
+
var xe = class extends b {
|
|
4873
4873
|
static {
|
|
4874
4874
|
d(this, "ZodMap");
|
|
4875
4875
|
}
|
|
@@ -4887,41 +4887,41 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4887
4887
|
expected: m.ZodParsedType.map,
|
|
4888
4888
|
received: r.parsedType
|
|
4889
4889
|
}), u.INVALID;
|
|
4890
|
-
let i = this._def.keyType, n = this._def.valueType,
|
|
4891
|
-
key: i._parse(new
|
|
4892
|
-
value: n._parse(new
|
|
4890
|
+
let i = this._def.keyType, n = this._def.valueType, a = [...r.data.entries()].map(([o, c], h) => ({
|
|
4891
|
+
key: i._parse(new N(r, o, r.path, [h, "key"])),
|
|
4892
|
+
value: n._parse(new N(r, c, r.path, [h, "value"]))
|
|
4893
4893
|
}));
|
|
4894
4894
|
if (r.common.async) {
|
|
4895
|
-
let
|
|
4895
|
+
let o = /* @__PURE__ */ new Map();
|
|
4896
4896
|
return Promise.resolve().then(async () => {
|
|
4897
|
-
for (let
|
|
4898
|
-
let h = await
|
|
4897
|
+
for (let c of a) {
|
|
4898
|
+
let h = await c.key, p = await c.value;
|
|
4899
4899
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4900
4900
|
return u.INVALID;
|
|
4901
|
-
(h.status === "dirty" || p.status === "dirty") && t.dirty(),
|
|
4901
|
+
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4902
4902
|
}
|
|
4903
|
-
return { status: t.value, value:
|
|
4903
|
+
return { status: t.value, value: o };
|
|
4904
4904
|
});
|
|
4905
4905
|
} else {
|
|
4906
|
-
let
|
|
4907
|
-
for (let
|
|
4908
|
-
let h =
|
|
4906
|
+
let o = /* @__PURE__ */ new Map();
|
|
4907
|
+
for (let c of a) {
|
|
4908
|
+
let h = c.key, p = c.value;
|
|
4909
4909
|
if (h.status === "aborted" || p.status === "aborted")
|
|
4910
4910
|
return u.INVALID;
|
|
4911
|
-
(h.status === "dirty" || p.status === "dirty") && t.dirty(),
|
|
4911
|
+
(h.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(h.value, p.value);
|
|
4912
4912
|
}
|
|
4913
|
-
return { status: t.value, value:
|
|
4913
|
+
return { status: t.value, value: o };
|
|
4914
4914
|
}
|
|
4915
4915
|
}
|
|
4916
4916
|
};
|
|
4917
|
-
|
|
4917
|
+
l.ZodMap = xe;
|
|
4918
4918
|
xe.create = (s, e, t) => new xe({
|
|
4919
4919
|
valueType: e,
|
|
4920
4920
|
keyType: s,
|
|
4921
4921
|
typeName: _.ZodMap,
|
|
4922
|
-
...
|
|
4922
|
+
...v(t)
|
|
4923
4923
|
});
|
|
4924
|
-
var
|
|
4924
|
+
var we = class s extends b {
|
|
4925
4925
|
static {
|
|
4926
4926
|
d(this, "ZodSet");
|
|
4927
4927
|
}
|
|
@@ -4950,18 +4950,18 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4950
4950
|
message: i.maxSize.message
|
|
4951
4951
|
}), t.dirty());
|
|
4952
4952
|
let n = this._def.valueType;
|
|
4953
|
-
function
|
|
4953
|
+
function a(c) {
|
|
4954
4954
|
let h = /* @__PURE__ */ new Set();
|
|
4955
|
-
for (let p of
|
|
4955
|
+
for (let p of c) {
|
|
4956
4956
|
if (p.status === "aborted")
|
|
4957
4957
|
return u.INVALID;
|
|
4958
4958
|
p.status === "dirty" && t.dirty(), h.add(p.value);
|
|
4959
4959
|
}
|
|
4960
4960
|
return { status: t.value, value: h };
|
|
4961
4961
|
}
|
|
4962
|
-
d(
|
|
4963
|
-
let
|
|
4964
|
-
return r.common.async ? Promise.all(
|
|
4962
|
+
d(a, "finalizeSet");
|
|
4963
|
+
let o = [...r.data.values()].map((c, h) => n._parse(new N(r, c, r.path, h)));
|
|
4964
|
+
return r.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
4965
4965
|
}
|
|
4966
4966
|
min(e, t) {
|
|
4967
4967
|
return new s({
|
|
@@ -4982,15 +4982,15 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
4982
4982
|
return this.min(1, e);
|
|
4983
4983
|
}
|
|
4984
4984
|
};
|
|
4985
|
-
|
|
4986
|
-
|
|
4985
|
+
l.ZodSet = we;
|
|
4986
|
+
we.create = (s, e) => new we({
|
|
4987
4987
|
valueType: s,
|
|
4988
4988
|
minSize: null,
|
|
4989
4989
|
maxSize: null,
|
|
4990
4990
|
typeName: _.ZodSet,
|
|
4991
|
-
...
|
|
4991
|
+
...v(e)
|
|
4992
4992
|
});
|
|
4993
|
-
var
|
|
4993
|
+
var Ge = class s extends b {
|
|
4994
4994
|
static {
|
|
4995
4995
|
d(this, "ZodFunction");
|
|
4996
4996
|
}
|
|
@@ -5005,58 +5005,58 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5005
5005
|
expected: m.ZodParsedType.function,
|
|
5006
5006
|
received: t.parsedType
|
|
5007
5007
|
}), u.INVALID;
|
|
5008
|
-
function r(
|
|
5008
|
+
function r(o, c) {
|
|
5009
5009
|
return (0, u.makeIssue)({
|
|
5010
|
-
data:
|
|
5010
|
+
data: o,
|
|
5011
5011
|
path: t.path,
|
|
5012
5012
|
errorMaps: [
|
|
5013
5013
|
t.common.contextualErrorMap,
|
|
5014
5014
|
t.schemaErrorMap,
|
|
5015
|
-
(0,
|
|
5016
|
-
|
|
5015
|
+
(0, He.getErrorMap)(),
|
|
5016
|
+
He.defaultErrorMap
|
|
5017
5017
|
].filter((h) => !!h),
|
|
5018
5018
|
issueData: {
|
|
5019
5019
|
code: f.ZodIssueCode.invalid_arguments,
|
|
5020
|
-
argumentsError:
|
|
5020
|
+
argumentsError: c
|
|
5021
5021
|
}
|
|
5022
5022
|
});
|
|
5023
5023
|
}
|
|
5024
5024
|
d(r, "makeArgsIssue");
|
|
5025
|
-
function i(
|
|
5025
|
+
function i(o, c) {
|
|
5026
5026
|
return (0, u.makeIssue)({
|
|
5027
|
-
data:
|
|
5027
|
+
data: o,
|
|
5028
5028
|
path: t.path,
|
|
5029
5029
|
errorMaps: [
|
|
5030
5030
|
t.common.contextualErrorMap,
|
|
5031
5031
|
t.schemaErrorMap,
|
|
5032
|
-
(0,
|
|
5033
|
-
|
|
5032
|
+
(0, He.getErrorMap)(),
|
|
5033
|
+
He.defaultErrorMap
|
|
5034
5034
|
].filter((h) => !!h),
|
|
5035
5035
|
issueData: {
|
|
5036
5036
|
code: f.ZodIssueCode.invalid_return_type,
|
|
5037
|
-
returnTypeError:
|
|
5037
|
+
returnTypeError: c
|
|
5038
5038
|
}
|
|
5039
5039
|
});
|
|
5040
5040
|
}
|
|
5041
5041
|
d(i, "makeReturnsIssue");
|
|
5042
|
-
let n = { errorMap: t.common.contextualErrorMap },
|
|
5043
|
-
if (this._def.returns instanceof
|
|
5044
|
-
let
|
|
5045
|
-
return (0, u.OK)(async function(...
|
|
5046
|
-
let h = new f.ZodError([]), p = await
|
|
5047
|
-
throw h.addIssue(r(
|
|
5048
|
-
}), y = await Reflect.apply(
|
|
5049
|
-
return await
|
|
5050
|
-
throw h.addIssue(i(y,
|
|
5042
|
+
let n = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
5043
|
+
if (this._def.returns instanceof Y) {
|
|
5044
|
+
let o = this;
|
|
5045
|
+
return (0, u.OK)(async function(...c) {
|
|
5046
|
+
let h = new f.ZodError([]), p = await o._def.args.parseAsync(c, n).catch((j) => {
|
|
5047
|
+
throw h.addIssue(r(c, j)), h;
|
|
5048
|
+
}), y = await Reflect.apply(a, this, p);
|
|
5049
|
+
return await o._def.returns._def.type.parseAsync(y, n).catch((j) => {
|
|
5050
|
+
throw h.addIssue(i(y, j)), h;
|
|
5051
5051
|
});
|
|
5052
5052
|
});
|
|
5053
5053
|
} else {
|
|
5054
|
-
let
|
|
5055
|
-
return (0, u.OK)(function(...
|
|
5056
|
-
let h =
|
|
5054
|
+
let o = this;
|
|
5055
|
+
return (0, u.OK)(function(...c) {
|
|
5056
|
+
let h = o._def.args.safeParse(c, n);
|
|
5057
5057
|
if (!h.success)
|
|
5058
|
-
throw new f.ZodError([r(
|
|
5059
|
-
let p = Reflect.apply(
|
|
5058
|
+
throw new f.ZodError([r(c, h.error)]);
|
|
5059
|
+
let p = Reflect.apply(a, this, h.data), y = o._def.returns.safeParse(p, n);
|
|
5060
5060
|
if (!y.success)
|
|
5061
5061
|
throw new f.ZodError([i(p, y.error)]);
|
|
5062
5062
|
return y.data;
|
|
@@ -5072,7 +5072,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5072
5072
|
args(...e) {
|
|
5073
5073
|
return new s({
|
|
5074
5074
|
...this._def,
|
|
5075
|
-
args:
|
|
5075
|
+
args: R.create(e).rest(U.create())
|
|
5076
5076
|
});
|
|
5077
5077
|
}
|
|
5078
5078
|
returns(e) {
|
|
@@ -5089,15 +5089,15 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5089
5089
|
}
|
|
5090
5090
|
static create(e, t, r) {
|
|
5091
5091
|
return new s({
|
|
5092
|
-
args: e ||
|
|
5093
|
-
returns: t ||
|
|
5092
|
+
args: e || R.create([]).rest(U.create()),
|
|
5093
|
+
returns: t || U.create(),
|
|
5094
5094
|
typeName: _.ZodFunction,
|
|
5095
|
-
...
|
|
5095
|
+
...v(r)
|
|
5096
5096
|
});
|
|
5097
5097
|
}
|
|
5098
5098
|
};
|
|
5099
|
-
|
|
5100
|
-
var
|
|
5099
|
+
l.ZodFunction = Ge;
|
|
5100
|
+
var oe = class extends b {
|
|
5101
5101
|
static {
|
|
5102
5102
|
d(this, "ZodLazy");
|
|
5103
5103
|
}
|
|
@@ -5109,13 +5109,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5109
5109
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
5110
5110
|
}
|
|
5111
5111
|
};
|
|
5112
|
-
|
|
5113
|
-
|
|
5112
|
+
l.ZodLazy = oe;
|
|
5113
|
+
oe.create = (s, e) => new oe({
|
|
5114
5114
|
getter: s,
|
|
5115
5115
|
typeName: _.ZodLazy,
|
|
5116
|
-
...
|
|
5116
|
+
...v(e)
|
|
5117
5117
|
});
|
|
5118
|
-
var de = class extends
|
|
5118
|
+
var de = class extends b {
|
|
5119
5119
|
static {
|
|
5120
5120
|
d(this, "ZodLiteral");
|
|
5121
5121
|
}
|
|
@@ -5134,26 +5134,26 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5134
5134
|
return this._def.value;
|
|
5135
5135
|
}
|
|
5136
5136
|
};
|
|
5137
|
-
|
|
5137
|
+
l.ZodLiteral = de;
|
|
5138
5138
|
de.create = (s, e) => new de({
|
|
5139
5139
|
value: s,
|
|
5140
5140
|
typeName: _.ZodLiteral,
|
|
5141
|
-
...
|
|
5141
|
+
...v(e)
|
|
5142
5142
|
});
|
|
5143
|
-
function
|
|
5144
|
-
return new
|
|
5143
|
+
function gr(s, e) {
|
|
5144
|
+
return new le({
|
|
5145
5145
|
values: s,
|
|
5146
5146
|
typeName: _.ZodEnum,
|
|
5147
|
-
...
|
|
5147
|
+
...v(e)
|
|
5148
5148
|
});
|
|
5149
5149
|
}
|
|
5150
|
-
d(
|
|
5151
|
-
var
|
|
5150
|
+
d(gr, "createZodEnum");
|
|
5151
|
+
var le = class s extends b {
|
|
5152
5152
|
static {
|
|
5153
5153
|
d(this, "ZodEnum");
|
|
5154
5154
|
}
|
|
5155
5155
|
constructor() {
|
|
5156
|
-
super(...arguments),
|
|
5156
|
+
super(...arguments), Se.set(this, void 0);
|
|
5157
5157
|
}
|
|
5158
5158
|
_parse(e) {
|
|
5159
5159
|
if (typeof e.data != "string") {
|
|
@@ -5164,7 +5164,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5164
5164
|
code: f.ZodIssueCode.invalid_type
|
|
5165
5165
|
}), u.INVALID;
|
|
5166
5166
|
}
|
|
5167
|
-
if (Be(this,
|
|
5167
|
+
if (Be(this, Se, "f") || hr(this, Se, new Set(this._def.values), "f"), !Be(this, Se, "f").has(e.data)) {
|
|
5168
5168
|
let t = this._getOrReturnCtx(e), r = this._def.values;
|
|
5169
5169
|
return (0, u.addIssueToContext)(t, {
|
|
5170
5170
|
received: t.data,
|
|
@@ -5208,15 +5208,15 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5208
5208
|
});
|
|
5209
5209
|
}
|
|
5210
5210
|
};
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
var ue = class extends
|
|
5211
|
+
l.ZodEnum = le;
|
|
5212
|
+
Se = /* @__PURE__ */ new WeakMap();
|
|
5213
|
+
le.create = gr;
|
|
5214
|
+
var ue = class extends b {
|
|
5215
5215
|
static {
|
|
5216
5216
|
d(this, "ZodNativeEnum");
|
|
5217
5217
|
}
|
|
5218
5218
|
constructor() {
|
|
5219
|
-
super(...arguments),
|
|
5219
|
+
super(...arguments), Ee.set(this, void 0);
|
|
5220
5220
|
}
|
|
5221
5221
|
_parse(e) {
|
|
5222
5222
|
let t = m.util.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
@@ -5228,7 +5228,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5228
5228
|
code: f.ZodIssueCode.invalid_type
|
|
5229
5229
|
}), u.INVALID;
|
|
5230
5230
|
}
|
|
5231
|
-
if (Be(this,
|
|
5231
|
+
if (Be(this, Ee, "f") || hr(this, Ee, new Set(m.util.getValidEnumValues(this._def.values)), "f"), !Be(this, Ee, "f").has(e.data)) {
|
|
5232
5232
|
let i = m.util.objectValues(t);
|
|
5233
5233
|
return (0, u.addIssueToContext)(r, {
|
|
5234
5234
|
received: r.data,
|
|
@@ -5242,14 +5242,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5242
5242
|
return this._def.values;
|
|
5243
5243
|
}
|
|
5244
5244
|
};
|
|
5245
|
-
|
|
5246
|
-
|
|
5245
|
+
l.ZodNativeEnum = ue;
|
|
5246
|
+
Ee = /* @__PURE__ */ new WeakMap();
|
|
5247
5247
|
ue.create = (s, e) => new ue({
|
|
5248
5248
|
values: s,
|
|
5249
5249
|
typeName: _.ZodNativeEnum,
|
|
5250
|
-
...
|
|
5250
|
+
...v(e)
|
|
5251
5251
|
});
|
|
5252
|
-
var
|
|
5252
|
+
var Y = class extends b {
|
|
5253
5253
|
static {
|
|
5254
5254
|
d(this, "ZodPromise");
|
|
5255
5255
|
}
|
|
@@ -5271,13 +5271,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5271
5271
|
})));
|
|
5272
5272
|
}
|
|
5273
5273
|
};
|
|
5274
|
-
|
|
5275
|
-
|
|
5274
|
+
l.ZodPromise = Y;
|
|
5275
|
+
Y.create = (s, e) => new Y({
|
|
5276
5276
|
type: s,
|
|
5277
5277
|
typeName: _.ZodPromise,
|
|
5278
|
-
...
|
|
5278
|
+
...v(e)
|
|
5279
5279
|
});
|
|
5280
|
-
var
|
|
5280
|
+
var S = class extends b {
|
|
5281
5281
|
static {
|
|
5282
5282
|
d(this, "ZodEffects");
|
|
5283
5283
|
}
|
|
@@ -5289,91 +5289,91 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5289
5289
|
}
|
|
5290
5290
|
_parse(e) {
|
|
5291
5291
|
let { status: t, ctx: r } = this._processInputParams(e), i = this._def.effect || null, n = {
|
|
5292
|
-
addIssue: /* @__PURE__ */ d((
|
|
5293
|
-
(0, u.addIssueToContext)(r,
|
|
5292
|
+
addIssue: /* @__PURE__ */ d((a) => {
|
|
5293
|
+
(0, u.addIssueToContext)(r, a), a.fatal ? t.abort() : t.dirty();
|
|
5294
5294
|
}, "addIssue"),
|
|
5295
5295
|
get path() {
|
|
5296
5296
|
return r.path;
|
|
5297
5297
|
}
|
|
5298
5298
|
};
|
|
5299
5299
|
if (n.addIssue = n.addIssue.bind(n), i.type === "preprocess") {
|
|
5300
|
-
let
|
|
5300
|
+
let a = i.transform(r.data, n);
|
|
5301
5301
|
if (r.common.async)
|
|
5302
|
-
return Promise.resolve(
|
|
5302
|
+
return Promise.resolve(a).then(async (o) => {
|
|
5303
5303
|
if (t.value === "aborted")
|
|
5304
5304
|
return u.INVALID;
|
|
5305
|
-
let
|
|
5306
|
-
data:
|
|
5305
|
+
let c = await this._def.schema._parseAsync({
|
|
5306
|
+
data: o,
|
|
5307
5307
|
path: r.path,
|
|
5308
5308
|
parent: r
|
|
5309
5309
|
});
|
|
5310
|
-
return
|
|
5310
|
+
return c.status === "aborted" ? u.INVALID : c.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(c.value) : c;
|
|
5311
5311
|
});
|
|
5312
5312
|
{
|
|
5313
5313
|
if (t.value === "aborted")
|
|
5314
5314
|
return u.INVALID;
|
|
5315
|
-
let
|
|
5316
|
-
data:
|
|
5315
|
+
let o = this._def.schema._parseSync({
|
|
5316
|
+
data: a,
|
|
5317
5317
|
path: r.path,
|
|
5318
5318
|
parent: r
|
|
5319
5319
|
});
|
|
5320
|
-
return
|
|
5320
|
+
return o.status === "aborted" ? u.INVALID : o.status === "dirty" || t.value === "dirty" ? (0, u.DIRTY)(o.value) : o;
|
|
5321
5321
|
}
|
|
5322
5322
|
}
|
|
5323
5323
|
if (i.type === "refinement") {
|
|
5324
|
-
let
|
|
5325
|
-
let
|
|
5324
|
+
let a = /* @__PURE__ */ d((o) => {
|
|
5325
|
+
let c = i.refinement(o, n);
|
|
5326
5326
|
if (r.common.async)
|
|
5327
|
-
return Promise.resolve(
|
|
5328
|
-
if (
|
|
5327
|
+
return Promise.resolve(c);
|
|
5328
|
+
if (c instanceof Promise)
|
|
5329
5329
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5330
|
-
return
|
|
5330
|
+
return o;
|
|
5331
5331
|
}, "executeRefinement");
|
|
5332
5332
|
if (r.common.async === !1) {
|
|
5333
|
-
let
|
|
5333
|
+
let o = this._def.schema._parseSync({
|
|
5334
5334
|
data: r.data,
|
|
5335
5335
|
path: r.path,
|
|
5336
5336
|
parent: r
|
|
5337
5337
|
});
|
|
5338
|
-
return
|
|
5338
|
+
return o.status === "aborted" ? u.INVALID : (o.status === "dirty" && t.dirty(), a(o.value), { status: t.value, value: o.value });
|
|
5339
5339
|
} else
|
|
5340
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((
|
|
5341
|
-
status === "dirty" && t.dirty(), o
|
|
5340
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? u.INVALID : (o.
|
|
5341
|
+
status === "dirty" && t.dirty(), a(o.value).then(() => ({ status: t.value, value: o.value }))));
|
|
5342
5342
|
}
|
|
5343
5343
|
if (i.type === "transform")
|
|
5344
5344
|
if (r.common.async === !1) {
|
|
5345
|
-
let
|
|
5345
|
+
let a = this._def.schema._parseSync({
|
|
5346
5346
|
data: r.data,
|
|
5347
5347
|
path: r.path,
|
|
5348
5348
|
parent: r
|
|
5349
5349
|
});
|
|
5350
|
-
if (!(0, u.isValid)(
|
|
5351
|
-
return
|
|
5352
|
-
let
|
|
5353
|
-
if (
|
|
5350
|
+
if (!(0, u.isValid)(a))
|
|
5351
|
+
return a;
|
|
5352
|
+
let o = i.transform(a.value, n);
|
|
5353
|
+
if (o instanceof Promise)
|
|
5354
5354
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
5355
|
-
return { status: t.value, value:
|
|
5355
|
+
return { status: t.value, value: o };
|
|
5356
5356
|
} else
|
|
5357
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((
|
|
5358
|
-
|
|
5357
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((a) => (0, u.isValid)(a) ? Promise.resolve(i.transform(
|
|
5358
|
+
a.value, n)).then((o) => ({ status: t.value, value: o })) : a);
|
|
5359
5359
|
m.util.assertNever(i);
|
|
5360
5360
|
}
|
|
5361
5361
|
};
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5362
|
+
l.ZodEffects = S;
|
|
5363
|
+
l.ZodTransformer = S;
|
|
5364
|
+
S.create = (s, e, t) => new S({
|
|
5365
5365
|
schema: s,
|
|
5366
5366
|
typeName: _.ZodEffects,
|
|
5367
5367
|
effect: e,
|
|
5368
|
-
...
|
|
5368
|
+
...v(t)
|
|
5369
5369
|
});
|
|
5370
|
-
|
|
5370
|
+
S.createWithPreprocess = (s, e, t) => new S({
|
|
5371
5371
|
schema: e,
|
|
5372
5372
|
effect: { type: "preprocess", transform: s },
|
|
5373
5373
|
typeName: _.ZodEffects,
|
|
5374
|
-
...
|
|
5374
|
+
...v(t)
|
|
5375
5375
|
});
|
|
5376
|
-
var
|
|
5376
|
+
var P = class extends b {
|
|
5377
5377
|
static {
|
|
5378
5378
|
d(this, "ZodOptional");
|
|
5379
5379
|
}
|
|
@@ -5384,13 +5384,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5384
5384
|
return this._def.innerType;
|
|
5385
5385
|
}
|
|
5386
5386
|
};
|
|
5387
|
-
|
|
5388
|
-
|
|
5387
|
+
l.ZodOptional = P;
|
|
5388
|
+
P.create = (s, e) => new P({
|
|
5389
5389
|
innerType: s,
|
|
5390
5390
|
typeName: _.ZodOptional,
|
|
5391
|
-
...
|
|
5391
|
+
...v(e)
|
|
5392
5392
|
});
|
|
5393
|
-
var M = class extends
|
|
5393
|
+
var M = class extends b {
|
|
5394
5394
|
static {
|
|
5395
5395
|
d(this, "ZodNullable");
|
|
5396
5396
|
}
|
|
@@ -5401,13 +5401,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5401
5401
|
return this._def.innerType;
|
|
5402
5402
|
}
|
|
5403
5403
|
};
|
|
5404
|
-
|
|
5404
|
+
l.ZodNullable = M;
|
|
5405
5405
|
M.create = (s, e) => new M({
|
|
5406
5406
|
innerType: s,
|
|
5407
5407
|
typeName: _.ZodNullable,
|
|
5408
|
-
...
|
|
5408
|
+
...v(e)
|
|
5409
5409
|
});
|
|
5410
|
-
var
|
|
5410
|
+
var ce = class extends b {
|
|
5411
5411
|
static {
|
|
5412
5412
|
d(this, "ZodDefault");
|
|
5413
5413
|
}
|
|
@@ -5423,14 +5423,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5423
5423
|
return this._def.innerType;
|
|
5424
5424
|
}
|
|
5425
5425
|
};
|
|
5426
|
-
|
|
5427
|
-
|
|
5426
|
+
l.ZodDefault = ce;
|
|
5427
|
+
ce.create = (s, e) => new ce({
|
|
5428
5428
|
innerType: s,
|
|
5429
5429
|
typeName: _.ZodDefault,
|
|
5430
5430
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
5431
|
-
...
|
|
5431
|
+
...v(e)
|
|
5432
5432
|
});
|
|
5433
|
-
var he = class extends
|
|
5433
|
+
var he = class extends b {
|
|
5434
5434
|
static {
|
|
5435
5435
|
d(this, "ZodCatch");
|
|
5436
5436
|
}
|
|
@@ -5470,14 +5470,14 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5470
5470
|
return this._def.innerType;
|
|
5471
5471
|
}
|
|
5472
5472
|
};
|
|
5473
|
-
|
|
5473
|
+
l.ZodCatch = he;
|
|
5474
5474
|
he.create = (s, e) => new he({
|
|
5475
5475
|
innerType: s,
|
|
5476
5476
|
typeName: _.ZodCatch,
|
|
5477
5477
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
5478
|
-
...
|
|
5478
|
+
...v(e)
|
|
5479
5479
|
});
|
|
5480
|
-
var
|
|
5480
|
+
var Ce = class extends b {
|
|
5481
5481
|
static {
|
|
5482
5482
|
d(this, "ZodNaN");
|
|
5483
5483
|
}
|
|
@@ -5493,13 +5493,13 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5493
5493
|
return { status: "valid", value: e.data };
|
|
5494
5494
|
}
|
|
5495
5495
|
};
|
|
5496
|
-
|
|
5497
|
-
|
|
5496
|
+
l.ZodNaN = Ce;
|
|
5497
|
+
Ce.create = (s) => new Ce({
|
|
5498
5498
|
typeName: _.ZodNaN,
|
|
5499
|
-
...
|
|
5499
|
+
...v(s)
|
|
5500
5500
|
});
|
|
5501
|
-
|
|
5502
|
-
var
|
|
5501
|
+
l.BRAND = Symbol("zod_brand");
|
|
5502
|
+
var Pe = class extends b {
|
|
5503
5503
|
static {
|
|
5504
5504
|
d(this, "ZodBranded");
|
|
5505
5505
|
}
|
|
@@ -5515,8 +5515,8 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5515
5515
|
return this._def.type;
|
|
5516
5516
|
}
|
|
5517
5517
|
};
|
|
5518
|
-
|
|
5519
|
-
var
|
|
5518
|
+
l.ZodBranded = Pe;
|
|
5519
|
+
var Ne = class s extends b {
|
|
5520
5520
|
static {
|
|
5521
5521
|
d(this, "ZodPipeline");
|
|
5522
5522
|
}
|
|
@@ -5560,8 +5560,8 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
|
|
|
5560
5560
|
});
|
|
5561
5561
|
}
|
|
5562
5562
|
};
|
|
5563
|
-
|
|
5564
|
-
var pe = class extends
|
|
5563
|
+
l.ZodPipeline = Ne;
|
|
5564
|
+
var pe = class extends b {
|
|
5565
5565
|
static {
|
|
5566
5566
|
d(this, "ZodReadonly");
|
|
5567
5567
|
}
|
|
@@ -5574,39 +5574,39 @@ eze");
|
|
|
5574
5574
|
return this._def.innerType;
|
|
5575
5575
|
}
|
|
5576
5576
|
};
|
|
5577
|
-
|
|
5577
|
+
l.ZodReadonly = pe;
|
|
5578
5578
|
pe.create = (s, e) => new pe({
|
|
5579
5579
|
innerType: s,
|
|
5580
5580
|
typeName: _.ZodReadonly,
|
|
5581
|
-
...
|
|
5581
|
+
...v(e)
|
|
5582
5582
|
});
|
|
5583
|
-
function
|
|
5583
|
+
function cr(s, e) {
|
|
5584
5584
|
let t = typeof s == "function" ? s(e) : typeof s == "string" ? { message: s } : s;
|
|
5585
5585
|
return typeof t == "string" ? { message: t } : t;
|
|
5586
5586
|
}
|
|
5587
|
-
d(
|
|
5588
|
-
function
|
|
5589
|
-
return s ?
|
|
5590
|
-
var n,
|
|
5591
|
-
let
|
|
5592
|
-
if (
|
|
5593
|
-
return
|
|
5587
|
+
d(cr, "cleanParams");
|
|
5588
|
+
function yr(s, e = {}, t) {
|
|
5589
|
+
return s ? J.create().superRefine((r, i) => {
|
|
5590
|
+
var n, a;
|
|
5591
|
+
let o = s(r);
|
|
5592
|
+
if (o instanceof Promise)
|
|
5593
|
+
return o.then((c) => {
|
|
5594
5594
|
var h, p;
|
|
5595
|
-
if (!
|
|
5596
|
-
let y =
|
|
5597
|
-
i.addIssue({ code: "custom", ...y, fatal:
|
|
5595
|
+
if (!c) {
|
|
5596
|
+
let y = cr(e, r), C = (p = (h = y.fatal) !== null && h !== void 0 ? h : t) !== null && p !== void 0 ? p : !0;
|
|
5597
|
+
i.addIssue({ code: "custom", ...y, fatal: C });
|
|
5598
5598
|
}
|
|
5599
5599
|
});
|
|
5600
|
-
if (!
|
|
5601
|
-
let
|
|
5602
|
-
i.addIssue({ code: "custom", ...
|
|
5600
|
+
if (!o) {
|
|
5601
|
+
let c = cr(e, r), h = (a = (n = c.fatal) !== null && n !== void 0 ? n : t) !== null && a !== void 0 ? a : !0;
|
|
5602
|
+
i.addIssue({ code: "custom", ...c, fatal: h });
|
|
5603
5603
|
}
|
|
5604
|
-
}) :
|
|
5604
|
+
}) : J.create();
|
|
5605
5605
|
}
|
|
5606
|
-
d(
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
object:
|
|
5606
|
+
d(yr, "custom");
|
|
5607
|
+
l.custom = yr;
|
|
5608
|
+
l.late = {
|
|
5609
|
+
object: A.lazycreate
|
|
5610
5610
|
};
|
|
5611
5611
|
var _;
|
|
5612
5612
|
(function(s) {
|
|
@@ -5618,88 +5618,88 @@ known", s.ZodNever = "ZodNever", s.ZodVoid = "ZodVoid", s.ZodArray = "ZodArray",
|
|
|
5618
5618
|
"ZodEffects", s.ZodNativeEnum = "ZodNativeEnum", s.ZodOptional = "ZodOptional", s.ZodNullable = "ZodNullable", s.ZodDefault = "ZodDefaul\
|
|
5619
5619
|
t", s.ZodCatch = "ZodCatch", s.ZodPromise = "ZodPromise", s.ZodBranded = "ZodBranded", s.ZodPipeline = "ZodPipeline", s.ZodReadonly = "ZodRe\
|
|
5620
5620
|
adonly";
|
|
5621
|
-
})(_ || (
|
|
5622
|
-
var
|
|
5621
|
+
})(_ || (l.ZodFirstPartyTypeKind = _ = {}));
|
|
5622
|
+
var ti = /* @__PURE__ */ d((s, e = {
|
|
5623
5623
|
message: `Input not instance of ${s.name}`
|
|
5624
|
-
}) =>
|
|
5625
|
-
|
|
5626
|
-
var
|
|
5627
|
-
|
|
5628
|
-
var
|
|
5629
|
-
|
|
5630
|
-
var
|
|
5631
|
-
|
|
5632
|
-
var
|
|
5633
|
-
|
|
5634
|
-
var
|
|
5635
|
-
|
|
5636
|
-
var
|
|
5637
|
-
|
|
5638
|
-
var
|
|
5639
|
-
|
|
5640
|
-
var
|
|
5641
|
-
|
|
5642
|
-
var
|
|
5643
|
-
|
|
5644
|
-
var
|
|
5645
|
-
|
|
5646
|
-
var li =
|
|
5647
|
-
|
|
5648
|
-
var
|
|
5649
|
-
|
|
5650
|
-
var
|
|
5651
|
-
|
|
5652
|
-
var
|
|
5653
|
-
|
|
5654
|
-
var
|
|
5655
|
-
|
|
5656
|
-
var
|
|
5657
|
-
|
|
5658
|
-
var
|
|
5659
|
-
|
|
5660
|
-
var
|
|
5661
|
-
|
|
5662
|
-
var
|
|
5663
|
-
|
|
5664
|
-
var
|
|
5665
|
-
|
|
5666
|
-
var
|
|
5667
|
-
|
|
5668
|
-
var
|
|
5669
|
-
|
|
5670
|
-
var
|
|
5671
|
-
|
|
5672
|
-
var
|
|
5673
|
-
|
|
5674
|
-
var
|
|
5675
|
-
|
|
5676
|
-
var
|
|
5677
|
-
|
|
5678
|
-
var
|
|
5679
|
-
|
|
5680
|
-
var
|
|
5681
|
-
|
|
5682
|
-
var
|
|
5683
|
-
|
|
5684
|
-
var
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
var
|
|
5688
|
-
|
|
5689
|
-
var
|
|
5690
|
-
|
|
5691
|
-
var
|
|
5692
|
-
|
|
5693
|
-
var
|
|
5694
|
-
|
|
5695
|
-
var
|
|
5696
|
-
|
|
5697
|
-
var
|
|
5698
|
-
|
|
5699
|
-
var
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
string: /* @__PURE__ */ d((s) =>
|
|
5624
|
+
}) => yr((t) => t instanceof s, e), "instanceOfType");
|
|
5625
|
+
l.instanceof = ti;
|
|
5626
|
+
var _r = G.create;
|
|
5627
|
+
l.string = _r;
|
|
5628
|
+
var vr = Q.create;
|
|
5629
|
+
l.number = vr;
|
|
5630
|
+
var ri = Ce.create;
|
|
5631
|
+
l.nan = ri;
|
|
5632
|
+
var si = ee.create;
|
|
5633
|
+
l.bigint = si;
|
|
5634
|
+
var br = te.create;
|
|
5635
|
+
l.boolean = br;
|
|
5636
|
+
var ii = re.create;
|
|
5637
|
+
l.date = ii;
|
|
5638
|
+
var ni = ve.create;
|
|
5639
|
+
l.symbol = ni;
|
|
5640
|
+
var ai = se.create;
|
|
5641
|
+
l.undefined = ai;
|
|
5642
|
+
var oi = ie.create;
|
|
5643
|
+
l.null = oi;
|
|
5644
|
+
var di = J.create;
|
|
5645
|
+
l.any = di;
|
|
5646
|
+
var li = U.create;
|
|
5647
|
+
l.unknown = li;
|
|
5648
|
+
var ui = D.create;
|
|
5649
|
+
l.never = ui;
|
|
5650
|
+
var ci = be.create;
|
|
5651
|
+
l.void = ci;
|
|
5652
|
+
var hi = F.create;
|
|
5653
|
+
l.array = hi;
|
|
5654
|
+
var pi = A.create;
|
|
5655
|
+
l.object = pi;
|
|
5656
|
+
var fi = A.strictCreate;
|
|
5657
|
+
l.strictObject = fi;
|
|
5658
|
+
var mi = ne.create;
|
|
5659
|
+
l.union = mi;
|
|
5660
|
+
var gi = We.create;
|
|
5661
|
+
l.discriminatedUnion = gi;
|
|
5662
|
+
var yi = ae.create;
|
|
5663
|
+
l.intersection = yi;
|
|
5664
|
+
var _i = R.create;
|
|
5665
|
+
l.tuple = _i;
|
|
5666
|
+
var vi = ze.create;
|
|
5667
|
+
l.record = vi;
|
|
5668
|
+
var bi = xe.create;
|
|
5669
|
+
l.map = bi;
|
|
5670
|
+
var xi = we.create;
|
|
5671
|
+
l.set = xi;
|
|
5672
|
+
var wi = Ge.create;
|
|
5673
|
+
l.function = wi;
|
|
5674
|
+
var Ci = oe.create;
|
|
5675
|
+
l.lazy = Ci;
|
|
5676
|
+
var ki = de.create;
|
|
5677
|
+
l.literal = ki;
|
|
5678
|
+
var Ii = le.create;
|
|
5679
|
+
l.enum = Ii;
|
|
5680
|
+
var Ti = ue.create;
|
|
5681
|
+
l.nativeEnum = Ti;
|
|
5682
|
+
var Oi = Y.create;
|
|
5683
|
+
l.promise = Oi;
|
|
5684
|
+
var xr = S.create;
|
|
5685
|
+
l.effect = xr;
|
|
5686
|
+
l.transformer = xr;
|
|
5687
|
+
var Ai = P.create;
|
|
5688
|
+
l.optional = Ai;
|
|
5689
|
+
var Zi = M.create;
|
|
5690
|
+
l.nullable = Zi;
|
|
5691
|
+
var ji = S.createWithPreprocess;
|
|
5692
|
+
l.preprocess = ji;
|
|
5693
|
+
var Si = Ne.create;
|
|
5694
|
+
l.pipeline = Si;
|
|
5695
|
+
var Ei = /* @__PURE__ */ d(() => _r().optional(), "ostring");
|
|
5696
|
+
l.ostring = Ei;
|
|
5697
|
+
var Pi = /* @__PURE__ */ d(() => vr().optional(), "onumber");
|
|
5698
|
+
l.onumber = Pi;
|
|
5699
|
+
var Ni = /* @__PURE__ */ d(() => br().optional(), "oboolean");
|
|
5700
|
+
l.oboolean = Ni;
|
|
5701
|
+
l.coerce = {
|
|
5702
|
+
string: /* @__PURE__ */ d((s) => G.create({ ...s, coerce: !0 }), "string"),
|
|
5703
5703
|
number: /* @__PURE__ */ d((s) => Q.create({ ...s, coerce: !0 }), "number"),
|
|
5704
5704
|
boolean: /* @__PURE__ */ d((s) => te.create({
|
|
5705
5705
|
...s,
|
|
@@ -5708,13 +5708,13 @@ adonly";
|
|
|
5708
5708
|
bigint: /* @__PURE__ */ d((s) => ee.create({ ...s, coerce: !0 }), "bigint"),
|
|
5709
5709
|
date: /* @__PURE__ */ d((s) => re.create({ ...s, coerce: !0 }), "date")
|
|
5710
5710
|
};
|
|
5711
|
-
|
|
5711
|
+
l.NEVER = u.INVALID;
|
|
5712
5712
|
});
|
|
5713
5713
|
|
|
5714
5714
|
// ../node_modules/zod/lib/external.js
|
|
5715
|
-
var
|
|
5715
|
+
var Ot = T((V) => {
|
|
5716
5716
|
"use strict";
|
|
5717
|
-
var
|
|
5717
|
+
var Vi = V && V.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5718
5718
|
r === void 0 && (r = t);
|
|
5719
5719
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5720
5720
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
@@ -5722,22 +5722,22 @@ var At = O((N) => {
|
|
|
5722
5722
|
}, "get") }), Object.defineProperty(s, r, i);
|
|
5723
5723
|
} : function(s, e, t, r) {
|
|
5724
5724
|
r === void 0 && (r = t), s[r] = e[t];
|
|
5725
|
-
}),
|
|
5726
|
-
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
5725
|
+
}), ke = V && V.__exportStar || function(s, e) {
|
|
5726
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Vi(e, s, t);
|
|
5727
5727
|
};
|
|
5728
|
-
Object.defineProperty(
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5728
|
+
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
5729
|
+
ke(Ue(), V);
|
|
5730
|
+
ke(kt(), V);
|
|
5731
|
+
ke(or(), V);
|
|
5732
|
+
ke(Ze(), V);
|
|
5733
|
+
ke(wr(), V);
|
|
5734
|
+
ke(qe(), V);
|
|
5735
5735
|
});
|
|
5736
5736
|
|
|
5737
5737
|
// ../node_modules/zod/lib/index.js
|
|
5738
|
-
var
|
|
5738
|
+
var Ir = T((Z) => {
|
|
5739
5739
|
"use strict";
|
|
5740
|
-
var
|
|
5740
|
+
var Cr = Z && Z.__createBinding || (Object.create ? function(s, e, t, r) {
|
|
5741
5741
|
r === void 0 && (r = t);
|
|
5742
5742
|
var i = Object.getOwnPropertyDescriptor(e, t);
|
|
5743
5743
|
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: /* @__PURE__ */ d(function() {
|
|
@@ -5745,60 +5745,60 @@ var Tr = O((A) => {
|
|
|
5745
5745
|
}, "get") }), Object.defineProperty(s, r, i);
|
|
5746
5746
|
} : function(s, e, t, r) {
|
|
5747
5747
|
r === void 0 && (r = t), s[r] = e[t];
|
|
5748
|
-
}),
|
|
5748
|
+
}), Di = Z && Z.__setModuleDefault || (Object.create ? function(s, e) {
|
|
5749
5749
|
Object.defineProperty(s, "default", { enumerable: !0, value: e });
|
|
5750
5750
|
} : function(s, e) {
|
|
5751
5751
|
s.default = e;
|
|
5752
|
-
}),
|
|
5752
|
+
}), $i = Z && Z.__importStar || function(s) {
|
|
5753
5753
|
if (s && s.__esModule) return s;
|
|
5754
5754
|
var e = {};
|
|
5755
|
-
if (s != null) for (var t in s) t !== "default" && Object.prototype.hasOwnProperty.call(s, t) &&
|
|
5756
|
-
return
|
|
5757
|
-
},
|
|
5758
|
-
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
5755
|
+
if (s != null) for (var t in s) t !== "default" && Object.prototype.hasOwnProperty.call(s, t) && Cr(e, s, t);
|
|
5756
|
+
return Di(e, s), e;
|
|
5757
|
+
}, Ri = Z && Z.__exportStar || function(s, e) {
|
|
5758
|
+
for (var t in s) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Cr(e, s, t);
|
|
5759
5759
|
};
|
|
5760
|
-
Object.defineProperty(
|
|
5761
|
-
|
|
5762
|
-
var
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5760
|
+
Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
5761
|
+
Z.z = void 0;
|
|
5762
|
+
var kr = $i(Ot());
|
|
5763
|
+
Z.z = kr;
|
|
5764
|
+
Ri(Ot(), Z);
|
|
5765
|
+
Z.default = kr;
|
|
5766
5766
|
});
|
|
5767
5767
|
|
|
5768
5768
|
// src/cli/bin/index.ts
|
|
5769
|
-
var
|
|
5770
|
-
import { getEnvConfig as
|
|
5771
|
-
import { logTracker as
|
|
5772
|
-
import { addToGlobalContext as
|
|
5769
|
+
var Ve = ye(Ft(), 1);
|
|
5770
|
+
import { getEnvConfig as jt, optionalEnvToBoolean as Ar, parseList as Bi } from "storybook/internal/common";
|
|
5771
|
+
import { logTracker as Zt, logger as fe } from "storybook/internal/node-logger";
|
|
5772
|
+
import { addToGlobalContext as Wi } from "storybook/internal/telemetry";
|
|
5773
5773
|
|
|
5774
5774
|
// ../node_modules/fd-package-json/dist/esm/main.js
|
|
5775
|
-
var
|
|
5776
|
-
import { resolve as
|
|
5777
|
-
import { stat as
|
|
5778
|
-
import { statSync as
|
|
5779
|
-
async function
|
|
5775
|
+
var Wt = ye(Bt(), 1);
|
|
5776
|
+
import { resolve as Kr } from "node:path";
|
|
5777
|
+
import { stat as Xr, readFile as Qr } from "node:fs/promises";
|
|
5778
|
+
import { statSync as pn, readFileSync as fn } from "node:fs";
|
|
5779
|
+
async function es(s) {
|
|
5780
5780
|
try {
|
|
5781
|
-
return (await
|
|
5781
|
+
return (await Xr(s)).isFile();
|
|
5782
5782
|
} catch {
|
|
5783
5783
|
return !1;
|
|
5784
5784
|
}
|
|
5785
5785
|
}
|
|
5786
|
-
d(
|
|
5787
|
-
async function
|
|
5788
|
-
for (let e of (0,
|
|
5789
|
-
let t =
|
|
5790
|
-
if (await
|
|
5786
|
+
d(es, "fileExists");
|
|
5787
|
+
async function ts(s) {
|
|
5788
|
+
for (let e of (0, Wt.walkUp)(s)) {
|
|
5789
|
+
let t = Kr(e, "package.json");
|
|
5790
|
+
if (await es(t))
|
|
5791
5791
|
return t;
|
|
5792
5792
|
}
|
|
5793
5793
|
return null;
|
|
5794
5794
|
}
|
|
5795
|
-
d(
|
|
5795
|
+
d(ts, "findPackagePath");
|
|
5796
5796
|
async function B(s) {
|
|
5797
|
-
let e = await
|
|
5797
|
+
let e = await ts(s);
|
|
5798
5798
|
if (!e)
|
|
5799
5799
|
return null;
|
|
5800
5800
|
try {
|
|
5801
|
-
let t = await
|
|
5801
|
+
let t = await Qr(e, { encoding: "utf8" });
|
|
5802
5802
|
return JSON.parse(t);
|
|
5803
5803
|
} catch {
|
|
5804
5804
|
return null;
|
|
@@ -5807,8 +5807,8 @@ async function B(s) {
|
|
|
5807
5807
|
d(B, "findPackage");
|
|
5808
5808
|
|
|
5809
5809
|
// ../node_modules/leven/index.js
|
|
5810
|
-
var
|
|
5811
|
-
function
|
|
5810
|
+
var pt = [], zt = [];
|
|
5811
|
+
function ft(s, e) {
|
|
5812
5812
|
if (s === e)
|
|
5813
5813
|
return 0;
|
|
5814
5814
|
let t = s;
|
|
@@ -5821,215 +5821,143 @@ function gt(s, e) {
|
|
|
5821
5821
|
n++;
|
|
5822
5822
|
if (r -= n, i -= n, r === 0)
|
|
5823
5823
|
return i;
|
|
5824
|
-
let
|
|
5824
|
+
let a, o, c, h, p = 0, y = 0;
|
|
5825
5825
|
for (; p < r; )
|
|
5826
|
-
|
|
5826
|
+
zt[p] = s.charCodeAt(n + p), pt[p] = ++p;
|
|
5827
5827
|
for (; y < i; )
|
|
5828
|
-
for (
|
|
5829
|
-
h =
|
|
5830
|
-
return
|
|
5828
|
+
for (a = e.charCodeAt(n + y), c = y++, o = y, p = 0; p < r; p++)
|
|
5829
|
+
h = a === zt[p] ? c : c + 1, c = pt[p], o = pt[p] = c > o ? h > o ? o + 1 : h : h > c ? c + 1 : h;
|
|
5830
|
+
return o;
|
|
5831
5831
|
}
|
|
5832
|
-
d(
|
|
5832
|
+
d(ft, "leven");
|
|
5833
5833
|
|
|
5834
5834
|
// src/cli/bin/index.ts
|
|
5835
|
-
var me = ye(
|
|
5835
|
+
var me = ye(Yt(), 1);
|
|
5836
5836
|
|
|
5837
5837
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
5838
|
-
var
|
|
5839
|
-
function
|
|
5838
|
+
var ns = process.env.NODE_ENV === "production", gt = "Invariant failed";
|
|
5839
|
+
function W(s, e) {
|
|
5840
5840
|
if (!s) {
|
|
5841
|
-
if (
|
|
5842
|
-
throw new Error(
|
|
5843
|
-
var t = typeof e == "function" ? e() : e, r = t ? "".concat(
|
|
5841
|
+
if (ns)
|
|
5842
|
+
throw new Error(gt);
|
|
5843
|
+
var t = typeof e == "function" ? e() : e, r = t ? "".concat(gt, ": ").concat(t) : gt;
|
|
5844
5844
|
throw new Error(r);
|
|
5845
5845
|
}
|
|
5846
5846
|
}
|
|
5847
|
-
d(
|
|
5847
|
+
d(W, "invariant");
|
|
5848
5848
|
|
|
5849
5849
|
// package.json
|
|
5850
|
-
var
|
|
5850
|
+
var yt = "9.2.0-alpha.1";
|
|
5851
5851
|
|
|
5852
5852
|
// src/cli/build.ts
|
|
5853
|
-
import { cache as
|
|
5854
|
-
import { buildStaticStandalone as
|
|
5855
|
-
var
|
|
5853
|
+
import { cache as os } from "storybook/internal/common";
|
|
5854
|
+
import { buildStaticStandalone as ds, withTelemetry as ls } from "storybook/internal/core-server";
|
|
5855
|
+
var Kt = /* @__PURE__ */ d(async (s) => {
|
|
5856
5856
|
let e = await B(__dirname);
|
|
5857
|
-
|
|
5857
|
+
W(e, "Failed to find the closest package.json file.");
|
|
5858
5858
|
let t = {
|
|
5859
5859
|
...s,
|
|
5860
5860
|
configDir: s.configDir || "./.storybook",
|
|
5861
5861
|
outputDir: s.outputDir || "./storybook-static",
|
|
5862
5862
|
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5863
5863
|
configType: "PRODUCTION",
|
|
5864
|
-
cache:
|
|
5864
|
+
cache: os,
|
|
5865
5865
|
packageJson: e
|
|
5866
5866
|
};
|
|
5867
5867
|
await ls(
|
|
5868
5868
|
"build",
|
|
5869
5869
|
{ cliOptions: s, presetOptions: t },
|
|
5870
|
-
() =>
|
|
5870
|
+
() => ds(t)
|
|
5871
5871
|
);
|
|
5872
5872
|
}, "build");
|
|
5873
5873
|
|
|
5874
5874
|
// src/cli/buildIndex.ts
|
|
5875
|
-
import { cache as
|
|
5876
|
-
import { buildIndexStandalone as
|
|
5877
|
-
var
|
|
5875
|
+
import { cache as us } from "storybook/internal/common";
|
|
5876
|
+
import { buildIndexStandalone as cs, withTelemetry as hs } from "storybook/internal/core-server";
|
|
5877
|
+
var Xt = /* @__PURE__ */ d(async (s) => {
|
|
5878
5878
|
let e = {
|
|
5879
5879
|
...s,
|
|
5880
5880
|
configDir: s.configDir || ".storybook",
|
|
5881
5881
|
outputFile: s.outputFile || "index.json",
|
|
5882
5882
|
ignorePreview: !0,
|
|
5883
5883
|
configType: "PRODUCTION",
|
|
5884
|
-
cache:
|
|
5884
|
+
cache: us,
|
|
5885
5885
|
packageJson: s.packageJson
|
|
5886
5886
|
}, t = {
|
|
5887
5887
|
...e,
|
|
5888
5888
|
corePresets: [],
|
|
5889
5889
|
overridePresets: []
|
|
5890
5890
|
};
|
|
5891
|
-
await
|
|
5891
|
+
await hs("index", { cliOptions: s, presetOptions: t }, () => cs(e));
|
|
5892
5892
|
}, "buildIndex");
|
|
5893
5893
|
|
|
5894
5894
|
// src/cli/dev.ts
|
|
5895
|
-
import { cache as
|
|
5896
|
-
import { buildDevStandalone as
|
|
5897
|
-
import { logger as
|
|
5898
|
-
var
|
|
5899
|
-
function
|
|
5900
|
-
|
|
5901
|
-
(e) =>
|
|
5902
|
-
s.close ?
|
|
5895
|
+
import { cache as ps } from "storybook/internal/common";
|
|
5896
|
+
import { buildDevStandalone as fs, withTelemetry as ms } from "storybook/internal/core-server";
|
|
5897
|
+
import { logger as K, instance as gs } from "storybook/internal/node-logger";
|
|
5898
|
+
var vt = ye(_t(), 1);
|
|
5899
|
+
function ys(s) {
|
|
5900
|
+
gs.heading = "", s instanceof Error ? s.error ? K.error(s.error) : s.stats && s.stats.compilation.errors ? s.stats.compilation.errors.forEach(
|
|
5901
|
+
(e) => K.plain(e)) : K.error(s) : s.compilation?.errors && s.compilation.errors.forEach((e) => K.plain(e)), K.line(), K.warn(
|
|
5902
|
+
s.close ? vt.dedent`
|
|
5903
5903
|
FATAL broken build!, will close the process,
|
|
5904
5904
|
Fix the error below and restart storybook.
|
|
5905
|
-
` :
|
|
5905
|
+
` : vt.dedent`
|
|
5906
5906
|
Broken build, fix the error above.
|
|
5907
5907
|
You may need to refresh the browser.
|
|
5908
5908
|
`
|
|
5909
|
-
),
|
|
5909
|
+
), K.line();
|
|
5910
5910
|
}
|
|
5911
|
-
d(
|
|
5912
|
-
var
|
|
5911
|
+
d(ys, "printError");
|
|
5912
|
+
var er = /* @__PURE__ */ d(async (s) => {
|
|
5913
5913
|
let { env: e } = process;
|
|
5914
5914
|
e.NODE_ENV = e.NODE_ENV || "development";
|
|
5915
5915
|
let t = await B(__dirname);
|
|
5916
|
-
|
|
5916
|
+
W(t, "Failed to find the closest package.json file.");
|
|
5917
5917
|
let r = {
|
|
5918
5918
|
...s,
|
|
5919
5919
|
configDir: s.configDir || "./.storybook",
|
|
5920
5920
|
configType: "DEVELOPMENT",
|
|
5921
5921
|
ignorePreview: !!s.previewUrl && !s.forceBuildPreview,
|
|
5922
|
-
cache:
|
|
5922
|
+
cache: ps,
|
|
5923
5923
|
packageJson: t
|
|
5924
5924
|
};
|
|
5925
|
-
await
|
|
5925
|
+
await ms(
|
|
5926
5926
|
"dev",
|
|
5927
5927
|
{
|
|
5928
5928
|
cliOptions: s,
|
|
5929
5929
|
presetOptions: r,
|
|
5930
|
-
printError:
|
|
5930
|
+
printError: ys
|
|
5931
5931
|
},
|
|
5932
|
-
() =>
|
|
5932
|
+
() => fs(r)
|
|
5933
5933
|
);
|
|
5934
5934
|
}, "dev");
|
|
5935
5935
|
|
|
5936
5936
|
// src/cli/globalSettings.ts
|
|
5937
|
-
var
|
|
5938
|
-
import
|
|
5939
|
-
import { homedir as
|
|
5940
|
-
import { dirname as
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
var Ar = ye(vt(), 1);
|
|
5944
|
-
|
|
5945
|
-
// src/storybook-error.ts
|
|
5946
|
-
function Er({
|
|
5947
|
-
code: s,
|
|
5948
|
-
category: e
|
|
5949
|
-
}) {
|
|
5950
|
-
let t = String(s).padStart(4, "0");
|
|
5951
|
-
return `SB_${e}_${t}`;
|
|
5952
|
-
}
|
|
5953
|
-
d(Er, "parseErrorCode");
|
|
5954
|
-
var Ge = class s extends Error {
|
|
5955
|
-
constructor(t) {
|
|
5956
|
-
super(s.getFullMessage(t));
|
|
5957
|
-
/**
|
|
5958
|
-
* Data associated with the error. Used to provide additional information in the error message or
|
|
5959
|
-
* to be passed to telemetry.
|
|
5960
|
-
*/
|
|
5961
|
-
this.data = {};
|
|
5962
|
-
/** Flag used to easily determine if the error originates from Storybook. */
|
|
5963
|
-
this.fromStorybook = !0;
|
|
5964
|
-
this.category = t.category, this.documentation = t.documentation ?? !1, this.code = t.code;
|
|
5965
|
-
}
|
|
5966
|
-
static {
|
|
5967
|
-
d(this, "StorybookError");
|
|
5968
|
-
}
|
|
5969
|
-
get fullErrorCode() {
|
|
5970
|
-
return Er({ code: this.code, category: this.category });
|
|
5971
|
-
}
|
|
5972
|
-
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
5973
|
-
get name() {
|
|
5974
|
-
let t = this.constructor.name;
|
|
5975
|
-
return `${this.fullErrorCode} (${t})`;
|
|
5976
|
-
}
|
|
5977
|
-
/** Generates the error message along with additional documentation link (if applicable). */
|
|
5978
|
-
static getFullMessage({
|
|
5979
|
-
documentation: t,
|
|
5980
|
-
code: r,
|
|
5981
|
-
category: i,
|
|
5982
|
-
message: n
|
|
5983
|
-
}) {
|
|
5984
|
-
let o;
|
|
5985
|
-
return t === !0 ? o = `https://storybook.js.org/error/${Er({ code: r, category: i })}` : typeof t == "string" ? o = t : Array.isArray(t) &&
|
|
5986
|
-
(o = `
|
|
5987
|
-
${t.map((a) => ` - ${a}`).join(`
|
|
5988
|
-
`)}`), `${n}${o != null ? `
|
|
5989
|
-
|
|
5990
|
-
More info: ${o}
|
|
5991
|
-
` : ""}`;
|
|
5992
|
-
}
|
|
5993
|
-
};
|
|
5994
|
-
|
|
5995
|
-
// src/server-errors.ts
|
|
5996
|
-
var Je = class extends Ge {
|
|
5997
|
-
constructor(t) {
|
|
5998
|
-
super({
|
|
5999
|
-
category: "CORE-SERVER",
|
|
6000
|
-
code: 1,
|
|
6001
|
-
message: Ar.dedent`
|
|
6002
|
-
Unable to save global settings file to ${t.filePath}
|
|
6003
|
-
${t.error && `Reason: ${t.error}`}`
|
|
6004
|
-
});
|
|
6005
|
-
this.data = t;
|
|
6006
|
-
}
|
|
6007
|
-
static {
|
|
6008
|
-
d(this, "SavingGlobalSettingsFileError");
|
|
6009
|
-
}
|
|
6010
|
-
};
|
|
6011
|
-
|
|
6012
|
-
// src/cli/globalSettings.ts
|
|
6013
|
-
var Wi = qi(Ui(), ".storybook", "settings.json"), Bi = 1, Hi = Oe.z.object({
|
|
6014
|
-
version: Oe.z.number(),
|
|
5937
|
+
var Tr = ye(_t(), 1), Te = ye(Ir(), 1);
|
|
5938
|
+
import At from "node:fs/promises";
|
|
5939
|
+
import { homedir as Mi } from "node:os";
|
|
5940
|
+
import { dirname as Li, join as qi } from "node:path";
|
|
5941
|
+
var Ui = qi(Mi(), ".storybook", "settings.json"), Fi = 1, Hi = Te.z.object({
|
|
5942
|
+
version: Te.z.number(),
|
|
6015
5943
|
// NOTE: every key (and subkey) below must be optional, for forwards compatibility reasons
|
|
6016
5944
|
// (we can remove keys once they are deprecated)
|
|
6017
|
-
userSince:
|
|
6018
|
-
init:
|
|
5945
|
+
userSince: Te.z.number().optional(),
|
|
5946
|
+
init: Te.z.object({ skipOnboarding: Te.z.boolean().optional() }).optional()
|
|
6019
5947
|
}), Ie;
|
|
6020
|
-
async function
|
|
5948
|
+
async function Or(s = Ui) {
|
|
6021
5949
|
if (Ie)
|
|
6022
5950
|
return Ie;
|
|
6023
5951
|
try {
|
|
6024
|
-
let e = await
|
|
6025
|
-
Ie = new
|
|
5952
|
+
let e = await At.readFile(s, "utf8"), t = Hi.parse(JSON.parse(e));
|
|
5953
|
+
Ie = new Je(s, t);
|
|
6026
5954
|
} catch {
|
|
6027
|
-
Ie = new
|
|
5955
|
+
Ie = new Je(s, { version: Fi, userSince: Date.now() }), await Ie.save();
|
|
6028
5956
|
}
|
|
6029
5957
|
return Ie;
|
|
6030
5958
|
}
|
|
6031
|
-
d(
|
|
6032
|
-
var
|
|
5959
|
+
d(Or, "globalSettings");
|
|
5960
|
+
var Je = class {
|
|
6033
5961
|
static {
|
|
6034
5962
|
d(this, "Settings");
|
|
6035
5963
|
}
|
|
@@ -6045,47 +5973,45 @@ var Ye = class {
|
|
|
6045
5973
|
/** Save settings to the file */
|
|
6046
5974
|
async save() {
|
|
6047
5975
|
try {
|
|
6048
|
-
await
|
|
5976
|
+
await At.mkdir(Li(this.filePath), { recursive: !0 }), await At.writeFile(this.filePath, JSON.stringify(this.value, null, 2));
|
|
6049
5977
|
} catch (e) {
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
});
|
|
5978
|
+
console.warn(Tr.dedent`
|
|
5979
|
+
Unable to save global settings file to ${this.filePath}
|
|
5980
|
+
${e && `Reason: ${e.message ?? e}`}`);
|
|
6054
5981
|
}
|
|
6055
5982
|
}
|
|
6056
5983
|
};
|
|
6057
5984
|
|
|
6058
5985
|
// src/cli/bin/index.ts
|
|
6059
|
-
|
|
6060
|
-
var
|
|
5986
|
+
Wi("cliVersion", yt);
|
|
5987
|
+
var St = /* @__PURE__ */ d((s) => Ve.program.command(s).option(
|
|
6061
5988
|
"--disable-telemetry",
|
|
6062
5989
|
"Disable sending telemetry data",
|
|
6063
|
-
|
|
6064
|
-
process.env.STORYBOOK_DISABLE_TELEMETRY && process.env.STORYBOOK_DISABLE_TELEMETRY !== "false"
|
|
5990
|
+
Ar(process.env.STORYBOOK_DISABLE_TELEMETRY)
|
|
6065
5991
|
).option("--debug", "Get more logs in debug mode", !1).option("--enable-crash-reports", "Enable sending crash reports to telemetry data").option(
|
|
6066
5992
|
"--loglevel <trace | debug | info | warn | error | silent>", "Define log level", "info").option("--write-logs", "Write all debug logs to a f\
|
|
6067
5993
|
ile at the end of the run").hook("preAction", async (e) => {
|
|
6068
5994
|
try {
|
|
6069
5995
|
let t = e.opts();
|
|
6070
|
-
t.loglevel && fe.setLogLevel(t.loglevel), t.writeLogs &&
|
|
5996
|
+
t.loglevel && fe.setLogLevel(t.loglevel), t.writeLogs && Zt.enableLogWriting(), await Or();
|
|
6071
5997
|
} catch (t) {
|
|
6072
5998
|
fe.error(`Error loading global settings:
|
|
6073
5999
|
` + String(t));
|
|
6074
6000
|
}
|
|
6075
6001
|
}).hook("postAction", async () => {
|
|
6076
|
-
if (
|
|
6077
|
-
let e = await
|
|
6002
|
+
if (Zt.shouldWriteLogsToFile) {
|
|
6003
|
+
let e = await Zt.writeToFile();
|
|
6078
6004
|
fe.outro(`Storybook debug logs can be found at: ${e}`);
|
|
6079
6005
|
}
|
|
6080
6006
|
}), "command");
|
|
6081
|
-
|
|
6007
|
+
St("dev").option("-p, --port <number>", "Port to run Storybook", (s) => parseInt(s, 10)).option("-h, --host <string>", "Host to run Storyboo\
|
|
6082
6008
|
k").option("-c, --config-dir <dir-name>", "Directory where to load Storybook configurations from").option(
|
|
6083
6009
|
"--https",
|
|
6084
6010
|
"Serve Storybook over HTTPS. Note: You must provide your own certificate information."
|
|
6085
6011
|
).option(
|
|
6086
6012
|
"--ssl-ca <ca>",
|
|
6087
6013
|
"Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)",
|
|
6088
|
-
|
|
6014
|
+
Bi
|
|
6089
6015
|
).option("--ssl-cert <cert>", "Provide an SSL certificate. (Required with --https)").option("--ssl-key <key>", "Provide an SSL key. (Require\
|
|
6090
6016
|
d with --https)").option("--smoke-test", "Exit after successful start").option("--ci", "CI mode (skip interactive prompts, don't open browse\
|
|
6091
6017
|
r)").option("--no-open", "Do not open Storybook automatically in the browser").option("--quiet", "Suppress verbose build output").option("--\
|
|
@@ -6101,16 +6027,16 @@ ly site using addon-docs").option("--exact-port", "Exit early if the desired por
|
|
|
6101
6027
|
"URL path to be appended when visiting Storybook for the first time"
|
|
6102
6028
|
).option("--preview-only", "Use the preview without the manager UI").action(async (s) => {
|
|
6103
6029
|
let e = await B(__dirname);
|
|
6104
|
-
|
|
6105
|
-
`)),
|
|
6030
|
+
W(e, "Failed to find the closest package.json file."), fe.log(me.default.bold(`${e.name} v${e.version}`) + me.default.reset(`
|
|
6031
|
+
`)), jt(s, {
|
|
6106
6032
|
port: "SBCONFIG_PORT",
|
|
6107
6033
|
host: "SBCONFIG_HOSTNAME",
|
|
6108
6034
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6109
6035
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6110
6036
|
ci: "CI"
|
|
6111
|
-
}), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await
|
|
6037
|
+
}), parseInt(`${s.port}`, 10) && (s.port = parseInt(`${s.port}`, 10)), await er({ ...s, packageJson: e }).catch(() => process.exit(1));
|
|
6112
6038
|
});
|
|
6113
|
-
|
|
6039
|
+
St("build").option("-o, --output-dir <dir-name>", "Directory where to store built files").option("-c, --config-dir <dir-name>", "Directory w\
|
|
6114
6040
|
here to load Storybook configurations from").option("--quiet", "Suppress verbose build output").option("--debug-webpack", "Display final web\
|
|
6115
6041
|
pack configurations for debugging purposes").option(
|
|
6116
6042
|
"--webpack-stats-json [directory]",
|
|
@@ -6124,35 +6050,35 @@ ut the manager UI").action(async (s) => {
|
|
|
6124
6050
|
let { env: e } = process;
|
|
6125
6051
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6126
6052
|
let t = await B(__dirname);
|
|
6127
|
-
|
|
6128
|
-
`)),
|
|
6053
|
+
W(t, "Failed to find the closest package.json file."), fe.log(me.default.bold(`${t.name} v${t.version}
|
|
6054
|
+
`)), jt(s, {
|
|
6129
6055
|
staticDir: "SBCONFIG_STATIC_DIR",
|
|
6130
6056
|
outputDir: "SBCONFIG_OUTPUT_DIR",
|
|
6131
6057
|
configDir: "SBCONFIG_CONFIG_DIR"
|
|
6132
|
-
}), await
|
|
6058
|
+
}), await Kt({
|
|
6133
6059
|
...s,
|
|
6134
6060
|
packageJson: t,
|
|
6135
|
-
test: !!s.test || process.env.SB_TESTBUILD
|
|
6061
|
+
test: !!s.test || Ar(process.env.SB_TESTBUILD)
|
|
6136
6062
|
}).catch(() => process.exit(1));
|
|
6137
6063
|
});
|
|
6138
|
-
|
|
6064
|
+
St("index").option("-o, --output-file <file-name>", "JSON file to output index").option("-c, --config-dir <dir-name>", "Directory where to l\
|
|
6139
6065
|
oad Storybook configurations from").option("--quiet", "Suppress verbose build output").action(async (s) => {
|
|
6140
6066
|
let { env: e } = process;
|
|
6141
6067
|
e.NODE_ENV = e.NODE_ENV || "production";
|
|
6142
6068
|
let t = await B(__dirname);
|
|
6143
|
-
|
|
6144
|
-
`)),
|
|
6069
|
+
W(t, "Failed to find the closest package.json file."), fe.log(me.default.bold(`${t.name} v${t.version}
|
|
6070
|
+
`)), jt(s, {
|
|
6145
6071
|
configDir: "SBCONFIG_CONFIG_DIR",
|
|
6146
6072
|
outputFile: "SBCONFIG_OUTPUT_FILE"
|
|
6147
|
-
}), await
|
|
6073
|
+
}), await Xt({
|
|
6148
6074
|
...s,
|
|
6149
6075
|
packageJson: t
|
|
6150
6076
|
}).catch(() => process.exit(1));
|
|
6151
6077
|
});
|
|
6152
|
-
|
|
6078
|
+
Ve.program.on("command:*", ([s]) => {
|
|
6153
6079
|
let e = ` Invalid command: ${me.default.bold(s)}.
|
|
6154
|
-
See --help for a list of available commands.`, r =
|
|
6080
|
+
See --help for a list of available commands.`, r = Ve.program.commands.map((i) => i.name()).find((i) => ft(i, s) < 3);
|
|
6155
6081
|
r && (e += `
|
|
6156
6082
|
Did you mean ${me.default.yellow(r)}?`), fe.error(e), process.exit(1);
|
|
6157
6083
|
});
|
|
6158
|
-
|
|
6084
|
+
Ve.program.usage("<command> [options]").version(String(yt)).parse(process.argv);
|