@polagram/core 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -25
- package/dist/index.d.ts +140 -33
- package/dist/polagram-core.js +811 -694
- package/dist/polagram-core.umd.cjs +17 -17
- package/package.json +1 -1
package/dist/polagram-core.js
CHANGED
|
@@ -7,16 +7,16 @@ const We = {
|
|
|
7
7
|
"--)": { type: "async", style: { line: "dotted", head: "async" } },
|
|
8
8
|
"-x": { type: "destroy", style: { line: "solid", head: "cross" } },
|
|
9
9
|
"--x": { type: "destroy", style: { line: "dotted", head: "cross" } }
|
|
10
|
-
},
|
|
10
|
+
}, At = Object.entries(We).reduce(
|
|
11
11
|
(t, [e, n]) => {
|
|
12
12
|
const r = JSON.stringify({ type: n.type, style: n.style });
|
|
13
13
|
return t[r] = e, t;
|
|
14
14
|
},
|
|
15
15
|
{}
|
|
16
16
|
);
|
|
17
|
-
function
|
|
17
|
+
function Zt(t, e) {
|
|
18
18
|
const n = JSON.stringify({ type: t, style: e });
|
|
19
|
-
return
|
|
19
|
+
return At[n] || "->>";
|
|
20
20
|
}
|
|
21
21
|
class Ke {
|
|
22
22
|
constructor(e) {
|
|
@@ -69,26 +69,48 @@ class Ye {
|
|
|
69
69
|
constructor() {
|
|
70
70
|
this.traverser = new Ke(this);
|
|
71
71
|
}
|
|
72
|
+
visitParticipantGroup(e) {
|
|
73
|
+
}
|
|
72
74
|
generate(e) {
|
|
73
75
|
return this.lines = [], this.indentLevel = 0, this.traverser.traverse(e), this.lines.join(`
|
|
74
76
|
`);
|
|
75
77
|
}
|
|
76
78
|
visitRoot(e) {
|
|
77
79
|
this.lines.push("sequenceDiagram"), this.indentLevel++, e.meta?.title && this.add(`title ${e.meta.title}`);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
const n = /* @__PURE__ */ new Map();
|
|
81
|
+
for (const i of e.participants)
|
|
82
|
+
n.set(i.id, []);
|
|
83
|
+
for (const i of e.groups)
|
|
84
|
+
for (const s of i.participantIds) {
|
|
85
|
+
const o = n.get(s);
|
|
86
|
+
o && o.push(i);
|
|
87
|
+
}
|
|
88
|
+
const r = [];
|
|
89
|
+
for (const i of e.participants) {
|
|
90
|
+
const s = n.get(i.id) || [];
|
|
91
|
+
let o = 0;
|
|
92
|
+
const a = Math.min(r.length, s.length);
|
|
93
|
+
for (let c = 0; c < a && r[c] === s[c]; c++)
|
|
94
|
+
o++;
|
|
95
|
+
for (; r.length > o; )
|
|
96
|
+
this.indentLevel--, this.add("end"), r.pop();
|
|
97
|
+
for (let c = o; c < s.length; c++) {
|
|
98
|
+
const h = s[c];
|
|
99
|
+
let p = "box";
|
|
100
|
+
h.style?.backgroundColor && (p += ` ${h.style.backgroundColor}`), h.name && (p += ` ${h.name}`), this.add(p), this.indentLevel++, r.push(h);
|
|
101
|
+
}
|
|
102
|
+
this.visitParticipant(i);
|
|
103
|
+
}
|
|
104
|
+
for (; r.length > 0; )
|
|
105
|
+
this.indentLevel--, this.add("end"), r.pop();
|
|
80
106
|
this.traverser.dispatchEvents(e.events);
|
|
81
107
|
}
|
|
82
108
|
visitParticipant(e) {
|
|
83
109
|
const n = e.type === "actor" ? "actor" : "participant", r = e.name;
|
|
84
110
|
e.id === e.name ? this.add(`${n} ${e.id}`) : this.add(`${n} ${e.id} as ${r}`);
|
|
85
111
|
}
|
|
86
|
-
visitParticipantGroup(e) {
|
|
87
|
-
let n = "box";
|
|
88
|
-
e.style?.backgroundColor && (n += ` ${e.style.backgroundColor}`), e.name && (n += ` ${e.name}`), this.add(n);
|
|
89
|
-
}
|
|
90
112
|
visitMessage(e) {
|
|
91
|
-
const n = e.from ?? "[*]", r = e.to ?? "[*]", i =
|
|
113
|
+
const n = e.from ?? "[*]", r = e.to ?? "[*]", i = Zt(e.type, e.style);
|
|
92
114
|
let s = "";
|
|
93
115
|
e.lifecycle?.activateTarget && (s += "+"), e.lifecycle?.deactivateSource && (s += "-"), this.add(`${n}${i}${s}${r}: ${e.text}`);
|
|
94
116
|
}
|
|
@@ -134,7 +156,7 @@ class Ye {
|
|
|
134
156
|
this.indentLevel++, e(), this.indentLevel--;
|
|
135
157
|
}
|
|
136
158
|
}
|
|
137
|
-
class
|
|
159
|
+
class qe {
|
|
138
160
|
lines = [];
|
|
139
161
|
traverser;
|
|
140
162
|
constructor() {
|
|
@@ -146,13 +168,31 @@ class Xe {
|
|
|
146
168
|
}
|
|
147
169
|
visitRoot(e) {
|
|
148
170
|
this.add("@startuml"), e.meta.title && this.add(`title ${e.meta.title}`);
|
|
149
|
-
const n =
|
|
150
|
-
for (const i of e.groups)
|
|
151
|
-
this.visitGroup(i, n), i.participantIds.forEach((s) => {
|
|
152
|
-
r.add(s);
|
|
153
|
-
});
|
|
171
|
+
const n = /* @__PURE__ */ new Map();
|
|
154
172
|
for (const i of e.participants)
|
|
155
|
-
|
|
173
|
+
n.set(i.id, []);
|
|
174
|
+
for (const i of e.groups)
|
|
175
|
+
for (const s of i.participantIds) {
|
|
176
|
+
const o = n.get(s);
|
|
177
|
+
o && o.push(i);
|
|
178
|
+
}
|
|
179
|
+
const r = [];
|
|
180
|
+
for (const i of e.participants) {
|
|
181
|
+
const s = n.get(i.id) || [];
|
|
182
|
+
let o = 0;
|
|
183
|
+
const a = Math.min(r.length, s.length);
|
|
184
|
+
for (let c = 0; c < a && r[c] === s[c]; c++)
|
|
185
|
+
o++;
|
|
186
|
+
for (; r.length > o; )
|
|
187
|
+
this.add("end box"), r.pop();
|
|
188
|
+
for (let c = o; c < s.length; c++) {
|
|
189
|
+
const h = s[c], p = h.style?.backgroundColor ? ` ${h.style.backgroundColor}` : "", d = h.name ? ` "${h.name}"` : "";
|
|
190
|
+
this.add(`box${d}${p}`), r.push(h);
|
|
191
|
+
}
|
|
192
|
+
this.visitParticipant(i);
|
|
193
|
+
}
|
|
194
|
+
for (; r.length > 0; )
|
|
195
|
+
this.add("end box"), r.pop();
|
|
156
196
|
this.traverser.dispatchEvents(e.events), this.add("@enduml");
|
|
157
197
|
}
|
|
158
198
|
visitParticipant(e) {
|
|
@@ -160,16 +200,6 @@ class Xe {
|
|
|
160
200
|
}
|
|
161
201
|
visitParticipantGroup(e) {
|
|
162
202
|
}
|
|
163
|
-
// Internal method with context for group handling
|
|
164
|
-
visitGroup(e, n) {
|
|
165
|
-
const r = e.style?.backgroundColor ? ` ${e.style.backgroundColor}` : "", i = e.name ? ` "${e.name}"` : "";
|
|
166
|
-
this.add(`box${i}${r}`);
|
|
167
|
-
for (const s of e.participantIds) {
|
|
168
|
-
const o = n.get(s);
|
|
169
|
-
o && this.visitParticipant(o);
|
|
170
|
-
}
|
|
171
|
-
this.add("end box");
|
|
172
|
-
}
|
|
173
203
|
visitMessage(e) {
|
|
174
204
|
const n = e.from || "[*]", r = e.to || "[*]";
|
|
175
205
|
let i = "->";
|
|
@@ -207,7 +237,7 @@ class Xe {
|
|
|
207
237
|
this.lines.push(e);
|
|
208
238
|
}
|
|
209
239
|
}
|
|
210
|
-
class
|
|
240
|
+
class Xe {
|
|
211
241
|
constructor(e) {
|
|
212
242
|
this.input = e, this.readChar();
|
|
213
243
|
}
|
|
@@ -277,7 +307,7 @@ class qe {
|
|
|
277
307
|
};
|
|
278
308
|
}
|
|
279
309
|
}
|
|
280
|
-
let
|
|
310
|
+
let Ct = class extends Xe {
|
|
281
311
|
nextToken() {
|
|
282
312
|
if (this.skipWhitespace(), this.ch === "%" && this.peekChar() === "%")
|
|
283
313
|
return this.skipComment(), this.nextToken();
|
|
@@ -438,7 +468,7 @@ class Qe {
|
|
|
438
468
|
return this.currToken.type;
|
|
439
469
|
}
|
|
440
470
|
}
|
|
441
|
-
let
|
|
471
|
+
let Rt = class extends Qe {
|
|
442
472
|
currentGroup = null;
|
|
443
473
|
idCounters = {
|
|
444
474
|
evt: 0,
|
|
@@ -542,8 +572,8 @@ let Ct = class extends Qe {
|
|
|
542
572
|
e.groups.push(o);
|
|
543
573
|
const a = this.currentGroup;
|
|
544
574
|
this.currentGroup = o;
|
|
545
|
-
const
|
|
546
|
-
return this.currentGroup = a, this.isCurrentToken("END") && this.advance(),
|
|
575
|
+
const c = this.parseBlock(e, ["END"]);
|
|
576
|
+
return this.currentGroup = a, this.isCurrentToken("END") && this.advance(), c;
|
|
547
577
|
}
|
|
548
578
|
parseFragment(e) {
|
|
549
579
|
const n = this.getCurrentTokenType();
|
|
@@ -559,28 +589,28 @@ let Ct = class extends Qe {
|
|
|
559
589
|
events: a
|
|
560
590
|
}); this.isCurrentToken("AND"); ) {
|
|
561
591
|
this.advance();
|
|
562
|
-
const
|
|
592
|
+
const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "AND"]);
|
|
563
593
|
s.push({
|
|
564
594
|
id: this.generateId("br"),
|
|
565
|
-
condition:
|
|
595
|
+
condition: c,
|
|
566
596
|
events: h
|
|
567
597
|
});
|
|
568
598
|
}
|
|
569
599
|
for (; this.isCurrentToken("OPTION"); ) {
|
|
570
600
|
this.advance();
|
|
571
|
-
const
|
|
601
|
+
const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "OPTION"]);
|
|
572
602
|
s.push({
|
|
573
603
|
id: this.generateId("br"),
|
|
574
|
-
condition:
|
|
604
|
+
condition: c,
|
|
575
605
|
events: h
|
|
576
606
|
});
|
|
577
607
|
}
|
|
578
608
|
for (; this.isCurrentToken("ELSE"); ) {
|
|
579
609
|
this.advance();
|
|
580
|
-
const
|
|
610
|
+
const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "ELSE"]);
|
|
581
611
|
s.push({
|
|
582
612
|
id: this.generateId("br"),
|
|
583
|
-
condition:
|
|
613
|
+
condition: c,
|
|
584
614
|
events: h
|
|
585
615
|
});
|
|
586
616
|
}
|
|
@@ -647,14 +677,14 @@ let Ct = class extends Qe {
|
|
|
647
677
|
this.ensureParticipant(e, o), this.advance();
|
|
648
678
|
let a = "";
|
|
649
679
|
this.isCurrentToken("COLON") && (this.advance(), a = this.readRestOfLine());
|
|
650
|
-
const { type:
|
|
680
|
+
const { type: c, style: h } = this.resolveArrow(r);
|
|
651
681
|
return {
|
|
652
682
|
kind: "message",
|
|
653
683
|
id: this.generateId("evt"),
|
|
654
684
|
from: n,
|
|
655
685
|
to: o,
|
|
656
686
|
text: a,
|
|
657
|
-
type:
|
|
687
|
+
type: c,
|
|
658
688
|
style: h,
|
|
659
689
|
lifecycle: i || s ? { activateTarget: i, deactivateSource: s } : void 0
|
|
660
690
|
};
|
|
@@ -683,13 +713,13 @@ let Ct = class extends Qe {
|
|
|
683
713
|
});
|
|
684
714
|
}
|
|
685
715
|
};
|
|
686
|
-
const
|
|
716
|
+
const Lt = {
|
|
687
717
|
parse: (t) => {
|
|
688
|
-
const e = new
|
|
689
|
-
return new
|
|
718
|
+
const e = new Ct(t);
|
|
719
|
+
return new Rt(e).parse();
|
|
690
720
|
}
|
|
691
721
|
};
|
|
692
|
-
class xt extends
|
|
722
|
+
class xt extends Xe {
|
|
693
723
|
nextToken() {
|
|
694
724
|
this.skipWhitespace();
|
|
695
725
|
const e = this.position, n = this.column;
|
|
@@ -805,7 +835,7 @@ class xt extends qe {
|
|
|
805
835
|
return n ? n[1] : "";
|
|
806
836
|
}
|
|
807
837
|
}
|
|
808
|
-
class
|
|
838
|
+
class Dt extends Qe {
|
|
809
839
|
/**
|
|
810
840
|
* Type-safe token type checker.
|
|
811
841
|
* Helps TypeScript understand token type after advance() calls.
|
|
@@ -933,8 +963,8 @@ class Lt extends Qe {
|
|
|
933
963
|
this.advance();
|
|
934
964
|
continue;
|
|
935
965
|
}
|
|
936
|
-
const
|
|
937
|
-
|
|
966
|
+
const c = this.parseStatement(e);
|
|
967
|
+
c && o.push(c);
|
|
938
968
|
}
|
|
939
969
|
return {
|
|
940
970
|
kind: n,
|
|
@@ -1053,18 +1083,18 @@ class Lt extends Qe {
|
|
|
1053
1083
|
return this.lexer.getInput().slice(e, n).trim();
|
|
1054
1084
|
}
|
|
1055
1085
|
}
|
|
1056
|
-
const
|
|
1086
|
+
const Ft = {
|
|
1057
1087
|
parse: (t) => {
|
|
1058
1088
|
const e = new xt(t);
|
|
1059
|
-
return new
|
|
1089
|
+
return new Dt(e).parse();
|
|
1060
1090
|
}
|
|
1061
|
-
},
|
|
1091
|
+
}, jt = {
|
|
1062
1092
|
".puml": "plantuml",
|
|
1063
1093
|
".plantuml": "plantuml",
|
|
1064
1094
|
".pu": "plantuml",
|
|
1065
1095
|
".mmd": "mermaid",
|
|
1066
1096
|
".mermaid": "mermaid"
|
|
1067
|
-
},
|
|
1097
|
+
}, Mt = [
|
|
1068
1098
|
{ pattern: /^\s*@startuml/m, format: "plantuml" },
|
|
1069
1099
|
{ pattern: /^\s*sequenceDiagram/m, format: "mermaid" }
|
|
1070
1100
|
], be = {
|
|
@@ -1095,7 +1125,7 @@ const Dt = {
|
|
|
1095
1125
|
*/
|
|
1096
1126
|
detectByExtension(t) {
|
|
1097
1127
|
const e = t.toLowerCase().match(/\.[^.]+$/)?.[0];
|
|
1098
|
-
return e &&
|
|
1128
|
+
return e && jt[e] || null;
|
|
1099
1129
|
},
|
|
1100
1130
|
/**
|
|
1101
1131
|
* Detect format based on content patterns.
|
|
@@ -1104,7 +1134,7 @@ const Dt = {
|
|
|
1104
1134
|
* @returns Detected format, or null if no pattern matches
|
|
1105
1135
|
*/
|
|
1106
1136
|
detectByContent(t) {
|
|
1107
|
-
for (const { pattern: e, format: n } of
|
|
1137
|
+
for (const { pattern: e, format: n } of Mt)
|
|
1108
1138
|
if (e.test(t))
|
|
1109
1139
|
return n;
|
|
1110
1140
|
return null;
|
|
@@ -1123,21 +1153,21 @@ const Dt = {
|
|
|
1123
1153
|
return ".mmd";
|
|
1124
1154
|
}
|
|
1125
1155
|
}
|
|
1126
|
-
},
|
|
1127
|
-
|
|
1128
|
-
|
|
1156
|
+
}, Q = /* @__PURE__ */ new Map();
|
|
1157
|
+
Q.set("mermaid", Lt);
|
|
1158
|
+
Q.set("plantuml", Ft);
|
|
1129
1159
|
const Ut = {
|
|
1130
1160
|
register(t, e) {
|
|
1131
|
-
|
|
1161
|
+
Q.set(t, e);
|
|
1132
1162
|
},
|
|
1133
1163
|
getParser(t) {
|
|
1134
|
-
const e =
|
|
1164
|
+
const e = Q.get(t);
|
|
1135
1165
|
if (!e)
|
|
1136
1166
|
throw new Error(`Parser for language '${t}' not found.`);
|
|
1137
1167
|
return e;
|
|
1138
1168
|
}
|
|
1139
1169
|
};
|
|
1140
|
-
class
|
|
1170
|
+
class K {
|
|
1141
1171
|
transform(e) {
|
|
1142
1172
|
const n = this.mapEvents(e.events);
|
|
1143
1173
|
return {
|
|
@@ -1167,7 +1197,7 @@ class ee {
|
|
|
1167
1197
|
};
|
|
1168
1198
|
}
|
|
1169
1199
|
}
|
|
1170
|
-
class
|
|
1200
|
+
class Gt extends K {
|
|
1171
1201
|
visitFragment(e) {
|
|
1172
1202
|
const n = super.visitFragment(e);
|
|
1173
1203
|
if (n.length === 0) return [];
|
|
@@ -1180,7 +1210,7 @@ class Mt extends ee {
|
|
|
1180
1210
|
];
|
|
1181
1211
|
}
|
|
1182
1212
|
}
|
|
1183
|
-
class
|
|
1213
|
+
class Vt {
|
|
1184
1214
|
transform(e) {
|
|
1185
1215
|
const n = this.collectUsedParticipants(e.events), r = e.participants.filter(
|
|
1186
1216
|
(s) => n.has(s.id)
|
|
@@ -1224,7 +1254,7 @@ class Gt {
|
|
|
1224
1254
|
return r(e), n;
|
|
1225
1255
|
}
|
|
1226
1256
|
}
|
|
1227
|
-
class
|
|
1257
|
+
class ne {
|
|
1228
1258
|
// -- Branch / Fragment --
|
|
1229
1259
|
matchBranch(e, n, r) {
|
|
1230
1260
|
return !(n.operator && !(Array.isArray(n.operator) ? n.operator : [n.operator]).includes(r) || n.condition && (!e.condition || !this.matchText(e.condition, n.condition)));
|
|
@@ -1254,11 +1284,11 @@ class de {
|
|
|
1254
1284
|
return !1;
|
|
1255
1285
|
}
|
|
1256
1286
|
}
|
|
1257
|
-
class
|
|
1287
|
+
class Bt extends K {
|
|
1258
1288
|
constructor(e) {
|
|
1259
1289
|
super(), this.layer = e;
|
|
1260
1290
|
}
|
|
1261
|
-
matcher = new
|
|
1291
|
+
matcher = new ne();
|
|
1262
1292
|
targetParticipantIds = /* @__PURE__ */ new Set();
|
|
1263
1293
|
transform(e) {
|
|
1264
1294
|
return this.resolveTargetParticipants(e), super.transform(e);
|
|
@@ -1292,11 +1322,84 @@ class Vt extends ee {
|
|
|
1292
1322
|
return !!(e.from && this.targetParticipantIds.has(e.from) || e.to && this.targetParticipantIds.has(e.to));
|
|
1293
1323
|
}
|
|
1294
1324
|
}
|
|
1295
|
-
class
|
|
1325
|
+
class Jt extends K {
|
|
1326
|
+
constructor(e) {
|
|
1327
|
+
super(), this.layer = e, this.newParticipantId = e.newName;
|
|
1328
|
+
}
|
|
1329
|
+
matcher = new ne();
|
|
1330
|
+
mergedParticipantIds = /* @__PURE__ */ new Set();
|
|
1331
|
+
newParticipantId;
|
|
1332
|
+
transform(e) {
|
|
1333
|
+
const n = this.layer.selector;
|
|
1334
|
+
if (e.participants.forEach((i) => {
|
|
1335
|
+
this.matcher.matchParticipant(i, n) && this.mergedParticipantIds.add(i.id);
|
|
1336
|
+
}), this.mergedParticipantIds.size === 0)
|
|
1337
|
+
return e;
|
|
1338
|
+
if (!e.participants.some(
|
|
1339
|
+
(i) => i.id === this.newParticipantId
|
|
1340
|
+
)) {
|
|
1341
|
+
const i = {
|
|
1342
|
+
id: this.newParticipantId,
|
|
1343
|
+
name: this.layer.newName,
|
|
1344
|
+
type: "participant"
|
|
1345
|
+
};
|
|
1346
|
+
e.participants.push(i);
|
|
1347
|
+
}
|
|
1348
|
+
return e.participants = e.participants.filter(
|
|
1349
|
+
(i) => !this.mergedParticipantIds.has(i.id)
|
|
1350
|
+
), super.transform(e);
|
|
1351
|
+
}
|
|
1352
|
+
visitEvent(e) {
|
|
1353
|
+
if (e.kind === "message")
|
|
1354
|
+
return this.transformMessage(e);
|
|
1355
|
+
if (e.kind === "note")
|
|
1356
|
+
return this.transformNote(e);
|
|
1357
|
+
if (e.kind === "activation")
|
|
1358
|
+
return this.transformActivation(e);
|
|
1359
|
+
if (e.kind === "fragment") {
|
|
1360
|
+
const n = super.visitEvent(e);
|
|
1361
|
+
return n.length > 0 && n[0].kind === "fragment" && n[0].branches.every(
|
|
1362
|
+
(s) => s.events.length === 0
|
|
1363
|
+
) ? [] : n;
|
|
1364
|
+
}
|
|
1365
|
+
return super.visitEvent(e);
|
|
1366
|
+
}
|
|
1367
|
+
transformMessage(e) {
|
|
1368
|
+
let n = e.from, r = e.to;
|
|
1369
|
+
return n && this.mergedParticipantIds.has(n) && (n = this.newParticipantId), r && this.mergedParticipantIds.has(r) && (r = this.newParticipantId), n === this.newParticipantId && r === this.newParticipantId ? [] : [
|
|
1370
|
+
{
|
|
1371
|
+
...e,
|
|
1372
|
+
from: n,
|
|
1373
|
+
to: r
|
|
1374
|
+
}
|
|
1375
|
+
];
|
|
1376
|
+
}
|
|
1377
|
+
transformNote(e) {
|
|
1378
|
+
const n = /* @__PURE__ */ new Set();
|
|
1379
|
+
let r = !1;
|
|
1380
|
+
for (const o of e.participantIds)
|
|
1381
|
+
this.mergedParticipantIds.has(o) ? (n.add(this.newParticipantId), r = !0) : n.add(o);
|
|
1382
|
+
if (!r)
|
|
1383
|
+
return [e];
|
|
1384
|
+
const i = Array.from(n);
|
|
1385
|
+
return e.participantIds.every(
|
|
1386
|
+
(o) => this.mergedParticipantIds.has(o)
|
|
1387
|
+
) ? [] : [
|
|
1388
|
+
{
|
|
1389
|
+
...e,
|
|
1390
|
+
participantIds: i
|
|
1391
|
+
}
|
|
1392
|
+
];
|
|
1393
|
+
}
|
|
1394
|
+
transformActivation(e) {
|
|
1395
|
+
return this.mergedParticipantIds.has(e.participantId) ? [] : [e];
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
class Wt extends K {
|
|
1296
1399
|
constructor(e) {
|
|
1297
1400
|
super(), this.layer = e;
|
|
1298
1401
|
}
|
|
1299
|
-
matcher = new
|
|
1402
|
+
matcher = new ne();
|
|
1300
1403
|
removedParticipantIds = /* @__PURE__ */ new Set();
|
|
1301
1404
|
transform(e) {
|
|
1302
1405
|
const n = this.layer.selector;
|
|
@@ -1332,11 +1435,11 @@ class Bt extends ee {
|
|
|
1332
1435
|
return !!(e.from && this.removedParticipantIds.has(e.from) || e.to && this.removedParticipantIds.has(e.to));
|
|
1333
1436
|
}
|
|
1334
1437
|
}
|
|
1335
|
-
class
|
|
1438
|
+
class Kt extends K {
|
|
1336
1439
|
constructor(e) {
|
|
1337
1440
|
super(), this.layer = e;
|
|
1338
1441
|
}
|
|
1339
|
-
matcher = new
|
|
1442
|
+
matcher = new ne();
|
|
1340
1443
|
visitFragment(e) {
|
|
1341
1444
|
const n = e.branches.find(
|
|
1342
1445
|
(r) => this.matcher.matchBranch(r, this.layer.selector, e.operator)
|
|
@@ -1344,10 +1447,10 @@ class Jt extends ee {
|
|
|
1344
1447
|
return n ? this.mapEvents(n.events) : super.visitFragment(e);
|
|
1345
1448
|
}
|
|
1346
1449
|
}
|
|
1347
|
-
class
|
|
1450
|
+
class Yt {
|
|
1348
1451
|
factories = /* @__PURE__ */ new Map();
|
|
1349
1452
|
constructor() {
|
|
1350
|
-
this.registerTyped("resolve", (e) => new
|
|
1453
|
+
this.registerTyped("resolve", (e) => new Kt(e)), this.registerTyped("focus", (e) => new Bt(e)), this.registerTyped("remove", (e) => new Wt(e)), this.registerTyped("merge", (e) => new Jt(e));
|
|
1351
1454
|
}
|
|
1352
1455
|
/**
|
|
1353
1456
|
* Type-safe registration for a specific layer type.
|
|
@@ -1376,18 +1479,18 @@ class Wt {
|
|
|
1376
1479
|
return this.factories.has(e);
|
|
1377
1480
|
}
|
|
1378
1481
|
}
|
|
1379
|
-
const
|
|
1380
|
-
class
|
|
1482
|
+
const qt = new Yt();
|
|
1483
|
+
class ue {
|
|
1381
1484
|
transform(e, n) {
|
|
1382
1485
|
let r = e;
|
|
1383
1486
|
for (const i of n) {
|
|
1384
|
-
const s =
|
|
1487
|
+
const s = qt.get(i);
|
|
1385
1488
|
s ? r = s.transform(r) : console.warn(`Unknown action: ${i.action}`);
|
|
1386
1489
|
}
|
|
1387
|
-
return r = new
|
|
1490
|
+
return r = new Gt().transform(r), r = new Vt().transform(r), r;
|
|
1388
1491
|
}
|
|
1389
1492
|
}
|
|
1390
|
-
class
|
|
1493
|
+
class Uo {
|
|
1391
1494
|
constructor() {
|
|
1392
1495
|
}
|
|
1393
1496
|
/**
|
|
@@ -1397,10 +1500,10 @@ class Fo {
|
|
|
1397
1500
|
*/
|
|
1398
1501
|
static init(e, n = "mermaid") {
|
|
1399
1502
|
const i = Ut.getParser(n).parse(e);
|
|
1400
|
-
return new
|
|
1503
|
+
return new Xt(i, n);
|
|
1401
1504
|
}
|
|
1402
1505
|
}
|
|
1403
|
-
class
|
|
1506
|
+
class Xt {
|
|
1404
1507
|
ast;
|
|
1405
1508
|
layers = [];
|
|
1406
1509
|
sourceFormat;
|
|
@@ -1474,21 +1577,21 @@ class Yt {
|
|
|
1474
1577
|
* Generate Mermaid code from the transformed AST.
|
|
1475
1578
|
*/
|
|
1476
1579
|
toMermaid() {
|
|
1477
|
-
const n = new
|
|
1580
|
+
const n = new ue().transform(this.ast, this.layers);
|
|
1478
1581
|
return new Ye().generate(n);
|
|
1479
1582
|
}
|
|
1480
1583
|
/**
|
|
1481
1584
|
* Generate PlantUML code from the transformed AST.
|
|
1482
1585
|
*/
|
|
1483
1586
|
toPlantUML() {
|
|
1484
|
-
const n = new
|
|
1485
|
-
return new
|
|
1587
|
+
const n = new ue().transform(this.ast, this.layers);
|
|
1588
|
+
return new qe().generate(n);
|
|
1486
1589
|
}
|
|
1487
1590
|
/**
|
|
1488
1591
|
* Get the transformed AST (for advanced use cases).
|
|
1489
1592
|
*/
|
|
1490
1593
|
toAST() {
|
|
1491
|
-
return new
|
|
1594
|
+
return new ue().transform(this.ast, this.layers);
|
|
1492
1595
|
}
|
|
1493
1596
|
/**
|
|
1494
1597
|
* Get the source format detected/specified during init.
|
|
@@ -1513,17 +1616,17 @@ class Yt {
|
|
|
1513
1616
|
return typeof e == "string" || e instanceof RegExp || typeof e == "object" && e !== null && "pattern" in e && !("kind" in e);
|
|
1514
1617
|
}
|
|
1515
1618
|
}
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
const
|
|
1619
|
+
const D = /* @__PURE__ */ new Map();
|
|
1620
|
+
D.set("mermaid", () => new Ye());
|
|
1621
|
+
D.set("plantuml", () => new qe());
|
|
1622
|
+
const Go = {
|
|
1520
1623
|
/**
|
|
1521
1624
|
* Register a custom generator.
|
|
1522
1625
|
* @param language - Language identifier (e.g., 'mermaid', 'plantuml')
|
|
1523
1626
|
* @param factory - Factory function that creates a generator instance
|
|
1524
1627
|
*/
|
|
1525
1628
|
register(t, e) {
|
|
1526
|
-
|
|
1629
|
+
D.set(t, e);
|
|
1527
1630
|
},
|
|
1528
1631
|
/**
|
|
1529
1632
|
* Get a generator for the specified language.
|
|
@@ -1532,7 +1635,7 @@ const jo = {
|
|
|
1532
1635
|
* @throws Error if no generator is registered for the language
|
|
1533
1636
|
*/
|
|
1534
1637
|
getGenerator(t) {
|
|
1535
|
-
const e =
|
|
1638
|
+
const e = D.get(t);
|
|
1536
1639
|
if (!e)
|
|
1537
1640
|
throw new Error(`Generator for language '${t}' not found.`);
|
|
1538
1641
|
return e();
|
|
@@ -1541,27 +1644,27 @@ const jo = {
|
|
|
1541
1644
|
* Check if a generator is registered for the given language.
|
|
1542
1645
|
*/
|
|
1543
1646
|
hasGenerator(t) {
|
|
1544
|
-
return
|
|
1647
|
+
return D.has(t);
|
|
1545
1648
|
},
|
|
1546
1649
|
/**
|
|
1547
1650
|
* Get list of registered languages.
|
|
1548
1651
|
*/
|
|
1549
1652
|
getLanguages() {
|
|
1550
|
-
return Array.from(
|
|
1653
|
+
return Array.from(D.keys());
|
|
1551
1654
|
}
|
|
1552
1655
|
};
|
|
1553
|
-
function
|
|
1554
|
-
function r(a,
|
|
1656
|
+
function u(t, e, n) {
|
|
1657
|
+
function r(a, c) {
|
|
1555
1658
|
if (a._zod || Object.defineProperty(a, "_zod", {
|
|
1556
1659
|
value: {
|
|
1557
|
-
def:
|
|
1660
|
+
def: c,
|
|
1558
1661
|
constr: o,
|
|
1559
1662
|
traits: /* @__PURE__ */ new Set()
|
|
1560
1663
|
},
|
|
1561
1664
|
enumerable: !1
|
|
1562
1665
|
}), a._zod.traits.has(t))
|
|
1563
1666
|
return;
|
|
1564
|
-
a._zod.traits.add(t), e(a,
|
|
1667
|
+
a._zod.traits.add(t), e(a, c);
|
|
1565
1668
|
const h = o.prototype, p = Object.keys(h);
|
|
1566
1669
|
for (let d = 0; d < p.length; d++) {
|
|
1567
1670
|
const f = p[d];
|
|
@@ -1573,9 +1676,9 @@ function c(t, e, n) {
|
|
|
1573
1676
|
}
|
|
1574
1677
|
Object.defineProperty(s, "name", { value: t });
|
|
1575
1678
|
function o(a) {
|
|
1576
|
-
var
|
|
1679
|
+
var c;
|
|
1577
1680
|
const h = n?.Parent ? new s() : this;
|
|
1578
|
-
r(h, a), (
|
|
1681
|
+
r(h, a), (c = h._zod).deferred ?? (c.deferred = []);
|
|
1579
1682
|
for (const p of h._zod.deferred)
|
|
1580
1683
|
p();
|
|
1581
1684
|
return h;
|
|
@@ -1584,7 +1687,7 @@ function c(t, e, n) {
|
|
|
1584
1687
|
value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(t)
|
|
1585
1688
|
}), Object.defineProperty(o, "name", { value: t }), o;
|
|
1586
1689
|
}
|
|
1587
|
-
class
|
|
1690
|
+
class j extends Error {
|
|
1588
1691
|
constructor() {
|
|
1589
1692
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1590
1693
|
}
|
|
@@ -1595,17 +1698,17 @@ class He extends Error {
|
|
|
1595
1698
|
}
|
|
1596
1699
|
}
|
|
1597
1700
|
const et = {};
|
|
1598
|
-
function
|
|
1701
|
+
function C(t) {
|
|
1599
1702
|
return et;
|
|
1600
1703
|
}
|
|
1601
1704
|
function tt(t) {
|
|
1602
1705
|
const e = Object.values(t).filter((r) => typeof r == "number");
|
|
1603
1706
|
return Object.entries(t).filter(([r, i]) => e.indexOf(+r) === -1).map(([r, i]) => i);
|
|
1604
1707
|
}
|
|
1605
|
-
function
|
|
1708
|
+
function le(t, e) {
|
|
1606
1709
|
return typeof e == "bigint" ? e.toString() : e;
|
|
1607
1710
|
}
|
|
1608
|
-
function
|
|
1711
|
+
function re(t) {
|
|
1609
1712
|
return {
|
|
1610
1713
|
get value() {
|
|
1611
1714
|
{
|
|
@@ -1615,19 +1718,19 @@ function te(t) {
|
|
|
1615
1718
|
}
|
|
1616
1719
|
};
|
|
1617
1720
|
}
|
|
1618
|
-
function
|
|
1721
|
+
function me(t) {
|
|
1619
1722
|
return t == null;
|
|
1620
1723
|
}
|
|
1621
|
-
function
|
|
1724
|
+
function ge(t) {
|
|
1622
1725
|
const e = t.startsWith("^") ? 1 : 0, n = t.endsWith("$") ? t.length - 1 : t.length;
|
|
1623
1726
|
return t.slice(e, n);
|
|
1624
1727
|
}
|
|
1625
|
-
function
|
|
1728
|
+
function Qt(t, e) {
|
|
1626
1729
|
const n = (t.toString().split(".")[1] || "").length, r = e.toString();
|
|
1627
1730
|
let i = (r.split(".")[1] || "").length;
|
|
1628
1731
|
if (i === 0 && /\d?e-\d?/.test(r)) {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1732
|
+
const c = r.match(/\d?e-(\d?)/);
|
|
1733
|
+
c?.[1] && (i = Number.parseInt(c[1]));
|
|
1631
1734
|
}
|
|
1632
1735
|
const s = n > i ? n : i, o = Number.parseInt(t.toFixed(s).replace(".", "")), a = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
1633
1736
|
return o % a / 10 ** s;
|
|
@@ -1649,7 +1752,7 @@ function m(t, e, n) {
|
|
|
1649
1752
|
configurable: !0
|
|
1650
1753
|
});
|
|
1651
1754
|
}
|
|
1652
|
-
function
|
|
1755
|
+
function L(t, e, n) {
|
|
1653
1756
|
Object.defineProperty(t, e, {
|
|
1654
1757
|
value: n,
|
|
1655
1758
|
writable: !0,
|
|
@@ -1665,18 +1768,18 @@ function x(...t) {
|
|
|
1665
1768
|
}
|
|
1666
1769
|
return Object.defineProperties({}, e);
|
|
1667
1770
|
}
|
|
1668
|
-
function
|
|
1771
|
+
function Ie(t) {
|
|
1669
1772
|
return JSON.stringify(t);
|
|
1670
1773
|
}
|
|
1671
|
-
function
|
|
1774
|
+
function Ht(t) {
|
|
1672
1775
|
return t.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1673
1776
|
}
|
|
1674
1777
|
const nt = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
|
|
1675
1778
|
};
|
|
1676
|
-
function
|
|
1779
|
+
function B(t) {
|
|
1677
1780
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1678
1781
|
}
|
|
1679
|
-
const
|
|
1782
|
+
const en = re(() => {
|
|
1680
1783
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
1681
1784
|
return !1;
|
|
1682
1785
|
try {
|
|
@@ -1686,23 +1789,23 @@ const Qt = te(() => {
|
|
|
1686
1789
|
return !1;
|
|
1687
1790
|
}
|
|
1688
1791
|
});
|
|
1689
|
-
function
|
|
1690
|
-
if (
|
|
1792
|
+
function J(t) {
|
|
1793
|
+
if (B(t) === !1)
|
|
1691
1794
|
return !1;
|
|
1692
1795
|
const e = t.constructor;
|
|
1693
1796
|
if (e === void 0 || typeof e != "function")
|
|
1694
1797
|
return !0;
|
|
1695
1798
|
const n = e.prototype;
|
|
1696
|
-
return !(
|
|
1799
|
+
return !(B(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1697
1800
|
}
|
|
1698
1801
|
function rt(t) {
|
|
1699
|
-
return
|
|
1802
|
+
return J(t) ? { ...t } : Array.isArray(t) ? [...t] : t;
|
|
1700
1803
|
}
|
|
1701
|
-
const
|
|
1702
|
-
function
|
|
1804
|
+
const tn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
1805
|
+
function M(t) {
|
|
1703
1806
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1704
1807
|
}
|
|
1705
|
-
function
|
|
1808
|
+
function N(t, e, n) {
|
|
1706
1809
|
const r = new t._zod.constr(e ?? t._zod.def);
|
|
1707
1810
|
return (!e || n?.parent) && (r._zod.parent = t), r;
|
|
1708
1811
|
}
|
|
@@ -1719,17 +1822,17 @@ function l(t) {
|
|
|
1719
1822
|
}
|
|
1720
1823
|
return delete e.message, typeof e.error == "string" ? { ...e, error: () => e.error } : e;
|
|
1721
1824
|
}
|
|
1722
|
-
function
|
|
1825
|
+
function nn(t) {
|
|
1723
1826
|
return Object.keys(t).filter((e) => t[e]._zod.optin === "optional" && t[e]._zod.optout === "optional");
|
|
1724
1827
|
}
|
|
1725
|
-
const
|
|
1828
|
+
const rn = {
|
|
1726
1829
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1727
1830
|
int32: [-2147483648, 2147483647],
|
|
1728
1831
|
uint32: [0, 4294967295],
|
|
1729
1832
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
1730
1833
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
1731
1834
|
};
|
|
1732
|
-
function
|
|
1835
|
+
function sn(t, e) {
|
|
1733
1836
|
const n = t._zod.def, r = x(t._zod.def, {
|
|
1734
1837
|
get shape() {
|
|
1735
1838
|
const i = {};
|
|
@@ -1738,13 +1841,13 @@ function nn(t, e) {
|
|
|
1738
1841
|
throw new Error(`Unrecognized key: "${s}"`);
|
|
1739
1842
|
e[s] && (i[s] = n.shape[s]);
|
|
1740
1843
|
}
|
|
1741
|
-
return
|
|
1844
|
+
return L(this, "shape", i), i;
|
|
1742
1845
|
},
|
|
1743
1846
|
checks: []
|
|
1744
1847
|
});
|
|
1745
|
-
return
|
|
1848
|
+
return N(t, r);
|
|
1746
1849
|
}
|
|
1747
|
-
function
|
|
1850
|
+
function on(t, e) {
|
|
1748
1851
|
const n = t._zod.def, r = x(t._zod.def, {
|
|
1749
1852
|
get shape() {
|
|
1750
1853
|
const i = { ...t._zod.def.shape };
|
|
@@ -1753,14 +1856,14 @@ function rn(t, e) {
|
|
|
1753
1856
|
throw new Error(`Unrecognized key: "${s}"`);
|
|
1754
1857
|
e[s] && delete i[s];
|
|
1755
1858
|
}
|
|
1756
|
-
return
|
|
1859
|
+
return L(this, "shape", i), i;
|
|
1757
1860
|
},
|
|
1758
1861
|
checks: []
|
|
1759
1862
|
});
|
|
1760
|
-
return
|
|
1863
|
+
return N(t, r);
|
|
1761
1864
|
}
|
|
1762
|
-
function
|
|
1763
|
-
if (!
|
|
1865
|
+
function an(t, e) {
|
|
1866
|
+
if (!J(e))
|
|
1764
1867
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
1765
1868
|
const n = t._zod.def.checks;
|
|
1766
1869
|
if (n && n.length > 0)
|
|
@@ -1768,30 +1871,30 @@ function sn(t, e) {
|
|
|
1768
1871
|
const i = x(t._zod.def, {
|
|
1769
1872
|
get shape() {
|
|
1770
1873
|
const s = { ...t._zod.def.shape, ...e };
|
|
1771
|
-
return
|
|
1874
|
+
return L(this, "shape", s), s;
|
|
1772
1875
|
},
|
|
1773
1876
|
checks: []
|
|
1774
1877
|
});
|
|
1775
|
-
return
|
|
1878
|
+
return N(t, i);
|
|
1776
1879
|
}
|
|
1777
|
-
function
|
|
1778
|
-
if (!
|
|
1880
|
+
function cn(t, e) {
|
|
1881
|
+
if (!J(e))
|
|
1779
1882
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1780
1883
|
const n = {
|
|
1781
1884
|
...t._zod.def,
|
|
1782
1885
|
get shape() {
|
|
1783
1886
|
const r = { ...t._zod.def.shape, ...e };
|
|
1784
|
-
return
|
|
1887
|
+
return L(this, "shape", r), r;
|
|
1785
1888
|
},
|
|
1786
1889
|
checks: t._zod.def.checks
|
|
1787
1890
|
};
|
|
1788
|
-
return
|
|
1891
|
+
return N(t, n);
|
|
1789
1892
|
}
|
|
1790
|
-
function
|
|
1893
|
+
function un(t, e) {
|
|
1791
1894
|
const n = x(t._zod.def, {
|
|
1792
1895
|
get shape() {
|
|
1793
1896
|
const r = { ...t._zod.def.shape, ...e._zod.def.shape };
|
|
1794
|
-
return
|
|
1897
|
+
return L(this, "shape", r), r;
|
|
1795
1898
|
},
|
|
1796
1899
|
get catchall() {
|
|
1797
1900
|
return e._zod.def.catchall;
|
|
@@ -1799,9 +1902,9 @@ function an(t, e) {
|
|
|
1799
1902
|
checks: []
|
|
1800
1903
|
// delete existing checks
|
|
1801
1904
|
});
|
|
1802
|
-
return
|
|
1905
|
+
return N(t, n);
|
|
1803
1906
|
}
|
|
1804
|
-
function
|
|
1907
|
+
function hn(t, e, n) {
|
|
1805
1908
|
const r = x(e._zod.def, {
|
|
1806
1909
|
get shape() {
|
|
1807
1910
|
const i = e._zod.def.shape, s = { ...i };
|
|
@@ -1820,13 +1923,13 @@ function cn(t, e, n) {
|
|
|
1820
1923
|
type: "optional",
|
|
1821
1924
|
innerType: i[o]
|
|
1822
1925
|
}) : i[o];
|
|
1823
|
-
return
|
|
1926
|
+
return L(this, "shape", s), s;
|
|
1824
1927
|
},
|
|
1825
1928
|
checks: []
|
|
1826
1929
|
});
|
|
1827
|
-
return
|
|
1930
|
+
return N(e, r);
|
|
1828
1931
|
}
|
|
1829
|
-
function
|
|
1932
|
+
function pn(t, e, n) {
|
|
1830
1933
|
const r = x(e._zod.def, {
|
|
1831
1934
|
get shape() {
|
|
1832
1935
|
const i = e._zod.def.shape, s = { ...i };
|
|
@@ -1845,13 +1948,13 @@ function un(t, e, n) {
|
|
|
1845
1948
|
type: "nonoptional",
|
|
1846
1949
|
innerType: i[o]
|
|
1847
1950
|
});
|
|
1848
|
-
return
|
|
1951
|
+
return L(this, "shape", s), s;
|
|
1849
1952
|
},
|
|
1850
1953
|
checks: []
|
|
1851
1954
|
});
|
|
1852
|
-
return
|
|
1955
|
+
return N(e, r);
|
|
1853
1956
|
}
|
|
1854
|
-
function
|
|
1957
|
+
function F(t, e = 0) {
|
|
1855
1958
|
if (t.aborted === !0)
|
|
1856
1959
|
return !0;
|
|
1857
1960
|
for (let n = e; n < t.issues.length; n++)
|
|
@@ -1865,21 +1968,21 @@ function it(t, e) {
|
|
|
1865
1968
|
return (r = n).path ?? (r.path = []), n.path.unshift(t), n;
|
|
1866
1969
|
});
|
|
1867
1970
|
}
|
|
1868
|
-
function
|
|
1971
|
+
function Y(t) {
|
|
1869
1972
|
return typeof t == "string" ? t : t?.message;
|
|
1870
1973
|
}
|
|
1871
|
-
function
|
|
1974
|
+
function R(t, e, n) {
|
|
1872
1975
|
const r = { ...t, path: t.path ?? [] };
|
|
1873
1976
|
if (!t.message) {
|
|
1874
|
-
const i =
|
|
1977
|
+
const i = Y(t.inst?._zod.def?.error?.(t)) ?? Y(e?.error?.(t)) ?? Y(n.customError?.(t)) ?? Y(n.localeError?.(t)) ?? "Invalid input";
|
|
1875
1978
|
r.message = i;
|
|
1876
1979
|
}
|
|
1877
1980
|
return delete r.inst, delete r.continue, e?.reportInput || delete r.input, r;
|
|
1878
1981
|
}
|
|
1879
|
-
function
|
|
1982
|
+
function ve(t) {
|
|
1880
1983
|
return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
|
|
1881
1984
|
}
|
|
1882
|
-
function
|
|
1985
|
+
function W(...t) {
|
|
1883
1986
|
const [e, n, r] = t;
|
|
1884
1987
|
return typeof e == "string" ? {
|
|
1885
1988
|
message: e,
|
|
@@ -1895,18 +1998,18 @@ const st = (t, e) => {
|
|
|
1895
1998
|
}), Object.defineProperty(t, "issues", {
|
|
1896
1999
|
value: e,
|
|
1897
2000
|
enumerable: !1
|
|
1898
|
-
}), t.message = JSON.stringify(e,
|
|
2001
|
+
}), t.message = JSON.stringify(e, le, 2), Object.defineProperty(t, "toString", {
|
|
1899
2002
|
value: () => t.message,
|
|
1900
2003
|
enumerable: !1
|
|
1901
2004
|
});
|
|
1902
|
-
}, ot =
|
|
1903
|
-
function
|
|
2005
|
+
}, ot = u("$ZodError", st), at = u("$ZodError", st, { Parent: Error });
|
|
2006
|
+
function ln(t, e = (n) => n.message) {
|
|
1904
2007
|
const n = {}, r = [];
|
|
1905
2008
|
for (const i of t.issues)
|
|
1906
2009
|
i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(e(i))) : r.push(e(i));
|
|
1907
2010
|
return { formErrors: r, fieldErrors: n };
|
|
1908
2011
|
}
|
|
1909
|
-
function
|
|
2012
|
+
function dn(t, e = (n) => n.message) {
|
|
1910
2013
|
const n = { _errors: [] }, r = (i) => {
|
|
1911
2014
|
for (const s of i.issues)
|
|
1912
2015
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -1920,86 +2023,86 @@ function pn(t, e = (n) => n.message) {
|
|
|
1920
2023
|
else {
|
|
1921
2024
|
let o = n, a = 0;
|
|
1922
2025
|
for (; a < s.path.length; ) {
|
|
1923
|
-
const
|
|
1924
|
-
a === s.path.length - 1 ? (o[
|
|
2026
|
+
const c = s.path[a];
|
|
2027
|
+
a === s.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(e(s))) : o[c] = o[c] || { _errors: [] }, o = o[c], a++;
|
|
1925
2028
|
}
|
|
1926
2029
|
}
|
|
1927
2030
|
};
|
|
1928
2031
|
return r(t), n;
|
|
1929
2032
|
}
|
|
1930
|
-
const
|
|
2033
|
+
const _e = (t) => (e, n, r, i) => {
|
|
1931
2034
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, o = e._zod.run({ value: n, issues: [] }, s);
|
|
1932
2035
|
if (o instanceof Promise)
|
|
1933
|
-
throw new
|
|
2036
|
+
throw new j();
|
|
1934
2037
|
if (o.issues.length) {
|
|
1935
|
-
const a = new (i?.Err ?? t)(o.issues.map((
|
|
2038
|
+
const a = new (i?.Err ?? t)(o.issues.map((c) => R(c, s, C())));
|
|
1936
2039
|
throw nt(a, i?.callee), a;
|
|
1937
2040
|
}
|
|
1938
2041
|
return o.value;
|
|
1939
|
-
},
|
|
2042
|
+
}, ke = (t) => async (e, n, r, i) => {
|
|
1940
2043
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1941
2044
|
let o = e._zod.run({ value: n, issues: [] }, s);
|
|
1942
2045
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
1943
|
-
const a = new (i?.Err ?? t)(o.issues.map((
|
|
2046
|
+
const a = new (i?.Err ?? t)(o.issues.map((c) => R(c, s, C())));
|
|
1944
2047
|
throw nt(a, i?.callee), a;
|
|
1945
2048
|
}
|
|
1946
2049
|
return o.value;
|
|
1947
|
-
},
|
|
2050
|
+
}, ie = (t) => (e, n, r) => {
|
|
1948
2051
|
const i = r ? { ...r, async: !1 } : { async: !1 }, s = e._zod.run({ value: n, issues: [] }, i);
|
|
1949
2052
|
if (s instanceof Promise)
|
|
1950
|
-
throw new
|
|
2053
|
+
throw new j();
|
|
1951
2054
|
return s.issues.length ? {
|
|
1952
2055
|
success: !1,
|
|
1953
|
-
error: new (t ?? ot)(s.issues.map((o) =>
|
|
2056
|
+
error: new (t ?? ot)(s.issues.map((o) => R(o, i, C())))
|
|
1954
2057
|
} : { success: !0, data: s.value };
|
|
1955
|
-
},
|
|
2058
|
+
}, fn = /* @__PURE__ */ ie(at), se = (t) => async (e, n, r) => {
|
|
1956
2059
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1957
2060
|
let s = e._zod.run({ value: n, issues: [] }, i);
|
|
1958
2061
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
1959
2062
|
success: !1,
|
|
1960
|
-
error: new t(s.issues.map((o) =>
|
|
2063
|
+
error: new t(s.issues.map((o) => R(o, i, C())))
|
|
1961
2064
|
} : { success: !0, data: s.value };
|
|
1962
|
-
},
|
|
1963
|
-
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1964
|
-
return ve(t)(e, n, i);
|
|
1965
|
-
}, mn = (t) => (e, n, r) => ve(t)(e, n, r), gn = (t) => async (e, n, r) => {
|
|
2065
|
+
}, mn = /* @__PURE__ */ se(at), gn = (t) => (e, n, r) => {
|
|
1966
2066
|
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1967
2067
|
return _e(t)(e, n, i);
|
|
1968
|
-
}, vn = (t) =>
|
|
2068
|
+
}, vn = (t) => (e, n, r) => _e(t)(e, n, r), _n = (t) => async (e, n, r) => {
|
|
1969
2069
|
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1970
|
-
return
|
|
1971
|
-
}, kn = (t) => (e, n, r) =>
|
|
2070
|
+
return ke(t)(e, n, i);
|
|
2071
|
+
}, kn = (t) => async (e, n, r) => ke(t)(e, n, r), yn = (t) => (e, n, r) => {
|
|
1972
2072
|
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1973
|
-
return
|
|
1974
|
-
}, Tn = (t) =>
|
|
1975
|
-
|
|
1976
|
-
return
|
|
2073
|
+
return ie(t)(e, n, i);
|
|
2074
|
+
}, Tn = (t) => (e, n, r) => ie(t)(e, n, r), wn = (t) => async (e, n, r) => {
|
|
2075
|
+
const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
2076
|
+
return se(t)(e, n, i);
|
|
2077
|
+
}, bn = (t) => async (e, n, r) => se(t)(e, n, r), En = /^[cC][^\s-]{8,}$/, In = /^[0-9a-z]+$/, zn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, $n = /^[0-9a-vA-V]{20}$/, On = /^[A-Za-z0-9]{27}$/, Pn = /^[a-zA-Z0-9_-]{21}$/, Sn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Nn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, ze = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, An = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Zn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2078
|
+
function Cn() {
|
|
2079
|
+
return new RegExp(Zn, "u");
|
|
1977
2080
|
}
|
|
1978
|
-
const
|
|
2081
|
+
const Rn = /^(?:(?: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])$/, Ln = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, xn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Dn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Fn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ct = /^[A-Za-z0-9_-]*$/, jn = /^\+(?:[0-9]){6,14}[0-9]$/, ut = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Mn = /* @__PURE__ */ new RegExp(`^${ut}$`);
|
|
1979
2082
|
function ht(t) {
|
|
1980
2083
|
const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1981
2084
|
return typeof t.precision == "number" ? t.precision === -1 ? `${e}` : t.precision === 0 ? `${e}:[0-5]\\d` : `${e}:[0-5]\\d\\.\\d{${t.precision}}` : `${e}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
1982
2085
|
}
|
|
1983
|
-
function
|
|
2086
|
+
function Un(t) {
|
|
1984
2087
|
return new RegExp(`^${ht(t)}$`);
|
|
1985
2088
|
}
|
|
1986
|
-
function
|
|
2089
|
+
function Gn(t) {
|
|
1987
2090
|
const e = ht({ precision: t.precision }), n = ["Z"];
|
|
1988
2091
|
t.local && n.push(""), t.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1989
2092
|
const r = `${e}(?:${n.join("|")})`;
|
|
1990
2093
|
return new RegExp(`^${ut}T(?:${r})$`);
|
|
1991
2094
|
}
|
|
1992
|
-
const
|
|
2095
|
+
const Vn = (t) => {
|
|
1993
2096
|
const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1994
2097
|
return new RegExp(`^${e}$`);
|
|
1995
|
-
},
|
|
2098
|
+
}, Bn = /^-?\d+$/, Jn = /^-?\d+(?:\.\d+)?/, Wn = /^[^A-Z]*$/, Kn = /^[^a-z]*$/, b = /* @__PURE__ */ u("$ZodCheck", (t, e) => {
|
|
1996
2099
|
var n;
|
|
1997
2100
|
t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
|
|
1998
2101
|
}), pt = {
|
|
1999
2102
|
number: "number",
|
|
2000
2103
|
bigint: "bigint",
|
|
2001
2104
|
object: "date"
|
|
2002
|
-
}, lt = /* @__PURE__ */
|
|
2105
|
+
}, lt = /* @__PURE__ */ u("$ZodCheckLessThan", (t, e) => {
|
|
2003
2106
|
b.init(t, e);
|
|
2004
2107
|
const n = pt[typeof e.value];
|
|
2005
2108
|
t._zod.onattach.push((r) => {
|
|
@@ -2016,7 +2119,7 @@ const Mn = (t) => {
|
|
|
2016
2119
|
continue: !e.abort
|
|
2017
2120
|
});
|
|
2018
2121
|
};
|
|
2019
|
-
}), dt = /* @__PURE__ */
|
|
2122
|
+
}), dt = /* @__PURE__ */ u("$ZodCheckGreaterThan", (t, e) => {
|
|
2020
2123
|
b.init(t, e);
|
|
2021
2124
|
const n = pt[typeof e.value];
|
|
2022
2125
|
t._zod.onattach.push((r) => {
|
|
@@ -2033,14 +2136,14 @@ const Mn = (t) => {
|
|
|
2033
2136
|
continue: !e.abort
|
|
2034
2137
|
});
|
|
2035
2138
|
};
|
|
2036
|
-
}),
|
|
2139
|
+
}), Yn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (t, e) => {
|
|
2037
2140
|
b.init(t, e), t._zod.onattach.push((n) => {
|
|
2038
2141
|
var r;
|
|
2039
2142
|
(r = n._zod.bag).multipleOf ?? (r.multipleOf = e.value);
|
|
2040
2143
|
}), t._zod.check = (n) => {
|
|
2041
2144
|
if (typeof n.value != typeof e.value)
|
|
2042
2145
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
2043
|
-
(typeof n.value == "bigint" ? n.value % e.value === BigInt(0) :
|
|
2146
|
+
(typeof n.value == "bigint" ? n.value % e.value === BigInt(0) : Qt(n.value, e.value) === 0) || n.issues.push({
|
|
2044
2147
|
origin: typeof n.value,
|
|
2045
2148
|
code: "not_multiple_of",
|
|
2046
2149
|
divisor: e.value,
|
|
@@ -2049,12 +2152,12 @@ const Mn = (t) => {
|
|
|
2049
2152
|
continue: !e.abort
|
|
2050
2153
|
});
|
|
2051
2154
|
};
|
|
2052
|
-
}),
|
|
2155
|
+
}), qn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (t, e) => {
|
|
2053
2156
|
b.init(t, e), e.format = e.format || "float64";
|
|
2054
|
-
const n = e.format?.includes("int"), r = n ? "int" : "number", [i, s] =
|
|
2157
|
+
const n = e.format?.includes("int"), r = n ? "int" : "number", [i, s] = rn[e.format];
|
|
2055
2158
|
t._zod.onattach.push((o) => {
|
|
2056
2159
|
const a = o._zod.bag;
|
|
2057
|
-
a.format = e.format, a.minimum = i, a.maximum = s, n && (a.pattern =
|
|
2160
|
+
a.format = e.format, a.minimum = i, a.maximum = s, n && (a.pattern = Bn);
|
|
2058
2161
|
}), t._zod.check = (o) => {
|
|
2059
2162
|
const a = o.value;
|
|
2060
2163
|
if (n) {
|
|
@@ -2106,11 +2209,11 @@ const Mn = (t) => {
|
|
|
2106
2209
|
inst: t
|
|
2107
2210
|
});
|
|
2108
2211
|
};
|
|
2109
|
-
}),
|
|
2212
|
+
}), Xn = /* @__PURE__ */ u("$ZodCheckMaxLength", (t, e) => {
|
|
2110
2213
|
var n;
|
|
2111
2214
|
b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
2112
2215
|
const i = r.value;
|
|
2113
|
-
return !
|
|
2216
|
+
return !me(i) && i.length !== void 0;
|
|
2114
2217
|
}), t._zod.onattach.push((r) => {
|
|
2115
2218
|
const i = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2116
2219
|
e.maximum < i && (r._zod.bag.maximum = e.maximum);
|
|
@@ -2118,7 +2221,7 @@ const Mn = (t) => {
|
|
|
2118
2221
|
const i = r.value;
|
|
2119
2222
|
if (i.length <= e.maximum)
|
|
2120
2223
|
return;
|
|
2121
|
-
const o =
|
|
2224
|
+
const o = ve(i);
|
|
2122
2225
|
r.issues.push({
|
|
2123
2226
|
origin: o,
|
|
2124
2227
|
code: "too_big",
|
|
@@ -2129,11 +2232,11 @@ const Mn = (t) => {
|
|
|
2129
2232
|
continue: !e.abort
|
|
2130
2233
|
});
|
|
2131
2234
|
};
|
|
2132
|
-
}),
|
|
2235
|
+
}), Qn = /* @__PURE__ */ u("$ZodCheckMinLength", (t, e) => {
|
|
2133
2236
|
var n;
|
|
2134
2237
|
b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
2135
2238
|
const i = r.value;
|
|
2136
|
-
return !
|
|
2239
|
+
return !me(i) && i.length !== void 0;
|
|
2137
2240
|
}), t._zod.onattach.push((r) => {
|
|
2138
2241
|
const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2139
2242
|
e.minimum > i && (r._zod.bag.minimum = e.minimum);
|
|
@@ -2141,7 +2244,7 @@ const Mn = (t) => {
|
|
|
2141
2244
|
const i = r.value;
|
|
2142
2245
|
if (i.length >= e.minimum)
|
|
2143
2246
|
return;
|
|
2144
|
-
const o =
|
|
2247
|
+
const o = ve(i);
|
|
2145
2248
|
r.issues.push({
|
|
2146
2249
|
origin: o,
|
|
2147
2250
|
code: "too_small",
|
|
@@ -2152,11 +2255,11 @@ const Mn = (t) => {
|
|
|
2152
2255
|
continue: !e.abort
|
|
2153
2256
|
});
|
|
2154
2257
|
};
|
|
2155
|
-
}),
|
|
2258
|
+
}), Hn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (t, e) => {
|
|
2156
2259
|
var n;
|
|
2157
2260
|
b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
|
|
2158
2261
|
const i = r.value;
|
|
2159
|
-
return !
|
|
2262
|
+
return !me(i) && i.length !== void 0;
|
|
2160
2263
|
}), t._zod.onattach.push((r) => {
|
|
2161
2264
|
const i = r._zod.bag;
|
|
2162
2265
|
i.minimum = e.length, i.maximum = e.length, i.length = e.length;
|
|
@@ -2164,7 +2267,7 @@ const Mn = (t) => {
|
|
|
2164
2267
|
const i = r.value, s = i.length;
|
|
2165
2268
|
if (s === e.length)
|
|
2166
2269
|
return;
|
|
2167
|
-
const o =
|
|
2270
|
+
const o = ve(i), a = s > e.length;
|
|
2168
2271
|
r.issues.push({
|
|
2169
2272
|
origin: o,
|
|
2170
2273
|
...a ? { code: "too_big", maximum: e.length } : { code: "too_small", minimum: e.length },
|
|
@@ -2175,7 +2278,7 @@ const Mn = (t) => {
|
|
|
2175
2278
|
continue: !e.abort
|
|
2176
2279
|
});
|
|
2177
2280
|
};
|
|
2178
|
-
}),
|
|
2281
|
+
}), oe = /* @__PURE__ */ u("$ZodCheckStringFormat", (t, e) => {
|
|
2179
2282
|
var n, r;
|
|
2180
2283
|
b.init(t, e), t._zod.onattach.push((i) => {
|
|
2181
2284
|
const s = i._zod.bag;
|
|
@@ -2192,8 +2295,8 @@ const Mn = (t) => {
|
|
|
2192
2295
|
});
|
|
2193
2296
|
}) : (r = t._zod).check ?? (r.check = () => {
|
|
2194
2297
|
});
|
|
2195
|
-
}),
|
|
2196
|
-
|
|
2298
|
+
}), er = /* @__PURE__ */ u("$ZodCheckRegex", (t, e) => {
|
|
2299
|
+
oe.init(t, e), t._zod.check = (n) => {
|
|
2197
2300
|
e.pattern.lastIndex = 0, !e.pattern.test(n.value) && n.issues.push({
|
|
2198
2301
|
origin: "string",
|
|
2199
2302
|
code: "invalid_format",
|
|
@@ -2204,13 +2307,13 @@ const Mn = (t) => {
|
|
|
2204
2307
|
continue: !e.abort
|
|
2205
2308
|
});
|
|
2206
2309
|
};
|
|
2207
|
-
}),
|
|
2208
|
-
e.pattern ?? (e.pattern =
|
|
2209
|
-
}),
|
|
2210
|
-
e.pattern ?? (e.pattern =
|
|
2211
|
-
}),
|
|
2310
|
+
}), tr = /* @__PURE__ */ u("$ZodCheckLowerCase", (t, e) => {
|
|
2311
|
+
e.pattern ?? (e.pattern = Wn), oe.init(t, e);
|
|
2312
|
+
}), nr = /* @__PURE__ */ u("$ZodCheckUpperCase", (t, e) => {
|
|
2313
|
+
e.pattern ?? (e.pattern = Kn), oe.init(t, e);
|
|
2314
|
+
}), rr = /* @__PURE__ */ u("$ZodCheckIncludes", (t, e) => {
|
|
2212
2315
|
b.init(t, e);
|
|
2213
|
-
const n =
|
|
2316
|
+
const n = M(e.includes), r = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${n}` : n);
|
|
2214
2317
|
e.pattern = r, t._zod.onattach.push((i) => {
|
|
2215
2318
|
const s = i._zod.bag;
|
|
2216
2319
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -2225,9 +2328,9 @@ const Mn = (t) => {
|
|
|
2225
2328
|
continue: !e.abort
|
|
2226
2329
|
});
|
|
2227
2330
|
};
|
|
2228
|
-
}),
|
|
2331
|
+
}), ir = /* @__PURE__ */ u("$ZodCheckStartsWith", (t, e) => {
|
|
2229
2332
|
b.init(t, e);
|
|
2230
|
-
const n = new RegExp(`^${
|
|
2333
|
+
const n = new RegExp(`^${M(e.prefix)}.*`);
|
|
2231
2334
|
e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
|
|
2232
2335
|
const i = r._zod.bag;
|
|
2233
2336
|
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
|
|
@@ -2242,9 +2345,9 @@ const Mn = (t) => {
|
|
|
2242
2345
|
continue: !e.abort
|
|
2243
2346
|
});
|
|
2244
2347
|
};
|
|
2245
|
-
}),
|
|
2348
|
+
}), sr = /* @__PURE__ */ u("$ZodCheckEndsWith", (t, e) => {
|
|
2246
2349
|
b.init(t, e);
|
|
2247
|
-
const n = new RegExp(`.*${
|
|
2350
|
+
const n = new RegExp(`.*${M(e.suffix)}$`);
|
|
2248
2351
|
e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
|
|
2249
2352
|
const i = r._zod.bag;
|
|
2250
2353
|
i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
|
|
@@ -2259,12 +2362,12 @@ const Mn = (t) => {
|
|
|
2259
2362
|
continue: !e.abort
|
|
2260
2363
|
});
|
|
2261
2364
|
};
|
|
2262
|
-
}),
|
|
2365
|
+
}), or = /* @__PURE__ */ u("$ZodCheckOverwrite", (t, e) => {
|
|
2263
2366
|
b.init(t, e), t._zod.check = (n) => {
|
|
2264
2367
|
n.value = e.tx(n.value);
|
|
2265
2368
|
};
|
|
2266
2369
|
});
|
|
2267
|
-
class
|
|
2370
|
+
class ar {
|
|
2268
2371
|
constructor(e = []) {
|
|
2269
2372
|
this.content = [], this.indent = 0, this && (this.args = e);
|
|
2270
2373
|
}
|
|
@@ -2287,13 +2390,13 @@ class sr {
|
|
|
2287
2390
|
`));
|
|
2288
2391
|
}
|
|
2289
2392
|
}
|
|
2290
|
-
const
|
|
2393
|
+
const cr = {
|
|
2291
2394
|
major: 4,
|
|
2292
2395
|
minor: 2,
|
|
2293
2396
|
patch: 1
|
|
2294
|
-
}, k = /* @__PURE__ */
|
|
2397
|
+
}, k = /* @__PURE__ */ u("$ZodType", (t, e) => {
|
|
2295
2398
|
var n;
|
|
2296
|
-
t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version =
|
|
2399
|
+
t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = cr;
|
|
2297
2400
|
const r = [...t._zod.def.checks ?? []];
|
|
2298
2401
|
t._zod.traits.has("$ZodCheck") && r.unshift(t);
|
|
2299
2402
|
for (const i of r)
|
|
@@ -2304,8 +2407,8 @@ const or = {
|
|
|
2304
2407
|
t._zod.run = t._zod.parse;
|
|
2305
2408
|
});
|
|
2306
2409
|
else {
|
|
2307
|
-
const i = (o, a,
|
|
2308
|
-
let h =
|
|
2410
|
+
const i = (o, a, c) => {
|
|
2411
|
+
let h = F(o), p;
|
|
2309
2412
|
for (const d of a) {
|
|
2310
2413
|
if (d._zod.def.when) {
|
|
2311
2414
|
if (!d._zod.def.when(o))
|
|
@@ -2313,29 +2416,29 @@ const or = {
|
|
|
2313
2416
|
} else if (h)
|
|
2314
2417
|
continue;
|
|
2315
2418
|
const f = o.issues.length, v = d._zod.check(o);
|
|
2316
|
-
if (v instanceof Promise &&
|
|
2317
|
-
throw new
|
|
2419
|
+
if (v instanceof Promise && c?.async === !1)
|
|
2420
|
+
throw new j();
|
|
2318
2421
|
if (p || v instanceof Promise)
|
|
2319
2422
|
p = (p ?? Promise.resolve()).then(async () => {
|
|
2320
|
-
await v, o.issues.length !== f && (h || (h =
|
|
2423
|
+
await v, o.issues.length !== f && (h || (h = F(o, f)));
|
|
2321
2424
|
});
|
|
2322
2425
|
else {
|
|
2323
2426
|
if (o.issues.length === f)
|
|
2324
2427
|
continue;
|
|
2325
|
-
h || (h =
|
|
2428
|
+
h || (h = F(o, f));
|
|
2326
2429
|
}
|
|
2327
2430
|
}
|
|
2328
2431
|
return p ? p.then(() => o) : o;
|
|
2329
|
-
}, s = (o, a,
|
|
2330
|
-
if (
|
|
2432
|
+
}, s = (o, a, c) => {
|
|
2433
|
+
if (F(o))
|
|
2331
2434
|
return o.aborted = !0, o;
|
|
2332
|
-
const h = i(a, r,
|
|
2435
|
+
const h = i(a, r, c);
|
|
2333
2436
|
if (h instanceof Promise) {
|
|
2334
|
-
if (
|
|
2335
|
-
throw new
|
|
2336
|
-
return h.then((p) => t._zod.parse(p,
|
|
2437
|
+
if (c.async === !1)
|
|
2438
|
+
throw new j();
|
|
2439
|
+
return h.then((p) => t._zod.parse(p, c));
|
|
2337
2440
|
}
|
|
2338
|
-
return t._zod.parse(h,
|
|
2441
|
+
return t._zod.parse(h, c);
|
|
2339
2442
|
};
|
|
2340
2443
|
t._zod.run = (o, a) => {
|
|
2341
2444
|
if (a.skipChecks)
|
|
@@ -2344,29 +2447,29 @@ const or = {
|
|
|
2344
2447
|
const h = t._zod.parse({ value: o.value, issues: [] }, { ...a, skipChecks: !0 });
|
|
2345
2448
|
return h instanceof Promise ? h.then((p) => s(p, o, a)) : s(h, o, a);
|
|
2346
2449
|
}
|
|
2347
|
-
const
|
|
2348
|
-
if (
|
|
2450
|
+
const c = t._zod.parse(o, a);
|
|
2451
|
+
if (c instanceof Promise) {
|
|
2349
2452
|
if (a.async === !1)
|
|
2350
|
-
throw new
|
|
2351
|
-
return
|
|
2453
|
+
throw new j();
|
|
2454
|
+
return c.then((h) => i(h, r, a));
|
|
2352
2455
|
}
|
|
2353
|
-
return i(
|
|
2456
|
+
return i(c, r, a);
|
|
2354
2457
|
};
|
|
2355
2458
|
}
|
|
2356
2459
|
t["~standard"] = {
|
|
2357
2460
|
validate: (i) => {
|
|
2358
2461
|
try {
|
|
2359
|
-
const s =
|
|
2462
|
+
const s = fn(t, i);
|
|
2360
2463
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
2361
2464
|
} catch {
|
|
2362
|
-
return
|
|
2465
|
+
return mn(t, i).then((o) => o.success ? { value: o.data } : { issues: o.error?.issues });
|
|
2363
2466
|
}
|
|
2364
2467
|
},
|
|
2365
2468
|
vendor: "zod",
|
|
2366
2469
|
version: 1
|
|
2367
2470
|
};
|
|
2368
|
-
}),
|
|
2369
|
-
k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ??
|
|
2471
|
+
}), ye = /* @__PURE__ */ u("$ZodString", (t, e) => {
|
|
2472
|
+
k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Vn(t._zod.bag), t._zod.parse = (n, r) => {
|
|
2370
2473
|
if (e.coerce)
|
|
2371
2474
|
try {
|
|
2372
2475
|
n.value = String(n.value);
|
|
@@ -2379,11 +2482,11 @@ const or = {
|
|
|
2379
2482
|
inst: t
|
|
2380
2483
|
}), n;
|
|
2381
2484
|
};
|
|
2382
|
-
}), g = /* @__PURE__ */
|
|
2383
|
-
|
|
2384
|
-
}),
|
|
2385
|
-
e.pattern ?? (e.pattern =
|
|
2386
|
-
}),
|
|
2485
|
+
}), g = /* @__PURE__ */ u("$ZodStringFormat", (t, e) => {
|
|
2486
|
+
oe.init(t, e), ye.init(t, e);
|
|
2487
|
+
}), ur = /* @__PURE__ */ u("$ZodGUID", (t, e) => {
|
|
2488
|
+
e.pattern ?? (e.pattern = Nn), g.init(t, e);
|
|
2489
|
+
}), hr = /* @__PURE__ */ u("$ZodUUID", (t, e) => {
|
|
2387
2490
|
if (e.version) {
|
|
2388
2491
|
const r = {
|
|
2389
2492
|
v1: 1,
|
|
@@ -2397,13 +2500,13 @@ const or = {
|
|
|
2397
2500
|
}[e.version];
|
|
2398
2501
|
if (r === void 0)
|
|
2399
2502
|
throw new Error(`Invalid UUID version: "${e.version}"`);
|
|
2400
|
-
e.pattern ?? (e.pattern =
|
|
2503
|
+
e.pattern ?? (e.pattern = ze(r));
|
|
2401
2504
|
} else
|
|
2402
|
-
e.pattern ?? (e.pattern =
|
|
2505
|
+
e.pattern ?? (e.pattern = ze());
|
|
2403
2506
|
g.init(t, e);
|
|
2404
|
-
}),
|
|
2405
|
-
e.pattern ?? (e.pattern =
|
|
2406
|
-
}),
|
|
2507
|
+
}), pr = /* @__PURE__ */ u("$ZodEmail", (t, e) => {
|
|
2508
|
+
e.pattern ?? (e.pattern = An), g.init(t, e);
|
|
2509
|
+
}), lr = /* @__PURE__ */ u("$ZodURL", (t, e) => {
|
|
2407
2510
|
g.init(t, e), t._zod.check = (n) => {
|
|
2408
2511
|
try {
|
|
2409
2512
|
const r = n.value.trim(), i = new URL(r);
|
|
@@ -2435,32 +2538,32 @@ const or = {
|
|
|
2435
2538
|
});
|
|
2436
2539
|
}
|
|
2437
2540
|
};
|
|
2438
|
-
}),
|
|
2439
|
-
e.pattern ?? (e.pattern =
|
|
2440
|
-
}),
|
|
2441
|
-
e.pattern ?? (e.pattern =
|
|
2442
|
-
}),
|
|
2443
|
-
e.pattern ?? (e.pattern = wn), g.init(t, e);
|
|
2444
|
-
}), fr = /* @__PURE__ */ c("$ZodCUID2", (t, e) => {
|
|
2445
|
-
e.pattern ?? (e.pattern = bn), g.init(t, e);
|
|
2446
|
-
}), mr = /* @__PURE__ */ c("$ZodULID", (t, e) => {
|
|
2541
|
+
}), dr = /* @__PURE__ */ u("$ZodEmoji", (t, e) => {
|
|
2542
|
+
e.pattern ?? (e.pattern = Cn()), g.init(t, e);
|
|
2543
|
+
}), fr = /* @__PURE__ */ u("$ZodNanoID", (t, e) => {
|
|
2544
|
+
e.pattern ?? (e.pattern = Pn), g.init(t, e);
|
|
2545
|
+
}), mr = /* @__PURE__ */ u("$ZodCUID", (t, e) => {
|
|
2447
2546
|
e.pattern ?? (e.pattern = En), g.init(t, e);
|
|
2448
|
-
}), gr = /* @__PURE__ */
|
|
2449
|
-
e.pattern ?? (e.pattern = zn), g.init(t, e);
|
|
2450
|
-
}), vr = /* @__PURE__ */ c("$ZodKSUID", (t, e) => {
|
|
2547
|
+
}), gr = /* @__PURE__ */ u("$ZodCUID2", (t, e) => {
|
|
2451
2548
|
e.pattern ?? (e.pattern = In), g.init(t, e);
|
|
2452
|
-
}),
|
|
2453
|
-
e.pattern ?? (e.pattern =
|
|
2454
|
-
}),
|
|
2455
|
-
e.pattern ?? (e.pattern =
|
|
2456
|
-
}),
|
|
2457
|
-
e.pattern ?? (e.pattern = jn(e)), g.init(t, e);
|
|
2458
|
-
}), Tr = /* @__PURE__ */ c("$ZodISODuration", (t, e) => {
|
|
2549
|
+
}), vr = /* @__PURE__ */ u("$ZodULID", (t, e) => {
|
|
2550
|
+
e.pattern ?? (e.pattern = zn), g.init(t, e);
|
|
2551
|
+
}), _r = /* @__PURE__ */ u("$ZodXID", (t, e) => {
|
|
2552
|
+
e.pattern ?? (e.pattern = $n), g.init(t, e);
|
|
2553
|
+
}), kr = /* @__PURE__ */ u("$ZodKSUID", (t, e) => {
|
|
2459
2554
|
e.pattern ?? (e.pattern = On), g.init(t, e);
|
|
2460
|
-
}),
|
|
2461
|
-
e.pattern ?? (e.pattern =
|
|
2462
|
-
}),
|
|
2463
|
-
e.pattern ?? (e.pattern =
|
|
2555
|
+
}), yr = /* @__PURE__ */ u("$ZodISODateTime", (t, e) => {
|
|
2556
|
+
e.pattern ?? (e.pattern = Gn(e)), g.init(t, e);
|
|
2557
|
+
}), Tr = /* @__PURE__ */ u("$ZodISODate", (t, e) => {
|
|
2558
|
+
e.pattern ?? (e.pattern = Mn), g.init(t, e);
|
|
2559
|
+
}), wr = /* @__PURE__ */ u("$ZodISOTime", (t, e) => {
|
|
2560
|
+
e.pattern ?? (e.pattern = Un(e)), g.init(t, e);
|
|
2561
|
+
}), br = /* @__PURE__ */ u("$ZodISODuration", (t, e) => {
|
|
2562
|
+
e.pattern ?? (e.pattern = Sn), g.init(t, e);
|
|
2563
|
+
}), Er = /* @__PURE__ */ u("$ZodIPv4", (t, e) => {
|
|
2564
|
+
e.pattern ?? (e.pattern = Rn), g.init(t, e), t._zod.bag.format = "ipv4";
|
|
2565
|
+
}), Ir = /* @__PURE__ */ u("$ZodIPv6", (t, e) => {
|
|
2566
|
+
e.pattern ?? (e.pattern = Ln), g.init(t, e), t._zod.bag.format = "ipv6", t._zod.check = (n) => {
|
|
2464
2567
|
try {
|
|
2465
2568
|
new URL(`http://[${n.value}]`);
|
|
2466
2569
|
} catch {
|
|
@@ -2473,10 +2576,10 @@ const or = {
|
|
|
2473
2576
|
});
|
|
2474
2577
|
}
|
|
2475
2578
|
};
|
|
2476
|
-
}),
|
|
2477
|
-
e.pattern ?? (e.pattern =
|
|
2478
|
-
}),
|
|
2479
|
-
e.pattern ?? (e.pattern =
|
|
2579
|
+
}), zr = /* @__PURE__ */ u("$ZodCIDRv4", (t, e) => {
|
|
2580
|
+
e.pattern ?? (e.pattern = xn), g.init(t, e);
|
|
2581
|
+
}), $r = /* @__PURE__ */ u("$ZodCIDRv6", (t, e) => {
|
|
2582
|
+
e.pattern ?? (e.pattern = Dn), g.init(t, e), t._zod.check = (n) => {
|
|
2480
2583
|
const r = n.value.split("/");
|
|
2481
2584
|
try {
|
|
2482
2585
|
if (r.length !== 2)
|
|
@@ -2512,8 +2615,8 @@ function ft(t) {
|
|
|
2512
2615
|
return !1;
|
|
2513
2616
|
}
|
|
2514
2617
|
}
|
|
2515
|
-
const
|
|
2516
|
-
e.pattern ?? (e.pattern =
|
|
2618
|
+
const Or = /* @__PURE__ */ u("$ZodBase64", (t, e) => {
|
|
2619
|
+
e.pattern ?? (e.pattern = Fn), g.init(t, e), t._zod.bag.contentEncoding = "base64", t._zod.check = (n) => {
|
|
2517
2620
|
ft(n.value) || n.issues.push({
|
|
2518
2621
|
code: "invalid_format",
|
|
2519
2622
|
format: "base64",
|
|
@@ -2523,15 +2626,15 @@ const Ir = /* @__PURE__ */ c("$ZodBase64", (t, e) => {
|
|
|
2523
2626
|
});
|
|
2524
2627
|
};
|
|
2525
2628
|
});
|
|
2526
|
-
function
|
|
2629
|
+
function Pr(t) {
|
|
2527
2630
|
if (!ct.test(t))
|
|
2528
2631
|
return !1;
|
|
2529
2632
|
const e = t.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = e.padEnd(Math.ceil(e.length / 4) * 4, "=");
|
|
2530
2633
|
return ft(n);
|
|
2531
2634
|
}
|
|
2532
|
-
const
|
|
2635
|
+
const Sr = /* @__PURE__ */ u("$ZodBase64URL", (t, e) => {
|
|
2533
2636
|
e.pattern ?? (e.pattern = ct), g.init(t, e), t._zod.bag.contentEncoding = "base64url", t._zod.check = (n) => {
|
|
2534
|
-
|
|
2637
|
+
Pr(n.value) || n.issues.push({
|
|
2535
2638
|
code: "invalid_format",
|
|
2536
2639
|
format: "base64url",
|
|
2537
2640
|
input: n.value,
|
|
@@ -2539,10 +2642,10 @@ const Or = /* @__PURE__ */ c("$ZodBase64URL", (t, e) => {
|
|
|
2539
2642
|
continue: !e.abort
|
|
2540
2643
|
});
|
|
2541
2644
|
};
|
|
2542
|
-
}),
|
|
2543
|
-
e.pattern ?? (e.pattern =
|
|
2645
|
+
}), Nr = /* @__PURE__ */ u("$ZodE164", (t, e) => {
|
|
2646
|
+
e.pattern ?? (e.pattern = jn), g.init(t, e);
|
|
2544
2647
|
});
|
|
2545
|
-
function
|
|
2648
|
+
function Ar(t, e = null) {
|
|
2546
2649
|
try {
|
|
2547
2650
|
const n = t.split(".");
|
|
2548
2651
|
if (n.length !== 3)
|
|
@@ -2556,9 +2659,9 @@ function Nr(t, e = null) {
|
|
|
2556
2659
|
return !1;
|
|
2557
2660
|
}
|
|
2558
2661
|
}
|
|
2559
|
-
const
|
|
2662
|
+
const Zr = /* @__PURE__ */ u("$ZodJWT", (t, e) => {
|
|
2560
2663
|
g.init(t, e), t._zod.check = (n) => {
|
|
2561
|
-
|
|
2664
|
+
Ar(n.value, e.alg) || n.issues.push({
|
|
2562
2665
|
code: "invalid_format",
|
|
2563
2666
|
format: "jwt",
|
|
2564
2667
|
input: n.value,
|
|
@@ -2566,8 +2669,8 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
|
|
|
2566
2669
|
continue: !e.abort
|
|
2567
2670
|
});
|
|
2568
2671
|
};
|
|
2569
|
-
}), mt = /* @__PURE__ */
|
|
2570
|
-
k.init(t, e), t._zod.pattern = t._zod.bag.pattern ??
|
|
2672
|
+
}), mt = /* @__PURE__ */ u("$ZodNumber", (t, e) => {
|
|
2673
|
+
k.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? Jn, t._zod.parse = (n, r) => {
|
|
2571
2674
|
if (e.coerce)
|
|
2572
2675
|
try {
|
|
2573
2676
|
n.value = Number(n.value);
|
|
@@ -2585,11 +2688,11 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
|
|
|
2585
2688
|
...s ? { received: s } : {}
|
|
2586
2689
|
}), n;
|
|
2587
2690
|
};
|
|
2588
|
-
}),
|
|
2589
|
-
|
|
2590
|
-
}),
|
|
2691
|
+
}), Cr = /* @__PURE__ */ u("$ZodNumberFormat", (t, e) => {
|
|
2692
|
+
qn.init(t, e), mt.init(t, e);
|
|
2693
|
+
}), Rr = /* @__PURE__ */ u("$ZodUnknown", (t, e) => {
|
|
2591
2694
|
k.init(t, e), t._zod.parse = (n) => n;
|
|
2592
|
-
}),
|
|
2695
|
+
}), Lr = /* @__PURE__ */ u("$ZodNever", (t, e) => {
|
|
2593
2696
|
k.init(t, e), t._zod.parse = (n, r) => (n.issues.push({
|
|
2594
2697
|
expected: "never",
|
|
2595
2698
|
code: "invalid_type",
|
|
@@ -2600,7 +2703,7 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
|
|
|
2600
2703
|
function $e(t, e, n) {
|
|
2601
2704
|
t.issues.length && e.issues.push(...it(n, t.issues)), e.value[n] = t.value;
|
|
2602
2705
|
}
|
|
2603
|
-
const
|
|
2706
|
+
const xr = /* @__PURE__ */ u("$ZodArray", (t, e) => {
|
|
2604
2707
|
k.init(t, e), t._zod.parse = (n, r) => {
|
|
2605
2708
|
const i = n.value;
|
|
2606
2709
|
if (!Array.isArray(i))
|
|
@@ -2613,16 +2716,16 @@ const Rr = /* @__PURE__ */ c("$ZodArray", (t, e) => {
|
|
|
2613
2716
|
n.value = Array(i.length);
|
|
2614
2717
|
const s = [];
|
|
2615
2718
|
for (let o = 0; o < i.length; o++) {
|
|
2616
|
-
const a = i[o],
|
|
2719
|
+
const a = i[o], c = e.element._zod.run({
|
|
2617
2720
|
value: a,
|
|
2618
2721
|
issues: []
|
|
2619
2722
|
}, r);
|
|
2620
|
-
|
|
2723
|
+
c instanceof Promise ? s.push(c.then((h) => $e(h, n, o))) : $e(c, n, o);
|
|
2621
2724
|
}
|
|
2622
2725
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
2623
2726
|
};
|
|
2624
2727
|
});
|
|
2625
|
-
function
|
|
2728
|
+
function H(t, e, n, r) {
|
|
2626
2729
|
t.issues.length && e.issues.push(...it(n, t.issues)), t.value === void 0 ? n in r && (e.value[n] = void 0) : e.value[n] = t.value;
|
|
2627
2730
|
}
|
|
2628
2731
|
function gt(t) {
|
|
@@ -2630,7 +2733,7 @@ function gt(t) {
|
|
|
2630
2733
|
for (const r of e)
|
|
2631
2734
|
if (!t.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
2632
2735
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
2633
|
-
const n =
|
|
2736
|
+
const n = nn(t.shape);
|
|
2634
2737
|
return {
|
|
2635
2738
|
...t,
|
|
2636
2739
|
keys: e,
|
|
@@ -2640,7 +2743,7 @@ function gt(t) {
|
|
|
2640
2743
|
};
|
|
2641
2744
|
}
|
|
2642
2745
|
function vt(t, e, n, r, i, s) {
|
|
2643
|
-
const o = [], a = i.keySet,
|
|
2746
|
+
const o = [], a = i.keySet, c = i.catchall._zod, h = c.def.type;
|
|
2644
2747
|
for (const p in e) {
|
|
2645
2748
|
if (a.has(p))
|
|
2646
2749
|
continue;
|
|
@@ -2648,8 +2751,8 @@ function vt(t, e, n, r, i, s) {
|
|
|
2648
2751
|
o.push(p);
|
|
2649
2752
|
continue;
|
|
2650
2753
|
}
|
|
2651
|
-
const d =
|
|
2652
|
-
d instanceof Promise ? t.push(d.then((f) =>
|
|
2754
|
+
const d = c.run({ value: e[p], issues: [] }, r);
|
|
2755
|
+
d instanceof Promise ? t.push(d.then((f) => H(f, n, p, e))) : H(d, n, p, e);
|
|
2653
2756
|
}
|
|
2654
2757
|
return o.length && n.issues.push({
|
|
2655
2758
|
code: "unrecognized_keys",
|
|
@@ -2658,34 +2761,34 @@ function vt(t, e, n, r, i, s) {
|
|
|
2658
2761
|
inst: s
|
|
2659
2762
|
}), t.length ? Promise.all(t).then(() => n) : n;
|
|
2660
2763
|
}
|
|
2661
|
-
const
|
|
2764
|
+
const Dr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
|
|
2662
2765
|
if (k.init(t, e), !Object.getOwnPropertyDescriptor(e, "shape")?.get) {
|
|
2663
2766
|
const a = e.shape;
|
|
2664
2767
|
Object.defineProperty(e, "shape", {
|
|
2665
2768
|
get: () => {
|
|
2666
|
-
const
|
|
2769
|
+
const c = { ...a };
|
|
2667
2770
|
return Object.defineProperty(e, "shape", {
|
|
2668
|
-
value:
|
|
2669
|
-
}),
|
|
2771
|
+
value: c
|
|
2772
|
+
}), c;
|
|
2670
2773
|
}
|
|
2671
2774
|
});
|
|
2672
2775
|
}
|
|
2673
|
-
const r =
|
|
2776
|
+
const r = re(() => gt(e));
|
|
2674
2777
|
m(t._zod, "propValues", () => {
|
|
2675
|
-
const a = e.shape,
|
|
2778
|
+
const a = e.shape, c = {};
|
|
2676
2779
|
for (const h in a) {
|
|
2677
2780
|
const p = a[h]._zod;
|
|
2678
2781
|
if (p.values) {
|
|
2679
|
-
|
|
2782
|
+
c[h] ?? (c[h] = /* @__PURE__ */ new Set());
|
|
2680
2783
|
for (const d of p.values)
|
|
2681
|
-
|
|
2784
|
+
c[h].add(d);
|
|
2682
2785
|
}
|
|
2683
2786
|
}
|
|
2684
|
-
return
|
|
2787
|
+
return c;
|
|
2685
2788
|
});
|
|
2686
|
-
const i =
|
|
2789
|
+
const i = B, s = e.catchall;
|
|
2687
2790
|
let o;
|
|
2688
|
-
t._zod.parse = (a,
|
|
2791
|
+
t._zod.parse = (a, c) => {
|
|
2689
2792
|
o ?? (o = r.value);
|
|
2690
2793
|
const h = a.value;
|
|
2691
2794
|
if (!i(h))
|
|
@@ -2698,51 +2801,51 @@ const xr = /* @__PURE__ */ c("$ZodObject", (t, e) => {
|
|
|
2698
2801
|
a.value = {};
|
|
2699
2802
|
const p = [], d = o.shape;
|
|
2700
2803
|
for (const f of o.keys) {
|
|
2701
|
-
const E = d[f]._zod.run({ value: h[f], issues: [] },
|
|
2702
|
-
E instanceof Promise ? p.push(E.then((
|
|
2804
|
+
const E = d[f]._zod.run({ value: h[f], issues: [] }, c);
|
|
2805
|
+
E instanceof Promise ? p.push(E.then((ce) => H(ce, a, f, h))) : H(E, a, f, h);
|
|
2703
2806
|
}
|
|
2704
|
-
return s ? vt(p, h, a,
|
|
2807
|
+
return s ? vt(p, h, a, c, r.value, t) : p.length ? Promise.all(p).then(() => a) : a;
|
|
2705
2808
|
};
|
|
2706
|
-
}),
|
|
2707
|
-
|
|
2708
|
-
const n = t._zod.parse, r =
|
|
2709
|
-
const v = new
|
|
2710
|
-
const
|
|
2711
|
-
return `shape[${
|
|
2809
|
+
}), Fr = /* @__PURE__ */ u("$ZodObjectJIT", (t, e) => {
|
|
2810
|
+
Dr.init(t, e);
|
|
2811
|
+
const n = t._zod.parse, r = re(() => gt(e)), i = (f) => {
|
|
2812
|
+
const v = new ar(["shape", "payload", "ctx"]), E = r.value, ce = (P) => {
|
|
2813
|
+
const O = Ie(P);
|
|
2814
|
+
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
2712
2815
|
};
|
|
2713
2816
|
v.write("const input = payload.value;");
|
|
2714
2817
|
const we = /* @__PURE__ */ Object.create(null);
|
|
2715
2818
|
let St = 0;
|
|
2716
|
-
for (const
|
|
2717
|
-
we[
|
|
2819
|
+
for (const P of E.keys)
|
|
2820
|
+
we[P] = `key_${St++}`;
|
|
2718
2821
|
v.write("const newResult = {};");
|
|
2719
|
-
for (const
|
|
2720
|
-
const
|
|
2721
|
-
v.write(`const ${
|
|
2722
|
-
if (${
|
|
2723
|
-
payload.issues = payload.issues.concat(${
|
|
2822
|
+
for (const P of E.keys) {
|
|
2823
|
+
const O = we[P], G = Ie(P);
|
|
2824
|
+
v.write(`const ${O} = ${ce(P)};`), v.write(`
|
|
2825
|
+
if (${O}.issues.length) {
|
|
2826
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
2724
2827
|
...iss,
|
|
2725
|
-
path: iss.path ? [${
|
|
2828
|
+
path: iss.path ? [${G}, ...iss.path] : [${G}]
|
|
2726
2829
|
})));
|
|
2727
2830
|
}
|
|
2728
2831
|
|
|
2729
2832
|
|
|
2730
|
-
if (${
|
|
2731
|
-
if (${
|
|
2732
|
-
newResult[${
|
|
2833
|
+
if (${O}.value === undefined) {
|
|
2834
|
+
if (${G} in input) {
|
|
2835
|
+
newResult[${G}] = undefined;
|
|
2733
2836
|
}
|
|
2734
2837
|
} else {
|
|
2735
|
-
newResult[${
|
|
2838
|
+
newResult[${G}] = ${O}.value;
|
|
2736
2839
|
}
|
|
2737
2840
|
|
|
2738
2841
|
`);
|
|
2739
2842
|
}
|
|
2740
2843
|
v.write("payload.value = newResult;"), v.write("return payload;");
|
|
2741
2844
|
const Nt = v.compile();
|
|
2742
|
-
return (
|
|
2845
|
+
return (P, O) => Nt(f, P, O);
|
|
2743
2846
|
};
|
|
2744
2847
|
let s;
|
|
2745
|
-
const o =
|
|
2848
|
+
const o = B, a = !et.jitless, h = a && en.value, p = e.catchall;
|
|
2746
2849
|
let d;
|
|
2747
2850
|
t._zod.parse = (f, v) => {
|
|
2748
2851
|
d ?? (d = r.value);
|
|
@@ -2759,22 +2862,22 @@ function Oe(t, e, n, r) {
|
|
|
2759
2862
|
for (const s of t)
|
|
2760
2863
|
if (s.issues.length === 0)
|
|
2761
2864
|
return e.value = s.value, e;
|
|
2762
|
-
const i = t.filter((s) => !
|
|
2865
|
+
const i = t.filter((s) => !F(s));
|
|
2763
2866
|
return i.length === 1 ? (e.value = i[0].value, i[0]) : (e.issues.push({
|
|
2764
2867
|
code: "invalid_union",
|
|
2765
2868
|
input: e.value,
|
|
2766
2869
|
inst: n,
|
|
2767
|
-
errors: t.map((s) => s.issues.map((o) =>
|
|
2870
|
+
errors: t.map((s) => s.issues.map((o) => R(o, r, C())))
|
|
2768
2871
|
}), e);
|
|
2769
2872
|
}
|
|
2770
|
-
const _t = /* @__PURE__ */
|
|
2873
|
+
const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
|
|
2771
2874
|
k.init(t, e), m(t._zod, "optin", () => e.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), m(t._zod, "optout", () => e.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), m(t._zod, "values", () => {
|
|
2772
2875
|
if (e.options.every((i) => i._zod.values))
|
|
2773
2876
|
return new Set(e.options.flatMap((i) => Array.from(i._zod.values)));
|
|
2774
2877
|
}), m(t._zod, "pattern", () => {
|
|
2775
2878
|
if (e.options.every((i) => i._zod.pattern)) {
|
|
2776
2879
|
const i = e.options.map((s) => s._zod.pattern);
|
|
2777
|
-
return new RegExp(`^(${i.map((s) =>
|
|
2880
|
+
return new RegExp(`^(${i.map((s) => ge(s.source)).join("|")})$`);
|
|
2778
2881
|
}
|
|
2779
2882
|
});
|
|
2780
2883
|
const n = e.options.length === 1, r = e.options[0]._zod.run;
|
|
@@ -2783,8 +2886,8 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
|
|
|
2783
2886
|
return r(i, s);
|
|
2784
2887
|
let o = !1;
|
|
2785
2888
|
const a = [];
|
|
2786
|
-
for (const
|
|
2787
|
-
const h =
|
|
2889
|
+
for (const c of e.options) {
|
|
2890
|
+
const h = c._zod.run({
|
|
2788
2891
|
value: i.value,
|
|
2789
2892
|
issues: []
|
|
2790
2893
|
}, s);
|
|
@@ -2796,9 +2899,9 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
|
|
|
2796
2899
|
a.push(h);
|
|
2797
2900
|
}
|
|
2798
2901
|
}
|
|
2799
|
-
return o ? Promise.all(a).then((
|
|
2902
|
+
return o ? Promise.all(a).then((c) => Oe(c, i, t, s)) : Oe(a, i, t, s);
|
|
2800
2903
|
};
|
|
2801
|
-
}),
|
|
2904
|
+
}), jr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (t, e) => {
|
|
2802
2905
|
e.inclusive = !1, _t.init(t, e);
|
|
2803
2906
|
const n = t._zod.parse;
|
|
2804
2907
|
m(t._zod, "propValues", () => {
|
|
@@ -2807,31 +2910,31 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
|
|
|
2807
2910
|
const o = s._zod.propValues;
|
|
2808
2911
|
if (!o || Object.keys(o).length === 0)
|
|
2809
2912
|
throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);
|
|
2810
|
-
for (const [a,
|
|
2913
|
+
for (const [a, c] of Object.entries(o)) {
|
|
2811
2914
|
i[a] || (i[a] = /* @__PURE__ */ new Set());
|
|
2812
|
-
for (const h of
|
|
2915
|
+
for (const h of c)
|
|
2813
2916
|
i[a].add(h);
|
|
2814
2917
|
}
|
|
2815
2918
|
}
|
|
2816
2919
|
return i;
|
|
2817
2920
|
});
|
|
2818
|
-
const r =
|
|
2921
|
+
const r = re(() => {
|
|
2819
2922
|
const i = e.options, s = /* @__PURE__ */ new Map();
|
|
2820
2923
|
for (const o of i) {
|
|
2821
2924
|
const a = o._zod.propValues?.[e.discriminator];
|
|
2822
2925
|
if (!a || a.size === 0)
|
|
2823
2926
|
throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);
|
|
2824
|
-
for (const
|
|
2825
|
-
if (s.has(
|
|
2826
|
-
throw new Error(`Duplicate discriminator value "${String(
|
|
2827
|
-
s.set(
|
|
2927
|
+
for (const c of a) {
|
|
2928
|
+
if (s.has(c))
|
|
2929
|
+
throw new Error(`Duplicate discriminator value "${String(c)}"`);
|
|
2930
|
+
s.set(c, o);
|
|
2828
2931
|
}
|
|
2829
2932
|
}
|
|
2830
2933
|
return s;
|
|
2831
2934
|
});
|
|
2832
2935
|
t._zod.parse = (i, s) => {
|
|
2833
2936
|
const o = i.value;
|
|
2834
|
-
if (!
|
|
2937
|
+
if (!B(o))
|
|
2835
2938
|
return i.issues.push({
|
|
2836
2939
|
code: "invalid_type",
|
|
2837
2940
|
expected: "object",
|
|
@@ -2849,21 +2952,21 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
|
|
|
2849
2952
|
inst: t
|
|
2850
2953
|
}), i);
|
|
2851
2954
|
};
|
|
2852
|
-
}),
|
|
2955
|
+
}), Mr = /* @__PURE__ */ u("$ZodIntersection", (t, e) => {
|
|
2853
2956
|
k.init(t, e), t._zod.parse = (n, r) => {
|
|
2854
2957
|
const i = n.value, s = e.left._zod.run({ value: i, issues: [] }, r), o = e.right._zod.run({ value: i, issues: [] }, r);
|
|
2855
|
-
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([
|
|
2958
|
+
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([c, h]) => Pe(n, c, h)) : Pe(n, s, o);
|
|
2856
2959
|
};
|
|
2857
2960
|
});
|
|
2858
|
-
function
|
|
2961
|
+
function de(t, e) {
|
|
2859
2962
|
if (t === e)
|
|
2860
2963
|
return { valid: !0, data: t };
|
|
2861
2964
|
if (t instanceof Date && e instanceof Date && +t == +e)
|
|
2862
2965
|
return { valid: !0, data: t };
|
|
2863
|
-
if (
|
|
2966
|
+
if (J(t) && J(e)) {
|
|
2864
2967
|
const n = Object.keys(e), r = Object.keys(t).filter((s) => n.indexOf(s) !== -1), i = { ...t, ...e };
|
|
2865
2968
|
for (const s of r) {
|
|
2866
|
-
const o =
|
|
2969
|
+
const o = de(t[s], e[s]);
|
|
2867
2970
|
if (!o.valid)
|
|
2868
2971
|
return {
|
|
2869
2972
|
valid: !1,
|
|
@@ -2878,7 +2981,7 @@ function pe(t, e) {
|
|
|
2878
2981
|
return { valid: !1, mergeErrorPath: [] };
|
|
2879
2982
|
const n = [];
|
|
2880
2983
|
for (let r = 0; r < t.length; r++) {
|
|
2881
|
-
const i = t[r], s = e[r], o =
|
|
2984
|
+
const i = t[r], s = e[r], o = de(i, s);
|
|
2882
2985
|
if (!o.valid)
|
|
2883
2986
|
return {
|
|
2884
2987
|
valid: !1,
|
|
@@ -2890,18 +2993,18 @@ function pe(t, e) {
|
|
|
2890
2993
|
}
|
|
2891
2994
|
return { valid: !1, mergeErrorPath: [] };
|
|
2892
2995
|
}
|
|
2893
|
-
function
|
|
2894
|
-
if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues),
|
|
2996
|
+
function Pe(t, e, n) {
|
|
2997
|
+
if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues), F(t))
|
|
2895
2998
|
return t;
|
|
2896
|
-
const r =
|
|
2999
|
+
const r = de(e.value, n.value);
|
|
2897
3000
|
if (!r.valid)
|
|
2898
3001
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
2899
3002
|
return t.value = r.data, t;
|
|
2900
3003
|
}
|
|
2901
|
-
const
|
|
3004
|
+
const Ur = /* @__PURE__ */ u("$ZodEnum", (t, e) => {
|
|
2902
3005
|
k.init(t, e);
|
|
2903
3006
|
const n = tt(e.entries), r = new Set(n);
|
|
2904
|
-
t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((i) =>
|
|
3007
|
+
t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((i) => tn.has(typeof i)).map((i) => typeof i == "string" ? M(i) : i.toString()).join("|")})$`), t._zod.parse = (i, s) => {
|
|
2905
3008
|
const o = i.value;
|
|
2906
3009
|
return r.has(o) || i.issues.push({
|
|
2907
3010
|
code: "invalid_value",
|
|
@@ -2910,11 +3013,11 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
|
|
|
2910
3013
|
inst: t
|
|
2911
3014
|
}), i;
|
|
2912
3015
|
};
|
|
2913
|
-
}),
|
|
3016
|
+
}), Gr = /* @__PURE__ */ u("$ZodLiteral", (t, e) => {
|
|
2914
3017
|
if (k.init(t, e), e.values.length === 0)
|
|
2915
3018
|
throw new Error("Cannot create literal schema with no valid values");
|
|
2916
3019
|
const n = new Set(e.values);
|
|
2917
|
-
t._zod.values = n, t._zod.pattern = new RegExp(`^(${e.values.map((r) => typeof r == "string" ?
|
|
3020
|
+
t._zod.values = n, t._zod.pattern = new RegExp(`^(${e.values.map((r) => typeof r == "string" ? M(r) : r ? M(r.toString()) : String(r)).join("|")})$`), t._zod.parse = (r, i) => {
|
|
2918
3021
|
const s = r.value;
|
|
2919
3022
|
return n.has(s) || r.issues.push({
|
|
2920
3023
|
code: "invalid_value",
|
|
@@ -2923,7 +3026,7 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
|
|
|
2923
3026
|
inst: t
|
|
2924
3027
|
}), r;
|
|
2925
3028
|
};
|
|
2926
|
-
}),
|
|
3029
|
+
}), Vr = /* @__PURE__ */ u("$ZodTransform", (t, e) => {
|
|
2927
3030
|
k.init(t, e), t._zod.parse = (n, r) => {
|
|
2928
3031
|
if (r.direction === "backward")
|
|
2929
3032
|
throw new He(t.constructor.name);
|
|
@@ -2931,45 +3034,45 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
|
|
|
2931
3034
|
if (r.async)
|
|
2932
3035
|
return (i instanceof Promise ? i : Promise.resolve(i)).then((o) => (n.value = o, n));
|
|
2933
3036
|
if (i instanceof Promise)
|
|
2934
|
-
throw new
|
|
3037
|
+
throw new j();
|
|
2935
3038
|
return n.value = i, n;
|
|
2936
3039
|
};
|
|
2937
3040
|
});
|
|
2938
|
-
function
|
|
3041
|
+
function Se(t, e) {
|
|
2939
3042
|
return t.issues.length && e === void 0 ? { issues: [], value: void 0 } : t;
|
|
2940
3043
|
}
|
|
2941
|
-
const
|
|
3044
|
+
const Br = /* @__PURE__ */ u("$ZodOptional", (t, e) => {
|
|
2942
3045
|
k.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, void 0]) : void 0), m(t._zod, "pattern", () => {
|
|
2943
3046
|
const n = e.innerType._zod.pattern;
|
|
2944
|
-
return n ? new RegExp(`^(${
|
|
3047
|
+
return n ? new RegExp(`^(${ge(n.source)})?$`) : void 0;
|
|
2945
3048
|
}), t._zod.parse = (n, r) => {
|
|
2946
3049
|
if (e.innerType._zod.optin === "optional") {
|
|
2947
3050
|
const i = e.innerType._zod.run(n, r);
|
|
2948
|
-
return i instanceof Promise ? i.then((s) =>
|
|
3051
|
+
return i instanceof Promise ? i.then((s) => Se(s, n.value)) : Se(i, n.value);
|
|
2949
3052
|
}
|
|
2950
3053
|
return n.value === void 0 ? n : e.innerType._zod.run(n, r);
|
|
2951
3054
|
};
|
|
2952
|
-
}),
|
|
3055
|
+
}), Jr = /* @__PURE__ */ u("$ZodNullable", (t, e) => {
|
|
2953
3056
|
k.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "pattern", () => {
|
|
2954
3057
|
const n = e.innerType._zod.pattern;
|
|
2955
|
-
return n ? new RegExp(`^(${
|
|
3058
|
+
return n ? new RegExp(`^(${ge(n.source)}|null)$`) : void 0;
|
|
2956
3059
|
}), m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
|
|
2957
|
-
}),
|
|
3060
|
+
}), Wr = /* @__PURE__ */ u("$ZodDefault", (t, e) => {
|
|
2958
3061
|
k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
|
|
2959
3062
|
if (r.direction === "backward")
|
|
2960
3063
|
return e.innerType._zod.run(n, r);
|
|
2961
3064
|
if (n.value === void 0)
|
|
2962
3065
|
return n.value = e.defaultValue, n;
|
|
2963
3066
|
const i = e.innerType._zod.run(n, r);
|
|
2964
|
-
return i instanceof Promise ? i.then((s) =>
|
|
3067
|
+
return i instanceof Promise ? i.then((s) => Ne(s, e)) : Ne(i, e);
|
|
2965
3068
|
};
|
|
2966
3069
|
});
|
|
2967
|
-
function
|
|
3070
|
+
function Ne(t, e) {
|
|
2968
3071
|
return t.value === void 0 && (t.value = e.defaultValue), t;
|
|
2969
3072
|
}
|
|
2970
|
-
const
|
|
3073
|
+
const Kr = /* @__PURE__ */ u("$ZodPrefault", (t, e) => {
|
|
2971
3074
|
k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = e.defaultValue), e.innerType._zod.run(n, r));
|
|
2972
|
-
}),
|
|
3075
|
+
}), Yr = /* @__PURE__ */ u("$ZodNonOptional", (t, e) => {
|
|
2973
3076
|
k.init(t, e), m(t._zod, "values", () => {
|
|
2974
3077
|
const n = e.innerType._zod.values;
|
|
2975
3078
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
@@ -2986,7 +3089,7 @@ function Ae(t, e) {
|
|
|
2986
3089
|
inst: e
|
|
2987
3090
|
}), t;
|
|
2988
3091
|
}
|
|
2989
|
-
const
|
|
3092
|
+
const qr = /* @__PURE__ */ u("$ZodCatch", (t, e) => {
|
|
2990
3093
|
k.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
|
|
2991
3094
|
if (r.direction === "backward")
|
|
2992
3095
|
return e.innerType._zod.run(n, r);
|
|
@@ -2994,31 +3097,31 @@ const Kr = /* @__PURE__ */ c("$ZodCatch", (t, e) => {
|
|
|
2994
3097
|
return i instanceof Promise ? i.then((s) => (n.value = s.value, s.issues.length && (n.value = e.catchValue({
|
|
2995
3098
|
...n,
|
|
2996
3099
|
error: {
|
|
2997
|
-
issues: s.issues.map((o) =>
|
|
3100
|
+
issues: s.issues.map((o) => R(o, r, C()))
|
|
2998
3101
|
},
|
|
2999
3102
|
input: n.value
|
|
3000
3103
|
}), n.issues = []), n)) : (n.value = i.value, i.issues.length && (n.value = e.catchValue({
|
|
3001
3104
|
...n,
|
|
3002
3105
|
error: {
|
|
3003
|
-
issues: i.issues.map((s) =>
|
|
3106
|
+
issues: i.issues.map((s) => R(s, r, C()))
|
|
3004
3107
|
},
|
|
3005
3108
|
input: n.value
|
|
3006
3109
|
}), n.issues = []), n);
|
|
3007
3110
|
};
|
|
3008
|
-
}),
|
|
3111
|
+
}), Xr = /* @__PURE__ */ u("$ZodPipe", (t, e) => {
|
|
3009
3112
|
k.init(t, e), m(t._zod, "values", () => e.in._zod.values), m(t._zod, "optin", () => e.in._zod.optin), m(t._zod, "optout", () => e.out._zod.optout), m(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (n, r) => {
|
|
3010
3113
|
if (r.direction === "backward") {
|
|
3011
3114
|
const s = e.out._zod.run(n, r);
|
|
3012
|
-
return s instanceof Promise ? s.then((o) =>
|
|
3115
|
+
return s instanceof Promise ? s.then((o) => q(o, e.in, r)) : q(s, e.in, r);
|
|
3013
3116
|
}
|
|
3014
3117
|
const i = e.in._zod.run(n, r);
|
|
3015
|
-
return i instanceof Promise ? i.then((s) =>
|
|
3118
|
+
return i instanceof Promise ? i.then((s) => q(s, e.out, r)) : q(i, e.out, r);
|
|
3016
3119
|
};
|
|
3017
3120
|
});
|
|
3018
|
-
function
|
|
3121
|
+
function q(t, e, n) {
|
|
3019
3122
|
return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, n);
|
|
3020
3123
|
}
|
|
3021
|
-
const
|
|
3124
|
+
const Qr = /* @__PURE__ */ u("$ZodReadonly", (t, e) => {
|
|
3022
3125
|
k.init(t, e), m(t._zod, "propValues", () => e.innerType._zod.propValues), m(t._zod, "values", () => e.innerType._zod.values), m(t._zod, "optin", () => e.innerType?._zod?.optin), m(t._zod, "optout", () => e.innerType?._zod?.optout), t._zod.parse = (n, r) => {
|
|
3023
3126
|
if (r.direction === "backward")
|
|
3024
3127
|
return e.innerType._zod.run(n, r);
|
|
@@ -3029,7 +3132,7 @@ const Xr = /* @__PURE__ */ c("$ZodReadonly", (t, e) => {
|
|
|
3029
3132
|
function Ze(t) {
|
|
3030
3133
|
return t.value = Object.freeze(t.value), t;
|
|
3031
3134
|
}
|
|
3032
|
-
const
|
|
3135
|
+
const Hr = /* @__PURE__ */ u("$ZodCustom", (t, e) => {
|
|
3033
3136
|
b.init(t, e), k.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
|
|
3034
3137
|
const r = n.value, i = e.fn(r);
|
|
3035
3138
|
if (i instanceof Promise)
|
|
@@ -3049,11 +3152,11 @@ function Ce(t, e, n, r) {
|
|
|
3049
3152
|
continue: !r._zod.def.abort
|
|
3050
3153
|
// params: inst._zod.def.params,
|
|
3051
3154
|
};
|
|
3052
|
-
r._zod.def.params && (i.params = r._zod.def.params), e.issues.push(
|
|
3155
|
+
r._zod.def.params && (i.params = r._zod.def.params), e.issues.push(W(i));
|
|
3053
3156
|
}
|
|
3054
3157
|
}
|
|
3055
3158
|
var Re;
|
|
3056
|
-
class
|
|
3159
|
+
class ei {
|
|
3057
3160
|
constructor() {
|
|
3058
3161
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
3059
3162
|
}
|
|
@@ -3087,18 +3190,18 @@ class Qr {
|
|
|
3087
3190
|
return this._map.has(e);
|
|
3088
3191
|
}
|
|
3089
3192
|
}
|
|
3090
|
-
function
|
|
3091
|
-
return new
|
|
3193
|
+
function ti() {
|
|
3194
|
+
return new ei();
|
|
3092
3195
|
}
|
|
3093
|
-
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry =
|
|
3094
|
-
const
|
|
3095
|
-
function
|
|
3196
|
+
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = ti());
|
|
3197
|
+
const V = globalThis.__zod_globalRegistry;
|
|
3198
|
+
function ni(t, e) {
|
|
3096
3199
|
return new t({
|
|
3097
3200
|
type: "string",
|
|
3098
3201
|
...l(e)
|
|
3099
3202
|
});
|
|
3100
3203
|
}
|
|
3101
|
-
function
|
|
3204
|
+
function ri(t, e) {
|
|
3102
3205
|
return new t({
|
|
3103
3206
|
type: "string",
|
|
3104
3207
|
format: "email",
|
|
@@ -3107,7 +3210,7 @@ function ti(t, e) {
|
|
|
3107
3210
|
...l(e)
|
|
3108
3211
|
});
|
|
3109
3212
|
}
|
|
3110
|
-
function
|
|
3213
|
+
function Le(t, e) {
|
|
3111
3214
|
return new t({
|
|
3112
3215
|
type: "string",
|
|
3113
3216
|
format: "guid",
|
|
@@ -3116,7 +3219,7 @@ function xe(t, e) {
|
|
|
3116
3219
|
...l(e)
|
|
3117
3220
|
});
|
|
3118
3221
|
}
|
|
3119
|
-
function
|
|
3222
|
+
function ii(t, e) {
|
|
3120
3223
|
return new t({
|
|
3121
3224
|
type: "string",
|
|
3122
3225
|
format: "uuid",
|
|
@@ -3125,7 +3228,7 @@ function ni(t, e) {
|
|
|
3125
3228
|
...l(e)
|
|
3126
3229
|
});
|
|
3127
3230
|
}
|
|
3128
|
-
function
|
|
3231
|
+
function si(t, e) {
|
|
3129
3232
|
return new t({
|
|
3130
3233
|
type: "string",
|
|
3131
3234
|
format: "uuid",
|
|
@@ -3135,7 +3238,7 @@ function ri(t, e) {
|
|
|
3135
3238
|
...l(e)
|
|
3136
3239
|
});
|
|
3137
3240
|
}
|
|
3138
|
-
function
|
|
3241
|
+
function oi(t, e) {
|
|
3139
3242
|
return new t({
|
|
3140
3243
|
type: "string",
|
|
3141
3244
|
format: "uuid",
|
|
@@ -3145,7 +3248,7 @@ function ii(t, e) {
|
|
|
3145
3248
|
...l(e)
|
|
3146
3249
|
});
|
|
3147
3250
|
}
|
|
3148
|
-
function
|
|
3251
|
+
function ai(t, e) {
|
|
3149
3252
|
return new t({
|
|
3150
3253
|
type: "string",
|
|
3151
3254
|
format: "uuid",
|
|
@@ -3155,7 +3258,7 @@ function si(t, e) {
|
|
|
3155
3258
|
...l(e)
|
|
3156
3259
|
});
|
|
3157
3260
|
}
|
|
3158
|
-
function
|
|
3261
|
+
function ci(t, e) {
|
|
3159
3262
|
return new t({
|
|
3160
3263
|
type: "string",
|
|
3161
3264
|
format: "url",
|
|
@@ -3164,7 +3267,7 @@ function oi(t, e) {
|
|
|
3164
3267
|
...l(e)
|
|
3165
3268
|
});
|
|
3166
3269
|
}
|
|
3167
|
-
function
|
|
3270
|
+
function ui(t, e) {
|
|
3168
3271
|
return new t({
|
|
3169
3272
|
type: "string",
|
|
3170
3273
|
format: "emoji",
|
|
@@ -3173,7 +3276,7 @@ function ai(t, e) {
|
|
|
3173
3276
|
...l(e)
|
|
3174
3277
|
});
|
|
3175
3278
|
}
|
|
3176
|
-
function
|
|
3279
|
+
function hi(t, e) {
|
|
3177
3280
|
return new t({
|
|
3178
3281
|
type: "string",
|
|
3179
3282
|
format: "nanoid",
|
|
@@ -3182,7 +3285,7 @@ function ci(t, e) {
|
|
|
3182
3285
|
...l(e)
|
|
3183
3286
|
});
|
|
3184
3287
|
}
|
|
3185
|
-
function
|
|
3288
|
+
function pi(t, e) {
|
|
3186
3289
|
return new t({
|
|
3187
3290
|
type: "string",
|
|
3188
3291
|
format: "cuid",
|
|
@@ -3191,7 +3294,7 @@ function ui(t, e) {
|
|
|
3191
3294
|
...l(e)
|
|
3192
3295
|
});
|
|
3193
3296
|
}
|
|
3194
|
-
function
|
|
3297
|
+
function li(t, e) {
|
|
3195
3298
|
return new t({
|
|
3196
3299
|
type: "string",
|
|
3197
3300
|
format: "cuid2",
|
|
@@ -3200,7 +3303,7 @@ function hi(t, e) {
|
|
|
3200
3303
|
...l(e)
|
|
3201
3304
|
});
|
|
3202
3305
|
}
|
|
3203
|
-
function
|
|
3306
|
+
function di(t, e) {
|
|
3204
3307
|
return new t({
|
|
3205
3308
|
type: "string",
|
|
3206
3309
|
format: "ulid",
|
|
@@ -3209,7 +3312,7 @@ function pi(t, e) {
|
|
|
3209
3312
|
...l(e)
|
|
3210
3313
|
});
|
|
3211
3314
|
}
|
|
3212
|
-
function
|
|
3315
|
+
function fi(t, e) {
|
|
3213
3316
|
return new t({
|
|
3214
3317
|
type: "string",
|
|
3215
3318
|
format: "xid",
|
|
@@ -3218,7 +3321,7 @@ function li(t, e) {
|
|
|
3218
3321
|
...l(e)
|
|
3219
3322
|
});
|
|
3220
3323
|
}
|
|
3221
|
-
function
|
|
3324
|
+
function mi(t, e) {
|
|
3222
3325
|
return new t({
|
|
3223
3326
|
type: "string",
|
|
3224
3327
|
format: "ksuid",
|
|
@@ -3227,7 +3330,7 @@ function di(t, e) {
|
|
|
3227
3330
|
...l(e)
|
|
3228
3331
|
});
|
|
3229
3332
|
}
|
|
3230
|
-
function
|
|
3333
|
+
function gi(t, e) {
|
|
3231
3334
|
return new t({
|
|
3232
3335
|
type: "string",
|
|
3233
3336
|
format: "ipv4",
|
|
@@ -3236,7 +3339,7 @@ function fi(t, e) {
|
|
|
3236
3339
|
...l(e)
|
|
3237
3340
|
});
|
|
3238
3341
|
}
|
|
3239
|
-
function
|
|
3342
|
+
function vi(t, e) {
|
|
3240
3343
|
return new t({
|
|
3241
3344
|
type: "string",
|
|
3242
3345
|
format: "ipv6",
|
|
@@ -3245,7 +3348,7 @@ function mi(t, e) {
|
|
|
3245
3348
|
...l(e)
|
|
3246
3349
|
});
|
|
3247
3350
|
}
|
|
3248
|
-
function
|
|
3351
|
+
function _i(t, e) {
|
|
3249
3352
|
return new t({
|
|
3250
3353
|
type: "string",
|
|
3251
3354
|
format: "cidrv4",
|
|
@@ -3254,7 +3357,7 @@ function gi(t, e) {
|
|
|
3254
3357
|
...l(e)
|
|
3255
3358
|
});
|
|
3256
3359
|
}
|
|
3257
|
-
function
|
|
3360
|
+
function ki(t, e) {
|
|
3258
3361
|
return new t({
|
|
3259
3362
|
type: "string",
|
|
3260
3363
|
format: "cidrv6",
|
|
@@ -3263,7 +3366,7 @@ function vi(t, e) {
|
|
|
3263
3366
|
...l(e)
|
|
3264
3367
|
});
|
|
3265
3368
|
}
|
|
3266
|
-
function
|
|
3369
|
+
function yi(t, e) {
|
|
3267
3370
|
return new t({
|
|
3268
3371
|
type: "string",
|
|
3269
3372
|
format: "base64",
|
|
@@ -3272,7 +3375,7 @@ function _i(t, e) {
|
|
|
3272
3375
|
...l(e)
|
|
3273
3376
|
});
|
|
3274
3377
|
}
|
|
3275
|
-
function
|
|
3378
|
+
function Ti(t, e) {
|
|
3276
3379
|
return new t({
|
|
3277
3380
|
type: "string",
|
|
3278
3381
|
format: "base64url",
|
|
@@ -3281,7 +3384,7 @@ function ki(t, e) {
|
|
|
3281
3384
|
...l(e)
|
|
3282
3385
|
});
|
|
3283
3386
|
}
|
|
3284
|
-
function
|
|
3387
|
+
function wi(t, e) {
|
|
3285
3388
|
return new t({
|
|
3286
3389
|
type: "string",
|
|
3287
3390
|
format: "e164",
|
|
@@ -3290,7 +3393,7 @@ function yi(t, e) {
|
|
|
3290
3393
|
...l(e)
|
|
3291
3394
|
});
|
|
3292
3395
|
}
|
|
3293
|
-
function
|
|
3396
|
+
function bi(t, e) {
|
|
3294
3397
|
return new t({
|
|
3295
3398
|
type: "string",
|
|
3296
3399
|
format: "jwt",
|
|
@@ -3299,7 +3402,7 @@ function Ti(t, e) {
|
|
|
3299
3402
|
...l(e)
|
|
3300
3403
|
});
|
|
3301
3404
|
}
|
|
3302
|
-
function
|
|
3405
|
+
function Ei(t, e) {
|
|
3303
3406
|
return new t({
|
|
3304
3407
|
type: "string",
|
|
3305
3408
|
format: "datetime",
|
|
@@ -3310,7 +3413,7 @@ function wi(t, e) {
|
|
|
3310
3413
|
...l(e)
|
|
3311
3414
|
});
|
|
3312
3415
|
}
|
|
3313
|
-
function
|
|
3416
|
+
function Ii(t, e) {
|
|
3314
3417
|
return new t({
|
|
3315
3418
|
type: "string",
|
|
3316
3419
|
format: "date",
|
|
@@ -3318,7 +3421,7 @@ function bi(t, e) {
|
|
|
3318
3421
|
...l(e)
|
|
3319
3422
|
});
|
|
3320
3423
|
}
|
|
3321
|
-
function
|
|
3424
|
+
function zi(t, e) {
|
|
3322
3425
|
return new t({
|
|
3323
3426
|
type: "string",
|
|
3324
3427
|
format: "time",
|
|
@@ -3327,7 +3430,7 @@ function Ei(t, e) {
|
|
|
3327
3430
|
...l(e)
|
|
3328
3431
|
});
|
|
3329
3432
|
}
|
|
3330
|
-
function
|
|
3433
|
+
function $i(t, e) {
|
|
3331
3434
|
return new t({
|
|
3332
3435
|
type: "string",
|
|
3333
3436
|
format: "duration",
|
|
@@ -3335,14 +3438,14 @@ function zi(t, e) {
|
|
|
3335
3438
|
...l(e)
|
|
3336
3439
|
});
|
|
3337
3440
|
}
|
|
3338
|
-
function
|
|
3441
|
+
function Oi(t, e) {
|
|
3339
3442
|
return new t({
|
|
3340
3443
|
type: "number",
|
|
3341
3444
|
checks: [],
|
|
3342
3445
|
...l(e)
|
|
3343
3446
|
});
|
|
3344
3447
|
}
|
|
3345
|
-
function
|
|
3448
|
+
function Pi(t, e) {
|
|
3346
3449
|
return new t({
|
|
3347
3450
|
type: "number",
|
|
3348
3451
|
check: "number_format",
|
|
@@ -3351,18 +3454,18 @@ function $i(t, e) {
|
|
|
3351
3454
|
...l(e)
|
|
3352
3455
|
});
|
|
3353
3456
|
}
|
|
3354
|
-
function
|
|
3457
|
+
function Si(t) {
|
|
3355
3458
|
return new t({
|
|
3356
3459
|
type: "unknown"
|
|
3357
3460
|
});
|
|
3358
3461
|
}
|
|
3359
|
-
function
|
|
3462
|
+
function Ni(t, e) {
|
|
3360
3463
|
return new t({
|
|
3361
3464
|
type: "never",
|
|
3362
3465
|
...l(e)
|
|
3363
3466
|
});
|
|
3364
3467
|
}
|
|
3365
|
-
function
|
|
3468
|
+
function xe(t, e) {
|
|
3366
3469
|
return new lt({
|
|
3367
3470
|
check: "less_than",
|
|
3368
3471
|
...l(e),
|
|
@@ -3370,7 +3473,7 @@ function Le(t, e) {
|
|
|
3370
3473
|
inclusive: !1
|
|
3371
3474
|
});
|
|
3372
3475
|
}
|
|
3373
|
-
function
|
|
3476
|
+
function he(t, e) {
|
|
3374
3477
|
return new lt({
|
|
3375
3478
|
check: "less_than",
|
|
3376
3479
|
...l(e),
|
|
@@ -3386,7 +3489,7 @@ function De(t, e) {
|
|
|
3386
3489
|
inclusive: !1
|
|
3387
3490
|
});
|
|
3388
3491
|
}
|
|
3389
|
-
function
|
|
3492
|
+
function pe(t, e) {
|
|
3390
3493
|
return new dt({
|
|
3391
3494
|
check: "greater_than",
|
|
3392
3495
|
...l(e),
|
|
@@ -3395,73 +3498,73 @@ function ue(t, e) {
|
|
|
3395
3498
|
});
|
|
3396
3499
|
}
|
|
3397
3500
|
function Fe(t, e) {
|
|
3398
|
-
return new
|
|
3501
|
+
return new Yn({
|
|
3399
3502
|
check: "multiple_of",
|
|
3400
3503
|
...l(e),
|
|
3401
3504
|
value: t
|
|
3402
3505
|
});
|
|
3403
3506
|
}
|
|
3404
3507
|
function kt(t, e) {
|
|
3405
|
-
return new
|
|
3508
|
+
return new Xn({
|
|
3406
3509
|
check: "max_length",
|
|
3407
3510
|
...l(e),
|
|
3408
3511
|
maximum: t
|
|
3409
3512
|
});
|
|
3410
3513
|
}
|
|
3411
|
-
function
|
|
3412
|
-
return new
|
|
3514
|
+
function ee(t, e) {
|
|
3515
|
+
return new Qn({
|
|
3413
3516
|
check: "min_length",
|
|
3414
3517
|
...l(e),
|
|
3415
3518
|
minimum: t
|
|
3416
3519
|
});
|
|
3417
3520
|
}
|
|
3418
3521
|
function yt(t, e) {
|
|
3419
|
-
return new
|
|
3522
|
+
return new Hn({
|
|
3420
3523
|
check: "length_equals",
|
|
3421
3524
|
...l(e),
|
|
3422
3525
|
length: t
|
|
3423
3526
|
});
|
|
3424
3527
|
}
|
|
3425
|
-
function
|
|
3426
|
-
return new
|
|
3528
|
+
function Ai(t, e) {
|
|
3529
|
+
return new er({
|
|
3427
3530
|
check: "string_format",
|
|
3428
3531
|
format: "regex",
|
|
3429
3532
|
...l(e),
|
|
3430
3533
|
pattern: t
|
|
3431
3534
|
});
|
|
3432
3535
|
}
|
|
3433
|
-
function
|
|
3434
|
-
return new
|
|
3536
|
+
function Zi(t) {
|
|
3537
|
+
return new tr({
|
|
3435
3538
|
check: "string_format",
|
|
3436
3539
|
format: "lowercase",
|
|
3437
3540
|
...l(t)
|
|
3438
3541
|
});
|
|
3439
3542
|
}
|
|
3440
|
-
function
|
|
3441
|
-
return new
|
|
3543
|
+
function Ci(t) {
|
|
3544
|
+
return new nr({
|
|
3442
3545
|
check: "string_format",
|
|
3443
3546
|
format: "uppercase",
|
|
3444
3547
|
...l(t)
|
|
3445
3548
|
});
|
|
3446
3549
|
}
|
|
3447
|
-
function
|
|
3448
|
-
return new
|
|
3550
|
+
function Ri(t, e) {
|
|
3551
|
+
return new rr({
|
|
3449
3552
|
check: "string_format",
|
|
3450
3553
|
format: "includes",
|
|
3451
3554
|
...l(e),
|
|
3452
3555
|
includes: t
|
|
3453
3556
|
});
|
|
3454
3557
|
}
|
|
3455
|
-
function
|
|
3456
|
-
return new
|
|
3558
|
+
function Li(t, e) {
|
|
3559
|
+
return new ir({
|
|
3457
3560
|
check: "string_format",
|
|
3458
3561
|
format: "starts_with",
|
|
3459
3562
|
...l(e),
|
|
3460
3563
|
prefix: t
|
|
3461
3564
|
});
|
|
3462
3565
|
}
|
|
3463
|
-
function
|
|
3464
|
-
return new
|
|
3566
|
+
function xi(t, e) {
|
|
3567
|
+
return new sr({
|
|
3465
3568
|
check: "string_format",
|
|
3466
3569
|
format: "ends_with",
|
|
3467
3570
|
...l(e),
|
|
@@ -3469,27 +3572,27 @@ function Ri(t, e) {
|
|
|
3469
3572
|
});
|
|
3470
3573
|
}
|
|
3471
3574
|
function U(t) {
|
|
3472
|
-
return new
|
|
3575
|
+
return new or({
|
|
3473
3576
|
check: "overwrite",
|
|
3474
3577
|
tx: t
|
|
3475
3578
|
});
|
|
3476
3579
|
}
|
|
3477
|
-
function
|
|
3580
|
+
function Di(t) {
|
|
3478
3581
|
return U((e) => e.normalize(t));
|
|
3479
3582
|
}
|
|
3480
|
-
function
|
|
3583
|
+
function Fi() {
|
|
3481
3584
|
return U((t) => t.trim());
|
|
3482
3585
|
}
|
|
3483
|
-
function
|
|
3586
|
+
function ji() {
|
|
3484
3587
|
return U((t) => t.toLowerCase());
|
|
3485
3588
|
}
|
|
3486
|
-
function
|
|
3589
|
+
function Mi() {
|
|
3487
3590
|
return U((t) => t.toUpperCase());
|
|
3488
3591
|
}
|
|
3489
|
-
function
|
|
3490
|
-
return U((t) =>
|
|
3592
|
+
function Ui() {
|
|
3593
|
+
return U((t) => Ht(t));
|
|
3491
3594
|
}
|
|
3492
|
-
function
|
|
3595
|
+
function Gi(t, e, n) {
|
|
3493
3596
|
return new t({
|
|
3494
3597
|
type: "array",
|
|
3495
3598
|
element: e,
|
|
@@ -3499,7 +3602,7 @@ function Ui(t, e, n) {
|
|
|
3499
3602
|
...l(n)
|
|
3500
3603
|
});
|
|
3501
3604
|
}
|
|
3502
|
-
function
|
|
3605
|
+
function Vi(t, e, n) {
|
|
3503
3606
|
return new t({
|
|
3504
3607
|
type: "custom",
|
|
3505
3608
|
check: "custom",
|
|
@@ -3507,18 +3610,18 @@ function Mi(t, e, n) {
|
|
|
3507
3610
|
...l(n)
|
|
3508
3611
|
});
|
|
3509
3612
|
}
|
|
3510
|
-
function
|
|
3511
|
-
const e =
|
|
3613
|
+
function Bi(t) {
|
|
3614
|
+
const e = Ji((n) => (n.addIssue = (r) => {
|
|
3512
3615
|
if (typeof r == "string")
|
|
3513
|
-
n.issues.push(
|
|
3616
|
+
n.issues.push(W(r, n.value, e._zod.def));
|
|
3514
3617
|
else {
|
|
3515
3618
|
const i = r;
|
|
3516
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !e._zod.def.abort), n.issues.push(
|
|
3619
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !e._zod.def.abort), n.issues.push(W(i));
|
|
3517
3620
|
}
|
|
3518
3621
|
}, t(n.value, n)));
|
|
3519
3622
|
return e;
|
|
3520
3623
|
}
|
|
3521
|
-
function
|
|
3624
|
+
function Ji(t, e) {
|
|
3522
3625
|
const n = new b({
|
|
3523
3626
|
check: "custom",
|
|
3524
3627
|
...l(e)
|
|
@@ -3529,7 +3632,7 @@ function Tt(t) {
|
|
|
3529
3632
|
let e = t?.target ?? "draft-2020-12";
|
|
3530
3633
|
return e === "draft-4" && (e = "draft-04"), e === "draft-7" && (e = "draft-07"), {
|
|
3531
3634
|
processors: t.processors ?? {},
|
|
3532
|
-
metadataRegistry: t?.metadata ??
|
|
3635
|
+
metadataRegistry: t?.metadata ?? V,
|
|
3533
3636
|
target: e,
|
|
3534
3637
|
unrepresentable: t?.unrepresentable ?? "throw",
|
|
3535
3638
|
override: t?.override ?? (() => {
|
|
@@ -3569,8 +3672,8 @@ function T(t, e, n = { path: [], schemaPath: [] }) {
|
|
|
3569
3672
|
v(t, e, f, p);
|
|
3570
3673
|
}
|
|
3571
3674
|
}
|
|
3572
|
-
const
|
|
3573
|
-
return
|
|
3675
|
+
const c = e.metadataRegistry.get(t);
|
|
3676
|
+
return c && Object.assign(o.schema, c), e.io === "input" && w(t) && (delete o.schema.examples, delete o.schema.default), e.io === "input" && o.schema._prefault && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, e.seen.get(t).schema;
|
|
3574
3677
|
}
|
|
3575
3678
|
function wt(t, e) {
|
|
3576
3679
|
const n = t.seen.get(e);
|
|
@@ -3587,13 +3690,13 @@ function wt(t, e) {
|
|
|
3587
3690
|
}
|
|
3588
3691
|
if (s[1] === n)
|
|
3589
3692
|
return { ref: "#" };
|
|
3590
|
-
const
|
|
3591
|
-
return { defId: h, ref:
|
|
3693
|
+
const c = `#/${o}/`, h = s[1].schema.id ?? `__schema${t.counter++}`;
|
|
3694
|
+
return { defId: h, ref: c + h };
|
|
3592
3695
|
}, i = (s) => {
|
|
3593
3696
|
if (s[1].schema.$ref)
|
|
3594
3697
|
return;
|
|
3595
|
-
const o = s[1], { ref: a, defId:
|
|
3596
|
-
o.def = { ...o.schema },
|
|
3698
|
+
const o = s[1], { ref: a, defId: c } = r(s);
|
|
3699
|
+
o.def = { ...o.schema }, c && (o.defId = c);
|
|
3597
3700
|
const h = o.schema;
|
|
3598
3701
|
for (const p in h)
|
|
3599
3702
|
delete h[p];
|
|
@@ -3614,8 +3717,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3614
3717
|
continue;
|
|
3615
3718
|
}
|
|
3616
3719
|
if (t.external) {
|
|
3617
|
-
const
|
|
3618
|
-
if (e !== s[0] &&
|
|
3720
|
+
const c = t.external.registry.get(s[0])?.id;
|
|
3721
|
+
if (e !== s[0] && c) {
|
|
3619
3722
|
i(s);
|
|
3620
3723
|
continue;
|
|
3621
3724
|
}
|
|
@@ -3639,18 +3742,18 @@ function bt(t, e) {
|
|
|
3639
3742
|
if (!n)
|
|
3640
3743
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3641
3744
|
const r = (o) => {
|
|
3642
|
-
const a = t.seen.get(o),
|
|
3745
|
+
const a = t.seen.get(o), c = a.def ?? a.schema, h = { ...c };
|
|
3643
3746
|
if (a.ref === null)
|
|
3644
3747
|
return;
|
|
3645
3748
|
const p = a.ref;
|
|
3646
3749
|
if (a.ref = null, p) {
|
|
3647
3750
|
r(p);
|
|
3648
3751
|
const d = t.seen.get(p).schema;
|
|
3649
|
-
d.$ref && (t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0") ? (
|
|
3752
|
+
d.$ref && (t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(d)) : (Object.assign(c, d), Object.assign(c, h));
|
|
3650
3753
|
}
|
|
3651
3754
|
a.isParent || t.override({
|
|
3652
3755
|
zodSchema: o,
|
|
3653
|
-
jsonSchema:
|
|
3756
|
+
jsonSchema: c,
|
|
3654
3757
|
path: a.path ?? []
|
|
3655
3758
|
});
|
|
3656
3759
|
};
|
|
@@ -3676,8 +3779,8 @@ function bt(t, e) {
|
|
|
3676
3779
|
value: {
|
|
3677
3780
|
...e["~standard"],
|
|
3678
3781
|
jsonSchema: {
|
|
3679
|
-
input:
|
|
3680
|
-
output:
|
|
3782
|
+
input: te(e, "input"),
|
|
3783
|
+
output: te(e, "output")
|
|
3681
3784
|
}
|
|
3682
3785
|
},
|
|
3683
3786
|
enumerable: !1,
|
|
@@ -3729,25 +3832,25 @@ function w(t, e) {
|
|
|
3729
3832
|
}
|
|
3730
3833
|
return !1;
|
|
3731
3834
|
}
|
|
3732
|
-
const
|
|
3835
|
+
const Wi = (t, e = {}) => (n) => {
|
|
3733
3836
|
const r = Tt({ ...n, processors: e });
|
|
3734
3837
|
return T(t, r), wt(r, t), bt(r, t);
|
|
3735
|
-
},
|
|
3838
|
+
}, te = (t, e) => (n) => {
|
|
3736
3839
|
const { libraryOptions: r, target: i } = n ?? {}, s = Tt({ ...r ?? {}, target: i, io: e, processors: {} });
|
|
3737
3840
|
return T(t, s), wt(s, t), bt(s, t);
|
|
3738
|
-
},
|
|
3841
|
+
}, Ki = {
|
|
3739
3842
|
guid: "uuid",
|
|
3740
3843
|
url: "uri",
|
|
3741
3844
|
datetime: "date-time",
|
|
3742
3845
|
json_string: "json-string",
|
|
3743
3846
|
regex: ""
|
|
3744
3847
|
// do not set
|
|
3745
|
-
},
|
|
3848
|
+
}, Yi = (t, e, n, r) => {
|
|
3746
3849
|
const i = n;
|
|
3747
3850
|
i.type = "string";
|
|
3748
|
-
const { minimum: s, maximum: o, format: a, patterns:
|
|
3749
|
-
if (typeof s == "number" && (i.minLength = s), typeof o == "number" && (i.maxLength = o), a && (i.format =
|
|
3750
|
-
const p = [...
|
|
3851
|
+
const { minimum: s, maximum: o, format: a, patterns: c, contentEncoding: h } = t._zod.bag;
|
|
3852
|
+
if (typeof s == "number" && (i.minLength = s), typeof o == "number" && (i.maxLength = o), a && (i.format = Ki[a] ?? a, i.format === "" && delete i.format), h && (i.contentEncoding = h), c && c.size > 0) {
|
|
3853
|
+
const p = [...c];
|
|
3751
3854
|
p.length === 1 ? i.pattern = p[0].source : p.length > 1 && (i.allOf = [
|
|
3752
3855
|
...p.map((d) => ({
|
|
3753
3856
|
...e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0" ? { type: "string" } : {},
|
|
@@ -3755,16 +3858,16 @@ const Bi = (t, e = {}) => (n) => {
|
|
|
3755
3858
|
}))
|
|
3756
3859
|
]);
|
|
3757
3860
|
}
|
|
3758
|
-
}, Ki = (t, e, n, r) => {
|
|
3759
|
-
const i = n, { minimum: s, maximum: o, format: a, multipleOf: u, exclusiveMaximum: h, exclusiveMinimum: p } = t._zod.bag;
|
|
3760
|
-
typeof a == "string" && a.includes("int") ? i.type = "integer" : i.type = "number", typeof p == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.minimum = p, i.exclusiveMinimum = !0) : i.exclusiveMinimum = p), typeof s == "number" && (i.minimum = s, typeof p == "number" && e.target !== "draft-04" && (p >= s ? delete i.minimum : delete i.exclusiveMinimum)), typeof h == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.maximum = h, i.exclusiveMaximum = !0) : i.exclusiveMaximum = h), typeof o == "number" && (i.maximum = o, typeof h == "number" && e.target !== "draft-04" && (h <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof u == "number" && (i.multipleOf = u);
|
|
3761
|
-
}, Yi = (t, e, n, r) => {
|
|
3762
|
-
n.not = {};
|
|
3763
|
-
}, Xi = (t, e, n, r) => {
|
|
3764
3861
|
}, qi = (t, e, n, r) => {
|
|
3862
|
+
const i = n, { minimum: s, maximum: o, format: a, multipleOf: c, exclusiveMaximum: h, exclusiveMinimum: p } = t._zod.bag;
|
|
3863
|
+
typeof a == "string" && a.includes("int") ? i.type = "integer" : i.type = "number", typeof p == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.minimum = p, i.exclusiveMinimum = !0) : i.exclusiveMinimum = p), typeof s == "number" && (i.minimum = s, typeof p == "number" && e.target !== "draft-04" && (p >= s ? delete i.minimum : delete i.exclusiveMinimum)), typeof h == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.maximum = h, i.exclusiveMaximum = !0) : i.exclusiveMaximum = h), typeof o == "number" && (i.maximum = o, typeof h == "number" && e.target !== "draft-04" && (h <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == "number" && (i.multipleOf = c);
|
|
3864
|
+
}, Xi = (t, e, n, r) => {
|
|
3865
|
+
n.not = {};
|
|
3866
|
+
}, Qi = (t, e, n, r) => {
|
|
3867
|
+
}, Hi = (t, e, n, r) => {
|
|
3765
3868
|
const i = t._zod.def, s = tt(i.entries);
|
|
3766
3869
|
s.every((o) => typeof o == "number") && (n.type = "number"), s.every((o) => typeof o == "string") && (n.type = "string"), n.enum = s;
|
|
3767
|
-
},
|
|
3870
|
+
}, es = (t, e, n, r) => {
|
|
3768
3871
|
const i = t._zod.def, s = [];
|
|
3769
3872
|
for (const o of i.values)
|
|
3770
3873
|
if (o === void 0) {
|
|
@@ -3781,16 +3884,16 @@ const Bi = (t, e = {}) => (n) => {
|
|
|
3781
3884
|
n.type = o === null ? "null" : typeof o, e.target === "draft-04" || e.target === "openapi-3.0" ? n.enum = [o] : n.const = o;
|
|
3782
3885
|
} else
|
|
3783
3886
|
s.every((o) => typeof o == "number") && (n.type = "number"), s.every((o) => typeof o == "string") && (n.type = "string"), s.every((o) => typeof o == "boolean") && (n.type = "boolean"), s.every((o) => o === null) && (n.type = "null"), n.enum = s;
|
|
3784
|
-
},
|
|
3887
|
+
}, ts = (t, e, n, r) => {
|
|
3785
3888
|
if (e.unrepresentable === "throw")
|
|
3786
3889
|
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3787
|
-
},
|
|
3890
|
+
}, ns = (t, e, n, r) => {
|
|
3788
3891
|
if (e.unrepresentable === "throw")
|
|
3789
3892
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
3790
|
-
},
|
|
3893
|
+
}, rs = (t, e, n, r) => {
|
|
3791
3894
|
const i = n, s = t._zod.def, { minimum: o, maximum: a } = t._zod.bag;
|
|
3792
3895
|
typeof o == "number" && (i.minItems = o), typeof a == "number" && (i.maxItems = a), i.type = "array", i.items = T(s.element, e, { ...r, path: [...r.path, "items"] });
|
|
3793
|
-
},
|
|
3896
|
+
}, is = (t, e, n, r) => {
|
|
3794
3897
|
const i = n, s = t._zod.def;
|
|
3795
3898
|
i.type = "object", i.properties = {};
|
|
3796
3899
|
const o = s.shape;
|
|
@@ -3799,51 +3902,51 @@ const Bi = (t, e = {}) => (n) => {
|
|
|
3799
3902
|
...r,
|
|
3800
3903
|
path: [...r.path, "properties", h]
|
|
3801
3904
|
});
|
|
3802
|
-
const a = new Set(Object.keys(o)),
|
|
3905
|
+
const a = new Set(Object.keys(o)), c = new Set([...a].filter((h) => {
|
|
3803
3906
|
const p = s.shape[h]._zod;
|
|
3804
3907
|
return e.io === "input" ? p.optin === void 0 : p.optout === void 0;
|
|
3805
3908
|
}));
|
|
3806
|
-
|
|
3909
|
+
c.size > 0 && (i.required = Array.from(c)), s.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : s.catchall ? s.catchall && (i.additionalProperties = T(s.catchall, e, {
|
|
3807
3910
|
...r,
|
|
3808
3911
|
path: [...r.path, "additionalProperties"]
|
|
3809
3912
|
})) : e.io === "output" && (i.additionalProperties = !1);
|
|
3810
|
-
},
|
|
3811
|
-
const i = t._zod.def, s = i.inclusive === !1, o = i.options.map((a,
|
|
3913
|
+
}, ss = (t, e, n, r) => {
|
|
3914
|
+
const i = t._zod.def, s = i.inclusive === !1, o = i.options.map((a, c) => T(a, e, {
|
|
3812
3915
|
...r,
|
|
3813
|
-
path: [...r.path, s ? "oneOf" : "anyOf",
|
|
3916
|
+
path: [...r.path, s ? "oneOf" : "anyOf", c]
|
|
3814
3917
|
}));
|
|
3815
3918
|
s ? n.oneOf = o : n.anyOf = o;
|
|
3816
|
-
},
|
|
3919
|
+
}, os = (t, e, n, r) => {
|
|
3817
3920
|
const i = t._zod.def, s = T(i.left, e, {
|
|
3818
3921
|
...r,
|
|
3819
3922
|
path: [...r.path, "allOf", 0]
|
|
3820
3923
|
}), o = T(i.right, e, {
|
|
3821
3924
|
...r,
|
|
3822
3925
|
path: [...r.path, "allOf", 1]
|
|
3823
|
-
}), a = (h) => "allOf" in h && Object.keys(h).length === 1,
|
|
3926
|
+
}), a = (h) => "allOf" in h && Object.keys(h).length === 1, c = [
|
|
3824
3927
|
...a(s) ? s.allOf : [s],
|
|
3825
3928
|
...a(o) ? o.allOf : [o]
|
|
3826
3929
|
];
|
|
3827
|
-
n.allOf =
|
|
3828
|
-
},
|
|
3930
|
+
n.allOf = c;
|
|
3931
|
+
}, as = (t, e, n, r) => {
|
|
3829
3932
|
const i = t._zod.def, s = T(i.innerType, e, r), o = e.seen.get(t);
|
|
3830
3933
|
e.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
|
|
3831
|
-
},
|
|
3934
|
+
}, cs = (t, e, n, r) => {
|
|
3832
3935
|
const i = t._zod.def;
|
|
3833
3936
|
T(i.innerType, e, r);
|
|
3834
3937
|
const s = e.seen.get(t);
|
|
3835
3938
|
s.ref = i.innerType;
|
|
3836
|
-
},
|
|
3939
|
+
}, us = (t, e, n, r) => {
|
|
3837
3940
|
const i = t._zod.def;
|
|
3838
3941
|
T(i.innerType, e, r);
|
|
3839
3942
|
const s = e.seen.get(t);
|
|
3840
3943
|
s.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
|
|
3841
|
-
},
|
|
3944
|
+
}, hs = (t, e, n, r) => {
|
|
3842
3945
|
const i = t._zod.def;
|
|
3843
3946
|
T(i.innerType, e, r);
|
|
3844
3947
|
const s = e.seen.get(t);
|
|
3845
3948
|
s.ref = i.innerType, e.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
|
|
3846
|
-
},
|
|
3949
|
+
}, ps = (t, e, n, r) => {
|
|
3847
3950
|
const i = t._zod.def;
|
|
3848
3951
|
T(i.innerType, e, r);
|
|
3849
3952
|
const s = e.seen.get(t);
|
|
@@ -3855,64 +3958,64 @@ const Bi = (t, e = {}) => (n) => {
|
|
|
3855
3958
|
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
3856
3959
|
}
|
|
3857
3960
|
n.default = o;
|
|
3858
|
-
},
|
|
3961
|
+
}, ls = (t, e, n, r) => {
|
|
3859
3962
|
const i = t._zod.def, s = e.io === "input" ? i.in._zod.def.type === "transform" ? i.out : i.in : i.out;
|
|
3860
3963
|
T(s, e, r);
|
|
3861
3964
|
const o = e.seen.get(t);
|
|
3862
3965
|
o.ref = s;
|
|
3863
|
-
},
|
|
3966
|
+
}, ds = (t, e, n, r) => {
|
|
3864
3967
|
const i = t._zod.def;
|
|
3865
3968
|
T(i.innerType, e, r);
|
|
3866
3969
|
const s = e.seen.get(t);
|
|
3867
3970
|
s.ref = i.innerType, n.readOnly = !0;
|
|
3868
|
-
},
|
|
3971
|
+
}, fs = (t, e, n, r) => {
|
|
3869
3972
|
const i = t._zod.def;
|
|
3870
3973
|
T(i.innerType, e, r);
|
|
3871
3974
|
const s = e.seen.get(t);
|
|
3872
3975
|
s.ref = i.innerType;
|
|
3873
|
-
},
|
|
3874
|
-
|
|
3875
|
-
});
|
|
3876
|
-
function fs(t) {
|
|
3877
|
-
return wi(ds, t);
|
|
3878
|
-
}
|
|
3879
|
-
const ms = /* @__PURE__ */ c("ZodISODate", (t, e) => {
|
|
3880
|
-
kr.init(t, e), _.init(t, e);
|
|
3976
|
+
}, ms = /* @__PURE__ */ u("ZodISODateTime", (t, e) => {
|
|
3977
|
+
yr.init(t, e), _.init(t, e);
|
|
3881
3978
|
});
|
|
3882
3979
|
function gs(t) {
|
|
3883
|
-
return
|
|
3980
|
+
return Ei(ms, t);
|
|
3884
3981
|
}
|
|
3885
|
-
const vs = /* @__PURE__ */
|
|
3886
|
-
|
|
3982
|
+
const vs = /* @__PURE__ */ u("ZodISODate", (t, e) => {
|
|
3983
|
+
Tr.init(t, e), _.init(t, e);
|
|
3887
3984
|
});
|
|
3888
3985
|
function _s(t) {
|
|
3889
|
-
return
|
|
3986
|
+
return Ii(vs, t);
|
|
3890
3987
|
}
|
|
3891
|
-
const ks = /* @__PURE__ */
|
|
3892
|
-
|
|
3988
|
+
const ks = /* @__PURE__ */ u("ZodISOTime", (t, e) => {
|
|
3989
|
+
wr.init(t, e), _.init(t, e);
|
|
3893
3990
|
});
|
|
3894
3991
|
function ys(t) {
|
|
3895
3992
|
return zi(ks, t);
|
|
3896
3993
|
}
|
|
3897
|
-
const Ts = (t, e) => {
|
|
3994
|
+
const Ts = /* @__PURE__ */ u("ZodISODuration", (t, e) => {
|
|
3995
|
+
br.init(t, e), _.init(t, e);
|
|
3996
|
+
});
|
|
3997
|
+
function ws(t) {
|
|
3998
|
+
return $i(Ts, t);
|
|
3999
|
+
}
|
|
4000
|
+
const bs = (t, e) => {
|
|
3898
4001
|
ot.init(t, e), t.name = "ZodError", Object.defineProperties(t, {
|
|
3899
4002
|
format: {
|
|
3900
|
-
value: (n) =>
|
|
4003
|
+
value: (n) => dn(t, n)
|
|
3901
4004
|
// enumerable: false,
|
|
3902
4005
|
},
|
|
3903
4006
|
flatten: {
|
|
3904
|
-
value: (n) =>
|
|
4007
|
+
value: (n) => ln(t, n)
|
|
3905
4008
|
// enumerable: false,
|
|
3906
4009
|
},
|
|
3907
4010
|
addIssue: {
|
|
3908
4011
|
value: (n) => {
|
|
3909
|
-
t.issues.push(n), t.message = JSON.stringify(t.issues,
|
|
4012
|
+
t.issues.push(n), t.message = JSON.stringify(t.issues, le, 2);
|
|
3910
4013
|
}
|
|
3911
4014
|
// enumerable: false,
|
|
3912
4015
|
},
|
|
3913
4016
|
addIssues: {
|
|
3914
4017
|
value: (n) => {
|
|
3915
|
-
t.issues.push(...n), t.message = JSON.stringify(t.issues,
|
|
4018
|
+
t.issues.push(...n), t.message = JSON.stringify(t.issues, le, 2);
|
|
3916
4019
|
}
|
|
3917
4020
|
// enumerable: false,
|
|
3918
4021
|
},
|
|
@@ -3923,157 +4026,157 @@ const Ts = (t, e) => {
|
|
|
3923
4026
|
// enumerable: false,
|
|
3924
4027
|
}
|
|
3925
4028
|
});
|
|
3926
|
-
},
|
|
4029
|
+
}, I = u("ZodError", bs, {
|
|
3927
4030
|
Parent: Error
|
|
3928
|
-
}),
|
|
4031
|
+
}), Es = /* @__PURE__ */ _e(I), Is = /* @__PURE__ */ ke(I), zs = /* @__PURE__ */ ie(I), $s = /* @__PURE__ */ se(I), Os = /* @__PURE__ */ gn(I), Ps = /* @__PURE__ */ vn(I), Ss = /* @__PURE__ */ _n(I), Ns = /* @__PURE__ */ kn(I), As = /* @__PURE__ */ yn(I), Zs = /* @__PURE__ */ Tn(I), Cs = /* @__PURE__ */ wn(I), Rs = /* @__PURE__ */ bn(I), y = /* @__PURE__ */ u("ZodType", (t, e) => (k.init(t, e), Object.assign(t["~standard"], {
|
|
3929
4032
|
jsonSchema: {
|
|
3930
|
-
input:
|
|
3931
|
-
output:
|
|
4033
|
+
input: te(t, "input"),
|
|
4034
|
+
output: te(t, "output")
|
|
3932
4035
|
}
|
|
3933
|
-
}), t.toJSONSchema =
|
|
4036
|
+
}), t.toJSONSchema = Wi(t, {}), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...n) => t.clone(x(e, {
|
|
3934
4037
|
checks: [
|
|
3935
4038
|
...e.checks ?? [],
|
|
3936
4039
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
3937
4040
|
]
|
|
3938
|
-
})), t.clone = (n, r) =>
|
|
4041
|
+
})), t.clone = (n, r) => N(t, n, r), t.brand = () => t, t.register = ((n, r) => (n.add(t, r), t)), t.parse = (n, r) => Es(t, n, r, { callee: t.parse }), t.safeParse = (n, r) => zs(t, n, r), t.parseAsync = async (n, r) => Is(t, n, r, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => $s(t, n, r), t.spa = t.safeParseAsync, t.encode = (n, r) => Os(t, n, r), t.decode = (n, r) => Ps(t, n, r), t.encodeAsync = async (n, r) => Ss(t, n, r), t.decodeAsync = async (n, r) => Ns(t, n, r), t.safeEncode = (n, r) => As(t, n, r), t.safeDecode = (n, r) => Zs(t, n, r), t.safeEncodeAsync = async (n, r) => Cs(t, n, r), t.safeDecodeAsync = async (n, r) => Rs(t, n, r), t.refine = (n, r) => t.check($o(n, r)), t.superRefine = (n) => t.check(Oo(n)), t.overwrite = (n) => t.check(U(n)), t.optional = () => Ge(t), t.nullable = () => Ve(t), t.nullish = () => Ge(Ve(t)), t.nonoptional = (n) => yo(t, n), t.array = () => Z(t), t.or = (n) => ae([t, n]), t.and = (n) => ho(t, n), t.transform = (n) => Be(t, fo(n)), t.default = (n) => vo(t, n), t.prefault = (n) => ko(t, n), t.catch = (n) => wo(t, n), t.pipe = (n) => Be(t, n), t.readonly = () => Io(t), t.describe = (n) => {
|
|
3939
4042
|
const r = t.clone();
|
|
3940
|
-
return
|
|
4043
|
+
return V.add(r, { description: n }), r;
|
|
3941
4044
|
}, Object.defineProperty(t, "description", {
|
|
3942
4045
|
get() {
|
|
3943
|
-
return
|
|
4046
|
+
return V.get(t)?.description;
|
|
3944
4047
|
},
|
|
3945
4048
|
configurable: !0
|
|
3946
4049
|
}), t.meta = (...n) => {
|
|
3947
4050
|
if (n.length === 0)
|
|
3948
|
-
return
|
|
4051
|
+
return V.get(t);
|
|
3949
4052
|
const r = t.clone();
|
|
3950
|
-
return
|
|
3951
|
-
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Et = /* @__PURE__ */
|
|
3952
|
-
|
|
4053
|
+
return V.add(r, n[0]), r;
|
|
4054
|
+
}, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Et = /* @__PURE__ */ u("_ZodString", (t, e) => {
|
|
4055
|
+
ye.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Yi(t, r, i);
|
|
3953
4056
|
const n = t._zod.bag;
|
|
3954
|
-
t.format = n.format ?? null, t.minLength = n.minimum ?? null, t.maxLength = n.maximum ?? null, t.regex = (...r) => t.check(
|
|
3955
|
-
}),
|
|
3956
|
-
|
|
4057
|
+
t.format = n.format ?? null, t.minLength = n.minimum ?? null, t.maxLength = n.maximum ?? null, t.regex = (...r) => t.check(Ai(...r)), t.includes = (...r) => t.check(Ri(...r)), t.startsWith = (...r) => t.check(Li(...r)), t.endsWith = (...r) => t.check(xi(...r)), t.min = (...r) => t.check(ee(...r)), t.max = (...r) => t.check(kt(...r)), t.length = (...r) => t.check(yt(...r)), t.nonempty = (...r) => t.check(ee(1, ...r)), t.lowercase = (r) => t.check(Zi(r)), t.uppercase = (r) => t.check(Ci(r)), t.trim = () => t.check(Fi()), t.normalize = (...r) => t.check(Di(...r)), t.toLowerCase = () => t.check(ji()), t.toUpperCase = () => t.check(Mi()), t.slugify = () => t.check(Ui());
|
|
4058
|
+
}), Ls = /* @__PURE__ */ u("ZodString", (t, e) => {
|
|
4059
|
+
ye.init(t, e), Et.init(t, e), t.email = (n) => t.check(ri(xs, n)), t.url = (n) => t.check(ci(Ds, n)), t.jwt = (n) => t.check(bi(Hs, n)), t.emoji = (n) => t.check(ui(Fs, n)), t.guid = (n) => t.check(Le(je, n)), t.uuid = (n) => t.check(ii(X, n)), t.uuidv4 = (n) => t.check(si(X, n)), t.uuidv6 = (n) => t.check(oi(X, n)), t.uuidv7 = (n) => t.check(ai(X, n)), t.nanoid = (n) => t.check(hi(js, n)), t.guid = (n) => t.check(Le(je, n)), t.cuid = (n) => t.check(pi(Ms, n)), t.cuid2 = (n) => t.check(li(Us, n)), t.ulid = (n) => t.check(di(Gs, n)), t.base64 = (n) => t.check(yi(qs, n)), t.base64url = (n) => t.check(Ti(Xs, n)), t.xid = (n) => t.check(fi(Vs, n)), t.ksuid = (n) => t.check(mi(Bs, n)), t.ipv4 = (n) => t.check(gi(Js, n)), t.ipv6 = (n) => t.check(vi(Ws, n)), t.cidrv4 = (n) => t.check(_i(Ks, n)), t.cidrv6 = (n) => t.check(ki(Ys, n)), t.e164 = (n) => t.check(wi(Qs, n)), t.datetime = (n) => t.check(gs(n)), t.date = (n) => t.check(_s(n)), t.time = (n) => t.check(ys(n)), t.duration = (n) => t.check(ws(n));
|
|
3957
4060
|
});
|
|
3958
4061
|
function $(t) {
|
|
3959
|
-
return
|
|
4062
|
+
return ni(Ls, t);
|
|
3960
4063
|
}
|
|
3961
|
-
const _ = /* @__PURE__ */
|
|
4064
|
+
const _ = /* @__PURE__ */ u("ZodStringFormat", (t, e) => {
|
|
3962
4065
|
g.init(t, e), Et.init(t, e);
|
|
3963
|
-
}),
|
|
4066
|
+
}), xs = /* @__PURE__ */ u("ZodEmail", (t, e) => {
|
|
4067
|
+
pr.init(t, e), _.init(t, e);
|
|
4068
|
+
}), je = /* @__PURE__ */ u("ZodGUID", (t, e) => {
|
|
3964
4069
|
ur.init(t, e), _.init(t, e);
|
|
3965
|
-
}),
|
|
3966
|
-
ar.init(t, e), _.init(t, e);
|
|
3967
|
-
}), Y = /* @__PURE__ */ c("ZodUUID", (t, e) => {
|
|
3968
|
-
cr.init(t, e), _.init(t, e);
|
|
3969
|
-
}), xs = /* @__PURE__ */ c("ZodURL", (t, e) => {
|
|
4070
|
+
}), X = /* @__PURE__ */ u("ZodUUID", (t, e) => {
|
|
3970
4071
|
hr.init(t, e), _.init(t, e);
|
|
3971
|
-
}),
|
|
3972
|
-
pr.init(t, e), _.init(t, e);
|
|
3973
|
-
}), Ds = /* @__PURE__ */ c("ZodNanoID", (t, e) => {
|
|
4072
|
+
}), Ds = /* @__PURE__ */ u("ZodURL", (t, e) => {
|
|
3974
4073
|
lr.init(t, e), _.init(t, e);
|
|
3975
|
-
}), Fs = /* @__PURE__ */
|
|
4074
|
+
}), Fs = /* @__PURE__ */ u("ZodEmoji", (t, e) => {
|
|
3976
4075
|
dr.init(t, e), _.init(t, e);
|
|
3977
|
-
}), js = /* @__PURE__ */
|
|
4076
|
+
}), js = /* @__PURE__ */ u("ZodNanoID", (t, e) => {
|
|
3978
4077
|
fr.init(t, e), _.init(t, e);
|
|
3979
|
-
}),
|
|
4078
|
+
}), Ms = /* @__PURE__ */ u("ZodCUID", (t, e) => {
|
|
3980
4079
|
mr.init(t, e), _.init(t, e);
|
|
3981
|
-
}),
|
|
4080
|
+
}), Us = /* @__PURE__ */ u("ZodCUID2", (t, e) => {
|
|
3982
4081
|
gr.init(t, e), _.init(t, e);
|
|
3983
|
-
}), Gs = /* @__PURE__ */
|
|
4082
|
+
}), Gs = /* @__PURE__ */ u("ZodULID", (t, e) => {
|
|
3984
4083
|
vr.init(t, e), _.init(t, e);
|
|
3985
|
-
}), Vs = /* @__PURE__ */
|
|
3986
|
-
|
|
3987
|
-
}), Bs = /* @__PURE__ */
|
|
3988
|
-
|
|
3989
|
-
}), Js = /* @__PURE__ */
|
|
4084
|
+
}), Vs = /* @__PURE__ */ u("ZodXID", (t, e) => {
|
|
4085
|
+
_r.init(t, e), _.init(t, e);
|
|
4086
|
+
}), Bs = /* @__PURE__ */ u("ZodKSUID", (t, e) => {
|
|
4087
|
+
kr.init(t, e), _.init(t, e);
|
|
4088
|
+
}), Js = /* @__PURE__ */ u("ZodIPv4", (t, e) => {
|
|
3990
4089
|
Er.init(t, e), _.init(t, e);
|
|
3991
|
-
}), Ws = /* @__PURE__ */
|
|
3992
|
-
zr.init(t, e), _.init(t, e);
|
|
3993
|
-
}), Ks = /* @__PURE__ */ c("ZodBase64", (t, e) => {
|
|
4090
|
+
}), Ws = /* @__PURE__ */ u("ZodIPv6", (t, e) => {
|
|
3994
4091
|
Ir.init(t, e), _.init(t, e);
|
|
3995
|
-
}),
|
|
4092
|
+
}), Ks = /* @__PURE__ */ u("ZodCIDRv4", (t, e) => {
|
|
4093
|
+
zr.init(t, e), _.init(t, e);
|
|
4094
|
+
}), Ys = /* @__PURE__ */ u("ZodCIDRv6", (t, e) => {
|
|
4095
|
+
$r.init(t, e), _.init(t, e);
|
|
4096
|
+
}), qs = /* @__PURE__ */ u("ZodBase64", (t, e) => {
|
|
3996
4097
|
Or.init(t, e), _.init(t, e);
|
|
3997
|
-
}), Xs = /* @__PURE__ */
|
|
4098
|
+
}), Xs = /* @__PURE__ */ u("ZodBase64URL", (t, e) => {
|
|
3998
4099
|
Sr.init(t, e), _.init(t, e);
|
|
3999
|
-
}),
|
|
4000
|
-
|
|
4001
|
-
}),
|
|
4002
|
-
|
|
4100
|
+
}), Qs = /* @__PURE__ */ u("ZodE164", (t, e) => {
|
|
4101
|
+
Nr.init(t, e), _.init(t, e);
|
|
4102
|
+
}), Hs = /* @__PURE__ */ u("ZodJWT", (t, e) => {
|
|
4103
|
+
Zr.init(t, e), _.init(t, e);
|
|
4104
|
+
}), It = /* @__PURE__ */ u("ZodNumber", (t, e) => {
|
|
4105
|
+
mt.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => qi(t, r, i), t.gt = (r, i) => t.check(De(r, i)), t.gte = (r, i) => t.check(pe(r, i)), t.min = (r, i) => t.check(pe(r, i)), t.lt = (r, i) => t.check(xe(r, i)), t.lte = (r, i) => t.check(he(r, i)), t.max = (r, i) => t.check(he(r, i)), t.int = (r) => t.check(Me(r)), t.safe = (r) => t.check(Me(r)), t.positive = (r) => t.check(De(0, r)), t.nonnegative = (r) => t.check(pe(0, r)), t.negative = (r) => t.check(xe(0, r)), t.nonpositive = (r) => t.check(he(0, r)), t.multipleOf = (r, i) => t.check(Fe(r, i)), t.step = (r, i) => t.check(Fe(r, i)), t.finite = () => t;
|
|
4003
4106
|
const n = t._zod.bag;
|
|
4004
4107
|
t.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), t.isFinite = !0, t.format = n.format ?? null;
|
|
4005
4108
|
});
|
|
4006
|
-
function
|
|
4007
|
-
return
|
|
4109
|
+
function eo(t) {
|
|
4110
|
+
return Oi(It, t);
|
|
4008
4111
|
}
|
|
4009
|
-
const
|
|
4010
|
-
|
|
4112
|
+
const to = /* @__PURE__ */ u("ZodNumberFormat", (t, e) => {
|
|
4113
|
+
Cr.init(t, e), It.init(t, e);
|
|
4011
4114
|
});
|
|
4012
|
-
function
|
|
4013
|
-
return
|
|
4115
|
+
function Me(t) {
|
|
4116
|
+
return Pi(to, t);
|
|
4014
4117
|
}
|
|
4015
|
-
const
|
|
4016
|
-
|
|
4118
|
+
const no = /* @__PURE__ */ u("ZodUnknown", (t, e) => {
|
|
4119
|
+
Rr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Qi();
|
|
4017
4120
|
});
|
|
4018
|
-
function
|
|
4019
|
-
return
|
|
4121
|
+
function Ue() {
|
|
4122
|
+
return Si(no);
|
|
4020
4123
|
}
|
|
4021
|
-
const
|
|
4022
|
-
|
|
4124
|
+
const ro = /* @__PURE__ */ u("ZodNever", (t, e) => {
|
|
4125
|
+
Lr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Xi(t, n, r);
|
|
4023
4126
|
});
|
|
4024
|
-
function
|
|
4025
|
-
return
|
|
4127
|
+
function io(t) {
|
|
4128
|
+
return Ni(ro, t);
|
|
4026
4129
|
}
|
|
4027
|
-
const
|
|
4028
|
-
|
|
4130
|
+
const so = /* @__PURE__ */ u("ZodArray", (t, e) => {
|
|
4131
|
+
xr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => rs(t, n, r, i), t.element = e.element, t.min = (n, r) => t.check(ee(n, r)), t.nonempty = (n) => t.check(ee(1, n)), t.max = (n, r) => t.check(kt(n, r)), t.length = (n, r) => t.check(yt(n, r)), t.unwrap = () => t.element;
|
|
4029
4132
|
});
|
|
4030
|
-
function
|
|
4031
|
-
return
|
|
4133
|
+
function Z(t, e) {
|
|
4134
|
+
return Gi(so, t, e);
|
|
4032
4135
|
}
|
|
4033
|
-
const
|
|
4034
|
-
|
|
4136
|
+
const oo = /* @__PURE__ */ u("ZodObject", (t, e) => {
|
|
4137
|
+
Fr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => is(t, n, r, i), m(t, "shape", () => e.shape), t.keyof = () => $t(Object.keys(t._zod.def.shape)), t.catchall = (n) => t.clone({ ...t._zod.def, catchall: n }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Ue() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Ue() }), t.strict = () => t.clone({ ...t._zod.def, catchall: io() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (n) => an(t, n), t.safeExtend = (n) => cn(t, n), t.merge = (n) => un(t, n), t.pick = (n) => sn(t, n), t.omit = (n) => on(t, n), t.partial = (...n) => hn(Ot, t, n[0]), t.required = (...n) => pn(Pt, t, n[0]);
|
|
4035
4138
|
});
|
|
4036
|
-
function
|
|
4139
|
+
function z(t, e) {
|
|
4037
4140
|
const n = {
|
|
4038
4141
|
type: "object",
|
|
4039
4142
|
shape: t ?? {},
|
|
4040
4143
|
...l(e)
|
|
4041
4144
|
};
|
|
4042
|
-
return new
|
|
4145
|
+
return new oo(n);
|
|
4043
4146
|
}
|
|
4044
|
-
const
|
|
4045
|
-
_t.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) =>
|
|
4147
|
+
const zt = /* @__PURE__ */ u("ZodUnion", (t, e) => {
|
|
4148
|
+
_t.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ss(t, n, r, i), t.options = e.options;
|
|
4046
4149
|
});
|
|
4047
|
-
function
|
|
4048
|
-
return new
|
|
4150
|
+
function ae(t, e) {
|
|
4151
|
+
return new zt({
|
|
4049
4152
|
type: "union",
|
|
4050
4153
|
options: t,
|
|
4051
4154
|
...l(e)
|
|
4052
4155
|
});
|
|
4053
4156
|
}
|
|
4054
|
-
const
|
|
4055
|
-
|
|
4157
|
+
const ao = /* @__PURE__ */ u("ZodDiscriminatedUnion", (t, e) => {
|
|
4158
|
+
zt.init(t, e), jr.init(t, e);
|
|
4056
4159
|
});
|
|
4057
|
-
function
|
|
4058
|
-
return new
|
|
4160
|
+
function co(t, e, n) {
|
|
4161
|
+
return new ao({
|
|
4059
4162
|
type: "union",
|
|
4060
4163
|
options: e,
|
|
4061
4164
|
discriminator: t,
|
|
4062
4165
|
...l(n)
|
|
4063
4166
|
});
|
|
4064
4167
|
}
|
|
4065
|
-
const
|
|
4066
|
-
|
|
4168
|
+
const uo = /* @__PURE__ */ u("ZodIntersection", (t, e) => {
|
|
4169
|
+
Mr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => os(t, n, r, i);
|
|
4067
4170
|
});
|
|
4068
|
-
function
|
|
4069
|
-
return new
|
|
4171
|
+
function ho(t, e) {
|
|
4172
|
+
return new uo({
|
|
4070
4173
|
type: "intersection",
|
|
4071
4174
|
left: t,
|
|
4072
4175
|
right: e
|
|
4073
4176
|
});
|
|
4074
4177
|
}
|
|
4075
|
-
const
|
|
4076
|
-
|
|
4178
|
+
const fe = /* @__PURE__ */ u("ZodEnum", (t, e) => {
|
|
4179
|
+
Ur.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Hi(t, r, i), t.enum = e.entries, t.options = Object.values(e.entries);
|
|
4077
4180
|
const n = new Set(Object.keys(e.entries));
|
|
4078
4181
|
t.extract = (r, i) => {
|
|
4079
4182
|
const s = {};
|
|
@@ -4082,7 +4185,7 @@ const le = /* @__PURE__ */ c("ZodEnum", (t, e) => {
|
|
|
4082
4185
|
s[o] = e.entries[o];
|
|
4083
4186
|
else
|
|
4084
4187
|
throw new Error(`Key ${o} not found in enum`);
|
|
4085
|
-
return new
|
|
4188
|
+
return new fe({
|
|
4086
4189
|
...e,
|
|
4087
4190
|
checks: [],
|
|
4088
4191
|
...l(i),
|
|
@@ -4095,7 +4198,7 @@ const le = /* @__PURE__ */ c("ZodEnum", (t, e) => {
|
|
|
4095
4198
|
delete s[o];
|
|
4096
4199
|
else
|
|
4097
4200
|
throw new Error(`Key ${o} not found in enum`);
|
|
4098
|
-
return new
|
|
4201
|
+
return new fe({
|
|
4099
4202
|
...e,
|
|
4100
4203
|
checks: [],
|
|
4101
4204
|
...l(i),
|
|
@@ -4103,16 +4206,16 @@ const le = /* @__PURE__ */ c("ZodEnum", (t, e) => {
|
|
|
4103
4206
|
});
|
|
4104
4207
|
};
|
|
4105
4208
|
});
|
|
4106
|
-
function
|
|
4209
|
+
function $t(t, e) {
|
|
4107
4210
|
const n = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, r])) : t;
|
|
4108
|
-
return new
|
|
4211
|
+
return new fe({
|
|
4109
4212
|
type: "enum",
|
|
4110
4213
|
entries: n,
|
|
4111
4214
|
...l(e)
|
|
4112
4215
|
});
|
|
4113
4216
|
}
|
|
4114
|
-
const
|
|
4115
|
-
|
|
4217
|
+
const po = /* @__PURE__ */ u("ZodLiteral", (t, e) => {
|
|
4218
|
+
Gr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => es(t, n, r), t.values = new Set(e.values), Object.defineProperty(t, "value", {
|
|
4116
4219
|
get() {
|
|
4117
4220
|
if (e.values.length > 1)
|
|
4118
4221
|
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
@@ -4120,58 +4223,58 @@ const uo = /* @__PURE__ */ c("ZodLiteral", (t, e) => {
|
|
|
4120
4223
|
}
|
|
4121
4224
|
});
|
|
4122
4225
|
});
|
|
4123
|
-
function
|
|
4124
|
-
return new
|
|
4226
|
+
function A(t, e) {
|
|
4227
|
+
return new po({
|
|
4125
4228
|
type: "literal",
|
|
4126
4229
|
values: Array.isArray(t) ? t : [t],
|
|
4127
4230
|
...l(e)
|
|
4128
4231
|
});
|
|
4129
4232
|
}
|
|
4130
|
-
const
|
|
4131
|
-
|
|
4233
|
+
const lo = /* @__PURE__ */ u("ZodTransform", (t, e) => {
|
|
4234
|
+
Vr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ns(t, n), t._zod.parse = (n, r) => {
|
|
4132
4235
|
if (r.direction === "backward")
|
|
4133
4236
|
throw new He(t.constructor.name);
|
|
4134
4237
|
n.addIssue = (s) => {
|
|
4135
4238
|
if (typeof s == "string")
|
|
4136
|
-
n.issues.push(
|
|
4239
|
+
n.issues.push(W(s, n.value, e));
|
|
4137
4240
|
else {
|
|
4138
4241
|
const o = s;
|
|
4139
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), n.issues.push(
|
|
4242
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), n.issues.push(W(o));
|
|
4140
4243
|
}
|
|
4141
4244
|
};
|
|
4142
4245
|
const i = e.transform(n.value, n);
|
|
4143
4246
|
return i instanceof Promise ? i.then((s) => (n.value = s, n)) : (n.value = i, n);
|
|
4144
4247
|
};
|
|
4145
4248
|
});
|
|
4146
|
-
function
|
|
4147
|
-
return new
|
|
4249
|
+
function fo(t) {
|
|
4250
|
+
return new lo({
|
|
4148
4251
|
type: "transform",
|
|
4149
4252
|
transform: t
|
|
4150
4253
|
});
|
|
4151
4254
|
}
|
|
4152
|
-
const
|
|
4153
|
-
|
|
4255
|
+
const Ot = /* @__PURE__ */ u("ZodOptional", (t, e) => {
|
|
4256
|
+
Br.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => fs(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
|
|
4154
4257
|
});
|
|
4155
4258
|
function Ge(t) {
|
|
4156
|
-
return new
|
|
4259
|
+
return new Ot({
|
|
4157
4260
|
type: "optional",
|
|
4158
4261
|
innerType: t
|
|
4159
4262
|
});
|
|
4160
4263
|
}
|
|
4161
|
-
const
|
|
4162
|
-
|
|
4264
|
+
const mo = /* @__PURE__ */ u("ZodNullable", (t, e) => {
|
|
4265
|
+
Jr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => as(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
|
|
4163
4266
|
});
|
|
4164
4267
|
function Ve(t) {
|
|
4165
|
-
return new
|
|
4268
|
+
return new mo({
|
|
4166
4269
|
type: "nullable",
|
|
4167
4270
|
innerType: t
|
|
4168
4271
|
});
|
|
4169
4272
|
}
|
|
4170
|
-
const
|
|
4171
|
-
|
|
4273
|
+
const go = /* @__PURE__ */ u("ZodDefault", (t, e) => {
|
|
4274
|
+
Wr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => us(t, n, r, i), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
|
|
4172
4275
|
});
|
|
4173
|
-
function
|
|
4174
|
-
return new
|
|
4276
|
+
function vo(t, e) {
|
|
4277
|
+
return new go({
|
|
4175
4278
|
type: "default",
|
|
4176
4279
|
innerType: t,
|
|
4177
4280
|
get defaultValue() {
|
|
@@ -4179,11 +4282,11 @@ function mo(t, e) {
|
|
|
4179
4282
|
}
|
|
4180
4283
|
});
|
|
4181
4284
|
}
|
|
4182
|
-
const
|
|
4183
|
-
|
|
4285
|
+
const _o = /* @__PURE__ */ u("ZodPrefault", (t, e) => {
|
|
4286
|
+
Kr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => hs(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
|
|
4184
4287
|
});
|
|
4185
|
-
function
|
|
4186
|
-
return new
|
|
4288
|
+
function ko(t, e) {
|
|
4289
|
+
return new _o({
|
|
4187
4290
|
type: "prefault",
|
|
4188
4291
|
innerType: t,
|
|
4189
4292
|
get defaultValue() {
|
|
@@ -4191,108 +4294,122 @@ function vo(t, e) {
|
|
|
4191
4294
|
}
|
|
4192
4295
|
});
|
|
4193
4296
|
}
|
|
4194
|
-
const
|
|
4195
|
-
|
|
4297
|
+
const Pt = /* @__PURE__ */ u("ZodNonOptional", (t, e) => {
|
|
4298
|
+
Yr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => cs(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
|
|
4196
4299
|
});
|
|
4197
|
-
function
|
|
4198
|
-
return new
|
|
4300
|
+
function yo(t, e) {
|
|
4301
|
+
return new Pt({
|
|
4199
4302
|
type: "nonoptional",
|
|
4200
4303
|
innerType: t,
|
|
4201
4304
|
...l(e)
|
|
4202
4305
|
});
|
|
4203
4306
|
}
|
|
4204
|
-
const
|
|
4205
|
-
|
|
4307
|
+
const To = /* @__PURE__ */ u("ZodCatch", (t, e) => {
|
|
4308
|
+
qr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ps(t, n, r, i), t.unwrap = () => t._zod.def.innerType, t.removeCatch = t.unwrap;
|
|
4206
4309
|
});
|
|
4207
|
-
function
|
|
4208
|
-
return new
|
|
4310
|
+
function wo(t, e) {
|
|
4311
|
+
return new To({
|
|
4209
4312
|
type: "catch",
|
|
4210
4313
|
innerType: t,
|
|
4211
4314
|
catchValue: typeof e == "function" ? e : () => e
|
|
4212
4315
|
});
|
|
4213
4316
|
}
|
|
4214
|
-
const
|
|
4215
|
-
|
|
4317
|
+
const bo = /* @__PURE__ */ u("ZodPipe", (t, e) => {
|
|
4318
|
+
Xr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ls(t, n, r, i), t.in = e.in, t.out = e.out;
|
|
4216
4319
|
});
|
|
4217
4320
|
function Be(t, e) {
|
|
4218
|
-
return new
|
|
4321
|
+
return new bo({
|
|
4219
4322
|
type: "pipe",
|
|
4220
4323
|
in: t,
|
|
4221
4324
|
out: e
|
|
4222
4325
|
// ...util.normalizeParams(params),
|
|
4223
4326
|
});
|
|
4224
4327
|
}
|
|
4225
|
-
const
|
|
4226
|
-
|
|
4328
|
+
const Eo = /* @__PURE__ */ u("ZodReadonly", (t, e) => {
|
|
4329
|
+
Qr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ds(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
|
|
4227
4330
|
});
|
|
4228
|
-
function
|
|
4229
|
-
return new
|
|
4331
|
+
function Io(t) {
|
|
4332
|
+
return new Eo({
|
|
4230
4333
|
type: "readonly",
|
|
4231
4334
|
innerType: t
|
|
4232
4335
|
});
|
|
4233
4336
|
}
|
|
4234
|
-
const
|
|
4235
|
-
|
|
4337
|
+
const zo = /* @__PURE__ */ u("ZodCustom", (t, e) => {
|
|
4338
|
+
Hr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ts(t, n);
|
|
4236
4339
|
});
|
|
4237
|
-
function
|
|
4238
|
-
return
|
|
4340
|
+
function $o(t, e = {}) {
|
|
4341
|
+
return Vi(zo, t, e);
|
|
4239
4342
|
}
|
|
4240
|
-
function
|
|
4241
|
-
return
|
|
4343
|
+
function Oo(t) {
|
|
4344
|
+
return Bi(t);
|
|
4242
4345
|
}
|
|
4243
|
-
const
|
|
4346
|
+
const S = ae([
|
|
4244
4347
|
$(),
|
|
4245
|
-
|
|
4348
|
+
z({
|
|
4246
4349
|
pattern: $(),
|
|
4247
4350
|
flags: $().optional()
|
|
4248
4351
|
})
|
|
4249
|
-
]),
|
|
4250
|
-
kind:
|
|
4251
|
-
condition:
|
|
4252
|
-
operator:
|
|
4352
|
+
]), Po = z({
|
|
4353
|
+
kind: A("fragment"),
|
|
4354
|
+
condition: S.optional(),
|
|
4355
|
+
operator: ae([$(), Z($())]).optional()
|
|
4253
4356
|
// Note: Operator types might need to be refined if we want strict enum validation,
|
|
4254
4357
|
// but string is flexible for now.
|
|
4255
|
-
}),
|
|
4256
|
-
kind:
|
|
4257
|
-
name:
|
|
4258
|
-
id:
|
|
4259
|
-
stereotype:
|
|
4260
|
-
}), So =
|
|
4261
|
-
kind:
|
|
4262
|
-
text:
|
|
4263
|
-
from:
|
|
4264
|
-
to:
|
|
4265
|
-
}), No =
|
|
4266
|
-
kind:
|
|
4267
|
-
name:
|
|
4268
|
-
}),
|
|
4269
|
-
|
|
4270
|
-
Oo,
|
|
4271
|
-
So,
|
|
4272
|
-
No
|
|
4273
|
-
]), Ao = Te(["focus", "remove", "resolve"]), Zo = S({
|
|
4274
|
-
action: Ao,
|
|
4358
|
+
}), Te = z({
|
|
4359
|
+
kind: A("participant"),
|
|
4360
|
+
name: S.optional(),
|
|
4361
|
+
id: S.optional(),
|
|
4362
|
+
stereotype: S.optional()
|
|
4363
|
+
}), So = z({
|
|
4364
|
+
kind: A("message"),
|
|
4365
|
+
text: S.optional(),
|
|
4366
|
+
from: S.optional(),
|
|
4367
|
+
to: S.optional()
|
|
4368
|
+
}), No = z({
|
|
4369
|
+
kind: A("group"),
|
|
4370
|
+
name: S.optional()
|
|
4371
|
+
}), Ao = z({
|
|
4372
|
+
action: A("resolve"),
|
|
4275
4373
|
selector: Po
|
|
4276
|
-
}),
|
|
4374
|
+
}), Zo = z({
|
|
4375
|
+
action: A("focus"),
|
|
4376
|
+
selector: Te
|
|
4377
|
+
}), Co = z({
|
|
4378
|
+
action: A("remove"),
|
|
4379
|
+
selector: ae([
|
|
4380
|
+
Te,
|
|
4381
|
+
So,
|
|
4382
|
+
No
|
|
4383
|
+
])
|
|
4384
|
+
}), Ro = z({
|
|
4385
|
+
action: A("merge"),
|
|
4386
|
+
newName: $(),
|
|
4387
|
+
selector: Te
|
|
4388
|
+
}), Lo = co("action", [
|
|
4389
|
+
Ao,
|
|
4390
|
+
Zo,
|
|
4391
|
+
Co,
|
|
4392
|
+
Ro
|
|
4393
|
+
]), xo = z({
|
|
4277
4394
|
name: $(),
|
|
4278
4395
|
suffix: $().optional(),
|
|
4279
4396
|
// Defaults to .name in logic
|
|
4280
|
-
layers:
|
|
4281
|
-
}), Je =
|
|
4282
|
-
input:
|
|
4397
|
+
layers: Z(Lo)
|
|
4398
|
+
}), Je = $t(["mermaid", "plantuml"]), Do = z({
|
|
4399
|
+
input: Z($()),
|
|
4283
4400
|
outputDir: $(),
|
|
4284
|
-
ignore:
|
|
4285
|
-
lenses:
|
|
4401
|
+
ignore: Z($()).optional(),
|
|
4402
|
+
lenses: Z(xo),
|
|
4286
4403
|
format: Je.optional(),
|
|
4287
4404
|
// Input format (auto-detected if omitted)
|
|
4288
4405
|
outputFormat: Je.optional()
|
|
4289
4406
|
// Output format (same as input if omitted)
|
|
4290
|
-
}),
|
|
4291
|
-
version:
|
|
4292
|
-
targets:
|
|
4407
|
+
}), Fo = z({
|
|
4408
|
+
version: eo(),
|
|
4409
|
+
targets: Z(Do)
|
|
4293
4410
|
});
|
|
4294
|
-
function
|
|
4295
|
-
const e =
|
|
4411
|
+
function Vo(t) {
|
|
4412
|
+
const e = Fo.safeParse(t);
|
|
4296
4413
|
if (!e.success) {
|
|
4297
4414
|
const n = e.error.issues.map((r) => `[${r.path.join(".")}]: ${r.message}`).join(`
|
|
4298
4415
|
`);
|
|
@@ -4303,15 +4420,15 @@ ${n}`);
|
|
|
4303
4420
|
}
|
|
4304
4421
|
export {
|
|
4305
4422
|
be as FormatDetector,
|
|
4306
|
-
|
|
4423
|
+
Go as GeneratorFactory,
|
|
4307
4424
|
Ye as MermaidGeneratorVisitor,
|
|
4308
4425
|
Ut as ParserFactory,
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4426
|
+
qe as PlantUMLGeneratorVisitor,
|
|
4427
|
+
Uo as Polagram,
|
|
4428
|
+
Xt as PolagramBuilder,
|
|
4429
|
+
Fo as PolagramConfigSchema,
|
|
4430
|
+
ue as TransformationEngine,
|
|
4314
4431
|
Ke as Traverser,
|
|
4315
|
-
|
|
4316
|
-
|
|
4432
|
+
qt as transformerRegistry,
|
|
4433
|
+
Vo as validateConfig
|
|
4317
4434
|
};
|