@polagram/core 0.3.0 → 0.4.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.
@@ -8,15 +8,15 @@ const We = {
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
- (t, [e, n]) => {
12
- const r = JSON.stringify({ type: n.type, style: n.style });
13
- return t[r] = e, t;
11
+ (t, [e, r]) => {
12
+ const n = JSON.stringify({ type: r.type, style: r.style });
13
+ return t[n] = e, t;
14
14
  },
15
15
  {}
16
16
  );
17
17
  function Zt(t, e) {
18
- const n = JSON.stringify({ type: t, style: e });
19
- return At[n] || "->>";
18
+ const r = JSON.stringify({ type: t, style: e });
19
+ return At[r] || "->>";
20
20
  }
21
21
  class Ke {
22
22
  constructor(e) {
@@ -58,8 +58,8 @@ class Ke {
58
58
  * Helper to iterate over a list of events.
59
59
  */
60
60
  dispatchEvents(e) {
61
- for (const n of e)
62
- this.dispatchEvent(n);
61
+ for (const r of e)
62
+ this.dispatchEvent(r);
63
63
  }
64
64
  }
65
65
  class Ye {
@@ -77,48 +77,48 @@ class Ye {
77
77
  }
78
78
  visitRoot(e) {
79
79
  this.lines.push("sequenceDiagram"), this.indentLevel++, e.meta?.title && this.add(`title ${e.meta.title}`);
80
- const n = /* @__PURE__ */ new Map();
80
+ const r = /* @__PURE__ */ new Map();
81
81
  for (const i of e.participants)
82
- n.set(i.id, []);
82
+ r.set(i.id, []);
83
83
  for (const i of e.groups)
84
84
  for (const s of i.participantIds) {
85
- const o = n.get(s);
85
+ const o = r.get(s);
86
86
  o && o.push(i);
87
87
  }
88
- const r = [];
88
+ const n = [];
89
89
  for (const i of e.participants) {
90
- const s = n.get(i.id) || [];
90
+ const s = r.get(i.id) || [];
91
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++)
92
+ const a = Math.min(n.length, s.length);
93
+ for (let c = 0; c < a && n[c] === s[c]; c++)
94
94
  o++;
95
- for (; r.length > o; )
96
- this.indentLevel--, this.add("end"), r.pop();
95
+ for (; n.length > o; )
96
+ this.indentLevel--, this.add("end"), n.pop();
97
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);
98
+ const p = s[c];
99
+ let h = "box";
100
+ p.style?.backgroundColor && (h += ` ${p.style.backgroundColor}`), p.name && (h += ` ${p.name}`), this.add(h), this.indentLevel++, n.push(p);
101
101
  }
102
102
  this.visitParticipant(i);
103
103
  }
104
- for (; r.length > 0; )
105
- this.indentLevel--, this.add("end"), r.pop();
104
+ for (; n.length > 0; )
105
+ this.indentLevel--, this.add("end"), n.pop();
106
106
  this.traverser.dispatchEvents(e.events);
107
107
  }
108
108
  visitParticipant(e) {
109
- const n = e.type === "actor" ? "actor" : "participant", r = e.name;
110
- e.id === e.name ? this.add(`${n} ${e.id}`) : this.add(`${n} ${e.id} as ${r}`);
109
+ const r = e.type === "actor" ? "actor" : "participant", n = e.name;
110
+ e.id === e.name ? this.add(`${r} ${e.id}`) : this.add(`${r} ${e.id} as ${n}`);
111
111
  }
112
112
  visitMessage(e) {
113
- const n = e.from ?? "[*]", r = e.to ?? "[*]", i = Zt(e.type, e.style);
113
+ const r = e.from ?? "[*]", n = e.to ?? "[*]", i = Zt(e.type, e.style);
114
114
  let s = "";
115
- e.lifecycle?.activateTarget && (s += "+"), e.lifecycle?.deactivateSource && (s += "-"), this.add(`${n}${i}${s}${r}: ${e.text}`);
115
+ e.lifecycle?.activateTarget && (s += "+"), e.lifecycle?.deactivateSource && (s += "-"), this.add(`${r}${i}${s}${n}: ${e.text}`);
116
116
  }
117
117
  visitFragment(e) {
118
118
  if (e.branches.length === 0) return;
119
- const n = e.branches[0], r = n.condition ? ` ${n.condition}` : "";
120
- this.add(`${e.operator}${r}`), this.indent(() => {
121
- this.traverser.dispatchEvents(n.events);
119
+ const r = e.branches[0], n = r.condition ? ` ${r.condition}` : "";
120
+ this.add(`${e.operator}${n}`), this.indent(() => {
121
+ this.traverser.dispatchEvents(r.events);
122
122
  });
123
123
  let i = "else";
124
124
  e.operator === "par" ? i = "and" : e.operator === "critical" && (i = "option");
@@ -131,9 +131,9 @@ class Ye {
131
131
  this.add("end");
132
132
  }
133
133
  visitNote(e) {
134
- const n = e.position;
135
- let r = "";
136
- e.participantIds.length > 0 && (r = e.participantIds.join(","), n !== "over" ? r = ` of ${r}` : r = ` ${r}`), this.add(`note ${n}${r}: ${e.text}`);
134
+ const r = e.position;
135
+ let n = "";
136
+ e.participantIds.length > 0 && (n = e.participantIds.join(","), r !== "over" ? n = ` of ${n}` : n = ` ${n}`), this.add(`note ${r}${n}: ${e.text}`);
137
137
  }
138
138
  visitActivation(e) {
139
139
  this.add(`${e.action} ${e.participantId}`);
@@ -149,8 +149,8 @@ class Ye {
149
149
  }
150
150
  // --- Helpers ---
151
151
  add(e) {
152
- const n = " ".repeat(this.indentLevel);
153
- this.lines.push(`${n}${e}`);
152
+ const r = " ".repeat(this.indentLevel);
153
+ this.lines.push(`${r}${e}`);
154
154
  }
155
155
  indent(e) {
156
156
  this.indentLevel++, e(), this.indentLevel--;
@@ -168,31 +168,31 @@ class qe {
168
168
  }
169
169
  visitRoot(e) {
170
170
  this.add("@startuml"), e.meta.title && this.add(`title ${e.meta.title}`);
171
- const n = /* @__PURE__ */ new Map();
171
+ const r = /* @__PURE__ */ new Map();
172
172
  for (const i of e.participants)
173
- n.set(i.id, []);
173
+ r.set(i.id, []);
174
174
  for (const i of e.groups)
175
175
  for (const s of i.participantIds) {
176
- const o = n.get(s);
176
+ const o = r.get(s);
177
177
  o && o.push(i);
178
178
  }
179
- const r = [];
179
+ const n = [];
180
180
  for (const i of e.participants) {
181
- const s = n.get(i.id) || [];
181
+ const s = r.get(i.id) || [];
182
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++)
183
+ const a = Math.min(n.length, s.length);
184
+ for (let c = 0; c < a && n[c] === s[c]; c++)
185
185
  o++;
186
- for (; r.length > o; )
187
- this.add("end box"), r.pop();
186
+ for (; n.length > o; )
187
+ this.add("end box"), n.pop();
188
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);
189
+ const p = s[c], h = p.style?.backgroundColor ? ` ${p.style.backgroundColor}` : "", d = p.name ? ` "${p.name}"` : "";
190
+ this.add(`box${d}${h}`), n.push(p);
191
191
  }
192
192
  this.visitParticipant(i);
193
193
  }
194
- for (; r.length > 0; )
195
- this.add("end box"), r.pop();
194
+ for (; n.length > 0; )
195
+ this.add("end box"), n.pop();
196
196
  this.traverser.dispatchEvents(e.events), this.add("@enduml");
197
197
  }
198
198
  visitParticipant(e) {
@@ -201,20 +201,20 @@ class qe {
201
201
  visitParticipantGroup(e) {
202
202
  }
203
203
  visitMessage(e) {
204
- const n = e.from || "[*]", r = e.to || "[*]";
204
+ const r = e.from || "[*]", n = e.to || "[*]";
205
205
  let i = "->";
206
- e.type === "reply" ? i = "-->" : e.type === "async" && (i = "->>"), this.add(`${n} ${i} ${r}: ${e.text}`);
206
+ e.type === "reply" ? i = "-->" : e.type === "async" && (i = "->>"), this.add(`${r} ${i} ${n}: ${e.text}`);
207
207
  }
208
208
  visitFragment(e) {
209
- const n = e.operator;
210
- e.branches.forEach((r, i) => {
211
- i === 0 ? this.add(`${n} ${r.condition || ""}`.trim()) : this.add(`else ${r.condition || ""}`.trim()), this.traverser.dispatchEvents(r.events);
209
+ const r = e.operator;
210
+ e.branches.forEach((n, i) => {
211
+ i === 0 ? this.add(`${r} ${n.condition || ""}`.trim()) : this.add(`else ${n.condition || ""}`.trim()), this.traverser.dispatchEvents(n.events);
212
212
  }), this.add("end");
213
213
  }
214
214
  visitNote(e) {
215
- const n = e.position || "over", r = e.participantIds.join(", ");
215
+ const r = e.position || "over", n = e.participantIds.join(", ");
216
216
  let i = "";
217
- e.participantIds.length > 0 ? n === "over" ? i = `note over ${r}` : i = `note ${n} of ${r}` : i = `note ${n}`, this.add(i), e.text.split(`
217
+ e.participantIds.length > 0 ? r === "over" ? i = `note over ${n}` : i = `note ${r} of ${n}` : i = `note ${r}`, this.add(i), e.text.split(`
218
218
  `).forEach((s) => {
219
219
  this.add(` ${s}`);
220
220
  }), this.add("end note");
@@ -229,8 +229,8 @@ class qe {
229
229
  this.add("|||");
230
230
  }
231
231
  visitReference(e) {
232
- const n = e.participantIds.join(", ");
233
- this.add(`ref over ${n}: ${e.text}`);
232
+ const r = e.participantIds.join(", ");
233
+ this.add(`ref over ${r}: ${e.text}`);
234
234
  }
235
235
  // --- Helpers ---
236
236
  add(e) {
@@ -261,10 +261,10 @@ class Xe {
261
261
  this.readChar();
262
262
  }
263
263
  readWhile(e) {
264
- const n = this.position;
264
+ const r = this.position;
265
265
  for (; e(this.ch); )
266
266
  this.readChar();
267
- return this.input.slice(n, this.position);
267
+ return this.input.slice(r, this.position);
268
268
  }
269
269
  isLetter(e) {
270
270
  return "a" <= e && e <= "z" || "A" <= e && e <= "Z" || e === "_" ? !0 : e.charCodeAt(0) > 127 ? !/[\s\d]/.test(e) : !1;
@@ -290,20 +290,20 @@ class Xe {
290
290
  for (this.readChar(); this.ch !== '"' && this.ch !== "" && this.ch !== `
291
291
  `; )
292
292
  this.readChar();
293
- const n = this.input.slice(e, this.position);
294
- return this.readChar(), n;
293
+ const r = this.input.slice(e, this.position);
294
+ return this.readChar(), r;
295
295
  }
296
296
  /**
297
297
  * Create a token with position information.
298
298
  */
299
- createToken(e, n, r, i) {
299
+ createToken(e, r, n, i) {
300
300
  return {
301
301
  type: e,
302
- literal: n,
302
+ literal: r,
303
303
  line: this.line,
304
304
  column: i,
305
- start: r,
306
- end: this.position > r ? this.position : r + n.length
305
+ start: n,
306
+ end: this.position > n ? this.position : n + r.length
307
307
  };
308
308
  }
309
309
  }
@@ -311,58 +311,58 @@ let Ct = class extends Xe {
311
311
  nextToken() {
312
312
  if (this.skipWhitespace(), this.ch === "%" && this.peekChar() === "%")
313
313
  return this.skipComment(), this.nextToken();
314
- const e = this.position, n = this.column;
315
- let r;
314
+ const e = this.position, r = this.column;
315
+ let n;
316
316
  switch (this.ch) {
317
317
  case ":":
318
- r = this.newToken("COLON", this.ch, e, n);
318
+ n = this.newToken("COLON", this.ch, e, r);
319
319
  break;
320
320
  case ",":
321
- r = this.newToken("COMMA", this.ch, e, n);
321
+ n = this.newToken("COMMA", this.ch, e, r);
322
322
  break;
323
323
  case "+":
324
- r = this.newToken("PLUS", this.ch, e, n);
324
+ n = this.newToken("PLUS", this.ch, e, r);
325
325
  break;
326
326
  case "-":
327
327
  if (this.isArrowStart()) {
328
328
  const i = this.readArrow();
329
- return r = this.newToken("ARROW", i, e, n), r;
329
+ return n = this.newToken("ARROW", i, e, r), n;
330
330
  } else
331
- r = this.newToken("MINUS", this.ch, e, n);
331
+ n = this.newToken("MINUS", this.ch, e, r);
332
332
  break;
333
333
  case '"': {
334
334
  const i = this.readString();
335
- return r = this.newToken("STRING", i, e, n), r;
335
+ return n = this.newToken("STRING", i, e, r), n;
336
336
  }
337
337
  case `
338
338
  `:
339
- r = this.newToken("NEWLINE", this.ch, e, n);
339
+ n = this.newToken("NEWLINE", this.ch, e, r);
340
340
  break;
341
341
  case "":
342
- r = this.newToken("EOF", "", e, n);
342
+ n = this.newToken("EOF", "", e, r);
343
343
  break;
344
344
  default:
345
345
  if (this.isLetter(this.ch)) {
346
346
  const i = this.readIdentifier(), s = this.lookupIdent(i);
347
- return this.newToken(s, i, e, n);
347
+ return this.newToken(s, i, e, r);
348
348
  } else if (this.isDigit(this.ch)) {
349
349
  const i = this.readNumber();
350
- return this.newToken("IDENTIFIER", i, e, n);
350
+ return this.newToken("IDENTIFIER", i, e, r);
351
351
  } else
352
- r = this.newToken("UNKNOWN", this.ch, e, n);
352
+ n = this.newToken("UNKNOWN", this.ch, e, r);
353
353
  }
354
- return this.readChar(), r;
354
+ return this.readChar(), n;
355
355
  }
356
- newToken(e, n, r, i) {
356
+ newToken(e, r, n, i) {
357
357
  return {
358
358
  type: e,
359
- literal: n,
359
+ literal: r,
360
360
  line: this.line,
361
361
  column: i,
362
- start: r,
362
+ start: n,
363
363
  // If the lexer position has advanced beyond the start (consumed tokens like String/Arrow), use that position.
364
364
  // Otherwise (simple chars), assume length-based calculation.
365
- end: this.position > r ? this.position : r + n.length
365
+ end: this.position > n ? this.position : n + r.length
366
366
  };
367
367
  }
368
368
  readNumber() {
@@ -376,8 +376,8 @@ let Ct = class extends Xe {
376
376
  for (this.readChar(); this.ch !== '"' && this.ch !== "" && this.ch !== `
377
377
  `; )
378
378
  this.readChar();
379
- const n = this.input.slice(e, this.position);
380
- return this.ch, this.readChar(), n;
379
+ const r = this.input.slice(e, this.position);
380
+ return this.ch, this.readChar(), r;
381
381
  }
382
382
  isArrowStart() {
383
383
  if (this.ch !== "-") return !1;
@@ -387,14 +387,14 @@ let Ct = class extends Xe {
387
387
  readArrow() {
388
388
  if (this.input.slice(this.position, this.position + 4) === "-->>")
389
389
  return this.readMulti(4), "-->>";
390
- const n = this.input.slice(this.position, this.position + 3);
391
- if (n === "-->" || n === "--)" || n === "->>" || n === "--x")
392
- return this.readMulti(3), n;
393
- const r = this.input.slice(this.position, this.position + 2);
394
- return r === "->" || r === "-)" || r === "-x" ? (this.readMulti(2), r) : "-";
390
+ const r = this.input.slice(this.position, this.position + 3);
391
+ if (r === "-->" || r === "--)" || r === "->>" || r === "--x")
392
+ return this.readMulti(3), r;
393
+ const n = this.input.slice(this.position, this.position + 2);
394
+ return n === "->" || n === "-)" || n === "-x" ? (this.readMulti(2), n) : "-";
395
395
  }
396
396
  readMulti(e) {
397
- for (let n = 0; n < e; n++) this.readChar();
397
+ for (let r = 0; r < e; r++) this.readChar();
398
398
  }
399
399
  skipComment() {
400
400
  for (; this.ch !== `
@@ -487,12 +487,12 @@ let Rt = class extends Qe {
487
487
  };
488
488
  return e.events = this.parseBlock(e), e;
489
489
  }
490
- parseBlock(e, n = []) {
491
- const r = [];
490
+ parseBlock(e, r = []) {
491
+ const n = [];
492
492
  for (; !this.isCurrentToken("EOF"); ) {
493
493
  const i = this.getCurrentTokenType();
494
- if (n.includes(i))
495
- return r;
494
+ if (r.includes(i))
495
+ return n;
496
496
  if (i === "NEWLINE") {
497
497
  this.advance();
498
498
  continue;
@@ -507,7 +507,7 @@ let Rt = class extends Qe {
507
507
  }
508
508
  if (i === "BOX") {
509
509
  const s = this.parseGroup(e);
510
- r.push(...s);
510
+ n.push(...s);
511
511
  continue;
512
512
  }
513
513
  if (i === "PARTICIPANT" || i === "ACTOR") {
@@ -515,39 +515,39 @@ let Rt = class extends Qe {
515
515
  continue;
516
516
  }
517
517
  if (i === "LOOP" || i === "ALT" || i === "OPT" || i === "PAR" || i === "BREAK" || i === "CRITICAL" || i === "RECT") {
518
- r.push(this.parseFragment(e));
518
+ n.push(this.parseFragment(e));
519
519
  continue;
520
520
  }
521
521
  if (i === "NOTE") {
522
- r.push(this.parseNote(e));
522
+ n.push(this.parseNote(e));
523
523
  continue;
524
524
  }
525
525
  if (i === "ACTIVATE" || i === "DEACTIVATE") {
526
- r.push(this.parseActivation(e));
526
+ n.push(this.parseActivation(e));
527
527
  continue;
528
528
  }
529
529
  if (this.isParticipantToken(this.currToken)) {
530
530
  const s = this.parseMessage(e);
531
531
  if (s) {
532
- r.push(s);
532
+ n.push(s);
533
533
  continue;
534
534
  }
535
535
  }
536
536
  this.advance();
537
537
  }
538
- return r;
538
+ return n;
539
539
  }
540
540
  isParticipantToken(e) {
541
541
  return e.type === "IDENTIFIER" || e.type === "STRING";
542
542
  }
543
543
  parseGroup(e) {
544
544
  this.advance();
545
- const n = this.readRestOfLine().trim();
546
- let r = n, i;
547
- const s = n.split(/\s+/);
545
+ const r = this.readRestOfLine().trim();
546
+ let n = r, i;
547
+ const s = r.split(/\s+/);
548
548
  if (s.length > 0) {
549
- const h = s[0];
550
- (h.startsWith("#") || [
549
+ const p = s[0];
550
+ (p.startsWith("#") || [
551
551
  "rgb",
552
552
  "rgba",
553
553
  "transparent",
@@ -558,13 +558,13 @@ let Rt = class extends Qe {
558
558
  "red",
559
559
  "blue",
560
560
  "green"
561
- ].includes(h.toLowerCase())) && (i = h, r = s.slice(1).join(" "));
561
+ ].includes(p.toLowerCase())) && (i = p, n = s.slice(1).join(" "));
562
562
  }
563
- r || (r = `Group ${this.idCounters.group + 1}`);
563
+ n || (n = `Group ${this.idCounters.group + 1}`);
564
564
  const o = {
565
565
  kind: "group",
566
566
  id: this.generateId("group"),
567
- name: r,
567
+ name: n,
568
568
  type: "box",
569
569
  participantIds: [],
570
570
  style: i ? { backgroundColor: i } : void 0
@@ -576,12 +576,12 @@ let Rt = class extends Qe {
576
576
  return this.currentGroup = a, this.isCurrentToken("END") && this.advance(), c;
577
577
  }
578
578
  parseFragment(e) {
579
- const n = this.getCurrentTokenType();
580
- let r = "loop";
581
- n === "ALT" && (r = "alt"), n === "OPT" && (r = "opt"), n === "PAR" && (r = "par"), n === "BREAK" && (r = "break"), n === "CRITICAL" && (r = "critical"), n === "RECT" && (r = "rect"), this.advance();
579
+ const r = this.getCurrentTokenType();
580
+ let n = "loop";
581
+ r === "ALT" && (n = "alt"), r === "OPT" && (n = "opt"), r === "PAR" && (n = "par"), r === "BREAK" && (n = "break"), r === "CRITICAL" && (n = "critical"), r === "RECT" && (n = "rect"), this.advance();
582
582
  const i = this.readRestOfLine(), s = [];
583
583
  let o;
584
- r === "par" ? o = ["END", "ELSE", "AND"] : r === "critical" ? o = ["END", "OPTION"] : o = ["END", "ELSE"];
584
+ n === "par" ? o = ["END", "ELSE", "AND"] : n === "critical" ? o = ["END", "OPTION"] : o = ["END", "ELSE"];
585
585
  const a = this.parseBlock(e, o);
586
586
  for (s.push({
587
587
  id: this.generateId("br"),
@@ -589,87 +589,87 @@ let Rt = class extends Qe {
589
589
  events: a
590
590
  }); this.isCurrentToken("AND"); ) {
591
591
  this.advance();
592
- const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "AND"]);
592
+ const c = this.readRestOfLine(), p = this.parseBlock(e, ["END", "AND"]);
593
593
  s.push({
594
594
  id: this.generateId("br"),
595
595
  condition: c,
596
- events: h
596
+ events: p
597
597
  });
598
598
  }
599
599
  for (; this.isCurrentToken("OPTION"); ) {
600
600
  this.advance();
601
- const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "OPTION"]);
601
+ const c = this.readRestOfLine(), p = this.parseBlock(e, ["END", "OPTION"]);
602
602
  s.push({
603
603
  id: this.generateId("br"),
604
604
  condition: c,
605
- events: h
605
+ events: p
606
606
  });
607
607
  }
608
608
  for (; this.isCurrentToken("ELSE"); ) {
609
609
  this.advance();
610
- const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "ELSE"]);
610
+ const c = this.readRestOfLine(), p = this.parseBlock(e, ["END", "ELSE"]);
611
611
  s.push({
612
612
  id: this.generateId("br"),
613
613
  condition: c,
614
- events: h
614
+ events: p
615
615
  });
616
616
  }
617
617
  return this.isCurrentToken("END") && this.advance(), {
618
618
  kind: "fragment",
619
619
  id: this.generateId("frag"),
620
- operator: r,
620
+ operator: n,
621
621
  branches: s
622
622
  };
623
623
  }
624
624
  parseParticipant(e) {
625
- const n = this.currToken.type === "ACTOR";
625
+ const r = this.currToken.type === "ACTOR";
626
626
  this.advance();
627
- let r = "", i = "";
628
- if (this.isParticipantToken(this.currToken) && (r = this.currToken.literal, i = r, this.advance()), this.currToken.type === "AS") {
627
+ let n = "", i = "";
628
+ if (this.isParticipantToken(this.currToken) && (n = this.currToken.literal, i = n, this.advance()), this.currToken.type === "AS") {
629
629
  this.advance();
630
630
  const o = this.readRestOfLine().trim();
631
631
  o && (i = o);
632
632
  }
633
- const s = e.participants.find((o) => o.id === r);
634
- s ? (i !== r && (s.name = i), n && (s.type = "actor")) : e.participants.push({
635
- id: r,
633
+ const s = e.participants.find((o) => o.id === n);
634
+ s ? (i !== n && (s.name = i), r && (s.type = "actor")) : e.participants.push({
635
+ id: n,
636
636
  name: i,
637
- type: n ? "actor" : "participant"
638
- }), this.currentGroup && (this.currentGroup.participantIds.includes(r) || this.currentGroup.participantIds.push(r));
637
+ type: r ? "actor" : "participant"
638
+ }), this.currentGroup && (this.currentGroup.participantIds.includes(n) || this.currentGroup.participantIds.push(n));
639
639
  }
640
640
  parseNote(e) {
641
641
  this.advance();
642
- let n = "over";
643
- this.currToken.type === "LEFT" ? (n = "left", this.advance()) : this.currToken.type === "RIGHT" ? (n = "right", this.advance()) : this.currToken.type === "OVER" && (n = "over", this.advance()), this.currToken.type === "OF" && this.advance();
644
- const r = [];
645
- for (; this.isParticipantToken(this.currToken) && (r.push(this.currToken.literal), this.ensureParticipant(e, this.currToken.literal), this.advance(), this.currToken.type === "COMMA"); )
642
+ let r = "over";
643
+ this.currToken.type === "LEFT" ? (r = "left", this.advance()) : this.currToken.type === "RIGHT" ? (r = "right", this.advance()) : this.currToken.type === "OVER" && (r = "over", this.advance()), this.currToken.type === "OF" && this.advance();
644
+ const n = [];
645
+ for (; this.isParticipantToken(this.currToken) && (n.push(this.currToken.literal), this.ensureParticipant(e, this.currToken.literal), this.advance(), this.currToken.type === "COMMA"); )
646
646
  this.advance();
647
647
  let i = "";
648
648
  return this.currToken.type === "COLON" && (this.advance(), i = this.readRestOfLine()), {
649
649
  kind: "note",
650
650
  id: this.generateId("note"),
651
- position: n,
652
- participantIds: r,
651
+ position: r,
652
+ participantIds: n,
653
653
  text: i
654
654
  };
655
655
  }
656
656
  parseActivation(e) {
657
- const n = this.currToken.type === "ACTIVATE" ? "activate" : "deactivate";
657
+ const r = this.currToken.type === "ACTIVATE" ? "activate" : "deactivate";
658
658
  this.advance();
659
- let r = "";
660
- return this.isParticipantToken(this.currToken) && (r = this.currToken.literal, this.ensureParticipant(e, r), this.advance()), {
659
+ let n = "";
660
+ return this.isParticipantToken(this.currToken) && (n = this.currToken.literal, this.ensureParticipant(e, n), this.advance()), {
661
661
  kind: "activation",
662
- participantId: r,
663
- action: n
662
+ participantId: n,
663
+ action: r
664
664
  };
665
665
  }
666
666
  parseMessage(e) {
667
667
  if (this.peekToken.type !== "ARROW")
668
668
  return null;
669
- const n = this.currToken.literal;
670
- if (this.ensureParticipant(e, n), this.advance(), this.currToken.type !== "ARROW")
671
- return null;
672
669
  const r = this.currToken.literal;
670
+ if (this.ensureParticipant(e, r), this.advance(), this.currToken.type !== "ARROW")
671
+ return null;
672
+ const n = this.currToken.literal;
673
673
  this.advance();
674
674
  let i = !1, s = !1;
675
675
  if (this.isCurrentToken("PLUS") && (i = !0, this.advance()), this.isCurrentToken("MINUS") && (s = !0, this.advance()), !this.isParticipantToken(this.currToken)) return null;
@@ -677,21 +677,21 @@ let Rt = class extends Qe {
677
677
  this.ensureParticipant(e, o), this.advance();
678
678
  let a = "";
679
679
  this.isCurrentToken("COLON") && (this.advance(), a = this.readRestOfLine());
680
- const { type: c, style: h } = this.resolveArrow(r);
680
+ const { type: c, style: p } = this.resolveArrow(n);
681
681
  return {
682
682
  kind: "message",
683
683
  id: this.generateId("evt"),
684
- from: n,
684
+ from: r,
685
685
  to: o,
686
686
  text: a,
687
687
  type: c,
688
- style: h,
688
+ style: p,
689
689
  lifecycle: i || s ? { activateTarget: i, deactivateSource: s } : void 0
690
690
  };
691
691
  }
692
692
  resolveArrow(e) {
693
- const n = We[e];
694
- return n || { type: "sync", style: { line: "solid", head: "arrow" } };
693
+ const r = We[e];
694
+ return r || { type: "sync", style: { line: "solid", head: "arrow" } };
695
695
  }
696
696
  generateId(e) {
697
697
  return this.idCounters[e]++, `${e}_${this.idCounters[e]}`;
@@ -700,76 +700,76 @@ let Rt = class extends Qe {
700
700
  if (this.isCurrentToken("NEWLINE") || this.isCurrentToken("EOF"))
701
701
  return "";
702
702
  const e = this.currToken.start;
703
- let n = this.currToken.end;
703
+ let r = this.currToken.end;
704
704
  for (; !this.isCurrentToken("NEWLINE") && !this.isCurrentToken("EOF"); )
705
- n = this.currToken.end, this.advance();
706
- return this.lexer.getInput().slice(e, n);
705
+ r = this.currToken.end, this.advance();
706
+ return this.lexer.getInput().slice(e, r);
707
707
  }
708
- ensureParticipant(e, n) {
709
- e.participants.find((r) => r.id === n) || e.participants.push({
710
- id: n,
711
- name: n,
708
+ ensureParticipant(e, r) {
709
+ e.participants.find((n) => n.id === r) || e.participants.push({
710
+ id: r,
711
+ name: r,
712
712
  type: "participant"
713
713
  });
714
714
  }
715
715
  };
716
- const Lt = {
716
+ const xt = {
717
717
  parse: (t) => {
718
718
  const e = new Ct(t);
719
719
  return new Rt(e).parse();
720
720
  }
721
721
  };
722
- class xt extends Xe {
722
+ class Lt extends Xe {
723
723
  nextToken() {
724
724
  this.skipWhitespace();
725
- const e = this.position, n = this.column;
726
- let r;
725
+ const e = this.position, r = this.column;
726
+ let n;
727
727
  switch (this.ch) {
728
728
  case `
729
729
  `:
730
- r = this.newToken("NEWLINE", this.ch, e, n);
730
+ n = this.newToken("NEWLINE", this.ch, e, r);
731
731
  break;
732
732
  case "@":
733
- this.peekString("startuml") ? (this.readMulti(9), r = this.newToken("START_UML", "@startuml", e, n)) : this.peekString("enduml") ? (this.readMulti(7), r = this.newToken("END_UML", "@enduml", e, n)) : r = this.newToken("UNKNOWN", this.ch, e, n);
733
+ this.peekString("startuml") ? (this.readMulti(9), n = this.newToken("START_UML", "@startuml", e, r)) : this.peekString("enduml") ? (this.readMulti(7), n = this.newToken("END_UML", "@enduml", e, r)) : n = this.newToken("UNKNOWN", this.ch, e, r);
734
734
  break;
735
735
  case ",":
736
- r = this.newToken("COMMA", ",", e, n);
736
+ n = this.newToken("COMMA", ",", e, r);
737
737
  break;
738
738
  case '"': {
739
739
  const i = this.readString();
740
- return this.newToken("STRING", i, e, n);
740
+ return this.newToken("STRING", i, e, r);
741
741
  }
742
742
  case ":":
743
- r = this.newToken("COLON", ":", e, n);
743
+ n = this.newToken("COLON", ":", e, r);
744
744
  break;
745
745
  case "-": {
746
746
  const i = this.readArrow();
747
- i ? r = this.newToken("ARROW", i, e, n) : r = this.newToken("UNKNOWN", this.ch, e, n);
747
+ i ? n = this.newToken("ARROW", i, e, r) : n = this.newToken("UNKNOWN", this.ch, e, r);
748
748
  break;
749
749
  }
750
750
  case "=": {
751
751
  if (this.peekExact("=")) {
752
752
  const i = this.readDivider();
753
- return this.newToken("DIVIDER", i, e, n);
753
+ return this.newToken("DIVIDER", i, e, r);
754
754
  }
755
- r = this.newToken("UNKNOWN", this.ch, e, n);
755
+ n = this.newToken("UNKNOWN", this.ch, e, r);
756
756
  break;
757
757
  }
758
758
  case "":
759
- r = this.newToken("EOF", "", e, n);
759
+ n = this.newToken("EOF", "", e, r);
760
760
  break;
761
761
  default:
762
762
  if (this.isLetter(this.ch)) {
763
763
  const i = this.readIdentifier(), s = this.lookupIdent(i);
764
- return this.newToken(s, i, e, n);
764
+ return this.newToken(s, i, e, r);
765
765
  } else
766
- r = this.newToken("UNKNOWN", this.ch, e, n);
766
+ n = this.newToken("UNKNOWN", this.ch, e, r);
767
767
  }
768
- return this.readChar(), r;
768
+ return this.readChar(), n;
769
769
  }
770
- newToken(e, n, r, i) {
771
- const s = this.position === r ? r + n.length : this.position;
772
- return { type: e, literal: n, line: this.line, column: i, start: r, end: s };
770
+ newToken(e, r, n, i) {
771
+ const s = this.position === n ? n + r.length : this.position;
772
+ return { type: e, literal: r, line: this.line, column: i, start: n, end: s };
773
773
  }
774
774
  // Override readString to handle PlantUML specific behavior
775
775
  readString() {
@@ -777,8 +777,8 @@ class xt extends Xe {
777
777
  for (this.readChar(); this.ch !== '"' && this.ch !== "" && this.ch !== `
778
778
  `; )
779
779
  this.readChar();
780
- const n = this.input.slice(e, this.position);
781
- return this.readChar(), n;
780
+ const r = this.input.slice(e, this.position);
781
+ return this.readChar(), r;
782
782
  }
783
783
  lookupIdent(e) {
784
784
  return {
@@ -816,8 +816,8 @@ class xt extends Xe {
816
816
  return this.input[this.position + 1] === e;
817
817
  }
818
818
  peekString(e) {
819
- for (let n = 0; n < e.length; n++)
820
- if (this.input[this.position + 1 + n] !== e[n]) return !1;
819
+ for (let r = 0; r < e.length; r++)
820
+ if (this.input[this.position + 1 + r] !== e[r]) return !1;
821
821
  return !0;
822
822
  }
823
823
  readRestOfLine() {
@@ -828,11 +828,11 @@ class xt extends Xe {
828
828
  return this.input.slice(e, this.position).trim();
829
829
  }
830
830
  readMulti(e) {
831
- for (let n = 0; n < e; n++) this.readChar();
831
+ for (let r = 0; r < e; r++) this.readChar();
832
832
  }
833
833
  readDivider() {
834
- const n = this.readRestOfLine().match(/^==\s*(.*?)\s*==$/);
835
- return n ? n[1] : "";
834
+ const r = this.readRestOfLine().match(/^==\s*(.*?)\s*==$/);
835
+ return r ? r[1] : "";
836
836
  }
837
837
  }
838
838
  class Dt extends Qe {
@@ -869,41 +869,41 @@ class Dt extends Qe {
869
869
  continue;
870
870
  }
871
871
  if (this.currToken.type === "DIVIDER") {
872
- const n = {
872
+ const r = {
873
873
  kind: "divider",
874
874
  id: `div_${e.events.length + 1}`,
875
875
  text: this.currToken.literal || void 0
876
876
  };
877
- e.events.push(n), this.advance();
877
+ e.events.push(r), this.advance();
878
878
  continue;
879
879
  }
880
880
  if (this.isParticipantToken(this.currToken)) {
881
- const n = this.parseMessage(e);
882
- if (n) {
883
- e.events.push(n);
881
+ const r = this.parseMessage(e);
882
+ if (r) {
883
+ e.events.push(r);
884
884
  continue;
885
885
  }
886
886
  }
887
887
  if (this.currToken.type === "ACTIVATE" || this.currToken.type === "DEACTIVATE") {
888
- const n = this.parseActivation(e);
889
- n && e.events.push(n);
888
+ const r = this.parseActivation(e);
889
+ r && e.events.push(r);
890
890
  continue;
891
891
  }
892
892
  if (this.currToken.type === "NOTE") {
893
- const n = this.parseNote(e);
894
- n && e.events.push(n);
893
+ const r = this.parseNote(e);
894
+ r && e.events.push(r);
895
895
  continue;
896
896
  }
897
897
  if (["ALT", "OPT", "LOOP"].includes(this.currToken.type)) {
898
- const n = this.parseFragment(e);
899
- n && e.events.push(n);
898
+ const r = this.parseFragment(e);
899
+ r && e.events.push(r);
900
900
  continue;
901
901
  }
902
902
  if (this.currToken.type === "END")
903
903
  return e;
904
904
  if (this.currToken.type === "BOX") {
905
- const n = this.parseGroup(e);
906
- n && e.groups.push(n);
905
+ const r = this.parseGroup(e);
906
+ r && e.groups.push(r);
907
907
  continue;
908
908
  }
909
909
  this.advance();
@@ -912,8 +912,8 @@ class Dt extends Qe {
912
912
  }
913
913
  parseGroup(e) {
914
914
  this.advance();
915
- let n = "", r;
916
- this.currToken.type === "STRING" && (n = this.currToken.literal, this.advance()), this.currToken.type === "UNKNOWN" && this.currToken.literal === "#" && (this.advance(), this.isTokenType("IDENTIFIER") && (r = `#${this.currToken.literal}`, this.advance()));
915
+ let r = "", n;
916
+ this.currToken.type === "STRING" && (r = this.currToken.literal, this.advance()), this.currToken.type === "UNKNOWN" && this.currToken.literal === "#" && (this.advance(), this.isTokenType("IDENTIFIER") && (n = `#${this.currToken.literal}`, this.advance()));
917
917
  const i = [];
918
918
  for (; this.currToken.type !== "EOF"; ) {
919
919
  if (this.currToken.type === "END") {
@@ -936,14 +936,14 @@ class Dt extends Qe {
936
936
  return {
937
937
  kind: "group",
938
938
  id: `group_${e.groups.length + 1}`,
939
- name: n,
939
+ name: r,
940
940
  type: "box",
941
941
  participantIds: i,
942
- style: r ? { backgroundColor: r } : void 0
942
+ style: n ? { backgroundColor: n } : void 0
943
943
  };
944
944
  }
945
945
  parseFragment(e) {
946
- const n = "fragment", r = this.currToken.literal.toLowerCase();
946
+ const r = "fragment", n = this.currToken.literal.toLowerCase();
947
947
  this.advance();
948
948
  const i = this.readRestOfLine().trim(), s = [];
949
949
  let o = [];
@@ -955,8 +955,8 @@ class Dt extends Qe {
955
955
  }
956
956
  if (this.currToken.type === "ELSE") {
957
957
  this.advance();
958
- const h = this.readRestOfLine().trim();
959
- o = [], s.push({ id: `br_${s.length + 1}`, condition: h, events: o });
958
+ const p = this.readRestOfLine().trim();
959
+ o = [], s.push({ id: `br_${s.length + 1}`, condition: p, events: o });
960
960
  continue;
961
961
  }
962
962
  if (this.currToken.type === "NEWLINE") {
@@ -967,9 +967,9 @@ class Dt extends Qe {
967
967
  c && o.push(c);
968
968
  }
969
969
  return {
970
- kind: n,
970
+ kind: r,
971
971
  id: `frag_${e.events.length + 1}`,
972
- operator: r,
972
+ operator: n,
973
973
  branches: s
974
974
  };
975
975
  }
@@ -978,17 +978,17 @@ class Dt extends Qe {
978
978
  if (["PARTICIPANT", "ACTOR", "DATABASE", "BOUNDARY", "CONTROL", "ENTITY", "COLLECTIONS", "QUEUE"].includes(this.currToken.type))
979
979
  return this.parseParticipant(e), null;
980
980
  if (this.isParticipantToken(this.currToken)) {
981
- const n = this.parseMessage(e);
982
- if (n) return n;
981
+ const r = this.parseMessage(e);
982
+ if (r) return r;
983
983
  }
984
984
  return this.currToken.type === "ACTIVATE" || this.currToken.type === "DEACTIVATE" ? this.parseActivation(e) : this.currToken.type === "NOTE" ? this.parseNote(e) : ["ALT", "OPT", "LOOP"].includes(this.currToken.type) ? this.parseFragment(e) : (this.advance(), null);
985
985
  }
986
986
  parseNote(e) {
987
987
  this.advance();
988
- let n = "over";
989
- this.currToken.type === "LEFT" ? (n = "left", this.advance()) : this.currToken.type === "RIGHT" ? (n = "right", this.advance()) : this.currToken.type === "OVER" && (n = "over", this.advance()), this.currToken.type === "OF" && this.advance();
990
- const r = [];
991
- for (; this.isParticipantToken(this.currToken) && (r.push(this.currToken.literal), this.ensureParticipant(e, this.currToken.literal), this.advance(), this.currToken.type === "COMMA"); )
988
+ let r = "over";
989
+ this.currToken.type === "LEFT" ? (r = "left", this.advance()) : this.currToken.type === "RIGHT" ? (r = "right", this.advance()) : this.currToken.type === "OVER" && (r = "over", this.advance()), this.currToken.type === "OF" && this.advance();
990
+ const n = [];
991
+ for (; this.isParticipantToken(this.currToken) && (n.push(this.currToken.literal), this.ensureParticipant(e, this.currToken.literal), this.advance(), this.currToken.type === "COMMA"); )
992
992
  this.advance();
993
993
  let i = "";
994
994
  if (this.currToken.type === "COLON")
@@ -1009,23 +1009,23 @@ class Dt extends Qe {
1009
1009
  return {
1010
1010
  kind: "note",
1011
1011
  id: `note_${e.events.length + 1}`,
1012
- position: n,
1013
- participantIds: r,
1012
+ position: r,
1013
+ participantIds: n,
1014
1014
  text: i
1015
1015
  };
1016
1016
  }
1017
1017
  parseActivation(e) {
1018
- const n = this.currToken.type === "ACTIVATE" ? "activate" : "deactivate";
1018
+ const r = this.currToken.type === "ACTIVATE" ? "activate" : "deactivate";
1019
1019
  this.advance();
1020
- let r = "";
1020
+ let n = "";
1021
1021
  if (this.isParticipantToken(this.currToken))
1022
- r = this.currToken.literal, this.ensureParticipant(e, r), this.advance();
1022
+ n = this.currToken.literal, this.ensureParticipant(e, n), this.advance();
1023
1023
  else
1024
1024
  return null;
1025
1025
  return {
1026
1026
  kind: "activation",
1027
- participantId: r,
1028
- action: n
1027
+ participantId: n,
1028
+ action: r
1029
1029
  };
1030
1030
  }
1031
1031
  isParticipantToken(e) {
@@ -1034,9 +1034,9 @@ class Dt extends Qe {
1034
1034
  parseMessage(e) {
1035
1035
  if (this.peekToken.type !== "ARROW")
1036
1036
  return null;
1037
- const n = this.currToken.literal;
1038
- this.ensureParticipant(e, n), this.advance();
1039
1037
  const r = this.currToken.literal;
1038
+ this.ensureParticipant(e, r), this.advance();
1039
+ const n = this.currToken.literal;
1040
1040
  if (this.advance(), !this.isParticipantToken(this.currToken))
1041
1041
  return null;
1042
1042
  const i = this.currToken.literal;
@@ -1044,60 +1044,60 @@ class Dt extends Qe {
1044
1044
  let s = "";
1045
1045
  this.currToken.type === "COLON" && (this.advance(), s = this.readRestOfLine().trim());
1046
1046
  let o = "sync", a = { line: "solid", head: "arrow" };
1047
- return r === "-->" ? (o = "reply", a = { line: "dotted", head: "arrow" }) : r === "->" && (o = "sync", a = { line: "solid", head: "arrow" }), {
1047
+ return n === "-->" ? (o = "reply", a = { line: "dotted", head: "arrow" }) : n === "->" && (o = "sync", a = { line: "solid", head: "arrow" }), {
1048
1048
  kind: "message",
1049
1049
  id: `msg_${e.events.length + 1}`,
1050
1050
  // Simple ID generation
1051
- from: n,
1051
+ from: r,
1052
1052
  to: i,
1053
1053
  text: s,
1054
1054
  type: o,
1055
1055
  style: a
1056
1056
  };
1057
1057
  }
1058
- ensureParticipant(e, n) {
1059
- e.participants.find((r) => r.id === n) || e.participants.push({
1060
- id: n,
1061
- name: n,
1058
+ ensureParticipant(e, r) {
1059
+ e.participants.find((n) => n.id === r) || e.participants.push({
1060
+ id: r,
1061
+ name: r,
1062
1062
  type: "participant"
1063
1063
  });
1064
1064
  }
1065
1065
  parseParticipant(e) {
1066
- const n = this.currToken.type;
1067
- let r = "participant";
1068
- n === "ACTOR" && (r = "actor"), n === "DATABASE" && (r = "database"), n === "BOUNDARY" && (r = "boundary"), n === "CONTROL" && (r = "control"), n === "ENTITY" && (r = "entity"), n === "COLLECTIONS" && (r = "collections"), n === "QUEUE" && (r = "queue"), this.advance();
1066
+ const r = this.currToken.type;
1067
+ let n = "participant";
1068
+ r === "ACTOR" && (n = "actor"), r === "DATABASE" && (n = "database"), r === "BOUNDARY" && (n = "boundary"), r === "CONTROL" && (n = "control"), r === "ENTITY" && (n = "entity"), r === "COLLECTIONS" && (n = "collections"), r === "QUEUE" && (n = "queue"), this.advance();
1069
1069
  let i = "", s = "";
1070
1070
  (this.currToken.type === "STRING" || this.currToken.type === "IDENTIFIER") && (i = this.currToken.literal, s = i, this.advance()), this.currToken.type === "AS" && (this.advance(), this.isTokenType("IDENTIFIER") && (s = this.currToken.literal, this.advance())), e.participants.push({
1071
1071
  id: s,
1072
1072
  name: i,
1073
- type: r
1073
+ type: n
1074
1074
  });
1075
1075
  }
1076
1076
  readRestOfLine() {
1077
1077
  if (this.currToken.type === "NEWLINE" || this.currToken.type === "EOF")
1078
1078
  return "";
1079
1079
  const e = this.currToken.start;
1080
- let n = this.currToken.end;
1080
+ let r = this.currToken.end;
1081
1081
  for (; !this.isTokenType("NEWLINE") && !this.isTokenType("EOF"); )
1082
- n = this.currToken.end, this.advance();
1083
- return this.lexer.getInput().slice(e, n).trim();
1082
+ r = this.currToken.end, this.advance();
1083
+ return this.lexer.getInput().slice(e, r).trim();
1084
1084
  }
1085
1085
  }
1086
1086
  const Ft = {
1087
1087
  parse: (t) => {
1088
- const e = new xt(t);
1088
+ const e = new Lt(t);
1089
1089
  return new Dt(e).parse();
1090
1090
  }
1091
- }, jt = {
1091
+ }, Mt = {
1092
1092
  ".puml": "plantuml",
1093
1093
  ".plantuml": "plantuml",
1094
1094
  ".pu": "plantuml",
1095
1095
  ".mmd": "mermaid",
1096
1096
  ".mermaid": "mermaid"
1097
- }, Mt = [
1097
+ }, jt = [
1098
1098
  { pattern: /^\s*@startuml/m, format: "plantuml" },
1099
1099
  { pattern: /^\s*sequenceDiagram/m, format: "mermaid" }
1100
- ], be = {
1100
+ ], we = {
1101
1101
  /**
1102
1102
  * Detect diagram format from file path and content.
1103
1103
  *
@@ -1114,8 +1114,8 @@ const Ft = {
1114
1114
  * ```
1115
1115
  */
1116
1116
  detect(t, e) {
1117
- const n = be.detectByExtension(t);
1118
- return n || be.detectByContent(e);
1117
+ const r = we.detectByExtension(t);
1118
+ return r || we.detectByContent(e);
1119
1119
  },
1120
1120
  /**
1121
1121
  * Detect format based on file extension.
@@ -1125,7 +1125,7 @@ const Ft = {
1125
1125
  */
1126
1126
  detectByExtension(t) {
1127
1127
  const e = t.toLowerCase().match(/\.[^.]+$/)?.[0];
1128
- return e && jt[e] || null;
1128
+ return e && Mt[e] || null;
1129
1129
  },
1130
1130
  /**
1131
1131
  * Detect format based on content patterns.
@@ -1134,9 +1134,9 @@ const Ft = {
1134
1134
  * @returns Detected format, or null if no pattern matches
1135
1135
  */
1136
1136
  detectByContent(t) {
1137
- for (const { pattern: e, format: n } of Mt)
1137
+ for (const { pattern: e, format: r } of jt)
1138
1138
  if (e.test(t))
1139
- return n;
1139
+ return r;
1140
1140
  return null;
1141
1141
  },
1142
1142
  /**
@@ -1154,7 +1154,7 @@ const Ft = {
1154
1154
  }
1155
1155
  }
1156
1156
  }, Q = /* @__PURE__ */ new Map();
1157
- Q.set("mermaid", Lt);
1157
+ Q.set("mermaid", xt);
1158
1158
  Q.set("plantuml", Ft);
1159
1159
  const Ut = {
1160
1160
  register(t, e) {
@@ -1169,24 +1169,24 @@ const Ut = {
1169
1169
  };
1170
1170
  class K {
1171
1171
  transform(e) {
1172
- const n = this.mapEvents(e.events);
1172
+ const r = this.mapEvents(e.events);
1173
1173
  return {
1174
1174
  ...e,
1175
- events: n
1175
+ events: r
1176
1176
  };
1177
1177
  }
1178
1178
  mapEvents(e) {
1179
- return e.flatMap((n) => this.visitEvent(n));
1179
+ return e.flatMap((r) => this.visitEvent(r));
1180
1180
  }
1181
1181
  visitEvent(e) {
1182
1182
  return e.kind === "fragment" ? this.visitFragment(e) : [e];
1183
1183
  }
1184
1184
  visitFragment(e) {
1185
- const n = e.branches.map((r) => this.visitBranch(r));
1185
+ const r = e.branches.map((n) => this.visitBranch(n));
1186
1186
  return [
1187
1187
  {
1188
1188
  ...e,
1189
- branches: n
1189
+ branches: r
1190
1190
  }
1191
1191
  ];
1192
1192
  }
@@ -1199,12 +1199,12 @@ class K {
1199
1199
  }
1200
1200
  class Gt extends K {
1201
1201
  visitFragment(e) {
1202
- const n = super.visitFragment(e);
1203
- if (n.length === 0) return [];
1204
- const r = n[0], i = r.branches.filter((s) => s.events.length > 0);
1202
+ const r = super.visitFragment(e);
1203
+ if (r.length === 0) return [];
1204
+ const n = r[0], i = n.branches.filter((s) => s.events.length > 0);
1205
1205
  return i.length === 0 ? [] : [
1206
1206
  {
1207
- ...r,
1207
+ ...n,
1208
1208
  branches: i
1209
1209
  }
1210
1210
  ];
@@ -1212,74 +1212,74 @@ class Gt extends K {
1212
1212
  }
1213
1213
  class Vt {
1214
1214
  transform(e) {
1215
- const n = this.collectUsedParticipants(e.events), r = e.participants.filter(
1216
- (s) => n.has(s.id)
1215
+ const r = this.collectUsedParticipants(e.events), n = e.participants.filter(
1216
+ (s) => r.has(s.id)
1217
1217
  ), i = e.groups.map((s) => ({
1218
1218
  ...s,
1219
- participantIds: s.participantIds.filter((o) => n.has(o))
1219
+ participantIds: s.participantIds.filter((o) => r.has(o))
1220
1220
  })).filter((s) => s.participantIds.length > 0);
1221
1221
  return {
1222
1222
  ...e,
1223
- participants: r,
1223
+ participants: n,
1224
1224
  groups: i
1225
1225
  };
1226
1226
  }
1227
1227
  collectUsedParticipants(e) {
1228
- const n = /* @__PURE__ */ new Set();
1229
- function r(i) {
1228
+ const r = /* @__PURE__ */ new Set();
1229
+ function n(i) {
1230
1230
  for (const s of i)
1231
1231
  switch (s.kind) {
1232
1232
  case "message":
1233
- s.from && n.add(s.from), s.to && n.add(s.to);
1233
+ s.from && r.add(s.from), s.to && r.add(s.to);
1234
1234
  break;
1235
1235
  case "fragment":
1236
1236
  for (const o of s.branches)
1237
- r(o.events);
1237
+ n(o.events);
1238
1238
  break;
1239
1239
  case "activation":
1240
- n.add(s.participantId);
1240
+ r.add(s.participantId);
1241
1241
  break;
1242
1242
  case "note":
1243
1243
  s.participantIds.forEach((o) => {
1244
- n.add(o);
1244
+ r.add(o);
1245
1245
  });
1246
1246
  break;
1247
1247
  case "ref":
1248
1248
  s.participantIds.forEach((o) => {
1249
- n.add(o);
1249
+ r.add(o);
1250
1250
  });
1251
1251
  break;
1252
1252
  }
1253
1253
  }
1254
- return r(e), n;
1254
+ return n(e), r;
1255
1255
  }
1256
1256
  }
1257
- class ne {
1257
+ class re {
1258
1258
  // -- Branch / Fragment --
1259
- matchBranch(e, n, r) {
1260
- return !(n.operator && !(Array.isArray(n.operator) ? n.operator : [n.operator]).includes(r) || n.condition && (!e.condition || !this.matchText(e.condition, n.condition)));
1259
+ matchBranch(e, r, n) {
1260
+ return !(r.operator && !(Array.isArray(r.operator) ? r.operator : [r.operator]).includes(n) || r.condition && (!e.condition || !this.matchText(e.condition, r.condition)));
1261
1261
  }
1262
1262
  // -- Participant --
1263
- matchParticipant(e, n) {
1264
- return !(n.id && !this.matchText(e.id, n.id) || n.name && !this.matchText(e.name, n.name) || n.stereotype && e.stereotype && !this.matchText(e.stereotype, n.stereotype));
1263
+ matchParticipant(e, r) {
1264
+ return !(r.id && !this.matchText(e.id, r.id) || r.name && !this.matchText(e.name, r.name) || r.stereotype && e.stereotype && !this.matchText(e.stereotype, r.stereotype));
1265
1265
  }
1266
1266
  // -- Message --
1267
- matchMessage(e, n) {
1268
- return !(n.text && !this.matchText(e.text, n.text) || n.from && e.from && !this.matchText(e.from, n.from) || n.to && e.to && !this.matchText(e.to, n.to));
1267
+ matchMessage(e, r) {
1268
+ return !(r.text && !this.matchText(e.text, r.text) || r.from && e.from && !this.matchText(e.from, r.from) || r.to && e.to && !this.matchText(e.to, r.to));
1269
1269
  }
1270
1270
  // -- Group --
1271
- matchGroup(e, n) {
1272
- return !(n.name && e.name && !this.matchText(e.name, n.name));
1271
+ matchGroup(e, r) {
1272
+ return !(r.name && e.name && !this.matchText(e.name, r.name));
1273
1273
  }
1274
1274
  // -- Helpers --
1275
- matchText(e, n) {
1276
- if (typeof n == "string")
1277
- return e === n;
1278
- if (n instanceof RegExp)
1279
- return n.test(e);
1280
- if (typeof n == "object" && n.pattern) {
1281
- const r = n.flags || "";
1282
- return new RegExp(n.pattern, r).test(e);
1275
+ matchText(e, r) {
1276
+ if (typeof r == "string")
1277
+ return e === r;
1278
+ if (r instanceof RegExp)
1279
+ return r.test(e);
1280
+ if (typeof r == "object" && r.pattern) {
1281
+ const n = r.flags || "";
1282
+ return new RegExp(r.pattern, n).test(e);
1283
1283
  }
1284
1284
  return !1;
1285
1285
  }
@@ -1288,35 +1288,44 @@ class Bt extends K {
1288
1288
  constructor(e) {
1289
1289
  super(), this.layer = e;
1290
1290
  }
1291
- matcher = new ne();
1291
+ matcher = new re();
1292
1292
  targetParticipantIds = /* @__PURE__ */ new Set();
1293
1293
  transform(e) {
1294
1294
  return this.resolveTargetParticipants(e), super.transform(e);
1295
1295
  }
1296
1296
  resolveTargetParticipants(e) {
1297
1297
  this.targetParticipantIds.clear();
1298
- const n = this.layer.selector;
1299
- e.participants.forEach((r) => {
1300
- this.matcher.matchParticipant(r, n) && this.targetParticipantIds.add(r.id);
1298
+ const r = this.layer.selector;
1299
+ e.participants.forEach((n) => {
1300
+ this.matcher.matchParticipant(n, r) && this.targetParticipantIds.add(n.id);
1301
1301
  });
1302
1302
  }
1303
1303
  visitEvent(e) {
1304
1304
  if (e.kind === "message") {
1305
- const n = e;
1306
- if (!this.isRelatedToParticipant(n))
1305
+ const r = e;
1306
+ if (!this.isRelatedToParticipant(r))
1307
1307
  return [];
1308
1308
  }
1309
- if (e.kind === "note" && !e.participantIds.some(
1310
- (i) => this.targetParticipantIds.has(i)
1311
- ))
1312
- return [];
1309
+ if (e.kind === "note" || e.kind === "ref")
1310
+ return this.filterMultiParticipantNode(e);
1313
1311
  if (e.kind === "activation") {
1314
- const n = e;
1315
- if (!this.targetParticipantIds.has(n.participantId))
1312
+ const r = e;
1313
+ if (!this.targetParticipantIds.has(r.participantId))
1316
1314
  return [];
1317
1315
  }
1318
1316
  return super.visitEvent(e);
1319
1317
  }
1318
+ filterMultiParticipantNode(e) {
1319
+ const r = e.participantIds.filter(
1320
+ (n) => this.targetParticipantIds.has(n)
1321
+ );
1322
+ return r.length === 0 ? [] : [
1323
+ {
1324
+ ...e,
1325
+ participantIds: r
1326
+ }
1327
+ ];
1328
+ }
1320
1329
  // Helper to check if message involves the participant from selector
1321
1330
  isRelatedToParticipant(e) {
1322
1331
  return !!(e.from && this.targetParticipantIds.has(e.from) || e.to && this.targetParticipantIds.has(e.to));
@@ -1326,76 +1335,82 @@ class Jt extends K {
1326
1335
  constructor(e) {
1327
1336
  super(), this.layer = e;
1328
1337
  }
1329
- matcher = new ne();
1338
+ matcher = new re();
1330
1339
  mergedParticipantIds = /* @__PURE__ */ new Set();
1331
1340
  targetParticipantId = "";
1332
1341
  transform(e) {
1333
- const n = this.layer.selector, r = [];
1342
+ const r = this.layer.selector, n = [];
1334
1343
  if (e.participants.forEach((d) => {
1335
- this.matcher.matchParticipant(d, n) && r.push(d);
1336
- }), r.length === 0)
1344
+ this.matcher.matchParticipant(d, r) && n.push(d);
1345
+ }), n.length === 0)
1337
1346
  return e;
1338
- this.mergedParticipantIds = new Set(r.map((d) => d.id));
1347
+ this.mergedParticipantIds = new Set(n.map((d) => d.id));
1339
1348
  const i = this.layer.into || {};
1340
1349
  let s = i.id, o = i.name;
1341
- s || (o ? s = o.replace(/[^a-zA-Z0-9-_]/g, "_") : s = r.map((d) => d.id).join("_")), o || (o = s), this.targetParticipantId = s;
1342
- const a = [], h = !e.participants.some(
1350
+ s || (o ? s = o.replace(/[^a-zA-Z0-9-_]/g, "_") : s = n.map((d) => d.id).join("_")), o || (o = s), this.targetParticipantId = s;
1351
+ const a = [], p = !e.participants.some(
1343
1352
  (d) => d.id === s && !this.mergedParticipantIds.has(d.id)
1344
1353
  );
1345
- let p = !1;
1354
+ let h = !1;
1346
1355
  for (const d of e.participants) {
1347
1356
  if (this.mergedParticipantIds.has(d.id)) {
1348
- if (h && !p) {
1357
+ if (p && !h) {
1349
1358
  const f = {
1350
1359
  id: s || "",
1351
1360
  name: o || "",
1352
1361
  type: "participant"
1353
1362
  // Todo: map stereotype?
1354
1363
  };
1355
- a.push(f), p = !0;
1364
+ a.push(f), h = !0;
1356
1365
  }
1357
1366
  continue;
1358
1367
  }
1359
1368
  d.id, a.push(d);
1360
1369
  }
1361
- return e.participants = a, super.transform(e);
1370
+ return e.participants = a, e.groups = e.groups.map((d) => {
1371
+ const f = /* @__PURE__ */ new Set();
1372
+ return d.participantIds.forEach((g) => {
1373
+ this.mergedParticipantIds.has(g) ? f.add(this.targetParticipantId) : f.add(g);
1374
+ }), {
1375
+ ...d,
1376
+ participantIds: Array.from(f)
1377
+ };
1378
+ }), super.transform(e);
1362
1379
  }
1363
1380
  visitEvent(e) {
1364
1381
  if (e.kind === "message")
1365
1382
  return this.transformMessage(e);
1366
- if (e.kind === "note")
1367
- return this.transformNote(e);
1383
+ if (e.kind === "note" || e.kind === "ref")
1384
+ return this.transformMultiParticipantNode(e);
1368
1385
  if (e.kind === "activation")
1369
1386
  return this.transformActivation(e);
1370
1387
  if (e.kind === "fragment") {
1371
- const n = super.visitEvent(e);
1372
- return n.length > 0 && n[0].kind === "fragment" && n[0].branches.every(
1388
+ const r = super.visitEvent(e);
1389
+ return r.length > 0 && r[0].kind === "fragment" && r[0].branches.every(
1373
1390
  (s) => s.events.length === 0
1374
- ) ? [] : n;
1391
+ ) ? [] : r;
1375
1392
  }
1376
1393
  return super.visitEvent(e);
1377
1394
  }
1378
1395
  transformMessage(e) {
1379
- let n = e.from, r = e.to;
1380
- return n && this.mergedParticipantIds.has(n) && (n = this.targetParticipantId), r && this.mergedParticipantIds.has(r) && (r = this.targetParticipantId), n === this.targetParticipantId && r === this.targetParticipantId ? [] : [
1396
+ let r = e.from, n = e.to;
1397
+ return r && this.mergedParticipantIds.has(r) && (r = this.targetParticipantId), n && this.mergedParticipantIds.has(n) && (n = this.targetParticipantId), r === this.targetParticipantId && n === this.targetParticipantId ? [] : [
1381
1398
  {
1382
1399
  ...e,
1383
- from: n,
1384
- to: r
1400
+ from: r,
1401
+ to: n
1385
1402
  }
1386
1403
  ];
1387
1404
  }
1388
- transformNote(e) {
1389
- const n = /* @__PURE__ */ new Set();
1390
- let r = !1;
1391
- for (const o of e.participantIds)
1392
- this.mergedParticipantIds.has(o) ? (n.add(this.targetParticipantId), r = !0) : n.add(o);
1393
- if (!r)
1405
+ transformMultiParticipantNode(e) {
1406
+ const r = /* @__PURE__ */ new Set();
1407
+ let n = !1;
1408
+ for (const s of e.participantIds)
1409
+ this.mergedParticipantIds.has(s) ? (r.add(this.targetParticipantId), n = !0) : r.add(s);
1410
+ if (!n)
1394
1411
  return [e];
1395
- const i = Array.from(n);
1396
- return e.participantIds.every(
1397
- (o) => this.mergedParticipantIds.has(o)
1398
- ) ? [] : [
1412
+ const i = Array.from(r);
1413
+ return [
1399
1414
  {
1400
1415
  ...e,
1401
1416
  participantIds: i
@@ -1410,38 +1425,47 @@ class Wt extends K {
1410
1425
  constructor(e) {
1411
1426
  super(), this.layer = e;
1412
1427
  }
1413
- matcher = new ne();
1428
+ matcher = new re();
1414
1429
  removedParticipantIds = /* @__PURE__ */ new Set();
1415
1430
  transform(e) {
1416
- const n = this.layer.selector;
1417
- return n.kind === "participant" && (e.participants.forEach((r) => {
1418
- this.matcher.matchParticipant(r, n) && this.removedParticipantIds.add(r.id);
1431
+ const r = this.layer.selector;
1432
+ return r.kind === "participant" && (e.participants.forEach((n) => {
1433
+ this.matcher.matchParticipant(n, r) && this.removedParticipantIds.add(n.id);
1419
1434
  }), e.participants = e.participants.filter(
1420
- (r) => !this.removedParticipantIds.has(r.id)
1421
- )), n.kind === "group" && (e.groups = e.groups.filter(
1422
- (r) => !this.matcher.matchGroup(r, n)
1435
+ (n) => !this.removedParticipantIds.has(n.id)
1436
+ )), r.kind === "group" && (e.groups = e.groups.filter(
1437
+ (n) => !this.matcher.matchGroup(n, r)
1423
1438
  )), super.transform(e);
1424
1439
  }
1425
1440
  visitEvent(e) {
1426
- const n = this.layer.selector;
1427
- if (n.kind === "message" && e.kind === "message" && this.matcher.matchMessage(e, n))
1441
+ const r = this.layer.selector;
1442
+ if (r.kind === "message" && e.kind === "message" && this.matcher.matchMessage(e, r))
1428
1443
  return [];
1429
- if (n.kind === "participant") {
1444
+ if (r.kind === "participant") {
1430
1445
  if (e.kind === "message") {
1431
- const r = e;
1432
- if (this.isRelatedToRemovedParticipant(r)) return [];
1446
+ const n = e;
1447
+ if (this.isRelatedToRemovedParticipant(n)) return [];
1433
1448
  }
1434
- if (e.kind === "note" && e.participantIds.some(
1435
- (s) => this.removedParticipantIds.has(s)
1436
- ))
1437
- return [];
1449
+ if (e.kind === "note" || e.kind === "ref")
1450
+ return this.filterMultiParticipantNode(e);
1438
1451
  if (e.kind === "activation") {
1439
- const r = e;
1440
- if (this.removedParticipantIds.has(r.participantId)) return [];
1452
+ const n = e;
1453
+ if (this.removedParticipantIds.has(n.participantId)) return [];
1441
1454
  }
1442
1455
  }
1443
1456
  return super.visitEvent(e);
1444
1457
  }
1458
+ filterMultiParticipantNode(e) {
1459
+ const r = e.participantIds.filter(
1460
+ (n) => !this.removedParticipantIds.has(n)
1461
+ );
1462
+ return r.length === 0 ? [] : [
1463
+ {
1464
+ ...e,
1465
+ participantIds: r
1466
+ }
1467
+ ];
1468
+ }
1445
1469
  isRelatedToRemovedParticipant(e) {
1446
1470
  return !!(e.from && this.removedParticipantIds.has(e.from) || e.to && this.removedParticipantIds.has(e.to));
1447
1471
  }
@@ -1450,12 +1474,12 @@ class Kt extends K {
1450
1474
  constructor(e) {
1451
1475
  super(), this.layer = e;
1452
1476
  }
1453
- matcher = new ne();
1477
+ matcher = new re();
1454
1478
  visitFragment(e) {
1455
- const n = e.branches.find(
1456
- (r) => this.matcher.matchBranch(r, this.layer.selector, e.operator)
1479
+ const r = e.branches.find(
1480
+ (n) => this.matcher.matchBranch(n, this.layer.selector, e.operator)
1457
1481
  );
1458
- return n ? this.mapEvents(n.events) : super.visitFragment(e);
1482
+ return r ? this.mapEvents(r.events) : super.visitFragment(e);
1459
1483
  }
1460
1484
  }
1461
1485
  class Yt {
@@ -1466,22 +1490,22 @@ class Yt {
1466
1490
  /**
1467
1491
  * Type-safe registration for a specific layer type.
1468
1492
  */
1469
- registerTyped(e, n) {
1470
- this.factories.set(e, n);
1493
+ registerTyped(e, r) {
1494
+ this.factories.set(e, r);
1471
1495
  }
1472
1496
  /**
1473
1497
  * Register a custom transformer factory.
1474
1498
  */
1475
- register(e, n) {
1476
- this.factories.set(e, n);
1499
+ register(e, r) {
1500
+ this.factories.set(e, r);
1477
1501
  }
1478
1502
  /**
1479
1503
  * Get a transformer for the given layer.
1480
1504
  * @returns Transformer instance or null if no factory is registered
1481
1505
  */
1482
1506
  get(e) {
1483
- const n = this.factories.get(e.action);
1484
- return n ? n(e) : null;
1507
+ const r = this.factories.get(e.action);
1508
+ return r ? r(e) : null;
1485
1509
  }
1486
1510
  /**
1487
1511
  * Check if a transformer is registered for the given action.
@@ -1492,13 +1516,13 @@ class Yt {
1492
1516
  }
1493
1517
  const qt = new Yt();
1494
1518
  class ue {
1495
- transform(e, n) {
1496
- let r = e;
1497
- for (const i of n) {
1519
+ transform(e, r) {
1520
+ let n = e;
1521
+ for (const i of r) {
1498
1522
  const s = qt.get(i);
1499
- s ? r = s.transform(r) : console.warn(`Unknown action: ${i.action}`);
1523
+ s ? n = s.transform(n) : console.warn(`Unknown action: ${i.action}`);
1500
1524
  }
1501
- return r = new Gt().transform(r), r = new Vt().transform(r), r;
1525
+ return n = new Gt().transform(n), n = new Vt().transform(n), n;
1502
1526
  }
1503
1527
  }
1504
1528
  class Uo {
@@ -1509,17 +1533,17 @@ class Uo {
1509
1533
  * @param code Source diagram code
1510
1534
  * @param format Input format ('mermaid' or 'plantuml')
1511
1535
  */
1512
- static init(e, n = "mermaid") {
1513
- const i = Ut.getParser(n).parse(e);
1514
- return new Xt(i, n);
1536
+ static init(e, r = "mermaid") {
1537
+ const i = Ut.getParser(r).parse(e);
1538
+ return new Xt(i, r);
1515
1539
  }
1516
1540
  }
1517
1541
  class Xt {
1518
1542
  ast;
1519
1543
  layers = [];
1520
1544
  sourceFormat;
1521
- constructor(e, n = "mermaid") {
1522
- this.ast = e, this.sourceFormat = n;
1545
+ constructor(e, r = "mermaid") {
1546
+ this.ast = e, this.sourceFormat = r;
1523
1547
  }
1524
1548
  // -- Entity Filtering --
1525
1549
  /**
@@ -1588,15 +1612,15 @@ class Xt {
1588
1612
  * Generate Mermaid code from the transformed AST.
1589
1613
  */
1590
1614
  toMermaid() {
1591
- const n = new ue().transform(this.ast, this.layers);
1592
- return new Ye().generate(n);
1615
+ const r = new ue().transform(this.ast, this.layers);
1616
+ return new Ye().generate(r);
1593
1617
  }
1594
1618
  /**
1595
1619
  * Generate PlantUML code from the transformed AST.
1596
1620
  */
1597
1621
  toPlantUML() {
1598
- const n = new ue().transform(this.ast, this.layers);
1599
- return new qe().generate(n);
1622
+ const r = new ue().transform(this.ast, this.layers);
1623
+ return new qe().generate(r);
1600
1624
  }
1601
1625
  /**
1602
1626
  * Get the transformed AST (for advanced use cases).
@@ -1664,8 +1688,8 @@ const Go = {
1664
1688
  return Array.from(D.keys());
1665
1689
  }
1666
1690
  };
1667
- function u(t, e, n) {
1668
- function r(a, c) {
1691
+ function u(t, e, r) {
1692
+ function n(a, c) {
1669
1693
  if (a._zod || Object.defineProperty(a, "_zod", {
1670
1694
  value: {
1671
1695
  def: c,
@@ -1676,29 +1700,29 @@ function u(t, e, n) {
1676
1700
  }), a._zod.traits.has(t))
1677
1701
  return;
1678
1702
  a._zod.traits.add(t), e(a, c);
1679
- const h = o.prototype, p = Object.keys(h);
1680
- for (let d = 0; d < p.length; d++) {
1681
- const f = p[d];
1682
- f in a || (a[f] = h[f].bind(a));
1703
+ const p = o.prototype, h = Object.keys(p);
1704
+ for (let d = 0; d < h.length; d++) {
1705
+ const f = h[d];
1706
+ f in a || (a[f] = p[f].bind(a));
1683
1707
  }
1684
1708
  }
1685
- const i = n?.Parent ?? Object;
1709
+ const i = r?.Parent ?? Object;
1686
1710
  class s extends i {
1687
1711
  }
1688
1712
  Object.defineProperty(s, "name", { value: t });
1689
1713
  function o(a) {
1690
1714
  var c;
1691
- const h = n?.Parent ? new s() : this;
1692
- r(h, a), (c = h._zod).deferred ?? (c.deferred = []);
1693
- for (const p of h._zod.deferred)
1694
- p();
1695
- return h;
1696
- }
1697
- return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, {
1698
- value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(t)
1715
+ const p = r?.Parent ? new s() : this;
1716
+ n(p, a), (c = p._zod).deferred ?? (c.deferred = []);
1717
+ for (const h of p._zod.deferred)
1718
+ h();
1719
+ return p;
1720
+ }
1721
+ return Object.defineProperty(o, "init", { value: n }), Object.defineProperty(o, Symbol.hasInstance, {
1722
+ value: (a) => r?.Parent && a instanceof r.Parent ? !0 : a?._zod?.traits?.has(t)
1699
1723
  }), Object.defineProperty(o, "name", { value: t }), o;
1700
1724
  }
1701
- class j extends Error {
1725
+ class M extends Error {
1702
1726
  constructor() {
1703
1727
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
1704
1728
  }
@@ -1713,13 +1737,13 @@ function C(t) {
1713
1737
  return et;
1714
1738
  }
1715
1739
  function tt(t) {
1716
- const e = Object.values(t).filter((r) => typeof r == "number");
1717
- return Object.entries(t).filter(([r, i]) => e.indexOf(+r) === -1).map(([r, i]) => i);
1740
+ const e = Object.values(t).filter((n) => typeof n == "number");
1741
+ return Object.entries(t).filter(([n, i]) => e.indexOf(+n) === -1).map(([n, i]) => i);
1718
1742
  }
1719
1743
  function le(t, e) {
1720
1744
  return typeof e == "bigint" ? e.toString() : e;
1721
1745
  }
1722
- function re(t) {
1746
+ function ne(t) {
1723
1747
  return {
1724
1748
  get value() {
1725
1749
  {
@@ -1733,26 +1757,26 @@ function me(t) {
1733
1757
  return t == null;
1734
1758
  }
1735
1759
  function ge(t) {
1736
- const e = t.startsWith("^") ? 1 : 0, n = t.endsWith("$") ? t.length - 1 : t.length;
1737
- return t.slice(e, n);
1760
+ const e = t.startsWith("^") ? 1 : 0, r = t.endsWith("$") ? t.length - 1 : t.length;
1761
+ return t.slice(e, r);
1738
1762
  }
1739
1763
  function Qt(t, e) {
1740
- const n = (t.toString().split(".")[1] || "").length, r = e.toString();
1741
- let i = (r.split(".")[1] || "").length;
1742
- if (i === 0 && /\d?e-\d?/.test(r)) {
1743
- const c = r.match(/\d?e-(\d?)/);
1764
+ const r = (t.toString().split(".")[1] || "").length, n = e.toString();
1765
+ let i = (n.split(".")[1] || "").length;
1766
+ if (i === 0 && /\d?e-\d?/.test(n)) {
1767
+ const c = n.match(/\d?e-(\d?)/);
1744
1768
  c?.[1] && (i = Number.parseInt(c[1]));
1745
1769
  }
1746
- const s = n > i ? n : i, o = Number.parseInt(t.toFixed(s).replace(".", "")), a = Number.parseInt(e.toFixed(s).replace(".", ""));
1770
+ const s = r > i ? r : i, o = Number.parseInt(t.toFixed(s).replace(".", "")), a = Number.parseInt(e.toFixed(s).replace(".", ""));
1747
1771
  return o % a / 10 ** s;
1748
1772
  }
1749
- const Ee = /* @__PURE__ */ Symbol("evaluating");
1750
- function m(t, e, n) {
1751
- let r;
1773
+ const Ie = /* @__PURE__ */ Symbol("evaluating");
1774
+ function m(t, e, r) {
1775
+ let n;
1752
1776
  Object.defineProperty(t, e, {
1753
1777
  get() {
1754
- if (r !== Ee)
1755
- return r === void 0 && (r = Ee, r = n()), r;
1778
+ if (n !== Ie)
1779
+ return n === void 0 && (n = Ie, n = r()), n;
1756
1780
  },
1757
1781
  set(i) {
1758
1782
  Object.defineProperty(t, e, {
@@ -1763,34 +1787,34 @@ function m(t, e, n) {
1763
1787
  configurable: !0
1764
1788
  });
1765
1789
  }
1766
- function L(t, e, n) {
1790
+ function x(t, e, r) {
1767
1791
  Object.defineProperty(t, e, {
1768
- value: n,
1792
+ value: r,
1769
1793
  writable: !0,
1770
1794
  enumerable: !0,
1771
1795
  configurable: !0
1772
1796
  });
1773
1797
  }
1774
- function x(...t) {
1798
+ function L(...t) {
1775
1799
  const e = {};
1776
- for (const n of t) {
1777
- const r = Object.getOwnPropertyDescriptors(n);
1778
- Object.assign(e, r);
1800
+ for (const r of t) {
1801
+ const n = Object.getOwnPropertyDescriptors(r);
1802
+ Object.assign(e, n);
1779
1803
  }
1780
1804
  return Object.defineProperties({}, e);
1781
1805
  }
1782
- function Ie(t) {
1806
+ function Ee(t) {
1783
1807
  return JSON.stringify(t);
1784
1808
  }
1785
1809
  function Ht(t) {
1786
1810
  return t.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
1787
1811
  }
1788
- const nt = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
1812
+ const rt = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
1789
1813
  };
1790
1814
  function B(t) {
1791
1815
  return typeof t == "object" && t !== null && !Array.isArray(t);
1792
1816
  }
1793
- const en = re(() => {
1817
+ const er = ne(() => {
1794
1818
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
1795
1819
  return !1;
1796
1820
  try {
@@ -1806,19 +1830,19 @@ function J(t) {
1806
1830
  const e = t.constructor;
1807
1831
  if (e === void 0 || typeof e != "function")
1808
1832
  return !0;
1809
- const n = e.prototype;
1810
- return !(B(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
1833
+ const r = e.prototype;
1834
+ return !(B(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
1811
1835
  }
1812
- function rt(t) {
1836
+ function nt(t) {
1813
1837
  return J(t) ? { ...t } : Array.isArray(t) ? [...t] : t;
1814
1838
  }
1815
- const tn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
1816
- function M(t) {
1839
+ const tr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
1840
+ function j(t) {
1817
1841
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1818
1842
  }
1819
- function N(t, e, n) {
1820
- const r = new t._zod.constr(e ?? t._zod.def);
1821
- return (!e || n?.parent) && (r._zod.parent = t), r;
1843
+ function N(t, e, r) {
1844
+ const n = new t._zod.constr(e ?? t._zod.def);
1845
+ return (!e || r?.parent) && (n._zod.parent = t), n;
1822
1846
  }
1823
1847
  function l(t) {
1824
1848
  const e = t;
@@ -1833,79 +1857,79 @@ function l(t) {
1833
1857
  }
1834
1858
  return delete e.message, typeof e.error == "string" ? { ...e, error: () => e.error } : e;
1835
1859
  }
1836
- function nn(t) {
1860
+ function rr(t) {
1837
1861
  return Object.keys(t).filter((e) => t[e]._zod.optin === "optional" && t[e]._zod.optout === "optional");
1838
1862
  }
1839
- const rn = {
1863
+ const nr = {
1840
1864
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
1841
1865
  int32: [-2147483648, 2147483647],
1842
1866
  uint32: [0, 4294967295],
1843
1867
  float32: [-34028234663852886e22, 34028234663852886e22],
1844
1868
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
1845
1869
  };
1846
- function sn(t, e) {
1847
- const n = t._zod.def, r = x(t._zod.def, {
1870
+ function ir(t, e) {
1871
+ const r = t._zod.def, n = L(t._zod.def, {
1848
1872
  get shape() {
1849
1873
  const i = {};
1850
1874
  for (const s in e) {
1851
- if (!(s in n.shape))
1875
+ if (!(s in r.shape))
1852
1876
  throw new Error(`Unrecognized key: "${s}"`);
1853
- e[s] && (i[s] = n.shape[s]);
1877
+ e[s] && (i[s] = r.shape[s]);
1854
1878
  }
1855
- return L(this, "shape", i), i;
1879
+ return x(this, "shape", i), i;
1856
1880
  },
1857
1881
  checks: []
1858
1882
  });
1859
- return N(t, r);
1883
+ return N(t, n);
1860
1884
  }
1861
- function on(t, e) {
1862
- const n = t._zod.def, r = x(t._zod.def, {
1885
+ function sr(t, e) {
1886
+ const r = t._zod.def, n = L(t._zod.def, {
1863
1887
  get shape() {
1864
1888
  const i = { ...t._zod.def.shape };
1865
1889
  for (const s in e) {
1866
- if (!(s in n.shape))
1890
+ if (!(s in r.shape))
1867
1891
  throw new Error(`Unrecognized key: "${s}"`);
1868
1892
  e[s] && delete i[s];
1869
1893
  }
1870
- return L(this, "shape", i), i;
1894
+ return x(this, "shape", i), i;
1871
1895
  },
1872
1896
  checks: []
1873
1897
  });
1874
- return N(t, r);
1898
+ return N(t, n);
1875
1899
  }
1876
- function an(t, e) {
1900
+ function or(t, e) {
1877
1901
  if (!J(e))
1878
1902
  throw new Error("Invalid input to extend: expected a plain object");
1879
- const n = t._zod.def.checks;
1880
- if (n && n.length > 0)
1903
+ const r = t._zod.def.checks;
1904
+ if (r && r.length > 0)
1881
1905
  throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
1882
- const i = x(t._zod.def, {
1906
+ const i = L(t._zod.def, {
1883
1907
  get shape() {
1884
1908
  const s = { ...t._zod.def.shape, ...e };
1885
- return L(this, "shape", s), s;
1909
+ return x(this, "shape", s), s;
1886
1910
  },
1887
1911
  checks: []
1888
1912
  });
1889
1913
  return N(t, i);
1890
1914
  }
1891
- function cn(t, e) {
1915
+ function ar(t, e) {
1892
1916
  if (!J(e))
1893
1917
  throw new Error("Invalid input to safeExtend: expected a plain object");
1894
- const n = {
1918
+ const r = {
1895
1919
  ...t._zod.def,
1896
1920
  get shape() {
1897
- const r = { ...t._zod.def.shape, ...e };
1898
- return L(this, "shape", r), r;
1921
+ const n = { ...t._zod.def.shape, ...e };
1922
+ return x(this, "shape", n), n;
1899
1923
  },
1900
1924
  checks: t._zod.def.checks
1901
1925
  };
1902
- return N(t, n);
1926
+ return N(t, r);
1903
1927
  }
1904
- function un(t, e) {
1905
- const n = x(t._zod.def, {
1928
+ function cr(t, e) {
1929
+ const r = L(t._zod.def, {
1906
1930
  get shape() {
1907
- const r = { ...t._zod.def.shape, ...e._zod.def.shape };
1908
- return L(this, "shape", r), r;
1931
+ const n = { ...t._zod.def.shape, ...e._zod.def.shape };
1932
+ return x(this, "shape", n), n;
1909
1933
  },
1910
1934
  get catchall() {
1911
1935
  return e._zod.def.catchall;
@@ -1913,17 +1937,17 @@ function un(t, e) {
1913
1937
  checks: []
1914
1938
  // delete existing checks
1915
1939
  });
1916
- return N(t, n);
1940
+ return N(t, r);
1917
1941
  }
1918
- function hn(t, e, n) {
1919
- const r = x(e._zod.def, {
1942
+ function ur(t, e, r) {
1943
+ const n = L(e._zod.def, {
1920
1944
  get shape() {
1921
1945
  const i = e._zod.def.shape, s = { ...i };
1922
- if (n)
1923
- for (const o in n) {
1946
+ if (r)
1947
+ for (const o in r) {
1924
1948
  if (!(o in i))
1925
1949
  throw new Error(`Unrecognized key: "${o}"`);
1926
- n[o] && (s[o] = t ? new t({
1950
+ r[o] && (s[o] = t ? new t({
1927
1951
  type: "optional",
1928
1952
  innerType: i[o]
1929
1953
  }) : i[o]);
@@ -1934,21 +1958,21 @@ function hn(t, e, n) {
1934
1958
  type: "optional",
1935
1959
  innerType: i[o]
1936
1960
  }) : i[o];
1937
- return L(this, "shape", s), s;
1961
+ return x(this, "shape", s), s;
1938
1962
  },
1939
1963
  checks: []
1940
1964
  });
1941
- return N(e, r);
1965
+ return N(e, n);
1942
1966
  }
1943
- function pn(t, e, n) {
1944
- const r = x(e._zod.def, {
1967
+ function pr(t, e, r) {
1968
+ const n = L(e._zod.def, {
1945
1969
  get shape() {
1946
1970
  const i = e._zod.def.shape, s = { ...i };
1947
- if (n)
1948
- for (const o in n) {
1971
+ if (r)
1972
+ for (const o in r) {
1949
1973
  if (!(o in s))
1950
1974
  throw new Error(`Unrecognized key: "${o}"`);
1951
- n[o] && (s[o] = new t({
1975
+ r[o] && (s[o] = new t({
1952
1976
  type: "nonoptional",
1953
1977
  innerType: i[o]
1954
1978
  }));
@@ -1959,47 +1983,47 @@ function pn(t, e, n) {
1959
1983
  type: "nonoptional",
1960
1984
  innerType: i[o]
1961
1985
  });
1962
- return L(this, "shape", s), s;
1986
+ return x(this, "shape", s), s;
1963
1987
  },
1964
1988
  checks: []
1965
1989
  });
1966
- return N(e, r);
1990
+ return N(e, n);
1967
1991
  }
1968
1992
  function F(t, e = 0) {
1969
1993
  if (t.aborted === !0)
1970
1994
  return !0;
1971
- for (let n = e; n < t.issues.length; n++)
1972
- if (t.issues[n]?.continue !== !0)
1995
+ for (let r = e; r < t.issues.length; r++)
1996
+ if (t.issues[r]?.continue !== !0)
1973
1997
  return !0;
1974
1998
  return !1;
1975
1999
  }
1976
2000
  function it(t, e) {
1977
- return e.map((n) => {
1978
- var r;
1979
- return (r = n).path ?? (r.path = []), n.path.unshift(t), n;
2001
+ return e.map((r) => {
2002
+ var n;
2003
+ return (n = r).path ?? (n.path = []), r.path.unshift(t), r;
1980
2004
  });
1981
2005
  }
1982
2006
  function Y(t) {
1983
2007
  return typeof t == "string" ? t : t?.message;
1984
2008
  }
1985
- function R(t, e, n) {
1986
- const r = { ...t, path: t.path ?? [] };
2009
+ function R(t, e, r) {
2010
+ const n = { ...t, path: t.path ?? [] };
1987
2011
  if (!t.message) {
1988
- const i = Y(t.inst?._zod.def?.error?.(t)) ?? Y(e?.error?.(t)) ?? Y(n.customError?.(t)) ?? Y(n.localeError?.(t)) ?? "Invalid input";
1989
- r.message = i;
2012
+ const i = Y(t.inst?._zod.def?.error?.(t)) ?? Y(e?.error?.(t)) ?? Y(r.customError?.(t)) ?? Y(r.localeError?.(t)) ?? "Invalid input";
2013
+ n.message = i;
1990
2014
  }
1991
- return delete r.inst, delete r.continue, e?.reportInput || delete r.input, r;
2015
+ return delete n.inst, delete n.continue, e?.reportInput || delete n.input, n;
1992
2016
  }
1993
2017
  function ve(t) {
1994
2018
  return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
1995
2019
  }
1996
2020
  function W(...t) {
1997
- const [e, n, r] = t;
2021
+ const [e, r, n] = t;
1998
2022
  return typeof e == "string" ? {
1999
2023
  message: e,
2000
2024
  code: "custom",
2001
- input: n,
2002
- inst: r
2025
+ input: r,
2026
+ inst: n
2003
2027
  } : { ...e };
2004
2028
  }
2005
2029
  const st = (t, e) => {
@@ -2014,167 +2038,167 @@ const st = (t, e) => {
2014
2038
  enumerable: !1
2015
2039
  });
2016
2040
  }, ot = u("$ZodError", st), at = u("$ZodError", st, { Parent: Error });
2017
- function ln(t, e = (n) => n.message) {
2018
- const n = {}, r = [];
2041
+ function hr(t, e = (r) => r.message) {
2042
+ const r = {}, n = [];
2019
2043
  for (const i of t.issues)
2020
- i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(e(i))) : r.push(e(i));
2021
- return { formErrors: r, fieldErrors: n };
2044
+ i.path.length > 0 ? (r[i.path[0]] = r[i.path[0]] || [], r[i.path[0]].push(e(i))) : n.push(e(i));
2045
+ return { formErrors: n, fieldErrors: r };
2022
2046
  }
2023
- function dn(t, e = (n) => n.message) {
2024
- const n = { _errors: [] }, r = (i) => {
2047
+ function lr(t, e = (r) => r.message) {
2048
+ const r = { _errors: [] }, n = (i) => {
2025
2049
  for (const s of i.issues)
2026
2050
  if (s.code === "invalid_union" && s.errors.length)
2027
- s.errors.map((o) => r({ issues: o }));
2051
+ s.errors.map((o) => n({ issues: o }));
2028
2052
  else if (s.code === "invalid_key")
2029
- r({ issues: s.issues });
2053
+ n({ issues: s.issues });
2030
2054
  else if (s.code === "invalid_element")
2031
- r({ issues: s.issues });
2055
+ n({ issues: s.issues });
2032
2056
  else if (s.path.length === 0)
2033
- n._errors.push(e(s));
2057
+ r._errors.push(e(s));
2034
2058
  else {
2035
- let o = n, a = 0;
2059
+ let o = r, a = 0;
2036
2060
  for (; a < s.path.length; ) {
2037
2061
  const c = s.path[a];
2038
2062
  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++;
2039
2063
  }
2040
2064
  }
2041
2065
  };
2042
- return r(t), n;
2066
+ return n(t), r;
2043
2067
  }
2044
- const _e = (t) => (e, n, r, i) => {
2045
- const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, o = e._zod.run({ value: n, issues: [] }, s);
2068
+ const _e = (t) => (e, r, n, i) => {
2069
+ const s = n ? Object.assign(n, { async: !1 }) : { async: !1 }, o = e._zod.run({ value: r, issues: [] }, s);
2046
2070
  if (o instanceof Promise)
2047
- throw new j();
2071
+ throw new M();
2048
2072
  if (o.issues.length) {
2049
2073
  const a = new (i?.Err ?? t)(o.issues.map((c) => R(c, s, C())));
2050
- throw nt(a, i?.callee), a;
2074
+ throw rt(a, i?.callee), a;
2051
2075
  }
2052
2076
  return o.value;
2053
- }, ke = (t) => async (e, n, r, i) => {
2054
- const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
2055
- let o = e._zod.run({ value: n, issues: [] }, s);
2077
+ }, ke = (t) => async (e, r, n, i) => {
2078
+ const s = n ? Object.assign(n, { async: !0 }) : { async: !0 };
2079
+ let o = e._zod.run({ value: r, issues: [] }, s);
2056
2080
  if (o instanceof Promise && (o = await o), o.issues.length) {
2057
2081
  const a = new (i?.Err ?? t)(o.issues.map((c) => R(c, s, C())));
2058
- throw nt(a, i?.callee), a;
2082
+ throw rt(a, i?.callee), a;
2059
2083
  }
2060
2084
  return o.value;
2061
- }, ie = (t) => (e, n, r) => {
2062
- const i = r ? { ...r, async: !1 } : { async: !1 }, s = e._zod.run({ value: n, issues: [] }, i);
2085
+ }, ie = (t) => (e, r, n) => {
2086
+ const i = n ? { ...n, async: !1 } : { async: !1 }, s = e._zod.run({ value: r, issues: [] }, i);
2063
2087
  if (s instanceof Promise)
2064
- throw new j();
2088
+ throw new M();
2065
2089
  return s.issues.length ? {
2066
2090
  success: !1,
2067
2091
  error: new (t ?? ot)(s.issues.map((o) => R(o, i, C())))
2068
2092
  } : { success: !0, data: s.value };
2069
- }, fn = /* @__PURE__ */ ie(at), se = (t) => async (e, n, r) => {
2070
- const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
2071
- let s = e._zod.run({ value: n, issues: [] }, i);
2093
+ }, dr = /* @__PURE__ */ ie(at), se = (t) => async (e, r, n) => {
2094
+ const i = n ? Object.assign(n, { async: !0 }) : { async: !0 };
2095
+ let s = e._zod.run({ value: r, issues: [] }, i);
2072
2096
  return s instanceof Promise && (s = await s), s.issues.length ? {
2073
2097
  success: !1,
2074
2098
  error: new t(s.issues.map((o) => R(o, i, C())))
2075
2099
  } : { success: !0, data: s.value };
2076
- }, mn = /* @__PURE__ */ se(at), gn = (t) => (e, n, r) => {
2077
- const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
2078
- return _e(t)(e, n, i);
2079
- }, vn = (t) => (e, n, r) => _e(t)(e, n, r), _n = (t) => async (e, n, r) => {
2080
- const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
2081
- return ke(t)(e, n, i);
2082
- }, kn = (t) => async (e, n, r) => ke(t)(e, n, r), yn = (t) => (e, n, r) => {
2083
- const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
2084
- return ie(t)(e, n, i);
2085
- }, Tn = (t) => (e, n, r) => ie(t)(e, n, r), wn = (t) => async (e, n, r) => {
2086
- const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
2087
- return se(t)(e, n, i);
2088
- }, 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})+$";
2089
- function Cn() {
2090
- return new RegExp(Zn, "u");
2091
- }
2092
- 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}$`);
2093
- function ht(t) {
2100
+ }, fr = /* @__PURE__ */ se(at), mr = (t) => (e, r, n) => {
2101
+ const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
2102
+ return _e(t)(e, r, i);
2103
+ }, gr = (t) => (e, r, n) => _e(t)(e, r, n), vr = (t) => async (e, r, n) => {
2104
+ const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
2105
+ return ke(t)(e, r, i);
2106
+ }, _r = (t) => async (e, r, n) => ke(t)(e, r, n), kr = (t) => (e, r, n) => {
2107
+ const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
2108
+ return ie(t)(e, r, i);
2109
+ }, yr = (t) => (e, r, n) => ie(t)(e, r, n), Tr = (t) => async (e, r, n) => {
2110
+ const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
2111
+ return se(t)(e, r, i);
2112
+ }, br = (t) => async (e, r, n) => se(t)(e, r, n), wr = /^[cC][^\s-]{8,}$/, Ir = /^[0-9a-z]+$/, Er = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, zr = /^[0-9a-vA-V]{20}$/, $r = /^[A-Za-z0-9]{27}$/, Or = /^[a-zA-Z0-9_-]{21}$/, Pr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Sr = /^([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)$/, Nr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ar = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
2113
+ function Zr() {
2114
+ return new RegExp(Ar, "u");
2115
+ }
2116
+ const Cr = /^(?:(?: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])$/, Rr = /^(([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}|:))$/, xr = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Lr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Dr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ct = /^[A-Za-z0-9_-]*$/, Fr = /^\+(?:[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])))", Mr = /* @__PURE__ */ new RegExp(`^${ut}$`);
2117
+ function pt(t) {
2094
2118
  const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
2095
2119
  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+)?)?`;
2096
2120
  }
2097
- function Un(t) {
2098
- return new RegExp(`^${ht(t)}$`);
2121
+ function jr(t) {
2122
+ return new RegExp(`^${pt(t)}$`);
2099
2123
  }
2100
- function Gn(t) {
2101
- const e = ht({ precision: t.precision }), n = ["Z"];
2102
- t.local && n.push(""), t.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
2103
- const r = `${e}(?:${n.join("|")})`;
2104
- return new RegExp(`^${ut}T(?:${r})$`);
2124
+ function Ur(t) {
2125
+ const e = pt({ precision: t.precision }), r = ["Z"];
2126
+ t.local && r.push(""), t.offset && r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
2127
+ const n = `${e}(?:${r.join("|")})`;
2128
+ return new RegExp(`^${ut}T(?:${n})$`);
2105
2129
  }
2106
- const Vn = (t) => {
2130
+ const Gr = (t) => {
2107
2131
  const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
2108
2132
  return new RegExp(`^${e}$`);
2109
- }, Bn = /^-?\d+$/, Jn = /^-?\d+(?:\.\d+)?/, Wn = /^[^A-Z]*$/, Kn = /^[^a-z]*$/, b = /* @__PURE__ */ u("$ZodCheck", (t, e) => {
2110
- var n;
2111
- t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
2112
- }), pt = {
2133
+ }, Vr = /^-?\d+$/, Br = /^-?\d+(?:\.\d+)?/, Jr = /^[^A-Z]*$/, Wr = /^[^a-z]*$/, w = /* @__PURE__ */ u("$ZodCheck", (t, e) => {
2134
+ var r;
2135
+ t._zod ?? (t._zod = {}), t._zod.def = e, (r = t._zod).onattach ?? (r.onattach = []);
2136
+ }), ht = {
2113
2137
  number: "number",
2114
2138
  bigint: "bigint",
2115
2139
  object: "date"
2116
2140
  }, lt = /* @__PURE__ */ u("$ZodCheckLessThan", (t, e) => {
2117
- b.init(t, e);
2118
- const n = pt[typeof e.value];
2119
- t._zod.onattach.push((r) => {
2120
- const i = r._zod.bag, s = (e.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
2141
+ w.init(t, e);
2142
+ const r = ht[typeof e.value];
2143
+ t._zod.onattach.push((n) => {
2144
+ const i = n._zod.bag, s = (e.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
2121
2145
  e.value < s && (e.inclusive ? i.maximum = e.value : i.exclusiveMaximum = e.value);
2122
- }), t._zod.check = (r) => {
2123
- (e.inclusive ? r.value <= e.value : r.value < e.value) || r.issues.push({
2124
- origin: n,
2146
+ }), t._zod.check = (n) => {
2147
+ (e.inclusive ? n.value <= e.value : n.value < e.value) || n.issues.push({
2148
+ origin: r,
2125
2149
  code: "too_big",
2126
2150
  maximum: e.value,
2127
- input: r.value,
2151
+ input: n.value,
2128
2152
  inclusive: e.inclusive,
2129
2153
  inst: t,
2130
2154
  continue: !e.abort
2131
2155
  });
2132
2156
  };
2133
2157
  }), dt = /* @__PURE__ */ u("$ZodCheckGreaterThan", (t, e) => {
2134
- b.init(t, e);
2135
- const n = pt[typeof e.value];
2136
- t._zod.onattach.push((r) => {
2137
- const i = r._zod.bag, s = (e.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
2158
+ w.init(t, e);
2159
+ const r = ht[typeof e.value];
2160
+ t._zod.onattach.push((n) => {
2161
+ const i = n._zod.bag, s = (e.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
2138
2162
  e.value > s && (e.inclusive ? i.minimum = e.value : i.exclusiveMinimum = e.value);
2139
- }), t._zod.check = (r) => {
2140
- (e.inclusive ? r.value >= e.value : r.value > e.value) || r.issues.push({
2141
- origin: n,
2163
+ }), t._zod.check = (n) => {
2164
+ (e.inclusive ? n.value >= e.value : n.value > e.value) || n.issues.push({
2165
+ origin: r,
2142
2166
  code: "too_small",
2143
2167
  minimum: e.value,
2144
- input: r.value,
2168
+ input: n.value,
2145
2169
  inclusive: e.inclusive,
2146
2170
  inst: t,
2147
2171
  continue: !e.abort
2148
2172
  });
2149
2173
  };
2150
- }), Yn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (t, e) => {
2151
- b.init(t, e), t._zod.onattach.push((n) => {
2152
- var r;
2153
- (r = n._zod.bag).multipleOf ?? (r.multipleOf = e.value);
2154
- }), t._zod.check = (n) => {
2155
- if (typeof n.value != typeof e.value)
2174
+ }), Kr = /* @__PURE__ */ u("$ZodCheckMultipleOf", (t, e) => {
2175
+ w.init(t, e), t._zod.onattach.push((r) => {
2176
+ var n;
2177
+ (n = r._zod.bag).multipleOf ?? (n.multipleOf = e.value);
2178
+ }), t._zod.check = (r) => {
2179
+ if (typeof r.value != typeof e.value)
2156
2180
  throw new Error("Cannot mix number and bigint in multiple_of check.");
2157
- (typeof n.value == "bigint" ? n.value % e.value === BigInt(0) : Qt(n.value, e.value) === 0) || n.issues.push({
2158
- origin: typeof n.value,
2181
+ (typeof r.value == "bigint" ? r.value % e.value === BigInt(0) : Qt(r.value, e.value) === 0) || r.issues.push({
2182
+ origin: typeof r.value,
2159
2183
  code: "not_multiple_of",
2160
2184
  divisor: e.value,
2161
- input: n.value,
2185
+ input: r.value,
2162
2186
  inst: t,
2163
2187
  continue: !e.abort
2164
2188
  });
2165
2189
  };
2166
- }), qn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (t, e) => {
2167
- b.init(t, e), e.format = e.format || "float64";
2168
- const n = e.format?.includes("int"), r = n ? "int" : "number", [i, s] = rn[e.format];
2190
+ }), Yr = /* @__PURE__ */ u("$ZodCheckNumberFormat", (t, e) => {
2191
+ w.init(t, e), e.format = e.format || "float64";
2192
+ const r = e.format?.includes("int"), n = r ? "int" : "number", [i, s] = nr[e.format];
2169
2193
  t._zod.onattach.push((o) => {
2170
2194
  const a = o._zod.bag;
2171
- a.format = e.format, a.minimum = i, a.maximum = s, n && (a.pattern = Bn);
2195
+ a.format = e.format, a.minimum = i, a.maximum = s, r && (a.pattern = Vr);
2172
2196
  }), t._zod.check = (o) => {
2173
2197
  const a = o.value;
2174
- if (n) {
2198
+ if (r) {
2175
2199
  if (!Number.isInteger(a)) {
2176
2200
  o.issues.push({
2177
- expected: r,
2201
+ expected: n,
2178
2202
  format: e.format,
2179
2203
  code: "invalid_type",
2180
2204
  continue: !1,
@@ -2190,7 +2214,7 @@ const Vn = (t) => {
2190
2214
  maximum: Number.MAX_SAFE_INTEGER,
2191
2215
  note: "Integers must be within the safe integer range.",
2192
2216
  inst: t,
2193
- origin: r,
2217
+ origin: n,
2194
2218
  continue: !e.abort
2195
2219
  }) : o.issues.push({
2196
2220
  input: a,
@@ -2198,7 +2222,7 @@ const Vn = (t) => {
2198
2222
  minimum: Number.MIN_SAFE_INTEGER,
2199
2223
  note: "Integers must be within the safe integer range.",
2200
2224
  inst: t,
2201
- origin: r,
2225
+ origin: n,
2202
2226
  continue: !e.abort
2203
2227
  });
2204
2228
  return;
@@ -2220,20 +2244,20 @@ const Vn = (t) => {
2220
2244
  inst: t
2221
2245
  });
2222
2246
  };
2223
- }), Xn = /* @__PURE__ */ u("$ZodCheckMaxLength", (t, e) => {
2224
- var n;
2225
- b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2226
- const i = r.value;
2247
+ }), qr = /* @__PURE__ */ u("$ZodCheckMaxLength", (t, e) => {
2248
+ var r;
2249
+ w.init(t, e), (r = t._zod.def).when ?? (r.when = (n) => {
2250
+ const i = n.value;
2227
2251
  return !me(i) && i.length !== void 0;
2228
- }), t._zod.onattach.push((r) => {
2229
- const i = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
2230
- e.maximum < i && (r._zod.bag.maximum = e.maximum);
2231
- }), t._zod.check = (r) => {
2232
- const i = r.value;
2252
+ }), t._zod.onattach.push((n) => {
2253
+ const i = n._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
2254
+ e.maximum < i && (n._zod.bag.maximum = e.maximum);
2255
+ }), t._zod.check = (n) => {
2256
+ const i = n.value;
2233
2257
  if (i.length <= e.maximum)
2234
2258
  return;
2235
2259
  const o = ve(i);
2236
- r.issues.push({
2260
+ n.issues.push({
2237
2261
  origin: o,
2238
2262
  code: "too_big",
2239
2263
  maximum: e.maximum,
@@ -2243,20 +2267,20 @@ const Vn = (t) => {
2243
2267
  continue: !e.abort
2244
2268
  });
2245
2269
  };
2246
- }), Qn = /* @__PURE__ */ u("$ZodCheckMinLength", (t, e) => {
2247
- var n;
2248
- b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2249
- const i = r.value;
2270
+ }), Xr = /* @__PURE__ */ u("$ZodCheckMinLength", (t, e) => {
2271
+ var r;
2272
+ w.init(t, e), (r = t._zod.def).when ?? (r.when = (n) => {
2273
+ const i = n.value;
2250
2274
  return !me(i) && i.length !== void 0;
2251
- }), t._zod.onattach.push((r) => {
2252
- const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
2253
- e.minimum > i && (r._zod.bag.minimum = e.minimum);
2254
- }), t._zod.check = (r) => {
2255
- const i = r.value;
2275
+ }), t._zod.onattach.push((n) => {
2276
+ const i = n._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
2277
+ e.minimum > i && (n._zod.bag.minimum = e.minimum);
2278
+ }), t._zod.check = (n) => {
2279
+ const i = n.value;
2256
2280
  if (i.length >= e.minimum)
2257
2281
  return;
2258
2282
  const o = ve(i);
2259
- r.issues.push({
2283
+ n.issues.push({
2260
2284
  origin: o,
2261
2285
  code: "too_small",
2262
2286
  minimum: e.minimum,
@@ -2266,35 +2290,35 @@ const Vn = (t) => {
2266
2290
  continue: !e.abort
2267
2291
  });
2268
2292
  };
2269
- }), Hn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (t, e) => {
2270
- var n;
2271
- b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2272
- const i = r.value;
2293
+ }), Qr = /* @__PURE__ */ u("$ZodCheckLengthEquals", (t, e) => {
2294
+ var r;
2295
+ w.init(t, e), (r = t._zod.def).when ?? (r.when = (n) => {
2296
+ const i = n.value;
2273
2297
  return !me(i) && i.length !== void 0;
2274
- }), t._zod.onattach.push((r) => {
2275
- const i = r._zod.bag;
2298
+ }), t._zod.onattach.push((n) => {
2299
+ const i = n._zod.bag;
2276
2300
  i.minimum = e.length, i.maximum = e.length, i.length = e.length;
2277
- }), t._zod.check = (r) => {
2278
- const i = r.value, s = i.length;
2301
+ }), t._zod.check = (n) => {
2302
+ const i = n.value, s = i.length;
2279
2303
  if (s === e.length)
2280
2304
  return;
2281
2305
  const o = ve(i), a = s > e.length;
2282
- r.issues.push({
2306
+ n.issues.push({
2283
2307
  origin: o,
2284
2308
  ...a ? { code: "too_big", maximum: e.length } : { code: "too_small", minimum: e.length },
2285
2309
  inclusive: !0,
2286
2310
  exact: !0,
2287
- input: r.value,
2311
+ input: n.value,
2288
2312
  inst: t,
2289
2313
  continue: !e.abort
2290
2314
  });
2291
2315
  };
2292
2316
  }), oe = /* @__PURE__ */ u("$ZodCheckStringFormat", (t, e) => {
2293
- var n, r;
2294
- b.init(t, e), t._zod.onattach.push((i) => {
2317
+ var r, n;
2318
+ w.init(t, e), t._zod.onattach.push((i) => {
2295
2319
  const s = i._zod.bag;
2296
2320
  s.format = e.format, e.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(e.pattern));
2297
- }), e.pattern ? (n = t._zod).check ?? (n.check = (i) => {
2321
+ }), e.pattern ? (r = t._zod).check ?? (r.check = (i) => {
2298
2322
  e.pattern.lastIndex = 0, !e.pattern.test(i.value) && i.issues.push({
2299
2323
  origin: "string",
2300
2324
  code: "invalid_format",
@@ -2304,30 +2328,30 @@ const Vn = (t) => {
2304
2328
  inst: t,
2305
2329
  continue: !e.abort
2306
2330
  });
2307
- }) : (r = t._zod).check ?? (r.check = () => {
2331
+ }) : (n = t._zod).check ?? (n.check = () => {
2308
2332
  });
2309
- }), er = /* @__PURE__ */ u("$ZodCheckRegex", (t, e) => {
2310
- oe.init(t, e), t._zod.check = (n) => {
2311
- e.pattern.lastIndex = 0, !e.pattern.test(n.value) && n.issues.push({
2333
+ }), Hr = /* @__PURE__ */ u("$ZodCheckRegex", (t, e) => {
2334
+ oe.init(t, e), t._zod.check = (r) => {
2335
+ e.pattern.lastIndex = 0, !e.pattern.test(r.value) && r.issues.push({
2312
2336
  origin: "string",
2313
2337
  code: "invalid_format",
2314
2338
  format: "regex",
2315
- input: n.value,
2339
+ input: r.value,
2316
2340
  pattern: e.pattern.toString(),
2317
2341
  inst: t,
2318
2342
  continue: !e.abort
2319
2343
  });
2320
2344
  };
2321
- }), tr = /* @__PURE__ */ u("$ZodCheckLowerCase", (t, e) => {
2322
- e.pattern ?? (e.pattern = Wn), oe.init(t, e);
2323
- }), nr = /* @__PURE__ */ u("$ZodCheckUpperCase", (t, e) => {
2324
- e.pattern ?? (e.pattern = Kn), oe.init(t, e);
2325
- }), rr = /* @__PURE__ */ u("$ZodCheckIncludes", (t, e) => {
2326
- b.init(t, e);
2327
- const n = M(e.includes), r = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${n}` : n);
2328
- e.pattern = r, t._zod.onattach.push((i) => {
2345
+ }), en = /* @__PURE__ */ u("$ZodCheckLowerCase", (t, e) => {
2346
+ e.pattern ?? (e.pattern = Jr), oe.init(t, e);
2347
+ }), tn = /* @__PURE__ */ u("$ZodCheckUpperCase", (t, e) => {
2348
+ e.pattern ?? (e.pattern = Wr), oe.init(t, e);
2349
+ }), rn = /* @__PURE__ */ u("$ZodCheckIncludes", (t, e) => {
2350
+ w.init(t, e);
2351
+ const r = j(e.includes), n = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${r}` : r);
2352
+ e.pattern = n, t._zod.onattach.push((i) => {
2329
2353
  const s = i._zod.bag;
2330
- s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
2354
+ s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n);
2331
2355
  }), t._zod.check = (i) => {
2332
2356
  i.value.includes(e.includes, e.position) || i.issues.push({
2333
2357
  origin: "string",
@@ -2339,46 +2363,46 @@ const Vn = (t) => {
2339
2363
  continue: !e.abort
2340
2364
  });
2341
2365
  };
2342
- }), ir = /* @__PURE__ */ u("$ZodCheckStartsWith", (t, e) => {
2343
- b.init(t, e);
2344
- const n = new RegExp(`^${M(e.prefix)}.*`);
2345
- e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
2346
- const i = r._zod.bag;
2347
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
2348
- }), t._zod.check = (r) => {
2349
- r.value.startsWith(e.prefix) || r.issues.push({
2366
+ }), nn = /* @__PURE__ */ u("$ZodCheckStartsWith", (t, e) => {
2367
+ w.init(t, e);
2368
+ const r = new RegExp(`^${j(e.prefix)}.*`);
2369
+ e.pattern ?? (e.pattern = r), t._zod.onattach.push((n) => {
2370
+ const i = n._zod.bag;
2371
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
2372
+ }), t._zod.check = (n) => {
2373
+ n.value.startsWith(e.prefix) || n.issues.push({
2350
2374
  origin: "string",
2351
2375
  code: "invalid_format",
2352
2376
  format: "starts_with",
2353
2377
  prefix: e.prefix,
2354
- input: r.value,
2378
+ input: n.value,
2355
2379
  inst: t,
2356
2380
  continue: !e.abort
2357
2381
  });
2358
2382
  };
2359
- }), sr = /* @__PURE__ */ u("$ZodCheckEndsWith", (t, e) => {
2360
- b.init(t, e);
2361
- const n = new RegExp(`.*${M(e.suffix)}$`);
2362
- e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
2363
- const i = r._zod.bag;
2364
- i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
2365
- }), t._zod.check = (r) => {
2366
- r.value.endsWith(e.suffix) || r.issues.push({
2383
+ }), sn = /* @__PURE__ */ u("$ZodCheckEndsWith", (t, e) => {
2384
+ w.init(t, e);
2385
+ const r = new RegExp(`.*${j(e.suffix)}$`);
2386
+ e.pattern ?? (e.pattern = r), t._zod.onattach.push((n) => {
2387
+ const i = n._zod.bag;
2388
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
2389
+ }), t._zod.check = (n) => {
2390
+ n.value.endsWith(e.suffix) || n.issues.push({
2367
2391
  origin: "string",
2368
2392
  code: "invalid_format",
2369
2393
  format: "ends_with",
2370
2394
  suffix: e.suffix,
2371
- input: r.value,
2395
+ input: n.value,
2372
2396
  inst: t,
2373
2397
  continue: !e.abort
2374
2398
  });
2375
2399
  };
2376
- }), or = /* @__PURE__ */ u("$ZodCheckOverwrite", (t, e) => {
2377
- b.init(t, e), t._zod.check = (n) => {
2378
- n.value = e.tx(n.value);
2400
+ }), on = /* @__PURE__ */ u("$ZodCheckOverwrite", (t, e) => {
2401
+ w.init(t, e), t._zod.check = (r) => {
2402
+ r.value = e.tx(r.value);
2379
2403
  };
2380
2404
  });
2381
- class ar {
2405
+ class an {
2382
2406
  constructor(e = []) {
2383
2407
  this.content = [], this.indent = 0, this && (this.args = e);
2384
2408
  }
@@ -2390,116 +2414,116 @@ class ar {
2390
2414
  e(this, { execution: "sync" }), e(this, { execution: "async" });
2391
2415
  return;
2392
2416
  }
2393
- const r = e.split(`
2394
- `).filter((o) => o), i = Math.min(...r.map((o) => o.length - o.trimStart().length)), s = r.map((o) => o.slice(i)).map((o) => " ".repeat(this.indent * 2) + o);
2417
+ const n = e.split(`
2418
+ `).filter((o) => o), i = Math.min(...n.map((o) => o.length - o.trimStart().length)), s = n.map((o) => o.slice(i)).map((o) => " ".repeat(this.indent * 2) + o);
2395
2419
  for (const o of s)
2396
2420
  this.content.push(o);
2397
2421
  }
2398
2422
  compile() {
2399
- const e = Function, n = this?.args, i = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
2400
- return new e(...n, i.join(`
2423
+ const e = Function, r = this?.args, i = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
2424
+ return new e(...r, i.join(`
2401
2425
  `));
2402
2426
  }
2403
2427
  }
2404
- const cr = {
2428
+ const cn = {
2405
2429
  major: 4,
2406
2430
  minor: 2,
2407
2431
  patch: 1
2408
2432
  }, k = /* @__PURE__ */ u("$ZodType", (t, e) => {
2409
- var n;
2410
- t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = cr;
2411
- const r = [...t._zod.def.checks ?? []];
2412
- t._zod.traits.has("$ZodCheck") && r.unshift(t);
2413
- for (const i of r)
2433
+ var r;
2434
+ t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = cn;
2435
+ const n = [...t._zod.def.checks ?? []];
2436
+ t._zod.traits.has("$ZodCheck") && n.unshift(t);
2437
+ for (const i of n)
2414
2438
  for (const s of i._zod.onattach)
2415
2439
  s(t);
2416
- if (r.length === 0)
2417
- (n = t._zod).deferred ?? (n.deferred = []), t._zod.deferred?.push(() => {
2440
+ if (n.length === 0)
2441
+ (r = t._zod).deferred ?? (r.deferred = []), t._zod.deferred?.push(() => {
2418
2442
  t._zod.run = t._zod.parse;
2419
2443
  });
2420
2444
  else {
2421
2445
  const i = (o, a, c) => {
2422
- let h = F(o), p;
2446
+ let p = F(o), h;
2423
2447
  for (const d of a) {
2424
2448
  if (d._zod.def.when) {
2425
2449
  if (!d._zod.def.when(o))
2426
2450
  continue;
2427
- } else if (h)
2451
+ } else if (p)
2428
2452
  continue;
2429
- const f = o.issues.length, v = d._zod.check(o);
2430
- if (v instanceof Promise && c?.async === !1)
2431
- throw new j();
2432
- if (p || v instanceof Promise)
2433
- p = (p ?? Promise.resolve()).then(async () => {
2434
- await v, o.issues.length !== f && (h || (h = F(o, f)));
2453
+ const f = o.issues.length, g = d._zod.check(o);
2454
+ if (g instanceof Promise && c?.async === !1)
2455
+ throw new M();
2456
+ if (h || g instanceof Promise)
2457
+ h = (h ?? Promise.resolve()).then(async () => {
2458
+ await g, o.issues.length !== f && (p || (p = F(o, f)));
2435
2459
  });
2436
2460
  else {
2437
2461
  if (o.issues.length === f)
2438
2462
  continue;
2439
- h || (h = F(o, f));
2463
+ p || (p = F(o, f));
2440
2464
  }
2441
2465
  }
2442
- return p ? p.then(() => o) : o;
2466
+ return h ? h.then(() => o) : o;
2443
2467
  }, s = (o, a, c) => {
2444
2468
  if (F(o))
2445
2469
  return o.aborted = !0, o;
2446
- const h = i(a, r, c);
2447
- if (h instanceof Promise) {
2470
+ const p = i(a, n, c);
2471
+ if (p instanceof Promise) {
2448
2472
  if (c.async === !1)
2449
- throw new j();
2450
- return h.then((p) => t._zod.parse(p, c));
2473
+ throw new M();
2474
+ return p.then((h) => t._zod.parse(h, c));
2451
2475
  }
2452
- return t._zod.parse(h, c);
2476
+ return t._zod.parse(p, c);
2453
2477
  };
2454
2478
  t._zod.run = (o, a) => {
2455
2479
  if (a.skipChecks)
2456
2480
  return t._zod.parse(o, a);
2457
2481
  if (a.direction === "backward") {
2458
- const h = t._zod.parse({ value: o.value, issues: [] }, { ...a, skipChecks: !0 });
2459
- return h instanceof Promise ? h.then((p) => s(p, o, a)) : s(h, o, a);
2482
+ const p = t._zod.parse({ value: o.value, issues: [] }, { ...a, skipChecks: !0 });
2483
+ return p instanceof Promise ? p.then((h) => s(h, o, a)) : s(p, o, a);
2460
2484
  }
2461
2485
  const c = t._zod.parse(o, a);
2462
2486
  if (c instanceof Promise) {
2463
2487
  if (a.async === !1)
2464
- throw new j();
2465
- return c.then((h) => i(h, r, a));
2488
+ throw new M();
2489
+ return c.then((p) => i(p, n, a));
2466
2490
  }
2467
- return i(c, r, a);
2491
+ return i(c, n, a);
2468
2492
  };
2469
2493
  }
2470
2494
  t["~standard"] = {
2471
2495
  validate: (i) => {
2472
2496
  try {
2473
- const s = fn(t, i);
2497
+ const s = dr(t, i);
2474
2498
  return s.success ? { value: s.data } : { issues: s.error?.issues };
2475
2499
  } catch {
2476
- return mn(t, i).then((o) => o.success ? { value: o.data } : { issues: o.error?.issues });
2500
+ return fr(t, i).then((o) => o.success ? { value: o.data } : { issues: o.error?.issues });
2477
2501
  }
2478
2502
  },
2479
2503
  vendor: "zod",
2480
2504
  version: 1
2481
2505
  };
2482
2506
  }), ye = /* @__PURE__ */ u("$ZodString", (t, e) => {
2483
- k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Vn(t._zod.bag), t._zod.parse = (n, r) => {
2507
+ k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Gr(t._zod.bag), t._zod.parse = (r, n) => {
2484
2508
  if (e.coerce)
2485
2509
  try {
2486
- n.value = String(n.value);
2510
+ r.value = String(r.value);
2487
2511
  } catch {
2488
2512
  }
2489
- return typeof n.value == "string" || n.issues.push({
2513
+ return typeof r.value == "string" || r.issues.push({
2490
2514
  expected: "string",
2491
2515
  code: "invalid_type",
2492
- input: n.value,
2516
+ input: r.value,
2493
2517
  inst: t
2494
- }), n;
2518
+ }), r;
2495
2519
  };
2496
- }), g = /* @__PURE__ */ u("$ZodStringFormat", (t, e) => {
2520
+ }), v = /* @__PURE__ */ u("$ZodStringFormat", (t, e) => {
2497
2521
  oe.init(t, e), ye.init(t, e);
2498
- }), ur = /* @__PURE__ */ u("$ZodGUID", (t, e) => {
2499
- e.pattern ?? (e.pattern = Nn), g.init(t, e);
2500
- }), hr = /* @__PURE__ */ u("$ZodUUID", (t, e) => {
2522
+ }), un = /* @__PURE__ */ u("$ZodGUID", (t, e) => {
2523
+ e.pattern ?? (e.pattern = Sr), v.init(t, e);
2524
+ }), pn = /* @__PURE__ */ u("$ZodUUID", (t, e) => {
2501
2525
  if (e.version) {
2502
- const r = {
2526
+ const n = {
2503
2527
  v1: 1,
2504
2528
  v2: 2,
2505
2529
  v3: 3,
@@ -2509,93 +2533,93 @@ const cr = {
2509
2533
  v7: 7,
2510
2534
  v8: 8
2511
2535
  }[e.version];
2512
- if (r === void 0)
2536
+ if (n === void 0)
2513
2537
  throw new Error(`Invalid UUID version: "${e.version}"`);
2514
- e.pattern ?? (e.pattern = ze(r));
2538
+ e.pattern ?? (e.pattern = ze(n));
2515
2539
  } else
2516
2540
  e.pattern ?? (e.pattern = ze());
2517
- g.init(t, e);
2518
- }), pr = /* @__PURE__ */ u("$ZodEmail", (t, e) => {
2519
- e.pattern ?? (e.pattern = An), g.init(t, e);
2520
- }), lr = /* @__PURE__ */ u("$ZodURL", (t, e) => {
2521
- g.init(t, e), t._zod.check = (n) => {
2541
+ v.init(t, e);
2542
+ }), hn = /* @__PURE__ */ u("$ZodEmail", (t, e) => {
2543
+ e.pattern ?? (e.pattern = Nr), v.init(t, e);
2544
+ }), ln = /* @__PURE__ */ u("$ZodURL", (t, e) => {
2545
+ v.init(t, e), t._zod.check = (r) => {
2522
2546
  try {
2523
- const r = n.value.trim(), i = new URL(r);
2524
- e.hostname && (e.hostname.lastIndex = 0, e.hostname.test(i.hostname) || n.issues.push({
2547
+ const n = r.value.trim(), i = new URL(n);
2548
+ e.hostname && (e.hostname.lastIndex = 0, e.hostname.test(i.hostname) || r.issues.push({
2525
2549
  code: "invalid_format",
2526
2550
  format: "url",
2527
2551
  note: "Invalid hostname",
2528
2552
  pattern: e.hostname.source,
2529
- input: n.value,
2553
+ input: r.value,
2530
2554
  inst: t,
2531
2555
  continue: !e.abort
2532
- })), e.protocol && (e.protocol.lastIndex = 0, e.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
2556
+ })), e.protocol && (e.protocol.lastIndex = 0, e.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || r.issues.push({
2533
2557
  code: "invalid_format",
2534
2558
  format: "url",
2535
2559
  note: "Invalid protocol",
2536
2560
  pattern: e.protocol.source,
2537
- input: n.value,
2561
+ input: r.value,
2538
2562
  inst: t,
2539
2563
  continue: !e.abort
2540
- })), e.normalize ? n.value = i.href : n.value = r;
2564
+ })), e.normalize ? r.value = i.href : r.value = n;
2541
2565
  return;
2542
2566
  } catch {
2543
- n.issues.push({
2567
+ r.issues.push({
2544
2568
  code: "invalid_format",
2545
2569
  format: "url",
2546
- input: n.value,
2570
+ input: r.value,
2547
2571
  inst: t,
2548
2572
  continue: !e.abort
2549
2573
  });
2550
2574
  }
2551
2575
  };
2552
- }), dr = /* @__PURE__ */ u("$ZodEmoji", (t, e) => {
2553
- e.pattern ?? (e.pattern = Cn()), g.init(t, e);
2554
- }), fr = /* @__PURE__ */ u("$ZodNanoID", (t, e) => {
2555
- e.pattern ?? (e.pattern = Pn), g.init(t, e);
2556
- }), mr = /* @__PURE__ */ u("$ZodCUID", (t, e) => {
2557
- e.pattern ?? (e.pattern = En), g.init(t, e);
2558
- }), gr = /* @__PURE__ */ u("$ZodCUID2", (t, e) => {
2559
- e.pattern ?? (e.pattern = In), g.init(t, e);
2560
- }), vr = /* @__PURE__ */ u("$ZodULID", (t, e) => {
2561
- e.pattern ?? (e.pattern = zn), g.init(t, e);
2562
- }), _r = /* @__PURE__ */ u("$ZodXID", (t, e) => {
2563
- e.pattern ?? (e.pattern = $n), g.init(t, e);
2564
- }), kr = /* @__PURE__ */ u("$ZodKSUID", (t, e) => {
2565
- e.pattern ?? (e.pattern = On), g.init(t, e);
2566
- }), yr = /* @__PURE__ */ u("$ZodISODateTime", (t, e) => {
2567
- e.pattern ?? (e.pattern = Gn(e)), g.init(t, e);
2568
- }), Tr = /* @__PURE__ */ u("$ZodISODate", (t, e) => {
2569
- e.pattern ?? (e.pattern = Mn), g.init(t, e);
2570
- }), wr = /* @__PURE__ */ u("$ZodISOTime", (t, e) => {
2571
- e.pattern ?? (e.pattern = Un(e)), g.init(t, e);
2572
- }), br = /* @__PURE__ */ u("$ZodISODuration", (t, e) => {
2573
- e.pattern ?? (e.pattern = Sn), g.init(t, e);
2574
- }), Er = /* @__PURE__ */ u("$ZodIPv4", (t, e) => {
2575
- e.pattern ?? (e.pattern = Rn), g.init(t, e), t._zod.bag.format = "ipv4";
2576
- }), Ir = /* @__PURE__ */ u("$ZodIPv6", (t, e) => {
2577
- e.pattern ?? (e.pattern = Ln), g.init(t, e), t._zod.bag.format = "ipv6", t._zod.check = (n) => {
2576
+ }), dn = /* @__PURE__ */ u("$ZodEmoji", (t, e) => {
2577
+ e.pattern ?? (e.pattern = Zr()), v.init(t, e);
2578
+ }), fn = /* @__PURE__ */ u("$ZodNanoID", (t, e) => {
2579
+ e.pattern ?? (e.pattern = Or), v.init(t, e);
2580
+ }), mn = /* @__PURE__ */ u("$ZodCUID", (t, e) => {
2581
+ e.pattern ?? (e.pattern = wr), v.init(t, e);
2582
+ }), gn = /* @__PURE__ */ u("$ZodCUID2", (t, e) => {
2583
+ e.pattern ?? (e.pattern = Ir), v.init(t, e);
2584
+ }), vn = /* @__PURE__ */ u("$ZodULID", (t, e) => {
2585
+ e.pattern ?? (e.pattern = Er), v.init(t, e);
2586
+ }), _n = /* @__PURE__ */ u("$ZodXID", (t, e) => {
2587
+ e.pattern ?? (e.pattern = zr), v.init(t, e);
2588
+ }), kn = /* @__PURE__ */ u("$ZodKSUID", (t, e) => {
2589
+ e.pattern ?? (e.pattern = $r), v.init(t, e);
2590
+ }), yn = /* @__PURE__ */ u("$ZodISODateTime", (t, e) => {
2591
+ e.pattern ?? (e.pattern = Ur(e)), v.init(t, e);
2592
+ }), Tn = /* @__PURE__ */ u("$ZodISODate", (t, e) => {
2593
+ e.pattern ?? (e.pattern = Mr), v.init(t, e);
2594
+ }), bn = /* @__PURE__ */ u("$ZodISOTime", (t, e) => {
2595
+ e.pattern ?? (e.pattern = jr(e)), v.init(t, e);
2596
+ }), wn = /* @__PURE__ */ u("$ZodISODuration", (t, e) => {
2597
+ e.pattern ?? (e.pattern = Pr), v.init(t, e);
2598
+ }), In = /* @__PURE__ */ u("$ZodIPv4", (t, e) => {
2599
+ e.pattern ?? (e.pattern = Cr), v.init(t, e), t._zod.bag.format = "ipv4";
2600
+ }), En = /* @__PURE__ */ u("$ZodIPv6", (t, e) => {
2601
+ e.pattern ?? (e.pattern = Rr), v.init(t, e), t._zod.bag.format = "ipv6", t._zod.check = (r) => {
2578
2602
  try {
2579
- new URL(`http://[${n.value}]`);
2603
+ new URL(`http://[${r.value}]`);
2580
2604
  } catch {
2581
- n.issues.push({
2605
+ r.issues.push({
2582
2606
  code: "invalid_format",
2583
2607
  format: "ipv6",
2584
- input: n.value,
2608
+ input: r.value,
2585
2609
  inst: t,
2586
2610
  continue: !e.abort
2587
2611
  });
2588
2612
  }
2589
2613
  };
2590
- }), zr = /* @__PURE__ */ u("$ZodCIDRv4", (t, e) => {
2591
- e.pattern ?? (e.pattern = xn), g.init(t, e);
2592
- }), $r = /* @__PURE__ */ u("$ZodCIDRv6", (t, e) => {
2593
- e.pattern ?? (e.pattern = Dn), g.init(t, e), t._zod.check = (n) => {
2594
- const r = n.value.split("/");
2614
+ }), zn = /* @__PURE__ */ u("$ZodCIDRv4", (t, e) => {
2615
+ e.pattern ?? (e.pattern = xr), v.init(t, e);
2616
+ }), $n = /* @__PURE__ */ u("$ZodCIDRv6", (t, e) => {
2617
+ e.pattern ?? (e.pattern = Lr), v.init(t, e), t._zod.check = (r) => {
2618
+ const n = r.value.split("/");
2595
2619
  try {
2596
- if (r.length !== 2)
2620
+ if (n.length !== 2)
2597
2621
  throw new Error();
2598
- const [i, s] = r;
2622
+ const [i, s] = n;
2599
2623
  if (!s)
2600
2624
  throw new Error();
2601
2625
  const o = Number(s);
@@ -2605,10 +2629,10 @@ const cr = {
2605
2629
  throw new Error();
2606
2630
  new URL(`http://[${i}]`);
2607
2631
  } catch {
2608
- n.issues.push({
2632
+ r.issues.push({
2609
2633
  code: "invalid_format",
2610
2634
  format: "cidrv6",
2611
- input: n.value,
2635
+ input: r.value,
2612
2636
  inst: t,
2613
2637
  continue: !e.abort
2614
2638
  });
@@ -2626,153 +2650,153 @@ function ft(t) {
2626
2650
  return !1;
2627
2651
  }
2628
2652
  }
2629
- const Or = /* @__PURE__ */ u("$ZodBase64", (t, e) => {
2630
- e.pattern ?? (e.pattern = Fn), g.init(t, e), t._zod.bag.contentEncoding = "base64", t._zod.check = (n) => {
2631
- ft(n.value) || n.issues.push({
2653
+ const On = /* @__PURE__ */ u("$ZodBase64", (t, e) => {
2654
+ e.pattern ?? (e.pattern = Dr), v.init(t, e), t._zod.bag.contentEncoding = "base64", t._zod.check = (r) => {
2655
+ ft(r.value) || r.issues.push({
2632
2656
  code: "invalid_format",
2633
2657
  format: "base64",
2634
- input: n.value,
2658
+ input: r.value,
2635
2659
  inst: t,
2636
2660
  continue: !e.abort
2637
2661
  });
2638
2662
  };
2639
2663
  });
2640
- function Pr(t) {
2664
+ function Pn(t) {
2641
2665
  if (!ct.test(t))
2642
2666
  return !1;
2643
- const e = t.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = e.padEnd(Math.ceil(e.length / 4) * 4, "=");
2644
- return ft(n);
2667
+ const e = t.replace(/[-_]/g, (n) => n === "-" ? "+" : "/"), r = e.padEnd(Math.ceil(e.length / 4) * 4, "=");
2668
+ return ft(r);
2645
2669
  }
2646
- const Sr = /* @__PURE__ */ u("$ZodBase64URL", (t, e) => {
2647
- e.pattern ?? (e.pattern = ct), g.init(t, e), t._zod.bag.contentEncoding = "base64url", t._zod.check = (n) => {
2648
- Pr(n.value) || n.issues.push({
2670
+ const Sn = /* @__PURE__ */ u("$ZodBase64URL", (t, e) => {
2671
+ e.pattern ?? (e.pattern = ct), v.init(t, e), t._zod.bag.contentEncoding = "base64url", t._zod.check = (r) => {
2672
+ Pn(r.value) || r.issues.push({
2649
2673
  code: "invalid_format",
2650
2674
  format: "base64url",
2651
- input: n.value,
2675
+ input: r.value,
2652
2676
  inst: t,
2653
2677
  continue: !e.abort
2654
2678
  });
2655
2679
  };
2656
- }), Nr = /* @__PURE__ */ u("$ZodE164", (t, e) => {
2657
- e.pattern ?? (e.pattern = jn), g.init(t, e);
2680
+ }), Nn = /* @__PURE__ */ u("$ZodE164", (t, e) => {
2681
+ e.pattern ?? (e.pattern = Fr), v.init(t, e);
2658
2682
  });
2659
- function Ar(t, e = null) {
2683
+ function An(t, e = null) {
2660
2684
  try {
2661
- const n = t.split(".");
2662
- if (n.length !== 3)
2685
+ const r = t.split(".");
2686
+ if (r.length !== 3)
2663
2687
  return !1;
2664
- const [r] = n;
2665
- if (!r)
2688
+ const [n] = r;
2689
+ if (!n)
2666
2690
  return !1;
2667
- const i = JSON.parse(atob(r));
2691
+ const i = JSON.parse(atob(n));
2668
2692
  return !("typ" in i && i?.typ !== "JWT" || !i.alg || e && (!("alg" in i) || i.alg !== e));
2669
2693
  } catch {
2670
2694
  return !1;
2671
2695
  }
2672
2696
  }
2673
- const Zr = /* @__PURE__ */ u("$ZodJWT", (t, e) => {
2674
- g.init(t, e), t._zod.check = (n) => {
2675
- Ar(n.value, e.alg) || n.issues.push({
2697
+ const Zn = /* @__PURE__ */ u("$ZodJWT", (t, e) => {
2698
+ v.init(t, e), t._zod.check = (r) => {
2699
+ An(r.value, e.alg) || r.issues.push({
2676
2700
  code: "invalid_format",
2677
2701
  format: "jwt",
2678
- input: n.value,
2702
+ input: r.value,
2679
2703
  inst: t,
2680
2704
  continue: !e.abort
2681
2705
  });
2682
2706
  };
2683
2707
  }), mt = /* @__PURE__ */ u("$ZodNumber", (t, e) => {
2684
- k.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? Jn, t._zod.parse = (n, r) => {
2708
+ k.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? Br, t._zod.parse = (r, n) => {
2685
2709
  if (e.coerce)
2686
2710
  try {
2687
- n.value = Number(n.value);
2711
+ r.value = Number(r.value);
2688
2712
  } catch {
2689
2713
  }
2690
- const i = n.value;
2714
+ const i = r.value;
2691
2715
  if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
2692
- return n;
2716
+ return r;
2693
2717
  const s = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
2694
- return n.issues.push({
2718
+ return r.issues.push({
2695
2719
  expected: "number",
2696
2720
  code: "invalid_type",
2697
2721
  input: i,
2698
2722
  inst: t,
2699
2723
  ...s ? { received: s } : {}
2700
- }), n;
2724
+ }), r;
2701
2725
  };
2702
- }), Cr = /* @__PURE__ */ u("$ZodNumberFormat", (t, e) => {
2703
- qn.init(t, e), mt.init(t, e);
2704
- }), Rr = /* @__PURE__ */ u("$ZodUnknown", (t, e) => {
2705
- k.init(t, e), t._zod.parse = (n) => n;
2706
- }), Lr = /* @__PURE__ */ u("$ZodNever", (t, e) => {
2707
- k.init(t, e), t._zod.parse = (n, r) => (n.issues.push({
2726
+ }), Cn = /* @__PURE__ */ u("$ZodNumberFormat", (t, e) => {
2727
+ Yr.init(t, e), mt.init(t, e);
2728
+ }), Rn = /* @__PURE__ */ u("$ZodUnknown", (t, e) => {
2729
+ k.init(t, e), t._zod.parse = (r) => r;
2730
+ }), xn = /* @__PURE__ */ u("$ZodNever", (t, e) => {
2731
+ k.init(t, e), t._zod.parse = (r, n) => (r.issues.push({
2708
2732
  expected: "never",
2709
2733
  code: "invalid_type",
2710
- input: n.value,
2734
+ input: r.value,
2711
2735
  inst: t
2712
- }), n);
2736
+ }), r);
2713
2737
  });
2714
- function $e(t, e, n) {
2715
- t.issues.length && e.issues.push(...it(n, t.issues)), e.value[n] = t.value;
2738
+ function $e(t, e, r) {
2739
+ t.issues.length && e.issues.push(...it(r, t.issues)), e.value[r] = t.value;
2716
2740
  }
2717
- const xr = /* @__PURE__ */ u("$ZodArray", (t, e) => {
2718
- k.init(t, e), t._zod.parse = (n, r) => {
2719
- const i = n.value;
2741
+ const Ln = /* @__PURE__ */ u("$ZodArray", (t, e) => {
2742
+ k.init(t, e), t._zod.parse = (r, n) => {
2743
+ const i = r.value;
2720
2744
  if (!Array.isArray(i))
2721
- return n.issues.push({
2745
+ return r.issues.push({
2722
2746
  expected: "array",
2723
2747
  code: "invalid_type",
2724
2748
  input: i,
2725
2749
  inst: t
2726
- }), n;
2727
- n.value = Array(i.length);
2750
+ }), r;
2751
+ r.value = Array(i.length);
2728
2752
  const s = [];
2729
2753
  for (let o = 0; o < i.length; o++) {
2730
2754
  const a = i[o], c = e.element._zod.run({
2731
2755
  value: a,
2732
2756
  issues: []
2733
- }, r);
2734
- c instanceof Promise ? s.push(c.then((h) => $e(h, n, o))) : $e(c, n, o);
2757
+ }, n);
2758
+ c instanceof Promise ? s.push(c.then((p) => $e(p, r, o))) : $e(c, r, o);
2735
2759
  }
2736
- return s.length ? Promise.all(s).then(() => n) : n;
2760
+ return s.length ? Promise.all(s).then(() => r) : r;
2737
2761
  };
2738
2762
  });
2739
- function H(t, e, n, r) {
2740
- 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;
2763
+ function H(t, e, r, n) {
2764
+ t.issues.length && e.issues.push(...it(r, t.issues)), t.value === void 0 ? r in n && (e.value[r] = void 0) : e.value[r] = t.value;
2741
2765
  }
2742
2766
  function gt(t) {
2743
2767
  const e = Object.keys(t.shape);
2744
- for (const r of e)
2745
- if (!t.shape?.[r]?._zod?.traits?.has("$ZodType"))
2746
- throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
2747
- const n = nn(t.shape);
2768
+ for (const n of e)
2769
+ if (!t.shape?.[n]?._zod?.traits?.has("$ZodType"))
2770
+ throw new Error(`Invalid element at key "${n}": expected a Zod schema`);
2771
+ const r = rr(t.shape);
2748
2772
  return {
2749
2773
  ...t,
2750
2774
  keys: e,
2751
2775
  keySet: new Set(e),
2752
2776
  numKeys: e.length,
2753
- optionalKeys: new Set(n)
2777
+ optionalKeys: new Set(r)
2754
2778
  };
2755
2779
  }
2756
- function vt(t, e, n, r, i, s) {
2757
- const o = [], a = i.keySet, c = i.catchall._zod, h = c.def.type;
2758
- for (const p in e) {
2759
- if (a.has(p))
2780
+ function vt(t, e, r, n, i, s) {
2781
+ const o = [], a = i.keySet, c = i.catchall._zod, p = c.def.type;
2782
+ for (const h in e) {
2783
+ if (a.has(h))
2760
2784
  continue;
2761
- if (h === "never") {
2762
- o.push(p);
2785
+ if (p === "never") {
2786
+ o.push(h);
2763
2787
  continue;
2764
2788
  }
2765
- const d = c.run({ value: e[p], issues: [] }, r);
2766
- d instanceof Promise ? t.push(d.then((f) => H(f, n, p, e))) : H(d, n, p, e);
2789
+ const d = c.run({ value: e[h], issues: [] }, n);
2790
+ d instanceof Promise ? t.push(d.then((f) => H(f, r, h, e))) : H(d, r, h, e);
2767
2791
  }
2768
- return o.length && n.issues.push({
2792
+ return o.length && r.issues.push({
2769
2793
  code: "unrecognized_keys",
2770
2794
  keys: o,
2771
2795
  input: e,
2772
2796
  inst: s
2773
- }), t.length ? Promise.all(t).then(() => n) : n;
2797
+ }), t.length ? Promise.all(t).then(() => r) : r;
2774
2798
  }
2775
- const Dr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2799
+ const Dn = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2776
2800
  if (k.init(t, e), !Object.getOwnPropertyDescriptor(e, "shape")?.get) {
2777
2801
  const a = e.shape;
2778
2802
  Object.defineProperty(e, "shape", {
@@ -2784,15 +2808,15 @@ const Dr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2784
2808
  }
2785
2809
  });
2786
2810
  }
2787
- const r = re(() => gt(e));
2811
+ const n = ne(() => gt(e));
2788
2812
  m(t._zod, "propValues", () => {
2789
2813
  const a = e.shape, c = {};
2790
- for (const h in a) {
2791
- const p = a[h]._zod;
2792
- if (p.values) {
2793
- c[h] ?? (c[h] = /* @__PURE__ */ new Set());
2794
- for (const d of p.values)
2795
- c[h].add(d);
2814
+ for (const p in a) {
2815
+ const h = a[p]._zod;
2816
+ if (h.values) {
2817
+ c[p] ?? (c[p] = /* @__PURE__ */ new Set());
2818
+ for (const d of h.values)
2819
+ c[p].add(d);
2796
2820
  }
2797
2821
  }
2798
2822
  return c;
@@ -2800,39 +2824,39 @@ const Dr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2800
2824
  const i = B, s = e.catchall;
2801
2825
  let o;
2802
2826
  t._zod.parse = (a, c) => {
2803
- o ?? (o = r.value);
2804
- const h = a.value;
2805
- if (!i(h))
2827
+ o ?? (o = n.value);
2828
+ const p = a.value;
2829
+ if (!i(p))
2806
2830
  return a.issues.push({
2807
2831
  expected: "object",
2808
2832
  code: "invalid_type",
2809
- input: h,
2833
+ input: p,
2810
2834
  inst: t
2811
2835
  }), a;
2812
2836
  a.value = {};
2813
- const p = [], d = o.shape;
2837
+ const h = [], d = o.shape;
2814
2838
  for (const f of o.keys) {
2815
- const E = d[f]._zod.run({ value: h[f], issues: [] }, c);
2816
- E instanceof Promise ? p.push(E.then((ce) => H(ce, a, f, h))) : H(E, a, f, h);
2839
+ const I = d[f]._zod.run({ value: p[f], issues: [] }, c);
2840
+ I instanceof Promise ? h.push(I.then((ce) => H(ce, a, f, p))) : H(I, a, f, p);
2817
2841
  }
2818
- return s ? vt(p, h, a, c, r.value, t) : p.length ? Promise.all(p).then(() => a) : a;
2842
+ return s ? vt(h, p, a, c, n.value, t) : h.length ? Promise.all(h).then(() => a) : a;
2819
2843
  };
2820
- }), Fr = /* @__PURE__ */ u("$ZodObjectJIT", (t, e) => {
2821
- Dr.init(t, e);
2822
- const n = t._zod.parse, r = re(() => gt(e)), i = (f) => {
2823
- const v = new ar(["shape", "payload", "ctx"]), E = r.value, ce = (P) => {
2824
- const O = Ie(P);
2844
+ }), Fn = /* @__PURE__ */ u("$ZodObjectJIT", (t, e) => {
2845
+ Dn.init(t, e);
2846
+ const r = t._zod.parse, n = ne(() => gt(e)), i = (f) => {
2847
+ const g = new an(["shape", "payload", "ctx"]), I = n.value, ce = (P) => {
2848
+ const O = Ee(P);
2825
2849
  return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
2826
2850
  };
2827
- v.write("const input = payload.value;");
2828
- const we = /* @__PURE__ */ Object.create(null);
2851
+ g.write("const input = payload.value;");
2852
+ const be = /* @__PURE__ */ Object.create(null);
2829
2853
  let St = 0;
2830
- for (const P of E.keys)
2831
- we[P] = `key_${St++}`;
2832
- v.write("const newResult = {};");
2833
- for (const P of E.keys) {
2834
- const O = we[P], G = Ie(P);
2835
- v.write(`const ${O} = ${ce(P)};`), v.write(`
2854
+ for (const P of I.keys)
2855
+ be[P] = `key_${St++}`;
2856
+ g.write("const newResult = {};");
2857
+ for (const P of I.keys) {
2858
+ const O = be[P], G = Ee(P);
2859
+ g.write(`const ${O} = ${ce(P)};`), g.write(`
2836
2860
  if (${O}.issues.length) {
2837
2861
  payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
2838
2862
  ...iss,
@@ -2851,25 +2875,25 @@ const Dr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2851
2875
 
2852
2876
  `);
2853
2877
  }
2854
- v.write("payload.value = newResult;"), v.write("return payload;");
2855
- const Nt = v.compile();
2878
+ g.write("payload.value = newResult;"), g.write("return payload;");
2879
+ const Nt = g.compile();
2856
2880
  return (P, O) => Nt(f, P, O);
2857
2881
  };
2858
2882
  let s;
2859
- const o = B, a = !et.jitless, h = a && en.value, p = e.catchall;
2883
+ const o = B, a = !et.jitless, p = a && er.value, h = e.catchall;
2860
2884
  let d;
2861
- t._zod.parse = (f, v) => {
2862
- d ?? (d = r.value);
2863
- const E = f.value;
2864
- return o(E) ? a && h && v?.async === !1 && v.jitless !== !0 ? (s || (s = i(e.shape)), f = s(f, v), p ? vt([], E, f, v, d, t) : f) : n(f, v) : (f.issues.push({
2885
+ t._zod.parse = (f, g) => {
2886
+ d ?? (d = n.value);
2887
+ const I = f.value;
2888
+ return o(I) ? a && p && g?.async === !1 && g.jitless !== !0 ? (s || (s = i(e.shape)), f = s(f, g), h ? vt([], I, f, g, d, t) : f) : r(f, g) : (f.issues.push({
2865
2889
  expected: "object",
2866
2890
  code: "invalid_type",
2867
- input: E,
2891
+ input: I,
2868
2892
  inst: t
2869
2893
  }), f);
2870
2894
  };
2871
2895
  });
2872
- function Oe(t, e, n, r) {
2896
+ function Oe(t, e, r, n) {
2873
2897
  for (const s of t)
2874
2898
  if (s.issues.length === 0)
2875
2899
  return e.value = s.value, e;
@@ -2877,8 +2901,8 @@ function Oe(t, e, n, r) {
2877
2901
  return i.length === 1 ? (e.value = i[0].value, i[0]) : (e.issues.push({
2878
2902
  code: "invalid_union",
2879
2903
  input: e.value,
2880
- inst: n,
2881
- errors: t.map((s) => s.issues.map((o) => R(o, r, C())))
2904
+ inst: r,
2905
+ errors: t.map((s) => s.issues.map((o) => R(o, n, C())))
2882
2906
  }), e);
2883
2907
  }
2884
2908
  const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
@@ -2891,30 +2915,30 @@ const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
2891
2915
  return new RegExp(`^(${i.map((s) => ge(s.source)).join("|")})$`);
2892
2916
  }
2893
2917
  });
2894
- const n = e.options.length === 1, r = e.options[0]._zod.run;
2918
+ const r = e.options.length === 1, n = e.options[0]._zod.run;
2895
2919
  t._zod.parse = (i, s) => {
2896
- if (n)
2897
- return r(i, s);
2920
+ if (r)
2921
+ return n(i, s);
2898
2922
  let o = !1;
2899
2923
  const a = [];
2900
2924
  for (const c of e.options) {
2901
- const h = c._zod.run({
2925
+ const p = c._zod.run({
2902
2926
  value: i.value,
2903
2927
  issues: []
2904
2928
  }, s);
2905
- if (h instanceof Promise)
2906
- a.push(h), o = !0;
2929
+ if (p instanceof Promise)
2930
+ a.push(p), o = !0;
2907
2931
  else {
2908
- if (h.issues.length === 0)
2909
- return h;
2910
- a.push(h);
2932
+ if (p.issues.length === 0)
2933
+ return p;
2934
+ a.push(p);
2911
2935
  }
2912
2936
  }
2913
2937
  return o ? Promise.all(a).then((c) => Oe(c, i, t, s)) : Oe(a, i, t, s);
2914
2938
  };
2915
- }), jr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (t, e) => {
2939
+ }), Mn = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (t, e) => {
2916
2940
  e.inclusive = !1, _t.init(t, e);
2917
- const n = t._zod.parse;
2941
+ const r = t._zod.parse;
2918
2942
  m(t._zod, "propValues", () => {
2919
2943
  const i = {};
2920
2944
  for (const s of e.options) {
@@ -2923,13 +2947,13 @@ const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
2923
2947
  throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);
2924
2948
  for (const [a, c] of Object.entries(o)) {
2925
2949
  i[a] || (i[a] = /* @__PURE__ */ new Set());
2926
- for (const h of c)
2927
- i[a].add(h);
2950
+ for (const p of c)
2951
+ i[a].add(p);
2928
2952
  }
2929
2953
  }
2930
2954
  return i;
2931
2955
  });
2932
- const r = re(() => {
2956
+ const n = ne(() => {
2933
2957
  const i = e.options, s = /* @__PURE__ */ new Map();
2934
2958
  for (const o of i) {
2935
2959
  const a = o._zod.propValues?.[e.discriminator];
@@ -2952,8 +2976,8 @@ const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
2952
2976
  input: o,
2953
2977
  inst: t
2954
2978
  }), i;
2955
- const a = r.value.get(o?.[e.discriminator]);
2956
- return a ? a._zod.run(i, s) : e.unionFallback ? n(i, s) : (i.issues.push({
2979
+ const a = n.value.get(o?.[e.discriminator]);
2980
+ return a ? a._zod.run(i, s) : e.unionFallback ? r(i, s) : (i.issues.push({
2957
2981
  code: "invalid_union",
2958
2982
  errors: [],
2959
2983
  note: "No matching discriminator",
@@ -2963,10 +2987,10 @@ const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
2963
2987
  inst: t
2964
2988
  }), i);
2965
2989
  };
2966
- }), Mr = /* @__PURE__ */ u("$ZodIntersection", (t, e) => {
2967
- k.init(t, e), t._zod.parse = (n, r) => {
2968
- const i = n.value, s = e.left._zod.run({ value: i, issues: [] }, r), o = e.right._zod.run({ value: i, issues: [] }, r);
2969
- return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([c, h]) => Pe(n, c, h)) : Pe(n, s, o);
2990
+ }), jn = /* @__PURE__ */ u("$ZodIntersection", (t, e) => {
2991
+ k.init(t, e), t._zod.parse = (r, n) => {
2992
+ const i = r.value, s = e.left._zod.run({ value: i, issues: [] }, n), o = e.right._zod.run({ value: i, issues: [] }, n);
2993
+ return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([c, p]) => Pe(r, c, p)) : Pe(r, s, o);
2970
2994
  };
2971
2995
  });
2972
2996
  function de(t, e) {
@@ -2975,8 +2999,8 @@ function de(t, e) {
2975
2999
  if (t instanceof Date && e instanceof Date && +t == +e)
2976
3000
  return { valid: !0, data: t };
2977
3001
  if (J(t) && J(e)) {
2978
- const n = Object.keys(e), r = Object.keys(t).filter((s) => n.indexOf(s) !== -1), i = { ...t, ...e };
2979
- for (const s of r) {
3002
+ const r = Object.keys(e), n = Object.keys(t).filter((s) => r.indexOf(s) !== -1), i = { ...t, ...e };
3003
+ for (const s of n) {
2980
3004
  const o = de(t[s], e[s]);
2981
3005
  if (!o.valid)
2982
3006
  return {
@@ -2990,105 +3014,105 @@ function de(t, e) {
2990
3014
  if (Array.isArray(t) && Array.isArray(e)) {
2991
3015
  if (t.length !== e.length)
2992
3016
  return { valid: !1, mergeErrorPath: [] };
2993
- const n = [];
2994
- for (let r = 0; r < t.length; r++) {
2995
- const i = t[r], s = e[r], o = de(i, s);
3017
+ const r = [];
3018
+ for (let n = 0; n < t.length; n++) {
3019
+ const i = t[n], s = e[n], o = de(i, s);
2996
3020
  if (!o.valid)
2997
3021
  return {
2998
3022
  valid: !1,
2999
- mergeErrorPath: [r, ...o.mergeErrorPath]
3023
+ mergeErrorPath: [n, ...o.mergeErrorPath]
3000
3024
  };
3001
- n.push(o.data);
3025
+ r.push(o.data);
3002
3026
  }
3003
- return { valid: !0, data: n };
3027
+ return { valid: !0, data: r };
3004
3028
  }
3005
3029
  return { valid: !1, mergeErrorPath: [] };
3006
3030
  }
3007
- function Pe(t, e, n) {
3008
- if (e.issues.length && t.issues.push(...e.issues), n.issues.length && t.issues.push(...n.issues), F(t))
3031
+ function Pe(t, e, r) {
3032
+ if (e.issues.length && t.issues.push(...e.issues), r.issues.length && t.issues.push(...r.issues), F(t))
3009
3033
  return t;
3010
- const r = de(e.value, n.value);
3011
- if (!r.valid)
3012
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
3013
- return t.value = r.data, t;
3034
+ const n = de(e.value, r.value);
3035
+ if (!n.valid)
3036
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);
3037
+ return t.value = n.data, t;
3014
3038
  }
3015
- const Ur = /* @__PURE__ */ u("$ZodEnum", (t, e) => {
3039
+ const Un = /* @__PURE__ */ u("$ZodEnum", (t, e) => {
3016
3040
  k.init(t, e);
3017
- const n = tt(e.entries), r = new Set(n);
3018
- 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) => {
3041
+ const r = tt(e.entries), n = new Set(r);
3042
+ t._zod.values = n, t._zod.pattern = new RegExp(`^(${r.filter((i) => tr.has(typeof i)).map((i) => typeof i == "string" ? j(i) : i.toString()).join("|")})$`), t._zod.parse = (i, s) => {
3019
3043
  const o = i.value;
3020
- return r.has(o) || i.issues.push({
3044
+ return n.has(o) || i.issues.push({
3021
3045
  code: "invalid_value",
3022
- values: n,
3046
+ values: r,
3023
3047
  input: o,
3024
3048
  inst: t
3025
3049
  }), i;
3026
3050
  };
3027
- }), Gr = /* @__PURE__ */ u("$ZodLiteral", (t, e) => {
3051
+ }), Gn = /* @__PURE__ */ u("$ZodLiteral", (t, e) => {
3028
3052
  if (k.init(t, e), e.values.length === 0)
3029
3053
  throw new Error("Cannot create literal schema with no valid values");
3030
- const n = new Set(e.values);
3031
- 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) => {
3032
- const s = r.value;
3033
- return n.has(s) || r.issues.push({
3054
+ const r = new Set(e.values);
3055
+ t._zod.values = r, t._zod.pattern = new RegExp(`^(${e.values.map((n) => typeof n == "string" ? j(n) : n ? j(n.toString()) : String(n)).join("|")})$`), t._zod.parse = (n, i) => {
3056
+ const s = n.value;
3057
+ return r.has(s) || n.issues.push({
3034
3058
  code: "invalid_value",
3035
3059
  values: e.values,
3036
3060
  input: s,
3037
3061
  inst: t
3038
- }), r;
3062
+ }), n;
3039
3063
  };
3040
- }), Vr = /* @__PURE__ */ u("$ZodTransform", (t, e) => {
3041
- k.init(t, e), t._zod.parse = (n, r) => {
3042
- if (r.direction === "backward")
3064
+ }), Vn = /* @__PURE__ */ u("$ZodTransform", (t, e) => {
3065
+ k.init(t, e), t._zod.parse = (r, n) => {
3066
+ if (n.direction === "backward")
3043
3067
  throw new He(t.constructor.name);
3044
- const i = e.transform(n.value, n);
3045
- if (r.async)
3046
- return (i instanceof Promise ? i : Promise.resolve(i)).then((o) => (n.value = o, n));
3068
+ const i = e.transform(r.value, r);
3069
+ if (n.async)
3070
+ return (i instanceof Promise ? i : Promise.resolve(i)).then((o) => (r.value = o, r));
3047
3071
  if (i instanceof Promise)
3048
- throw new j();
3049
- return n.value = i, n;
3072
+ throw new M();
3073
+ return r.value = i, r;
3050
3074
  };
3051
3075
  });
3052
3076
  function Se(t, e) {
3053
3077
  return t.issues.length && e === void 0 ? { issues: [], value: void 0 } : t;
3054
3078
  }
3055
- const Br = /* @__PURE__ */ u("$ZodOptional", (t, e) => {
3079
+ const Bn = /* @__PURE__ */ u("$ZodOptional", (t, e) => {
3056
3080
  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", () => {
3057
- const n = e.innerType._zod.pattern;
3058
- return n ? new RegExp(`^(${ge(n.source)})?$`) : void 0;
3059
- }), t._zod.parse = (n, r) => {
3081
+ const r = e.innerType._zod.pattern;
3082
+ return r ? new RegExp(`^(${ge(r.source)})?$`) : void 0;
3083
+ }), t._zod.parse = (r, n) => {
3060
3084
  if (e.innerType._zod.optin === "optional") {
3061
- const i = e.innerType._zod.run(n, r);
3062
- return i instanceof Promise ? i.then((s) => Se(s, n.value)) : Se(i, n.value);
3085
+ const i = e.innerType._zod.run(r, n);
3086
+ return i instanceof Promise ? i.then((s) => Se(s, r.value)) : Se(i, r.value);
3063
3087
  }
3064
- return n.value === void 0 ? n : e.innerType._zod.run(n, r);
3088
+ return r.value === void 0 ? r : e.innerType._zod.run(r, n);
3065
3089
  };
3066
- }), Jr = /* @__PURE__ */ u("$ZodNullable", (t, e) => {
3090
+ }), Jn = /* @__PURE__ */ u("$ZodNullable", (t, e) => {
3067
3091
  k.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "pattern", () => {
3068
- const n = e.innerType._zod.pattern;
3069
- return n ? new RegExp(`^(${ge(n.source)}|null)$`) : void 0;
3070
- }), 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);
3071
- }), Wr = /* @__PURE__ */ u("$ZodDefault", (t, e) => {
3072
- k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
3073
- if (r.direction === "backward")
3074
- return e.innerType._zod.run(n, r);
3075
- if (n.value === void 0)
3076
- return n.value = e.defaultValue, n;
3077
- const i = e.innerType._zod.run(n, r);
3092
+ const r = e.innerType._zod.pattern;
3093
+ return r ? new RegExp(`^(${ge(r.source)}|null)$`) : void 0;
3094
+ }), m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (r, n) => r.value === null ? r : e.innerType._zod.run(r, n);
3095
+ }), Wn = /* @__PURE__ */ u("$ZodDefault", (t, e) => {
3096
+ k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (r, n) => {
3097
+ if (n.direction === "backward")
3098
+ return e.innerType._zod.run(r, n);
3099
+ if (r.value === void 0)
3100
+ return r.value = e.defaultValue, r;
3101
+ const i = e.innerType._zod.run(r, n);
3078
3102
  return i instanceof Promise ? i.then((s) => Ne(s, e)) : Ne(i, e);
3079
3103
  };
3080
3104
  });
3081
3105
  function Ne(t, e) {
3082
3106
  return t.value === void 0 && (t.value = e.defaultValue), t;
3083
3107
  }
3084
- const Kr = /* @__PURE__ */ u("$ZodPrefault", (t, e) => {
3085
- 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));
3086
- }), Yr = /* @__PURE__ */ u("$ZodNonOptional", (t, e) => {
3108
+ const Kn = /* @__PURE__ */ u("$ZodPrefault", (t, e) => {
3109
+ k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (r, n) => (n.direction === "backward" || r.value === void 0 && (r.value = e.defaultValue), e.innerType._zod.run(r, n));
3110
+ }), Yn = /* @__PURE__ */ u("$ZodNonOptional", (t, e) => {
3087
3111
  k.init(t, e), m(t._zod, "values", () => {
3088
- const n = e.innerType._zod.values;
3089
- return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
3090
- }), t._zod.parse = (n, r) => {
3091
- const i = e.innerType._zod.run(n, r);
3112
+ const r = e.innerType._zod.values;
3113
+ return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
3114
+ }), t._zod.parse = (r, n) => {
3115
+ const i = e.innerType._zod.run(r, n);
3092
3116
  return i instanceof Promise ? i.then((s) => Ae(s, t)) : Ae(i, t);
3093
3117
  };
3094
3118
  });
@@ -3100,70 +3124,70 @@ function Ae(t, e) {
3100
3124
  inst: e
3101
3125
  }), t;
3102
3126
  }
3103
- const qr = /* @__PURE__ */ u("$ZodCatch", (t, e) => {
3104
- 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) => {
3105
- if (r.direction === "backward")
3106
- return e.innerType._zod.run(n, r);
3107
- const i = e.innerType._zod.run(n, r);
3108
- return i instanceof Promise ? i.then((s) => (n.value = s.value, s.issues.length && (n.value = e.catchValue({
3109
- ...n,
3127
+ const qn = /* @__PURE__ */ u("$ZodCatch", (t, e) => {
3128
+ 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 = (r, n) => {
3129
+ if (n.direction === "backward")
3130
+ return e.innerType._zod.run(r, n);
3131
+ const i = e.innerType._zod.run(r, n);
3132
+ return i instanceof Promise ? i.then((s) => (r.value = s.value, s.issues.length && (r.value = e.catchValue({
3133
+ ...r,
3110
3134
  error: {
3111
- issues: s.issues.map((o) => R(o, r, C()))
3135
+ issues: s.issues.map((o) => R(o, n, C()))
3112
3136
  },
3113
- input: n.value
3114
- }), n.issues = []), n)) : (n.value = i.value, i.issues.length && (n.value = e.catchValue({
3115
- ...n,
3137
+ input: r.value
3138
+ }), r.issues = []), r)) : (r.value = i.value, i.issues.length && (r.value = e.catchValue({
3139
+ ...r,
3116
3140
  error: {
3117
- issues: i.issues.map((s) => R(s, r, C()))
3141
+ issues: i.issues.map((s) => R(s, n, C()))
3118
3142
  },
3119
- input: n.value
3120
- }), n.issues = []), n);
3143
+ input: r.value
3144
+ }), r.issues = []), r);
3121
3145
  };
3122
- }), Xr = /* @__PURE__ */ u("$ZodPipe", (t, e) => {
3123
- 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) => {
3124
- if (r.direction === "backward") {
3125
- const s = e.out._zod.run(n, r);
3126
- return s instanceof Promise ? s.then((o) => q(o, e.in, r)) : q(s, e.in, r);
3146
+ }), Xn = /* @__PURE__ */ u("$ZodPipe", (t, e) => {
3147
+ 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 = (r, n) => {
3148
+ if (n.direction === "backward") {
3149
+ const s = e.out._zod.run(r, n);
3150
+ return s instanceof Promise ? s.then((o) => q(o, e.in, n)) : q(s, e.in, n);
3127
3151
  }
3128
- const i = e.in._zod.run(n, r);
3129
- return i instanceof Promise ? i.then((s) => q(s, e.out, r)) : q(i, e.out, r);
3152
+ const i = e.in._zod.run(r, n);
3153
+ return i instanceof Promise ? i.then((s) => q(s, e.out, n)) : q(i, e.out, n);
3130
3154
  };
3131
3155
  });
3132
- function q(t, e, n) {
3133
- return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, n);
3134
- }
3135
- const Qr = /* @__PURE__ */ u("$ZodReadonly", (t, e) => {
3136
- 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) => {
3137
- if (r.direction === "backward")
3138
- return e.innerType._zod.run(n, r);
3139
- const i = e.innerType._zod.run(n, r);
3156
+ function q(t, e, r) {
3157
+ return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, r);
3158
+ }
3159
+ const Qn = /* @__PURE__ */ u("$ZodReadonly", (t, e) => {
3160
+ 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 = (r, n) => {
3161
+ if (n.direction === "backward")
3162
+ return e.innerType._zod.run(r, n);
3163
+ const i = e.innerType._zod.run(r, n);
3140
3164
  return i instanceof Promise ? i.then(Ze) : Ze(i);
3141
3165
  };
3142
3166
  });
3143
3167
  function Ze(t) {
3144
3168
  return t.value = Object.freeze(t.value), t;
3145
3169
  }
3146
- const Hr = /* @__PURE__ */ u("$ZodCustom", (t, e) => {
3147
- b.init(t, e), k.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
3148
- const r = n.value, i = e.fn(r);
3170
+ const Hn = /* @__PURE__ */ u("$ZodCustom", (t, e) => {
3171
+ w.init(t, e), k.init(t, e), t._zod.parse = (r, n) => r, t._zod.check = (r) => {
3172
+ const n = r.value, i = e.fn(n);
3149
3173
  if (i instanceof Promise)
3150
- return i.then((s) => Ce(s, n, r, t));
3151
- Ce(i, n, r, t);
3174
+ return i.then((s) => Ce(s, r, n, t));
3175
+ Ce(i, r, n, t);
3152
3176
  };
3153
3177
  });
3154
- function Ce(t, e, n, r) {
3178
+ function Ce(t, e, r, n) {
3155
3179
  if (!t) {
3156
3180
  const i = {
3157
3181
  code: "custom",
3158
- input: n,
3159
- inst: r,
3182
+ input: r,
3183
+ inst: n,
3160
3184
  // incorporates params.error into issue reporting
3161
- path: [...r._zod.def.path ?? []],
3185
+ path: [...n._zod.def.path ?? []],
3162
3186
  // incorporates params.error into issue reporting
3163
- continue: !r._zod.def.abort
3187
+ continue: !n._zod.def.abort
3164
3188
  // params: inst._zod.def.params,
3165
3189
  };
3166
- r._zod.def.params && (i.params = r._zod.def.params), e.issues.push(W(i));
3190
+ n._zod.def.params && (i.params = n._zod.def.params), e.issues.push(W(i));
3167
3191
  }
3168
3192
  }
3169
3193
  var Re;
@@ -3171,12 +3195,12 @@ class ei {
3171
3195
  constructor() {
3172
3196
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
3173
3197
  }
3174
- add(e, ...n) {
3175
- const r = n[0];
3176
- if (this._map.set(e, r), r && typeof r == "object" && "id" in r) {
3177
- if (this._idmap.has(r.id))
3178
- throw new Error(`ID ${r.id} already exists in the registry`);
3179
- this._idmap.set(r.id, e);
3198
+ add(e, ...r) {
3199
+ const n = r[0];
3200
+ if (this._map.set(e, n), n && typeof n == "object" && "id" in n) {
3201
+ if (this._idmap.has(n.id))
3202
+ throw new Error(`ID ${n.id} already exists in the registry`);
3203
+ this._idmap.set(n.id, e);
3180
3204
  }
3181
3205
  return this;
3182
3206
  }
@@ -3184,15 +3208,15 @@ class ei {
3184
3208
  return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
3185
3209
  }
3186
3210
  remove(e) {
3187
- const n = this._map.get(e);
3188
- return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(e), this;
3211
+ const r = this._map.get(e);
3212
+ return r && typeof r == "object" && "id" in r && this._idmap.delete(r.id), this._map.delete(e), this;
3189
3213
  }
3190
3214
  get(e) {
3191
- const n = e._zod.parent;
3192
- if (n) {
3193
- const r = { ...this.get(n) ?? {} };
3194
- delete r.id;
3195
- const i = { ...r, ...this._map.get(e) };
3215
+ const r = e._zod.parent;
3216
+ if (r) {
3217
+ const n = { ...this.get(r) ?? {} };
3218
+ delete n.id;
3219
+ const i = { ...n, ...this._map.get(e) };
3196
3220
  return Object.keys(i).length ? i : void 0;
3197
3221
  }
3198
3222
  return this._map.get(e);
@@ -3206,13 +3230,13 @@ function ti() {
3206
3230
  }
3207
3231
  (Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = ti());
3208
3232
  const V = globalThis.__zod_globalRegistry;
3209
- function ni(t, e) {
3233
+ function ri(t, e) {
3210
3234
  return new t({
3211
3235
  type: "string",
3212
3236
  ...l(e)
3213
3237
  });
3214
3238
  }
3215
- function ri(t, e) {
3239
+ function ni(t, e) {
3216
3240
  return new t({
3217
3241
  type: "string",
3218
3242
  format: "email",
@@ -3221,7 +3245,7 @@ function ri(t, e) {
3221
3245
  ...l(e)
3222
3246
  });
3223
3247
  }
3224
- function Le(t, e) {
3248
+ function xe(t, e) {
3225
3249
  return new t({
3226
3250
  type: "string",
3227
3251
  format: "guid",
@@ -3287,7 +3311,7 @@ function ui(t, e) {
3287
3311
  ...l(e)
3288
3312
  });
3289
3313
  }
3290
- function hi(t, e) {
3314
+ function pi(t, e) {
3291
3315
  return new t({
3292
3316
  type: "string",
3293
3317
  format: "nanoid",
@@ -3296,7 +3320,7 @@ function hi(t, e) {
3296
3320
  ...l(e)
3297
3321
  });
3298
3322
  }
3299
- function pi(t, e) {
3323
+ function hi(t, e) {
3300
3324
  return new t({
3301
3325
  type: "string",
3302
3326
  format: "cuid",
@@ -3395,7 +3419,7 @@ function Ti(t, e) {
3395
3419
  ...l(e)
3396
3420
  });
3397
3421
  }
3398
- function wi(t, e) {
3422
+ function bi(t, e) {
3399
3423
  return new t({
3400
3424
  type: "string",
3401
3425
  format: "e164",
@@ -3404,7 +3428,7 @@ function wi(t, e) {
3404
3428
  ...l(e)
3405
3429
  });
3406
3430
  }
3407
- function bi(t, e) {
3431
+ function wi(t, e) {
3408
3432
  return new t({
3409
3433
  type: "string",
3410
3434
  format: "jwt",
@@ -3413,7 +3437,7 @@ function bi(t, e) {
3413
3437
  ...l(e)
3414
3438
  });
3415
3439
  }
3416
- function Ei(t, e) {
3440
+ function Ii(t, e) {
3417
3441
  return new t({
3418
3442
  type: "string",
3419
3443
  format: "datetime",
@@ -3424,7 +3448,7 @@ function Ei(t, e) {
3424
3448
  ...l(e)
3425
3449
  });
3426
3450
  }
3427
- function Ii(t, e) {
3451
+ function Ei(t, e) {
3428
3452
  return new t({
3429
3453
  type: "string",
3430
3454
  format: "date",
@@ -3476,7 +3500,7 @@ function Ni(t, e) {
3476
3500
  ...l(e)
3477
3501
  });
3478
3502
  }
3479
- function xe(t, e) {
3503
+ function Le(t, e) {
3480
3504
  return new lt({
3481
3505
  check: "less_than",
3482
3506
  ...l(e),
@@ -3484,7 +3508,7 @@ function xe(t, e) {
3484
3508
  inclusive: !1
3485
3509
  });
3486
3510
  }
3487
- function he(t, e) {
3511
+ function pe(t, e) {
3488
3512
  return new lt({
3489
3513
  check: "less_than",
3490
3514
  ...l(e),
@@ -3500,7 +3524,7 @@ function De(t, e) {
3500
3524
  inclusive: !1
3501
3525
  });
3502
3526
  }
3503
- function pe(t, e) {
3527
+ function he(t, e) {
3504
3528
  return new dt({
3505
3529
  check: "greater_than",
3506
3530
  ...l(e),
@@ -3509,35 +3533,35 @@ function pe(t, e) {
3509
3533
  });
3510
3534
  }
3511
3535
  function Fe(t, e) {
3512
- return new Yn({
3536
+ return new Kr({
3513
3537
  check: "multiple_of",
3514
3538
  ...l(e),
3515
3539
  value: t
3516
3540
  });
3517
3541
  }
3518
3542
  function kt(t, e) {
3519
- return new Xn({
3543
+ return new qr({
3520
3544
  check: "max_length",
3521
3545
  ...l(e),
3522
3546
  maximum: t
3523
3547
  });
3524
3548
  }
3525
3549
  function ee(t, e) {
3526
- return new Qn({
3550
+ return new Xr({
3527
3551
  check: "min_length",
3528
3552
  ...l(e),
3529
3553
  minimum: t
3530
3554
  });
3531
3555
  }
3532
3556
  function yt(t, e) {
3533
- return new Hn({
3557
+ return new Qr({
3534
3558
  check: "length_equals",
3535
3559
  ...l(e),
3536
3560
  length: t
3537
3561
  });
3538
3562
  }
3539
3563
  function Ai(t, e) {
3540
- return new er({
3564
+ return new Hr({
3541
3565
  check: "string_format",
3542
3566
  format: "regex",
3543
3567
  ...l(e),
@@ -3545,37 +3569,37 @@ function Ai(t, e) {
3545
3569
  });
3546
3570
  }
3547
3571
  function Zi(t) {
3548
- return new tr({
3572
+ return new en({
3549
3573
  check: "string_format",
3550
3574
  format: "lowercase",
3551
3575
  ...l(t)
3552
3576
  });
3553
3577
  }
3554
3578
  function Ci(t) {
3555
- return new nr({
3579
+ return new tn({
3556
3580
  check: "string_format",
3557
3581
  format: "uppercase",
3558
3582
  ...l(t)
3559
3583
  });
3560
3584
  }
3561
3585
  function Ri(t, e) {
3562
- return new rr({
3586
+ return new rn({
3563
3587
  check: "string_format",
3564
3588
  format: "includes",
3565
3589
  ...l(e),
3566
3590
  includes: t
3567
3591
  });
3568
3592
  }
3569
- function Li(t, e) {
3570
- return new ir({
3593
+ function xi(t, e) {
3594
+ return new nn({
3571
3595
  check: "string_format",
3572
3596
  format: "starts_with",
3573
3597
  ...l(e),
3574
3598
  prefix: t
3575
3599
  });
3576
3600
  }
3577
- function xi(t, e) {
3578
- return new sr({
3601
+ function Li(t, e) {
3602
+ return new sn({
3579
3603
  check: "string_format",
3580
3604
  format: "ends_with",
3581
3605
  ...l(e),
@@ -3583,7 +3607,7 @@ function xi(t, e) {
3583
3607
  });
3584
3608
  }
3585
3609
  function U(t) {
3586
- return new or({
3610
+ return new on({
3587
3611
  check: "overwrite",
3588
3612
  tx: t
3589
3613
  });
@@ -3594,50 +3618,50 @@ function Di(t) {
3594
3618
  function Fi() {
3595
3619
  return U((t) => t.trim());
3596
3620
  }
3597
- function ji() {
3621
+ function Mi() {
3598
3622
  return U((t) => t.toLowerCase());
3599
3623
  }
3600
- function Mi() {
3624
+ function ji() {
3601
3625
  return U((t) => t.toUpperCase());
3602
3626
  }
3603
3627
  function Ui() {
3604
3628
  return U((t) => Ht(t));
3605
3629
  }
3606
- function Gi(t, e, n) {
3630
+ function Gi(t, e, r) {
3607
3631
  return new t({
3608
3632
  type: "array",
3609
3633
  element: e,
3610
3634
  // get element() {
3611
3635
  // return element;
3612
3636
  // },
3613
- ...l(n)
3637
+ ...l(r)
3614
3638
  });
3615
3639
  }
3616
- function Vi(t, e, n) {
3640
+ function Vi(t, e, r) {
3617
3641
  return new t({
3618
3642
  type: "custom",
3619
3643
  check: "custom",
3620
3644
  fn: e,
3621
- ...l(n)
3645
+ ...l(r)
3622
3646
  });
3623
3647
  }
3624
3648
  function Bi(t) {
3625
- const e = Ji((n) => (n.addIssue = (r) => {
3626
- if (typeof r == "string")
3627
- n.issues.push(W(r, n.value, e._zod.def));
3649
+ const e = Ji((r) => (r.addIssue = (n) => {
3650
+ if (typeof n == "string")
3651
+ r.issues.push(W(n, r.value, e._zod.def));
3628
3652
  else {
3629
- const i = r;
3630
- 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));
3653
+ const i = n;
3654
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = r.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !e._zod.def.abort), r.issues.push(W(i));
3631
3655
  }
3632
- }, t(n.value, n)));
3656
+ }, t(r.value, r)));
3633
3657
  return e;
3634
3658
  }
3635
3659
  function Ji(t, e) {
3636
- const n = new b({
3660
+ const r = new w({
3637
3661
  check: "custom",
3638
3662
  ...l(e)
3639
3663
  });
3640
- return n._zod.check = t, n;
3664
+ return r._zod.check = t, r;
3641
3665
  }
3642
3666
  function Tt(t) {
3643
3667
  let e = t?.target ?? "draft-2020-12";
@@ -3656,62 +3680,62 @@ function Tt(t) {
3656
3680
  external: t?.external ?? void 0
3657
3681
  };
3658
3682
  }
3659
- function T(t, e, n = { path: [], schemaPath: [] }) {
3660
- var r;
3683
+ function T(t, e, r = { path: [], schemaPath: [] }) {
3684
+ var n;
3661
3685
  const i = t._zod.def, s = e.seen.get(t);
3662
3686
  if (s)
3663
- return s.count++, n.schemaPath.includes(t) && (s.cycle = n.path), s.schema;
3664
- const o = { schema: {}, count: 1, cycle: void 0, path: n.path };
3687
+ return s.count++, r.schemaPath.includes(t) && (s.cycle = r.path), s.schema;
3688
+ const o = { schema: {}, count: 1, cycle: void 0, path: r.path };
3665
3689
  e.seen.set(t, o);
3666
3690
  const a = t._zod.toJSONSchema?.();
3667
3691
  if (a)
3668
3692
  o.schema = a;
3669
3693
  else {
3670
- const p = {
3671
- ...n,
3672
- schemaPath: [...n.schemaPath, t],
3673
- path: n.path
3694
+ const h = {
3695
+ ...r,
3696
+ schemaPath: [...r.schemaPath, t],
3697
+ path: r.path
3674
3698
  }, d = t._zod.parent;
3675
3699
  if (d)
3676
- o.ref = d, T(d, e, p), e.seen.get(d).isParent = !0;
3700
+ o.ref = d, T(d, e, h), e.seen.get(d).isParent = !0;
3677
3701
  else if (t._zod.processJSONSchema)
3678
- t._zod.processJSONSchema(e, o.schema, p);
3702
+ t._zod.processJSONSchema(e, o.schema, h);
3679
3703
  else {
3680
- const f = o.schema, v = e.processors[i.type];
3681
- if (!v)
3704
+ const f = o.schema, g = e.processors[i.type];
3705
+ if (!g)
3682
3706
  throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
3683
- v(t, e, f, p);
3707
+ g(t, e, f, h);
3684
3708
  }
3685
3709
  }
3686
3710
  const c = e.metadataRegistry.get(t);
3687
- 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;
3711
+ return c && Object.assign(o.schema, c), e.io === "input" && b(t) && (delete o.schema.examples, delete o.schema.default), e.io === "input" && o.schema._prefault && ((n = o.schema).default ?? (n.default = o.schema._prefault)), delete o.schema._prefault, e.seen.get(t).schema;
3688
3712
  }
3689
- function wt(t, e) {
3690
- const n = t.seen.get(e);
3691
- if (!n)
3713
+ function bt(t, e) {
3714
+ const r = t.seen.get(e);
3715
+ if (!r)
3692
3716
  throw new Error("Unprocessed schema. This is a bug in Zod.");
3693
- const r = (s) => {
3717
+ const n = (s) => {
3694
3718
  const o = t.target === "draft-2020-12" ? "$defs" : "definitions";
3695
3719
  if (t.external) {
3696
- const p = t.external.registry.get(s[0])?.id, d = t.external.uri ?? ((v) => v);
3697
- if (p)
3698
- return { ref: d(p) };
3720
+ const h = t.external.registry.get(s[0])?.id, d = t.external.uri ?? ((g) => g);
3721
+ if (h)
3722
+ return { ref: d(h) };
3699
3723
  const f = s[1].defId ?? s[1].schema.id ?? `schema${t.counter++}`;
3700
3724
  return s[1].defId = f, { defId: f, ref: `${d("__shared")}#/${o}/${f}` };
3701
3725
  }
3702
- if (s[1] === n)
3726
+ if (s[1] === r)
3703
3727
  return { ref: "#" };
3704
- const c = `#/${o}/`, h = s[1].schema.id ?? `__schema${t.counter++}`;
3705
- return { defId: h, ref: c + h };
3728
+ const c = `#/${o}/`, p = s[1].schema.id ?? `__schema${t.counter++}`;
3729
+ return { defId: p, ref: c + p };
3706
3730
  }, i = (s) => {
3707
3731
  if (s[1].schema.$ref)
3708
3732
  return;
3709
- const o = s[1], { ref: a, defId: c } = r(s);
3733
+ const o = s[1], { ref: a, defId: c } = n(s);
3710
3734
  o.def = { ...o.schema }, c && (o.defId = c);
3711
- const h = o.schema;
3712
- for (const p in h)
3713
- delete h[p];
3714
- h.$ref = a;
3735
+ const p = o.schema;
3736
+ for (const h in p)
3737
+ delete p[h];
3738
+ p.$ref = a;
3715
3739
  };
3716
3740
  if (t.cycles === "throw")
3717
3741
  for (const s of t.seen.entries()) {
@@ -3748,19 +3772,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3748
3772
  }
3749
3773
  }
3750
3774
  }
3751
- function bt(t, e) {
3752
- const n = t.seen.get(e);
3753
- if (!n)
3775
+ function wt(t, e) {
3776
+ const r = t.seen.get(e);
3777
+ if (!r)
3754
3778
  throw new Error("Unprocessed schema. This is a bug in Zod.");
3755
- const r = (o) => {
3756
- const a = t.seen.get(o), c = a.def ?? a.schema, h = { ...c };
3779
+ const n = (o) => {
3780
+ const a = t.seen.get(o), c = a.def ?? a.schema, p = { ...c };
3757
3781
  if (a.ref === null)
3758
3782
  return;
3759
- const p = a.ref;
3760
- if (a.ref = null, p) {
3761
- r(p);
3762
- const d = t.seen.get(p).schema;
3763
- 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));
3783
+ const h = a.ref;
3784
+ if (a.ref = null, h) {
3785
+ n(h);
3786
+ const d = t.seen.get(h).schema;
3787
+ 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, p));
3764
3788
  }
3765
3789
  a.isParent || t.override({
3766
3790
  zodSchema: o,
@@ -3769,7 +3793,7 @@ function bt(t, e) {
3769
3793
  });
3770
3794
  };
3771
3795
  for (const o of [...t.seen.entries()].reverse())
3772
- r(o[0]);
3796
+ n(o[0]);
3773
3797
  const i = {};
3774
3798
  if (t.target === "draft-2020-12" ? i.$schema = "https://json-schema.org/draft/2020-12/schema" : t.target === "draft-07" ? i.$schema = "http://json-schema.org/draft-07/schema#" : t.target === "draft-04" ? i.$schema = "http://json-schema.org/draft-04/schema#" : t.target, t.external?.uri) {
3775
3799
  const o = t.external.registry.get(e)?.id;
@@ -3777,7 +3801,7 @@ function bt(t, e) {
3777
3801
  throw new Error("Schema is missing an `id` property");
3778
3802
  i.$id = t.external.uri(o);
3779
3803
  }
3780
- Object.assign(i, n.def ?? n.schema);
3804
+ Object.assign(i, r.def ?? r.schema);
3781
3805
  const s = t.external?.defs ?? {};
3782
3806
  for (const o of t.seen.entries()) {
3783
3807
  const a = o[1];
@@ -3801,54 +3825,54 @@ function bt(t, e) {
3801
3825
  throw new Error("Error converting schema to JSON.");
3802
3826
  }
3803
3827
  }
3804
- function w(t, e) {
3805
- const n = e ?? { seen: /* @__PURE__ */ new Set() };
3806
- if (n.seen.has(t))
3828
+ function b(t, e) {
3829
+ const r = e ?? { seen: /* @__PURE__ */ new Set() };
3830
+ if (r.seen.has(t))
3807
3831
  return !1;
3808
- n.seen.add(t);
3809
- const r = t._zod.def;
3810
- if (r.type === "transform")
3832
+ r.seen.add(t);
3833
+ const n = t._zod.def;
3834
+ if (n.type === "transform")
3811
3835
  return !0;
3812
- if (r.type === "array")
3813
- return w(r.element, n);
3814
- if (r.type === "set")
3815
- return w(r.valueType, n);
3816
- if (r.type === "lazy")
3817
- return w(r.getter(), n);
3818
- if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
3819
- return w(r.innerType, n);
3820
- if (r.type === "intersection")
3821
- return w(r.left, n) || w(r.right, n);
3822
- if (r.type === "record" || r.type === "map")
3823
- return w(r.keyType, n) || w(r.valueType, n);
3824
- if (r.type === "pipe")
3825
- return w(r.in, n) || w(r.out, n);
3826
- if (r.type === "object") {
3827
- for (const i in r.shape)
3828
- if (w(r.shape[i], n))
3836
+ if (n.type === "array")
3837
+ return b(n.element, r);
3838
+ if (n.type === "set")
3839
+ return b(n.valueType, r);
3840
+ if (n.type === "lazy")
3841
+ return b(n.getter(), r);
3842
+ if (n.type === "promise" || n.type === "optional" || n.type === "nonoptional" || n.type === "nullable" || n.type === "readonly" || n.type === "default" || n.type === "prefault")
3843
+ return b(n.innerType, r);
3844
+ if (n.type === "intersection")
3845
+ return b(n.left, r) || b(n.right, r);
3846
+ if (n.type === "record" || n.type === "map")
3847
+ return b(n.keyType, r) || b(n.valueType, r);
3848
+ if (n.type === "pipe")
3849
+ return b(n.in, r) || b(n.out, r);
3850
+ if (n.type === "object") {
3851
+ for (const i in n.shape)
3852
+ if (b(n.shape[i], r))
3829
3853
  return !0;
3830
3854
  return !1;
3831
3855
  }
3832
- if (r.type === "union") {
3833
- for (const i of r.options)
3834
- if (w(i, n))
3856
+ if (n.type === "union") {
3857
+ for (const i of n.options)
3858
+ if (b(i, r))
3835
3859
  return !0;
3836
3860
  return !1;
3837
3861
  }
3838
- if (r.type === "tuple") {
3839
- for (const i of r.items)
3840
- if (w(i, n))
3862
+ if (n.type === "tuple") {
3863
+ for (const i of n.items)
3864
+ if (b(i, r))
3841
3865
  return !0;
3842
- return !!(r.rest && w(r.rest, n));
3866
+ return !!(n.rest && b(n.rest, r));
3843
3867
  }
3844
3868
  return !1;
3845
3869
  }
3846
- const Wi = (t, e = {}) => (n) => {
3847
- const r = Tt({ ...n, processors: e });
3848
- return T(t, r), wt(r, t), bt(r, t);
3849
- }, te = (t, e) => (n) => {
3850
- const { libraryOptions: r, target: i } = n ?? {}, s = Tt({ ...r ?? {}, target: i, io: e, processors: {} });
3851
- return T(t, s), wt(s, t), bt(s, t);
3870
+ const Wi = (t, e = {}) => (r) => {
3871
+ const n = Tt({ ...r, processors: e });
3872
+ return T(t, n), bt(n, t), wt(n, t);
3873
+ }, te = (t, e) => (r) => {
3874
+ const { libraryOptions: n, target: i } = r ?? {}, s = Tt({ ...n ?? {}, target: i, io: e, processors: {} });
3875
+ return T(t, s), bt(s, t), wt(s, t);
3852
3876
  }, Ki = {
3853
3877
  guid: "uuid",
3854
3878
  url: "uri",
@@ -3856,29 +3880,29 @@ const Wi = (t, e = {}) => (n) => {
3856
3880
  json_string: "json-string",
3857
3881
  regex: ""
3858
3882
  // do not set
3859
- }, Yi = (t, e, n, r) => {
3860
- const i = n;
3883
+ }, Yi = (t, e, r, n) => {
3884
+ const i = r;
3861
3885
  i.type = "string";
3862
- const { minimum: s, maximum: o, format: a, patterns: c, contentEncoding: h } = t._zod.bag;
3863
- 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) {
3864
- const p = [...c];
3865
- p.length === 1 ? i.pattern = p[0].source : p.length > 1 && (i.allOf = [
3866
- ...p.map((d) => ({
3886
+ const { minimum: s, maximum: o, format: a, patterns: c, contentEncoding: p } = t._zod.bag;
3887
+ if (typeof s == "number" && (i.minLength = s), typeof o == "number" && (i.maxLength = o), a && (i.format = Ki[a] ?? a, i.format === "" && delete i.format), p && (i.contentEncoding = p), c && c.size > 0) {
3888
+ const h = [...c];
3889
+ h.length === 1 ? i.pattern = h[0].source : h.length > 1 && (i.allOf = [
3890
+ ...h.map((d) => ({
3867
3891
  ...e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0" ? { type: "string" } : {},
3868
3892
  pattern: d.source
3869
3893
  }))
3870
3894
  ]);
3871
3895
  }
3872
- }, qi = (t, e, n, r) => {
3873
- const i = n, { minimum: s, maximum: o, format: a, multipleOf: c, exclusiveMaximum: h, exclusiveMinimum: p } = t._zod.bag;
3874
- 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);
3875
- }, Xi = (t, e, n, r) => {
3876
- n.not = {};
3877
- }, Qi = (t, e, n, r) => {
3878
- }, Hi = (t, e, n, r) => {
3896
+ }, qi = (t, e, r, n) => {
3897
+ const i = r, { minimum: s, maximum: o, format: a, multipleOf: c, exclusiveMaximum: p, exclusiveMinimum: h } = t._zod.bag;
3898
+ typeof a == "string" && a.includes("int") ? i.type = "integer" : i.type = "number", typeof h == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.minimum = h, i.exclusiveMinimum = !0) : i.exclusiveMinimum = h), typeof s == "number" && (i.minimum = s, typeof h == "number" && e.target !== "draft-04" && (h >= s ? delete i.minimum : delete i.exclusiveMinimum)), typeof p == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.maximum = p, i.exclusiveMaximum = !0) : i.exclusiveMaximum = p), typeof o == "number" && (i.maximum = o, typeof p == "number" && e.target !== "draft-04" && (p <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == "number" && (i.multipleOf = c);
3899
+ }, Xi = (t, e, r, n) => {
3900
+ r.not = {};
3901
+ }, Qi = (t, e, r, n) => {
3902
+ }, Hi = (t, e, r, n) => {
3879
3903
  const i = t._zod.def, s = tt(i.entries);
3880
- s.every((o) => typeof o == "number") && (n.type = "number"), s.every((o) => typeof o == "string") && (n.type = "string"), n.enum = s;
3881
- }, es = (t, e, n, r) => {
3904
+ s.every((o) => typeof o == "number") && (r.type = "number"), s.every((o) => typeof o == "string") && (r.type = "string"), r.enum = s;
3905
+ }, es = (t, e, r, n) => {
3882
3906
  const i = t._zod.def, s = [];
3883
3907
  for (const o of i.values)
3884
3908
  if (o === void 0) {
@@ -3892,74 +3916,74 @@ const Wi = (t, e = {}) => (n) => {
3892
3916
  s.push(o);
3893
3917
  if (s.length !== 0) if (s.length === 1) {
3894
3918
  const o = s[0];
3895
- n.type = o === null ? "null" : typeof o, e.target === "draft-04" || e.target === "openapi-3.0" ? n.enum = [o] : n.const = o;
3919
+ r.type = o === null ? "null" : typeof o, e.target === "draft-04" || e.target === "openapi-3.0" ? r.enum = [o] : r.const = o;
3896
3920
  } else
3897
- 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;
3898
- }, ts = (t, e, n, r) => {
3921
+ s.every((o) => typeof o == "number") && (r.type = "number"), s.every((o) => typeof o == "string") && (r.type = "string"), s.every((o) => typeof o == "boolean") && (r.type = "boolean"), s.every((o) => o === null) && (r.type = "null"), r.enum = s;
3922
+ }, ts = (t, e, r, n) => {
3899
3923
  if (e.unrepresentable === "throw")
3900
3924
  throw new Error("Custom types cannot be represented in JSON Schema");
3901
- }, ns = (t, e, n, r) => {
3925
+ }, rs = (t, e, r, n) => {
3902
3926
  if (e.unrepresentable === "throw")
3903
3927
  throw new Error("Transforms cannot be represented in JSON Schema");
3904
- }, rs = (t, e, n, r) => {
3905
- const i = n, s = t._zod.def, { minimum: o, maximum: a } = t._zod.bag;
3906
- 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"] });
3907
- }, is = (t, e, n, r) => {
3908
- const i = n, s = t._zod.def;
3928
+ }, ns = (t, e, r, n) => {
3929
+ const i = r, s = t._zod.def, { minimum: o, maximum: a } = t._zod.bag;
3930
+ typeof o == "number" && (i.minItems = o), typeof a == "number" && (i.maxItems = a), i.type = "array", i.items = T(s.element, e, { ...n, path: [...n.path, "items"] });
3931
+ }, is = (t, e, r, n) => {
3932
+ const i = r, s = t._zod.def;
3909
3933
  i.type = "object", i.properties = {};
3910
3934
  const o = s.shape;
3911
- for (const h in o)
3912
- i.properties[h] = T(o[h], e, {
3913
- ...r,
3914
- path: [...r.path, "properties", h]
3935
+ for (const p in o)
3936
+ i.properties[p] = T(o[p], e, {
3937
+ ...n,
3938
+ path: [...n.path, "properties", p]
3915
3939
  });
3916
- const a = new Set(Object.keys(o)), c = new Set([...a].filter((h) => {
3917
- const p = s.shape[h]._zod;
3918
- return e.io === "input" ? p.optin === void 0 : p.optout === void 0;
3940
+ const a = new Set(Object.keys(o)), c = new Set([...a].filter((p) => {
3941
+ const h = s.shape[p]._zod;
3942
+ return e.io === "input" ? h.optin === void 0 : h.optout === void 0;
3919
3943
  }));
3920
3944
  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, {
3921
- ...r,
3922
- path: [...r.path, "additionalProperties"]
3945
+ ...n,
3946
+ path: [...n.path, "additionalProperties"]
3923
3947
  })) : e.io === "output" && (i.additionalProperties = !1);
3924
- }, ss = (t, e, n, r) => {
3948
+ }, ss = (t, e, r, n) => {
3925
3949
  const i = t._zod.def, s = i.inclusive === !1, o = i.options.map((a, c) => T(a, e, {
3926
- ...r,
3927
- path: [...r.path, s ? "oneOf" : "anyOf", c]
3950
+ ...n,
3951
+ path: [...n.path, s ? "oneOf" : "anyOf", c]
3928
3952
  }));
3929
- s ? n.oneOf = o : n.anyOf = o;
3930
- }, os = (t, e, n, r) => {
3953
+ s ? r.oneOf = o : r.anyOf = o;
3954
+ }, os = (t, e, r, n) => {
3931
3955
  const i = t._zod.def, s = T(i.left, e, {
3932
- ...r,
3933
- path: [...r.path, "allOf", 0]
3956
+ ...n,
3957
+ path: [...n.path, "allOf", 0]
3934
3958
  }), o = T(i.right, e, {
3935
- ...r,
3936
- path: [...r.path, "allOf", 1]
3937
- }), a = (h) => "allOf" in h && Object.keys(h).length === 1, c = [
3959
+ ...n,
3960
+ path: [...n.path, "allOf", 1]
3961
+ }), a = (p) => "allOf" in p && Object.keys(p).length === 1, c = [
3938
3962
  ...a(s) ? s.allOf : [s],
3939
3963
  ...a(o) ? o.allOf : [o]
3940
3964
  ];
3941
- n.allOf = c;
3942
- }, as = (t, e, n, r) => {
3943
- const i = t._zod.def, s = T(i.innerType, e, r), o = e.seen.get(t);
3944
- e.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
3945
- }, cs = (t, e, n, r) => {
3965
+ r.allOf = c;
3966
+ }, as = (t, e, r, n) => {
3967
+ const i = t._zod.def, s = T(i.innerType, e, n), o = e.seen.get(t);
3968
+ e.target === "openapi-3.0" ? (o.ref = i.innerType, r.nullable = !0) : r.anyOf = [s, { type: "null" }];
3969
+ }, cs = (t, e, r, n) => {
3946
3970
  const i = t._zod.def;
3947
- T(i.innerType, e, r);
3971
+ T(i.innerType, e, n);
3948
3972
  const s = e.seen.get(t);
3949
3973
  s.ref = i.innerType;
3950
- }, us = (t, e, n, r) => {
3974
+ }, us = (t, e, r, n) => {
3951
3975
  const i = t._zod.def;
3952
- T(i.innerType, e, r);
3976
+ T(i.innerType, e, n);
3953
3977
  const s = e.seen.get(t);
3954
- s.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
3955
- }, hs = (t, e, n, r) => {
3978
+ s.ref = i.innerType, r.default = JSON.parse(JSON.stringify(i.defaultValue));
3979
+ }, ps = (t, e, r, n) => {
3956
3980
  const i = t._zod.def;
3957
- T(i.innerType, e, r);
3981
+ T(i.innerType, e, n);
3958
3982
  const s = e.seen.get(t);
3959
- s.ref = i.innerType, e.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
3960
- }, ps = (t, e, n, r) => {
3983
+ s.ref = i.innerType, e.io === "input" && (r._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
3984
+ }, hs = (t, e, r, n) => {
3961
3985
  const i = t._zod.def;
3962
- T(i.innerType, e, r);
3986
+ T(i.innerType, e, n);
3963
3987
  const s = e.seen.get(t);
3964
3988
  s.ref = i.innerType;
3965
3989
  let o;
@@ -3968,65 +3992,65 @@ const Wi = (t, e = {}) => (n) => {
3968
3992
  } catch {
3969
3993
  throw new Error("Dynamic catch values are not supported in JSON Schema");
3970
3994
  }
3971
- n.default = o;
3972
- }, ls = (t, e, n, r) => {
3995
+ r.default = o;
3996
+ }, ls = (t, e, r, n) => {
3973
3997
  const i = t._zod.def, s = e.io === "input" ? i.in._zod.def.type === "transform" ? i.out : i.in : i.out;
3974
- T(s, e, r);
3998
+ T(s, e, n);
3975
3999
  const o = e.seen.get(t);
3976
4000
  o.ref = s;
3977
- }, ds = (t, e, n, r) => {
4001
+ }, ds = (t, e, r, n) => {
3978
4002
  const i = t._zod.def;
3979
- T(i.innerType, e, r);
4003
+ T(i.innerType, e, n);
3980
4004
  const s = e.seen.get(t);
3981
- s.ref = i.innerType, n.readOnly = !0;
3982
- }, fs = (t, e, n, r) => {
4005
+ s.ref = i.innerType, r.readOnly = !0;
4006
+ }, fs = (t, e, r, n) => {
3983
4007
  const i = t._zod.def;
3984
- T(i.innerType, e, r);
4008
+ T(i.innerType, e, n);
3985
4009
  const s = e.seen.get(t);
3986
4010
  s.ref = i.innerType;
3987
4011
  }, ms = /* @__PURE__ */ u("ZodISODateTime", (t, e) => {
3988
- yr.init(t, e), _.init(t, e);
4012
+ yn.init(t, e), _.init(t, e);
3989
4013
  });
3990
4014
  function gs(t) {
3991
- return Ei(ms, t);
4015
+ return Ii(ms, t);
3992
4016
  }
3993
4017
  const vs = /* @__PURE__ */ u("ZodISODate", (t, e) => {
3994
- Tr.init(t, e), _.init(t, e);
4018
+ Tn.init(t, e), _.init(t, e);
3995
4019
  });
3996
4020
  function _s(t) {
3997
- return Ii(vs, t);
4021
+ return Ei(vs, t);
3998
4022
  }
3999
4023
  const ks = /* @__PURE__ */ u("ZodISOTime", (t, e) => {
4000
- wr.init(t, e), _.init(t, e);
4024
+ bn.init(t, e), _.init(t, e);
4001
4025
  });
4002
4026
  function ys(t) {
4003
4027
  return zi(ks, t);
4004
4028
  }
4005
4029
  const Ts = /* @__PURE__ */ u("ZodISODuration", (t, e) => {
4006
- br.init(t, e), _.init(t, e);
4030
+ wn.init(t, e), _.init(t, e);
4007
4031
  });
4008
- function ws(t) {
4032
+ function bs(t) {
4009
4033
  return $i(Ts, t);
4010
4034
  }
4011
- const bs = (t, e) => {
4035
+ const ws = (t, e) => {
4012
4036
  ot.init(t, e), t.name = "ZodError", Object.defineProperties(t, {
4013
4037
  format: {
4014
- value: (n) => dn(t, n)
4038
+ value: (r) => lr(t, r)
4015
4039
  // enumerable: false,
4016
4040
  },
4017
4041
  flatten: {
4018
- value: (n) => ln(t, n)
4042
+ value: (r) => hr(t, r)
4019
4043
  // enumerable: false,
4020
4044
  },
4021
4045
  addIssue: {
4022
- value: (n) => {
4023
- t.issues.push(n), t.message = JSON.stringify(t.issues, le, 2);
4046
+ value: (r) => {
4047
+ t.issues.push(r), t.message = JSON.stringify(t.issues, le, 2);
4024
4048
  }
4025
4049
  // enumerable: false,
4026
4050
  },
4027
4051
  addIssues: {
4028
- value: (n) => {
4029
- t.issues.push(...n), t.message = JSON.stringify(t.issues, le, 2);
4052
+ value: (r) => {
4053
+ t.issues.push(...r), t.message = JSON.stringify(t.issues, le, 2);
4030
4054
  }
4031
4055
  // enumerable: false,
4032
4056
  },
@@ -4037,126 +4061,126 @@ const bs = (t, e) => {
4037
4061
  // enumerable: false,
4038
4062
  }
4039
4063
  });
4040
- }, $ = u("ZodError", bs, {
4064
+ }, $ = u("ZodError", ws, {
4041
4065
  Parent: Error
4042
- }), Es = /* @__PURE__ */ _e($), Is = /* @__PURE__ */ ke($), zs = /* @__PURE__ */ ie($), $s = /* @__PURE__ */ se($), Os = /* @__PURE__ */ gn($), Ps = /* @__PURE__ */ vn($), Ss = /* @__PURE__ */ _n($), Ns = /* @__PURE__ */ kn($), As = /* @__PURE__ */ yn($), Zs = /* @__PURE__ */ Tn($), Cs = /* @__PURE__ */ wn($), Rs = /* @__PURE__ */ bn($), y = /* @__PURE__ */ u("ZodType", (t, e) => (k.init(t, e), Object.assign(t["~standard"], {
4066
+ }), Is = /* @__PURE__ */ _e($), Es = /* @__PURE__ */ ke($), zs = /* @__PURE__ */ ie($), $s = /* @__PURE__ */ se($), Os = /* @__PURE__ */ mr($), Ps = /* @__PURE__ */ gr($), Ss = /* @__PURE__ */ vr($), Ns = /* @__PURE__ */ _r($), As = /* @__PURE__ */ kr($), Zs = /* @__PURE__ */ yr($), Cs = /* @__PURE__ */ Tr($), Rs = /* @__PURE__ */ br($), y = /* @__PURE__ */ u("ZodType", (t, e) => (k.init(t, e), Object.assign(t["~standard"], {
4043
4067
  jsonSchema: {
4044
4068
  input: te(t, "input"),
4045
4069
  output: te(t, "output")
4046
4070
  }
4047
- }), t.toJSONSchema = Wi(t, {}), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...n) => t.clone(x(e, {
4071
+ }), t.toJSONSchema = Wi(t, {}), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...r) => t.clone(L(e, {
4048
4072
  checks: [
4049
4073
  ...e.checks ?? [],
4050
- ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
4074
+ ...r.map((n) => typeof n == "function" ? { _zod: { check: n, def: { check: "custom" }, onattach: [] } } : n)
4051
4075
  ]
4052
- })), 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) => {
4053
- const r = t.clone();
4054
- return V.add(r, { description: n }), r;
4076
+ })), t.clone = (r, n) => N(t, r, n), t.brand = () => t, t.register = ((r, n) => (r.add(t, n), t)), t.parse = (r, n) => Is(t, r, n, { callee: t.parse }), t.safeParse = (r, n) => zs(t, r, n), t.parseAsync = async (r, n) => Es(t, r, n, { callee: t.parseAsync }), t.safeParseAsync = async (r, n) => $s(t, r, n), t.spa = t.safeParseAsync, t.encode = (r, n) => Os(t, r, n), t.decode = (r, n) => Ps(t, r, n), t.encodeAsync = async (r, n) => Ss(t, r, n), t.decodeAsync = async (r, n) => Ns(t, r, n), t.safeEncode = (r, n) => As(t, r, n), t.safeDecode = (r, n) => Zs(t, r, n), t.safeEncodeAsync = async (r, n) => Cs(t, r, n), t.safeDecodeAsync = async (r, n) => Rs(t, r, n), t.refine = (r, n) => t.check($o(r, n)), t.superRefine = (r) => t.check(Oo(r)), t.overwrite = (r) => t.check(U(r)), t.optional = () => Ge(t), t.nullable = () => Ve(t), t.nullish = () => Ge(Ve(t)), t.nonoptional = (r) => yo(t, r), t.array = () => Z(t), t.or = (r) => ae([t, r]), t.and = (r) => po(t, r), t.transform = (r) => Be(t, fo(r)), t.default = (r) => vo(t, r), t.prefault = (r) => ko(t, r), t.catch = (r) => bo(t, r), t.pipe = (r) => Be(t, r), t.readonly = () => Eo(t), t.describe = (r) => {
4077
+ const n = t.clone();
4078
+ return V.add(n, { description: r }), n;
4055
4079
  }, Object.defineProperty(t, "description", {
4056
4080
  get() {
4057
4081
  return V.get(t)?.description;
4058
4082
  },
4059
4083
  configurable: !0
4060
- }), t.meta = (...n) => {
4061
- if (n.length === 0)
4084
+ }), t.meta = (...r) => {
4085
+ if (r.length === 0)
4062
4086
  return V.get(t);
4063
- const r = t.clone();
4064
- return V.add(r, n[0]), r;
4065
- }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Et = /* @__PURE__ */ u("_ZodString", (t, e) => {
4066
- ye.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Yi(t, r, i);
4067
- const n = t._zod.bag;
4068
- 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());
4069
- }), Ls = /* @__PURE__ */ u("ZodString", (t, e) => {
4070
- 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));
4087
+ const n = t.clone();
4088
+ return V.add(n, r[0]), n;
4089
+ }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), It = /* @__PURE__ */ u("_ZodString", (t, e) => {
4090
+ ye.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, i, s) => Yi(t, n, i);
4091
+ const r = t._zod.bag;
4092
+ t.format = r.format ?? null, t.minLength = r.minimum ?? null, t.maxLength = r.maximum ?? null, t.regex = (...n) => t.check(Ai(...n)), t.includes = (...n) => t.check(Ri(...n)), t.startsWith = (...n) => t.check(xi(...n)), t.endsWith = (...n) => t.check(Li(...n)), t.min = (...n) => t.check(ee(...n)), t.max = (...n) => t.check(kt(...n)), t.length = (...n) => t.check(yt(...n)), t.nonempty = (...n) => t.check(ee(1, ...n)), t.lowercase = (n) => t.check(Zi(n)), t.uppercase = (n) => t.check(Ci(n)), t.trim = () => t.check(Fi()), t.normalize = (...n) => t.check(Di(...n)), t.toLowerCase = () => t.check(Mi()), t.toUpperCase = () => t.check(ji()), t.slugify = () => t.check(Ui());
4093
+ }), xs = /* @__PURE__ */ u("ZodString", (t, e) => {
4094
+ ye.init(t, e), It.init(t, e), t.email = (r) => t.check(ni(Ls, r)), t.url = (r) => t.check(ci(Ds, r)), t.jwt = (r) => t.check(wi(Hs, r)), t.emoji = (r) => t.check(ui(Fs, r)), t.guid = (r) => t.check(xe(Me, r)), t.uuid = (r) => t.check(ii(X, r)), t.uuidv4 = (r) => t.check(si(X, r)), t.uuidv6 = (r) => t.check(oi(X, r)), t.uuidv7 = (r) => t.check(ai(X, r)), t.nanoid = (r) => t.check(pi(Ms, r)), t.guid = (r) => t.check(xe(Me, r)), t.cuid = (r) => t.check(hi(js, r)), t.cuid2 = (r) => t.check(li(Us, r)), t.ulid = (r) => t.check(di(Gs, r)), t.base64 = (r) => t.check(yi(qs, r)), t.base64url = (r) => t.check(Ti(Xs, r)), t.xid = (r) => t.check(fi(Vs, r)), t.ksuid = (r) => t.check(mi(Bs, r)), t.ipv4 = (r) => t.check(gi(Js, r)), t.ipv6 = (r) => t.check(vi(Ws, r)), t.cidrv4 = (r) => t.check(_i(Ks, r)), t.cidrv6 = (r) => t.check(ki(Ys, r)), t.e164 = (r) => t.check(bi(Qs, r)), t.datetime = (r) => t.check(gs(r)), t.date = (r) => t.check(_s(r)), t.time = (r) => t.check(ys(r)), t.duration = (r) => t.check(bs(r));
4071
4095
  });
4072
- function I(t) {
4073
- return ni(Ls, t);
4096
+ function E(t) {
4097
+ return ri(xs, t);
4074
4098
  }
4075
4099
  const _ = /* @__PURE__ */ u("ZodStringFormat", (t, e) => {
4076
- g.init(t, e), Et.init(t, e);
4077
- }), xs = /* @__PURE__ */ u("ZodEmail", (t, e) => {
4078
- pr.init(t, e), _.init(t, e);
4079
- }), je = /* @__PURE__ */ u("ZodGUID", (t, e) => {
4080
- ur.init(t, e), _.init(t, e);
4100
+ v.init(t, e), It.init(t, e);
4101
+ }), Ls = /* @__PURE__ */ u("ZodEmail", (t, e) => {
4102
+ hn.init(t, e), _.init(t, e);
4103
+ }), Me = /* @__PURE__ */ u("ZodGUID", (t, e) => {
4104
+ un.init(t, e), _.init(t, e);
4081
4105
  }), X = /* @__PURE__ */ u("ZodUUID", (t, e) => {
4082
- hr.init(t, e), _.init(t, e);
4106
+ pn.init(t, e), _.init(t, e);
4083
4107
  }), Ds = /* @__PURE__ */ u("ZodURL", (t, e) => {
4084
- lr.init(t, e), _.init(t, e);
4108
+ ln.init(t, e), _.init(t, e);
4085
4109
  }), Fs = /* @__PURE__ */ u("ZodEmoji", (t, e) => {
4086
- dr.init(t, e), _.init(t, e);
4087
- }), js = /* @__PURE__ */ u("ZodNanoID", (t, e) => {
4088
- fr.init(t, e), _.init(t, e);
4089
- }), Ms = /* @__PURE__ */ u("ZodCUID", (t, e) => {
4090
- mr.init(t, e), _.init(t, e);
4110
+ dn.init(t, e), _.init(t, e);
4111
+ }), Ms = /* @__PURE__ */ u("ZodNanoID", (t, e) => {
4112
+ fn.init(t, e), _.init(t, e);
4113
+ }), js = /* @__PURE__ */ u("ZodCUID", (t, e) => {
4114
+ mn.init(t, e), _.init(t, e);
4091
4115
  }), Us = /* @__PURE__ */ u("ZodCUID2", (t, e) => {
4092
- gr.init(t, e), _.init(t, e);
4116
+ gn.init(t, e), _.init(t, e);
4093
4117
  }), Gs = /* @__PURE__ */ u("ZodULID", (t, e) => {
4094
- vr.init(t, e), _.init(t, e);
4118
+ vn.init(t, e), _.init(t, e);
4095
4119
  }), Vs = /* @__PURE__ */ u("ZodXID", (t, e) => {
4096
- _r.init(t, e), _.init(t, e);
4120
+ _n.init(t, e), _.init(t, e);
4097
4121
  }), Bs = /* @__PURE__ */ u("ZodKSUID", (t, e) => {
4098
- kr.init(t, e), _.init(t, e);
4122
+ kn.init(t, e), _.init(t, e);
4099
4123
  }), Js = /* @__PURE__ */ u("ZodIPv4", (t, e) => {
4100
- Er.init(t, e), _.init(t, e);
4124
+ In.init(t, e), _.init(t, e);
4101
4125
  }), Ws = /* @__PURE__ */ u("ZodIPv6", (t, e) => {
4102
- Ir.init(t, e), _.init(t, e);
4126
+ En.init(t, e), _.init(t, e);
4103
4127
  }), Ks = /* @__PURE__ */ u("ZodCIDRv4", (t, e) => {
4104
- zr.init(t, e), _.init(t, e);
4128
+ zn.init(t, e), _.init(t, e);
4105
4129
  }), Ys = /* @__PURE__ */ u("ZodCIDRv6", (t, e) => {
4106
- $r.init(t, e), _.init(t, e);
4130
+ $n.init(t, e), _.init(t, e);
4107
4131
  }), qs = /* @__PURE__ */ u("ZodBase64", (t, e) => {
4108
- Or.init(t, e), _.init(t, e);
4132
+ On.init(t, e), _.init(t, e);
4109
4133
  }), Xs = /* @__PURE__ */ u("ZodBase64URL", (t, e) => {
4110
- Sr.init(t, e), _.init(t, e);
4134
+ Sn.init(t, e), _.init(t, e);
4111
4135
  }), Qs = /* @__PURE__ */ u("ZodE164", (t, e) => {
4112
- Nr.init(t, e), _.init(t, e);
4136
+ Nn.init(t, e), _.init(t, e);
4113
4137
  }), Hs = /* @__PURE__ */ u("ZodJWT", (t, e) => {
4114
- Zr.init(t, e), _.init(t, e);
4115
- }), It = /* @__PURE__ */ u("ZodNumber", (t, e) => {
4116
- 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;
4117
- const n = t._zod.bag;
4118
- 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;
4138
+ Zn.init(t, e), _.init(t, e);
4139
+ }), Et = /* @__PURE__ */ u("ZodNumber", (t, e) => {
4140
+ mt.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, i, s) => qi(t, n, i), t.gt = (n, i) => t.check(De(n, i)), t.gte = (n, i) => t.check(he(n, i)), t.min = (n, i) => t.check(he(n, i)), t.lt = (n, i) => t.check(Le(n, i)), t.lte = (n, i) => t.check(pe(n, i)), t.max = (n, i) => t.check(pe(n, i)), t.int = (n) => t.check(je(n)), t.safe = (n) => t.check(je(n)), t.positive = (n) => t.check(De(0, n)), t.nonnegative = (n) => t.check(he(0, n)), t.negative = (n) => t.check(Le(0, n)), t.nonpositive = (n) => t.check(pe(0, n)), t.multipleOf = (n, i) => t.check(Fe(n, i)), t.step = (n, i) => t.check(Fe(n, i)), t.finite = () => t;
4141
+ const r = t._zod.bag;
4142
+ t.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), t.isFinite = !0, t.format = r.format ?? null;
4119
4143
  });
4120
4144
  function eo(t) {
4121
- return Oi(It, t);
4145
+ return Oi(Et, t);
4122
4146
  }
4123
4147
  const to = /* @__PURE__ */ u("ZodNumberFormat", (t, e) => {
4124
- Cr.init(t, e), It.init(t, e);
4148
+ Cn.init(t, e), Et.init(t, e);
4125
4149
  });
4126
- function Me(t) {
4150
+ function je(t) {
4127
4151
  return Pi(to, t);
4128
4152
  }
4129
- const no = /* @__PURE__ */ u("ZodUnknown", (t, e) => {
4130
- Rr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Qi();
4153
+ const ro = /* @__PURE__ */ u("ZodUnknown", (t, e) => {
4154
+ Rn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => Qi();
4131
4155
  });
4132
4156
  function Ue() {
4133
- return Si(no);
4157
+ return Si(ro);
4134
4158
  }
4135
- const ro = /* @__PURE__ */ u("ZodNever", (t, e) => {
4136
- Lr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Xi(t, n, r);
4159
+ const no = /* @__PURE__ */ u("ZodNever", (t, e) => {
4160
+ xn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => Xi(t, r, n);
4137
4161
  });
4138
4162
  function io(t) {
4139
- return Ni(ro, t);
4163
+ return Ni(no, t);
4140
4164
  }
4141
4165
  const so = /* @__PURE__ */ u("ZodArray", (t, e) => {
4142
- 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;
4166
+ Ln.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ns(t, r, n, i), t.element = e.element, t.min = (r, n) => t.check(ee(r, n)), t.nonempty = (r) => t.check(ee(1, r)), t.max = (r, n) => t.check(kt(r, n)), t.length = (r, n) => t.check(yt(r, n)), t.unwrap = () => t.element;
4143
4167
  });
4144
4168
  function Z(t, e) {
4145
4169
  return Gi(so, t, e);
4146
4170
  }
4147
4171
  const oo = /* @__PURE__ */ u("ZodObject", (t, e) => {
4148
- 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]);
4172
+ Fn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => is(t, r, n, i), m(t, "shape", () => e.shape), t.keyof = () => $t(Object.keys(t._zod.def.shape)), t.catchall = (r) => t.clone({ ...t._zod.def, catchall: r }), 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 = (r) => or(t, r), t.safeExtend = (r) => ar(t, r), t.merge = (r) => cr(t, r), t.pick = (r) => ir(t, r), t.omit = (r) => sr(t, r), t.partial = (...r) => ur(Ot, t, r[0]), t.required = (...r) => pr(Pt, t, r[0]);
4149
4173
  });
4150
4174
  function z(t, e) {
4151
- const n = {
4175
+ const r = {
4152
4176
  type: "object",
4153
4177
  shape: t ?? {},
4154
4178
  ...l(e)
4155
4179
  };
4156
- return new oo(n);
4180
+ return new oo(r);
4157
4181
  }
4158
4182
  const zt = /* @__PURE__ */ u("ZodUnion", (t, e) => {
4159
- _t.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ss(t, n, r, i), t.options = e.options;
4183
+ _t.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ss(t, r, n, i), t.options = e.options;
4160
4184
  });
4161
4185
  function ae(t, e) {
4162
4186
  return new zt({
@@ -4166,20 +4190,20 @@ function ae(t, e) {
4166
4190
  });
4167
4191
  }
4168
4192
  const ao = /* @__PURE__ */ u("ZodDiscriminatedUnion", (t, e) => {
4169
- zt.init(t, e), jr.init(t, e);
4193
+ zt.init(t, e), Mn.init(t, e);
4170
4194
  });
4171
- function co(t, e, n) {
4195
+ function co(t, e, r) {
4172
4196
  return new ao({
4173
4197
  type: "union",
4174
4198
  options: e,
4175
4199
  discriminator: t,
4176
- ...l(n)
4200
+ ...l(r)
4177
4201
  });
4178
4202
  }
4179
4203
  const uo = /* @__PURE__ */ u("ZodIntersection", (t, e) => {
4180
- Mr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => os(t, n, r, i);
4204
+ jn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => os(t, r, n, i);
4181
4205
  });
4182
- function ho(t, e) {
4206
+ function po(t, e) {
4183
4207
  return new uo({
4184
4208
  type: "intersection",
4185
4209
  left: t,
@@ -4187,12 +4211,12 @@ function ho(t, e) {
4187
4211
  });
4188
4212
  }
4189
4213
  const fe = /* @__PURE__ */ u("ZodEnum", (t, e) => {
4190
- 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);
4191
- const n = new Set(Object.keys(e.entries));
4192
- t.extract = (r, i) => {
4214
+ Un.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, i, s) => Hi(t, n, i), t.enum = e.entries, t.options = Object.values(e.entries);
4215
+ const r = new Set(Object.keys(e.entries));
4216
+ t.extract = (n, i) => {
4193
4217
  const s = {};
4194
- for (const o of r)
4195
- if (n.has(o))
4218
+ for (const o of n)
4219
+ if (r.has(o))
4196
4220
  s[o] = e.entries[o];
4197
4221
  else
4198
4222
  throw new Error(`Key ${o} not found in enum`);
@@ -4202,10 +4226,10 @@ const fe = /* @__PURE__ */ u("ZodEnum", (t, e) => {
4202
4226
  ...l(i),
4203
4227
  entries: s
4204
4228
  });
4205
- }, t.exclude = (r, i) => {
4229
+ }, t.exclude = (n, i) => {
4206
4230
  const s = { ...e.entries };
4207
- for (const o of r)
4208
- if (n.has(o))
4231
+ for (const o of n)
4232
+ if (r.has(o))
4209
4233
  delete s[o];
4210
4234
  else
4211
4235
  throw new Error(`Key ${o} not found in enum`);
@@ -4218,15 +4242,15 @@ const fe = /* @__PURE__ */ u("ZodEnum", (t, e) => {
4218
4242
  };
4219
4243
  });
4220
4244
  function $t(t, e) {
4221
- const n = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, r])) : t;
4245
+ const r = Array.isArray(t) ? Object.fromEntries(t.map((n) => [n, n])) : t;
4222
4246
  return new fe({
4223
4247
  type: "enum",
4224
- entries: n,
4248
+ entries: r,
4225
4249
  ...l(e)
4226
4250
  });
4227
4251
  }
4228
- const po = /* @__PURE__ */ u("ZodLiteral", (t, e) => {
4229
- 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", {
4252
+ const ho = /* @__PURE__ */ u("ZodLiteral", (t, e) => {
4253
+ Gn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => es(t, r, n), t.values = new Set(e.values), Object.defineProperty(t, "value", {
4230
4254
  get() {
4231
4255
  if (e.values.length > 1)
4232
4256
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
@@ -4235,26 +4259,26 @@ const po = /* @__PURE__ */ u("ZodLiteral", (t, e) => {
4235
4259
  });
4236
4260
  });
4237
4261
  function A(t, e) {
4238
- return new po({
4262
+ return new ho({
4239
4263
  type: "literal",
4240
4264
  values: Array.isArray(t) ? t : [t],
4241
4265
  ...l(e)
4242
4266
  });
4243
4267
  }
4244
4268
  const lo = /* @__PURE__ */ u("ZodTransform", (t, e) => {
4245
- Vr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ns(t, n), t._zod.parse = (n, r) => {
4246
- if (r.direction === "backward")
4269
+ Vn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => rs(t, r), t._zod.parse = (r, n) => {
4270
+ if (n.direction === "backward")
4247
4271
  throw new He(t.constructor.name);
4248
- n.addIssue = (s) => {
4272
+ r.addIssue = (s) => {
4249
4273
  if (typeof s == "string")
4250
- n.issues.push(W(s, n.value, e));
4274
+ r.issues.push(W(s, r.value, e));
4251
4275
  else {
4252
4276
  const o = s;
4253
- 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));
4277
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = r.value), o.inst ?? (o.inst = t), r.issues.push(W(o));
4254
4278
  }
4255
4279
  };
4256
- const i = e.transform(n.value, n);
4257
- return i instanceof Promise ? i.then((s) => (n.value = s, n)) : (n.value = i, n);
4280
+ const i = e.transform(r.value, r);
4281
+ return i instanceof Promise ? i.then((s) => (r.value = s, r)) : (r.value = i, r);
4258
4282
  };
4259
4283
  });
4260
4284
  function fo(t) {
@@ -4264,7 +4288,7 @@ function fo(t) {
4264
4288
  });
4265
4289
  }
4266
4290
  const Ot = /* @__PURE__ */ u("ZodOptional", (t, e) => {
4267
- 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;
4291
+ Bn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => fs(t, r, n, i), t.unwrap = () => t._zod.def.innerType;
4268
4292
  });
4269
4293
  function Ge(t) {
4270
4294
  return new Ot({
@@ -4273,7 +4297,7 @@ function Ge(t) {
4273
4297
  });
4274
4298
  }
4275
4299
  const mo = /* @__PURE__ */ u("ZodNullable", (t, e) => {
4276
- 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;
4300
+ Jn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => as(t, r, n, i), t.unwrap = () => t._zod.def.innerType;
4277
4301
  });
4278
4302
  function Ve(t) {
4279
4303
  return new mo({
@@ -4282,31 +4306,31 @@ function Ve(t) {
4282
4306
  });
4283
4307
  }
4284
4308
  const go = /* @__PURE__ */ u("ZodDefault", (t, e) => {
4285
- 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;
4309
+ Wn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => us(t, r, n, i), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
4286
4310
  });
4287
4311
  function vo(t, e) {
4288
4312
  return new go({
4289
4313
  type: "default",
4290
4314
  innerType: t,
4291
4315
  get defaultValue() {
4292
- return typeof e == "function" ? e() : rt(e);
4316
+ return typeof e == "function" ? e() : nt(e);
4293
4317
  }
4294
4318
  });
4295
4319
  }
4296
4320
  const _o = /* @__PURE__ */ u("ZodPrefault", (t, e) => {
4297
- 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;
4321
+ Kn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ps(t, r, n, i), t.unwrap = () => t._zod.def.innerType;
4298
4322
  });
4299
4323
  function ko(t, e) {
4300
4324
  return new _o({
4301
4325
  type: "prefault",
4302
4326
  innerType: t,
4303
4327
  get defaultValue() {
4304
- return typeof e == "function" ? e() : rt(e);
4328
+ return typeof e == "function" ? e() : nt(e);
4305
4329
  }
4306
4330
  });
4307
4331
  }
4308
4332
  const Pt = /* @__PURE__ */ u("ZodNonOptional", (t, e) => {
4309
- 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;
4333
+ Yn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => cs(t, r, n, i), t.unwrap = () => t._zod.def.innerType;
4310
4334
  });
4311
4335
  function yo(t, e) {
4312
4336
  return new Pt({
@@ -4316,37 +4340,37 @@ function yo(t, e) {
4316
4340
  });
4317
4341
  }
4318
4342
  const To = /* @__PURE__ */ u("ZodCatch", (t, e) => {
4319
- 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;
4343
+ qn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => hs(t, r, n, i), t.unwrap = () => t._zod.def.innerType, t.removeCatch = t.unwrap;
4320
4344
  });
4321
- function wo(t, e) {
4345
+ function bo(t, e) {
4322
4346
  return new To({
4323
4347
  type: "catch",
4324
4348
  innerType: t,
4325
4349
  catchValue: typeof e == "function" ? e : () => e
4326
4350
  });
4327
4351
  }
4328
- const bo = /* @__PURE__ */ u("ZodPipe", (t, e) => {
4329
- 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;
4352
+ const wo = /* @__PURE__ */ u("ZodPipe", (t, e) => {
4353
+ Xn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ls(t, r, n, i), t.in = e.in, t.out = e.out;
4330
4354
  });
4331
4355
  function Be(t, e) {
4332
- return new bo({
4356
+ return new wo({
4333
4357
  type: "pipe",
4334
4358
  in: t,
4335
4359
  out: e
4336
4360
  // ...util.normalizeParams(params),
4337
4361
  });
4338
4362
  }
4339
- const Eo = /* @__PURE__ */ u("ZodReadonly", (t, e) => {
4340
- 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;
4363
+ const Io = /* @__PURE__ */ u("ZodReadonly", (t, e) => {
4364
+ Qn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ds(t, r, n, i), t.unwrap = () => t._zod.def.innerType;
4341
4365
  });
4342
- function Io(t) {
4343
- return new Eo({
4366
+ function Eo(t) {
4367
+ return new Io({
4344
4368
  type: "readonly",
4345
4369
  innerType: t
4346
4370
  });
4347
4371
  }
4348
4372
  const zo = /* @__PURE__ */ u("ZodCustom", (t, e) => {
4349
- Hr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ts(t, n);
4373
+ Hn.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, n, i) => ts(t, r);
4350
4374
  });
4351
4375
  function $o(t, e = {}) {
4352
4376
  return Vi(zo, t, e);
@@ -4355,86 +4379,111 @@ function Oo(t) {
4355
4379
  return Bi(t);
4356
4380
  }
4357
4381
  const S = ae([
4358
- I(),
4382
+ E(),
4359
4383
  z({
4360
- pattern: I(),
4361
- flags: I().optional()
4384
+ pattern: E().describe(`Regex pattern to match.
4385
+ @example ".*\\\\.ts$"`),
4386
+ flags: E().optional().describe(`Regex flags to modify matching behavior (e.g. "i" for case-insensitive, "m" for multiline).
4387
+ @example "i"`)
4362
4388
  })
4363
- ]), Po = z({
4364
- kind: A("fragment"),
4365
- condition: S.optional(),
4366
- operator: ae([I(), Z(I())]).optional()
4367
- // Note: Operator types might need to be refined if we want strict enum validation,
4368
- // but string is flexible for now.
4369
- }), Te = z({
4370
- kind: A("participant"),
4371
- name: S.optional(),
4372
- id: S.optional(),
4373
- stereotype: S.optional()
4374
- }), So = z({
4375
- kind: A("message"),
4376
- text: S.optional(),
4377
- from: S.optional(),
4378
- to: S.optional()
4379
- }), No = z({
4380
- kind: A("group"),
4381
- name: S.optional()
4382
- }), Ao = z({
4383
- action: A("resolve"),
4384
- selector: Po
4385
- }), Zo = z({
4386
- action: A("focus"),
4387
- selector: Te
4388
- }), Co = z({
4389
- action: A("remove"),
4389
+ ]).describe("A string or a regex pattern to match text."), Po = z({
4390
+ kind: A("fragment").describe(`The type of element to select.
4391
+ @example "fragment"`),
4392
+ condition: S.optional().describe(`Filter by branch condition text (e.g. "Success").
4393
+ @example "Success"`),
4394
+ operator: ae([E(), Z(E())]).optional().describe(`Filter by loop/alt type.
4395
+ @example "loop"
4396
+ @values "loop", "alt", "opt", "break", "par", "critical"`)
4397
+ }).describe("Selects fragment (alt/loop/opt) blocks."), Te = z({
4398
+ kind: A("participant").describe(`The type of element to select.
4399
+ @example "participant"`),
4400
+ name: S.optional().describe(`Filter by participant name (the text displayed).
4401
+ @example "UserService"`),
4402
+ id: S.optional().describe(`Filter by participant ID (alias).
4403
+ @example "S1"`),
4404
+ stereotype: S.optional().describe(`Filter by stereotype (e.g. <<Service>>).
4405
+ @example "<<Service>>"`)
4406
+ }).describe("Selects participants in the diagram."), So = z({
4407
+ kind: A("message").describe(`The type of element to select.
4408
+ @example "message"`),
4409
+ text: S.optional().describe(`Filter by message content.
4410
+ @example "Login Request"`),
4411
+ from: S.optional().describe(`Filter by Sender participant ID.
4412
+ @example "User"`),
4413
+ to: S.optional().describe(`Filter by Receiver participant ID.
4414
+ @example "Database"`)
4415
+ }).describe("Selects messages between participants."), No = z({
4416
+ kind: A("group").describe(`The type of element to select.
4417
+ @example "group"`),
4418
+ name: S.optional().describe(`Filter by group name.
4419
+ @example "Services"`)
4420
+ }).describe("Selects groups (boxes/rectangles) of participants."), Ao = z({
4421
+ action: A("resolve").describe(`The operation to perform.
4422
+ @example "resolve"`),
4423
+ selector: Po.describe("Criteria for selecting fragments to resolve.")
4424
+ }).describe("Unwraps specific branches of fragments (alt, opt, loop), simplifying the diagram."), Zo = z({
4425
+ action: A("focus").describe(`The operation to perform.
4426
+ @example "focus"`),
4427
+ selector: Te.describe("Criteria for selecting participants to focus on.")
4428
+ }).describe("Keeps only interactions involving the selected participants, hiding everything else."), Co = z({
4429
+ action: A("remove").describe(`The operation to perform.
4430
+ @example "remove"`),
4390
4431
  selector: ae([
4391
4432
  Te,
4392
4433
  So,
4393
4434
  No
4394
- ])
4395
- }), Ro = z({
4396
- action: A("merge"),
4435
+ ]).describe("Criteria for selecting elements to remove.")
4436
+ }).describe("Removes the selected elements (participants, messages, or groups) from the diagram."), Ro = z({
4437
+ action: A("merge").describe(`The operation to perform.
4438
+ @example "merge"`),
4397
4439
  into: z({
4398
- name: I().optional(),
4399
- id: I().optional(),
4400
- stereotype: I().optional()
4401
- }).optional(),
4402
- selector: Te
4403
- }), Lo = co("action", [
4440
+ name: E().optional().describe(`The name of the new merged participant.
4441
+ @example "User System"`),
4442
+ id: E().optional().describe(`The ID of the new merged participant.
4443
+ @example "MergedUser"`),
4444
+ stereotype: E().optional().describe(`The stereotype of the new merged participant.
4445
+ @example "<<System>>"`)
4446
+ }).optional().describe("Configuration for the target participant to merge into."),
4447
+ selector: Te.describe("Criteria for selecting participants to merge.")
4448
+ }).describe("Merges multiple participants into a single participant."), xo = co("action", [
4404
4449
  Ao,
4405
4450
  Zo,
4406
4451
  Co,
4407
4452
  Ro
4408
- ]), xo = z({
4409
- name: I(),
4410
- suffix: I().optional(),
4411
- // Defaults to .name in logic
4412
- layers: Z(Lo)
4413
- }), Je = $t(["mermaid", "plantuml"]), Do = z({
4414
- input: Z(I()),
4415
- outputDir: I(),
4416
- ignore: Z(I()).optional(),
4417
- lenses: Z(xo),
4418
- format: Je.optional(),
4419
- // Input format (auto-detected if omitted)
4420
- outputFormat: Je.optional()
4421
- // Output format (same as input if omitted)
4422
- }), Fo = z({
4423
- version: eo(),
4424
- targets: Z(Do)
4425
- });
4453
+ ]).describe("A transformation step to apply to the diagram."), Lo = z({
4454
+ name: E().describe(`Unique name for the lens. Used to generate the output filename.
4455
+ @example "web-view"`),
4456
+ suffix: E().optional().describe(`Custom file suffix. If omitted, defaults to ".<name>".
4457
+ @example ".web.mmd"`),
4458
+ layers: Z(xo).describe("Ordered list of transformation layers. Applied sequentially.")
4459
+ }).describe("A specific view or transformation configuration for the diagram."), Je = $t(["mermaid", "plantuml"]).describe(`Supported diagram format for parsing/generation.
4460
+ @example "mermaid"`), Do = z({
4461
+ input: Z(E()).describe(`Array of file paths or glob patterns to include.
4462
+ @example ["src/**/*.mmd"]`),
4463
+ outputDir: E().describe(`Directory where generated files will be saved.
4464
+ @example "generated"`),
4465
+ ignore: Z(E()).optional().describe(`Array of glob patterns to exclude files from processing.
4466
+ @example ["**/node_modules/**", "**/*.test.mmd"]`),
4467
+ lenses: Z(Lo).describe("List of lenses (transformations) to apply to the input diagrams."),
4468
+ format: Je.optional().describe("Input format (auto-detected if omitted)."),
4469
+ outputFormat: Je.optional().describe("Output format (same as input if omitted).")
4470
+ }).describe("Defines a conversion target: inputs, output location, and transformations."), Fo = z({
4471
+ version: eo().describe(`The version of the configuration schema. Currently, only version 1 is supported.
4472
+ @example 1`),
4473
+ targets: Z(Do).describe("A list of conversion targets.")
4474
+ }).describe("The root configuration object for Polagram.");
4426
4475
  function Vo(t) {
4427
4476
  const e = Fo.safeParse(t);
4428
4477
  if (!e.success) {
4429
- const n = e.error.issues.map((r) => `[${r.path.join(".")}]: ${r.message}`).join(`
4478
+ const r = e.error.issues.map((n) => `[${n.path.join(".")}]: ${n.message}`).join(`
4430
4479
  `);
4431
4480
  throw new Error(`Invalid Polagram Configuration:
4432
- ${n}`);
4481
+ ${r}`);
4433
4482
  }
4434
4483
  return e.data;
4435
4484
  }
4436
4485
  export {
4437
- be as FormatDetector,
4486
+ we as FormatDetector,
4438
4487
  Go as GeneratorFactory,
4439
4488
  Ye as MermaidGeneratorVisitor,
4440
4489
  Ut as ParserFactory,