@resconet/qp-bridge 1.4.0 → 1.4.1-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- var pe = { exports: {} }, Ee;
2
- function Xe() {
3
- if (Ee) return pe.exports;
4
- Ee = 1;
5
- var t = pe.exports = {}, e, s;
1
+ var xe = { exports: {} }, $e;
2
+ function rt() {
3
+ if ($e) return xe.exports;
4
+ $e = 1;
5
+ var t = xe.exports = {}, e, s;
6
6
  function n() {
7
7
  throw new Error("setTimeout has not been defined");
8
8
  }
@@ -51,38 +51,38 @@ function Xe() {
51
51
  }
52
52
  }
53
53
  }
54
- var o = [], d = !1, l, y = -1;
55
- function O() {
56
- !d || !l || (d = !1, l.length ? o = l.concat(o) : y = -1, o.length && M());
57
- }
54
+ var o = [], d = !1, l, _ = -1;
58
55
  function M() {
56
+ !d || !l || (d = !1, l.length ? o = l.concat(o) : _ = -1, o.length && Z());
57
+ }
58
+ function Z() {
59
59
  if (!d) {
60
- var k = r(O);
60
+ var k = r(M);
61
61
  d = !0;
62
- for (var E = o.length; E; ) {
63
- for (l = o, o = []; ++y < E; )
64
- l && l[y].run();
65
- y = -1, E = o.length;
62
+ for (var N = o.length; N; ) {
63
+ for (l = o, o = []; ++_ < N; )
64
+ l && l[_].run();
65
+ _ = -1, N = o.length;
66
66
  }
67
67
  l = null, d = !1, i(k);
68
68
  }
69
69
  }
70
70
  t.nextTick = function(k) {
71
- var E = new Array(arguments.length - 1);
71
+ var N = new Array(arguments.length - 1);
72
72
  if (arguments.length > 1)
73
- for (var z = 1; z < arguments.length; z++)
74
- E[z - 1] = arguments[z];
75
- o.push(new Ie(k, E)), o.length === 1 && !d && r(M);
73
+ for (var H = 1; H < arguments.length; H++)
74
+ N[H - 1] = arguments[H];
75
+ o.push(new Pe(k, N)), o.length === 1 && !d && r(Z);
76
76
  };
77
- function Ie(k, E) {
78
- this.fun = k, this.array = E;
77
+ function Pe(k, N) {
78
+ this.fun = k, this.array = N;
79
79
  }
80
- Ie.prototype.run = function() {
80
+ Pe.prototype.run = function() {
81
81
  this.fun.apply(null, this.array);
82
82
  }, t.title = "browser", t.browser = !0, t.env = {}, t.argv = [], t.version = "", t.versions = {};
83
- function Z() {
83
+ function q() {
84
84
  }
85
- return t.on = Z, t.addListener = Z, t.once = Z, t.off = Z, t.removeListener = Z, t.removeAllListeners = Z, t.emit = Z, t.prependListener = Z, t.prependOnceListener = Z, t.listeners = function(k) {
85
+ return t.on = q, t.addListener = q, t.once = q, t.off = q, t.removeListener = q, t.removeAllListeners = q, t.emit = q, t.prependListener = q, t.prependOnceListener = q, t.listeners = function(k) {
86
86
  return [];
87
87
  }, t.binding = function(k) {
88
88
  throw new Error("process.binding is not supported");
@@ -92,33 +92,30 @@ function Xe() {
92
92
  throw new Error("process.chdir is not supported");
93
93
  }, t.umask = function() {
94
94
  return 0;
95
- }, pe.exports;
95
+ }, xe.exports;
96
96
  }
97
- var Ke = Xe();
98
- let ie;
99
- const et = new Uint8Array(16);
100
- function tt() {
101
- if (!ie && (ie = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ie))
102
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
103
- return ie(et);
104
- }
105
- const R = [];
97
+ var it = rt();
98
+ const T = [];
106
99
  for (let t = 0; t < 256; ++t)
107
- R.push((t + 256).toString(16).slice(1));
108
- function st(t, e = 0) {
109
- return R[t[e + 0]] + R[t[e + 1]] + R[t[e + 2]] + R[t[e + 3]] + "-" + R[t[e + 4]] + R[t[e + 5]] + "-" + R[t[e + 6]] + R[t[e + 7]] + "-" + R[t[e + 8]] + R[t[e + 9]] + "-" + R[t[e + 10]] + R[t[e + 11]] + R[t[e + 12]] + R[t[e + 13]] + R[t[e + 14]] + R[t[e + 15]];
100
+ T.push((t + 256).toString(16).slice(1));
101
+ function ot(t, e = 0) {
102
+ return (T[t[e + 0]] + T[t[e + 1]] + T[t[e + 2]] + T[t[e + 3]] + "-" + T[t[e + 4]] + T[t[e + 5]] + "-" + T[t[e + 6]] + T[t[e + 7]] + "-" + T[t[e + 8]] + T[t[e + 9]] + "-" + T[t[e + 10]] + T[t[e + 11]] + T[t[e + 12]] + T[t[e + 13]] + T[t[e + 14]] + T[t[e + 15]]).toLowerCase();
110
103
  }
111
- const nt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ne = {
112
- randomUUID: nt
113
- };
114
- function ze(t, e, s) {
115
- if (Ne.randomUUID && !t)
116
- return Ne.randomUUID();
104
+ const ct = new Uint8Array(16);
105
+ function ut() {
106
+ return crypto.getRandomValues(ct);
107
+ }
108
+ function We(t, e, s) {
109
+ return crypto.randomUUID ? crypto.randomUUID() : dt(t);
110
+ }
111
+ function dt(t, e, s) {
117
112
  t = t || {};
118
- const n = t.random || (t.rng || tt)();
119
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, st(n);
113
+ const n = t.random ?? t.rng?.() ?? ut();
114
+ if (n.length < 16)
115
+ throw new Error("Random bytes length must be >= 16");
116
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ot(n);
120
117
  }
121
- var v;
118
+ var x;
122
119
  (function(t) {
123
120
  t.assertEqual = (a) => {
124
121
  };
@@ -154,16 +151,16 @@ var v;
154
151
  return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(r);
155
152
  }
156
153
  t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
157
- })(v || (v = {}));
158
- var Ae;
154
+ })(x || (x = {}));
155
+ var Le;
159
156
  (function(t) {
160
157
  t.mergeShapes = (e, s) => ({
161
158
  ...e,
162
159
  ...s
163
160
  // second overwrites first
164
161
  });
165
- })(Ae || (Ae = {}));
166
- const f = v.arrayToEnum([
162
+ })(Le || (Le = {}));
163
+ const f = x.arrayToEnum([
167
164
  "string",
168
165
  "nan",
169
166
  "number",
@@ -184,7 +181,7 @@ const f = v.arrayToEnum([
184
181
  "never",
185
182
  "map",
186
183
  "set"
187
- ]), P = (t) => {
184
+ ]), U = (t) => {
188
185
  switch (typeof t) {
189
186
  case "undefined":
190
187
  return f.undefined;
@@ -205,7 +202,7 @@ const f = v.arrayToEnum([
205
202
  default:
206
203
  return f.unknown;
207
204
  }
208
- }, c = v.arrayToEnum([
205
+ }, c = x.arrayToEnum([
209
206
  "invalid_type",
210
207
  "invalid_literal",
211
208
  "custom",
@@ -223,7 +220,7 @@ const f = v.arrayToEnum([
223
220
  "not_multiple_of",
224
221
  "not_finite"
225
222
  ]);
226
- class j extends Error {
223
+ class L extends Error {
227
224
  get errors() {
228
225
  return this.issues;
229
226
  }
@@ -260,14 +257,14 @@ class j extends Error {
260
257
  return a(this), n;
261
258
  }
262
259
  static assert(e) {
263
- if (!(e instanceof j))
260
+ if (!(e instanceof L))
264
261
  throw new Error(`Not a ZodError: ${e}`);
265
262
  }
266
263
  toString() {
267
264
  return this.message;
268
265
  }
269
266
  get message() {
270
- return JSON.stringify(this.issues, v.jsonStringifyReplacer, 2);
267
+ return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
271
268
  }
272
269
  get isEmpty() {
273
270
  return this.issues.length === 0;
@@ -286,27 +283,27 @@ class j extends Error {
286
283
  return this.flatten();
287
284
  }
288
285
  }
289
- j.create = (t) => new j(t);
290
- const ge = (t, e) => {
286
+ L.create = (t) => new L(t);
287
+ const ke = (t, e) => {
291
288
  let s;
292
289
  switch (t.code) {
293
290
  case c.invalid_type:
294
291
  t.received === f.undefined ? s = "Required" : s = `Expected ${t.expected}, received ${t.received}`;
295
292
  break;
296
293
  case c.invalid_literal:
297
- s = `Invalid literal value, expected ${JSON.stringify(t.expected, v.jsonStringifyReplacer)}`;
294
+ s = `Invalid literal value, expected ${JSON.stringify(t.expected, x.jsonStringifyReplacer)}`;
298
295
  break;
299
296
  case c.unrecognized_keys:
300
- s = `Unrecognized key(s) in object: ${v.joinValues(t.keys, ", ")}`;
297
+ s = `Unrecognized key(s) in object: ${x.joinValues(t.keys, ", ")}`;
301
298
  break;
302
299
  case c.invalid_union:
303
300
  s = "Invalid input";
304
301
  break;
305
302
  case c.invalid_union_discriminator:
306
- s = `Invalid discriminator value. Expected ${v.joinValues(t.options)}`;
303
+ s = `Invalid discriminator value. Expected ${x.joinValues(t.options)}`;
307
304
  break;
308
305
  case c.invalid_enum_value:
309
- s = `Invalid enum value. Expected ${v.joinValues(t.options)}, received '${t.received}'`;
306
+ s = `Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;
310
307
  break;
311
308
  case c.invalid_arguments:
312
309
  s = "Invalid function arguments";
@@ -318,7 +315,7 @@ const ge = (t, e) => {
318
315
  s = "Invalid date";
319
316
  break;
320
317
  case c.invalid_string:
321
- typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` : v.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
318
+ typeof t.validation == "object" ? "includes" in t.validation ? (s = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (s = `${s} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? s = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? s = `Invalid input: must end with "${t.validation.endsWith}"` : x.assertNever(t.validation) : t.validation !== "regex" ? s = `Invalid ${t.validation}` : s = "Invalid";
322
319
  break;
323
320
  case c.too_small:
324
321
  t.type === "array" ? s = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? s = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? s = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? s = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : s = "Invalid input";
@@ -339,15 +336,15 @@ const ge = (t, e) => {
339
336
  s = "Number must be finite";
340
337
  break;
341
338
  default:
342
- s = e.defaultError, v.assertNever(t);
339
+ s = e.defaultError, x.assertNever(t);
343
340
  }
344
341
  return { message: s };
345
342
  };
346
- let at = ge;
347
- function rt() {
348
- return at;
343
+ let lt = ke;
344
+ function ft() {
345
+ return lt;
349
346
  }
350
- const it = (t) => {
347
+ const ht = (t) => {
351
348
  const { data: e, path: s, errorMaps: n, issueData: a } = t, r = [...s, ...a.path || []], i = {
352
349
  ...a,
353
350
  path: r
@@ -369,7 +366,7 @@ const it = (t) => {
369
366
  };
370
367
  };
371
368
  function u(t, e) {
372
- const s = rt(), n = it({
369
+ const s = ft(), n = ht({
373
370
  issueData: e,
374
371
  data: t.data,
375
372
  path: t.path,
@@ -380,13 +377,13 @@ function u(t, e) {
380
377
  // then schema-bound map if available
381
378
  s,
382
379
  // then global override map
383
- s === ge ? void 0 : ge
380
+ s === ke ? void 0 : ke
384
381
  // then global default map
385
382
  ].filter((a) => !!a)
386
383
  });
387
384
  t.common.issues.push(n);
388
385
  }
389
- class T {
386
+ class R {
390
387
  constructor() {
391
388
  this.value = "valid";
392
389
  }
@@ -414,7 +411,7 @@ class T {
414
411
  value: i
415
412
  });
416
413
  }
417
- return T.mergeObjectSync(e, n);
414
+ return R.mergeObjectSync(e, n);
418
415
  }
419
416
  static mergeObjectSync(e, s) {
420
417
  const n = {};
@@ -429,12 +426,12 @@ class T {
429
426
  }
430
427
  const m = Object.freeze({
431
428
  status: "aborted"
432
- }), K = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Oe = (t) => t.status === "aborted", Me = (t) => t.status === "dirty", Q = (t) => t.status === "valid", oe = (t) => typeof Promise < "u" && t instanceof Promise;
429
+ }), ee = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }), Ve = (t) => t.status === "aborted", Ue = (t) => t.status === "dirty", Y = (t) => t.status === "valid", oe = (t) => typeof Promise < "u" && t instanceof Promise;
433
430
  var h;
434
431
  (function(t) {
435
432
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
436
433
  })(h || (h = {}));
437
- class A {
434
+ class O {
438
435
  constructor(e, s, n, a) {
439
436
  this._cachedPath = [], this.parent = e, this.data = s, this._path = n, this._key = a;
440
437
  }
@@ -442,8 +439,8 @@ class A {
442
439
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
443
440
  }
444
441
  }
445
- const Ze = (t, e) => {
446
- if (Q(e))
442
+ const Be = (t, e) => {
443
+ if (Y(e))
447
444
  return { success: !0, data: e.value };
448
445
  if (!t.common.issues.length)
449
446
  throw new Error("Validation failed but no issues detected.");
@@ -452,12 +449,12 @@ const Ze = (t, e) => {
452
449
  get error() {
453
450
  if (this._error)
454
451
  return this._error;
455
- const s = new j(t.common.issues);
452
+ const s = new L(t.common.issues);
456
453
  return this._error = s, this._error;
457
454
  }
458
455
  };
459
456
  };
460
- function g(t) {
457
+ function y(t) {
461
458
  if (!t)
462
459
  return {};
463
460
  const { errorMap: e, invalid_type_error: s, required_error: n, description: a } = t;
@@ -468,18 +465,18 @@ function g(t) {
468
465
  return i.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: d ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: d ?? s ?? o.defaultError };
469
466
  }, description: a };
470
467
  }
471
- class _ {
468
+ class v {
472
469
  get description() {
473
470
  return this._def.description;
474
471
  }
475
472
  _getType(e) {
476
- return P(e.data);
473
+ return U(e.data);
477
474
  }
478
475
  _getOrReturnCtx(e, s) {
479
476
  return s || {
480
477
  common: e.parent.common,
481
478
  data: e.data,
482
- parsedType: P(e.data),
479
+ parsedType: U(e.data),
483
480
  schemaErrorMap: this._def.errorMap,
484
481
  path: e.path,
485
482
  parent: e.parent
@@ -487,11 +484,11 @@ class _ {
487
484
  }
488
485
  _processInputParams(e) {
489
486
  return {
490
- status: new T(),
487
+ status: new R(),
491
488
  ctx: {
492
489
  common: e.parent.common,
493
490
  data: e.data,
494
- parsedType: P(e.data),
491
+ parsedType: U(e.data),
495
492
  schemaErrorMap: this._def.errorMap,
496
493
  path: e.path,
497
494
  parent: e.parent
@@ -525,9 +522,9 @@ class _ {
525
522
  schemaErrorMap: this._def.errorMap,
526
523
  parent: null,
527
524
  data: e,
528
- parsedType: P(e)
525
+ parsedType: U(e)
529
526
  }, a = this._parseSync({ data: e, path: n.path, parent: n });
530
- return Ze(n, a);
527
+ return Be(n, a);
531
528
  }
532
529
  "~validate"(e) {
533
530
  const s = {
@@ -539,12 +536,12 @@ class _ {
539
536
  schemaErrorMap: this._def.errorMap,
540
537
  parent: null,
541
538
  data: e,
542
- parsedType: P(e)
539
+ parsedType: U(e)
543
540
  };
544
541
  if (!this["~standard"].async)
545
542
  try {
546
543
  const n = this._parseSync({ data: e, path: [], parent: s });
547
- return Q(n) ? {
544
+ return Y(n) ? {
548
545
  value: n.value
549
546
  } : {
550
547
  issues: s.common.issues
@@ -555,7 +552,7 @@ class _ {
555
552
  async: !0
556
553
  };
557
554
  }
558
- return this._parseAsync({ data: e, path: [], parent: s }).then((n) => Q(n) ? {
555
+ return this._parseAsync({ data: e, path: [], parent: s }).then((n) => Y(n) ? {
559
556
  value: n.value
560
557
  } : {
561
558
  issues: s.common.issues
@@ -578,9 +575,9 @@ class _ {
578
575
  schemaErrorMap: this._def.errorMap,
579
576
  parent: null,
580
577
  data: e,
581
- parsedType: P(e)
578
+ parsedType: U(e)
582
579
  }, a = this._parse({ data: e, path: n.path, parent: n }), r = await (oe(a) ? a : Promise.resolve(a));
583
- return Ze(n, r);
580
+ return Be(n, r);
584
581
  }
585
582
  refine(e, s) {
586
583
  const n = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
@@ -596,7 +593,7 @@ class _ {
596
593
  return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof s == "function" ? s(n, a) : s), !1));
597
594
  }
598
595
  _refinement(e) {
599
- return new H({
596
+ return new D({
600
597
  schema: this,
601
598
  typeName: p.ZodEffects,
602
599
  effect: { type: "refinement", refinement: e }
@@ -613,19 +610,19 @@ class _ {
613
610
  };
614
611
  }
615
612
  optional() {
616
- return L.create(this, this._def);
613
+ return $.create(this, this._def);
617
614
  }
618
615
  nullable() {
619
- return J.create(this, this._def);
616
+ return Q.create(this, this._def);
620
617
  }
621
618
  nullish() {
622
619
  return this.nullable().optional();
623
620
  }
624
621
  array() {
625
- return N.create(this);
622
+ return A.create(this);
626
623
  }
627
624
  promise() {
628
- return fe.create(this, this._def);
625
+ return me.create(this, this._def);
629
626
  }
630
627
  or(e) {
631
628
  return ue.create([this, e], this._def);
@@ -634,8 +631,8 @@ class _ {
634
631
  return de.create(this, e, this._def);
635
632
  }
636
633
  transform(e) {
637
- return new H({
638
- ...g(this._def),
634
+ return new D({
635
+ ...y(this._def),
639
636
  schema: this,
640
637
  typeName: p.ZodEffects,
641
638
  effect: { type: "transform", transform: e }
@@ -643,24 +640,24 @@ class _ {
643
640
  }
644
641
  default(e) {
645
642
  const s = typeof e == "function" ? e : () => e;
646
- return new be({
647
- ...g(this._def),
643
+ return new pe({
644
+ ...y(this._def),
648
645
  innerType: this,
649
646
  defaultValue: s,
650
647
  typeName: p.ZodDefault
651
648
  });
652
649
  }
653
650
  brand() {
654
- return new Et({
651
+ return new Xe({
655
652
  typeName: p.ZodBranded,
656
653
  type: this,
657
- ...g(this._def)
654
+ ...y(this._def)
658
655
  });
659
656
  }
660
657
  catch(e) {
661
658
  const s = typeof e == "function" ? e : () => e;
662
- return new ke({
663
- ...g(this._def),
659
+ return new ge({
660
+ ...y(this._def),
664
661
  innerType: this,
665
662
  catchValue: s,
666
663
  typeName: p.ZodCatch
@@ -674,10 +671,10 @@ class _ {
674
671
  });
675
672
  }
676
673
  pipe(e) {
677
- return Re.create(this, e);
674
+ return Oe.create(this, e);
678
675
  }
679
676
  readonly() {
680
- return we.create(this);
677
+ return ye.create(this);
681
678
  }
682
679
  isOptional() {
683
680
  return this.safeParse(void 0).success;
@@ -686,28 +683,28 @@ class _ {
686
683
  return this.safeParse(null).success;
687
684
  }
688
685
  }
689
- const ot = /^c[^\s-]{8,}$/i, ct = /^[0-9a-z]+$/, ut = /^[0-9A-HJKMNP-TV-Z]{26}$/i, dt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, lt = /^[a-z0-9_-]{21}$/i, ft = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ht = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, pt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
690
- let me;
691
- const gt = /^(?:(?: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])$/, yt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, _t = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, vt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, De = "((\\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])))", kt = new RegExp(`^${De}$`);
692
- function Qe(t) {
686
+ const mt = /^c[^\s-]{8,}$/i, pt = /^[0-9a-z]+$/, gt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, yt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, _t = /^[a-z0-9_-]{21}$/i, vt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, xt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, bt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
687
+ let be;
688
+ const wt = /^(?:(?: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])$/, St = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Tt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Rt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ct = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, He = "((\\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])))", Et = new RegExp(`^${He}$`);
689
+ function Je(t) {
693
690
  let e = "[0-5]\\d";
694
691
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
695
692
  const s = t.precision ? "+" : "?";
696
693
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
697
694
  }
698
- function wt(t) {
699
- return new RegExp(`^${Qe(t)}$`);
695
+ function Nt(t) {
696
+ return new RegExp(`^${Je(t)}$`);
700
697
  }
701
- function St(t) {
702
- let e = `${De}T${Qe(t)}`;
698
+ function At(t) {
699
+ let e = `${He}T${Je(t)}`;
703
700
  const s = [];
704
701
  return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
705
702
  }
706
- function Rt(t, e) {
707
- return !!((e === "v4" || !e) && gt.test(t) || (e === "v6" || !e) && _t.test(t));
703
+ function Ot(t, e) {
704
+ return !!((e === "v4" || !e) && wt.test(t) || (e === "v6" || !e) && Tt.test(t));
708
705
  }
709
- function Tt(t, e) {
710
- if (!ft.test(t))
706
+ function Mt(t, e) {
707
+ if (!vt.test(t))
711
708
  return !1;
712
709
  try {
713
710
  const [s] = t.split(".");
@@ -719,10 +716,10 @@ function Tt(t, e) {
719
716
  return !1;
720
717
  }
721
718
  }
722
- function Ct(t, e) {
723
- return !!((e === "v4" || !e) && yt.test(t) || (e === "v6" || !e) && vt.test(t));
719
+ function Zt(t, e) {
720
+ return !!((e === "v4" || !e) && St.test(t) || (e === "v6" || !e) && Rt.test(t));
724
721
  }
725
- class q extends _ {
722
+ class P extends v {
726
723
  _parse(e) {
727
724
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
728
725
  const r = this._getOrReturnCtx(e);
@@ -732,7 +729,7 @@ class q extends _ {
732
729
  received: r.parsedType
733
730
  }), m;
734
731
  }
735
- const n = new T();
732
+ const n = new R();
736
733
  let a;
737
734
  for (const r of this._def.checks)
738
735
  if (r.kind === "min")
@@ -771,43 +768,43 @@ class q extends _ {
771
768
  message: r.message
772
769
  }), n.dirty());
773
770
  } else if (r.kind === "email")
774
- pt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
771
+ bt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
775
772
  validation: "email",
776
773
  code: c.invalid_string,
777
774
  message: r.message
778
775
  }), n.dirty());
779
776
  else if (r.kind === "emoji")
780
- me || (me = new RegExp(mt, "u")), me.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
777
+ be || (be = new RegExp(kt, "u")), be.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
781
778
  validation: "emoji",
782
779
  code: c.invalid_string,
783
780
  message: r.message
784
781
  }), n.dirty());
785
782
  else if (r.kind === "uuid")
786
- dt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
783
+ yt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
787
784
  validation: "uuid",
788
785
  code: c.invalid_string,
789
786
  message: r.message
790
787
  }), n.dirty());
791
788
  else if (r.kind === "nanoid")
792
- lt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
789
+ _t.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
793
790
  validation: "nanoid",
794
791
  code: c.invalid_string,
795
792
  message: r.message
796
793
  }), n.dirty());
797
794
  else if (r.kind === "cuid")
798
- ot.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
795
+ mt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
799
796
  validation: "cuid",
800
797
  code: c.invalid_string,
801
798
  message: r.message
802
799
  }), n.dirty());
803
800
  else if (r.kind === "cuid2")
804
- ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
801
+ pt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
805
802
  validation: "cuid2",
806
803
  code: c.invalid_string,
807
804
  message: r.message
808
805
  }), n.dirty());
809
806
  else if (r.kind === "ulid")
810
- ut.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
807
+ gt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
811
808
  validation: "ulid",
812
809
  code: c.invalid_string,
813
810
  message: r.message
@@ -838,43 +835,43 @@ class q extends _ {
838
835
  code: c.invalid_string,
839
836
  validation: { endsWith: r.value },
840
837
  message: r.message
841
- }), n.dirty()) : r.kind === "datetime" ? St(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
838
+ }), n.dirty()) : r.kind === "datetime" ? At(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
842
839
  code: c.invalid_string,
843
840
  validation: "datetime",
844
841
  message: r.message
845
- }), n.dirty()) : r.kind === "date" ? kt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
842
+ }), n.dirty()) : r.kind === "date" ? Et.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
846
843
  code: c.invalid_string,
847
844
  validation: "date",
848
845
  message: r.message
849
- }), n.dirty()) : r.kind === "time" ? wt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
846
+ }), n.dirty()) : r.kind === "time" ? Nt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
850
847
  code: c.invalid_string,
851
848
  validation: "time",
852
849
  message: r.message
853
- }), n.dirty()) : r.kind === "duration" ? ht.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
850
+ }), n.dirty()) : r.kind === "duration" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
854
851
  validation: "duration",
855
852
  code: c.invalid_string,
856
853
  message: r.message
857
- }), n.dirty()) : r.kind === "ip" ? Rt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
854
+ }), n.dirty()) : r.kind === "ip" ? Ot(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
858
855
  validation: "ip",
859
856
  code: c.invalid_string,
860
857
  message: r.message
861
- }), n.dirty()) : r.kind === "jwt" ? Tt(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
858
+ }), n.dirty()) : r.kind === "jwt" ? Mt(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
862
859
  validation: "jwt",
863
860
  code: c.invalid_string,
864
861
  message: r.message
865
- }), n.dirty()) : r.kind === "cidr" ? Ct(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
862
+ }), n.dirty()) : r.kind === "cidr" ? Zt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
866
863
  validation: "cidr",
867
864
  code: c.invalid_string,
868
865
  message: r.message
869
- }), n.dirty()) : r.kind === "base64" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
866
+ }), n.dirty()) : r.kind === "base64" ? Ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
870
867
  validation: "base64",
871
868
  code: c.invalid_string,
872
869
  message: r.message
873
- }), n.dirty()) : r.kind === "base64url" ? bt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
870
+ }), n.dirty()) : r.kind === "base64url" ? It.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
874
871
  validation: "base64url",
875
872
  code: c.invalid_string,
876
873
  message: r.message
877
- }), n.dirty()) : v.assertNever(r);
874
+ }), n.dirty()) : x.assertNever(r);
878
875
  return { status: n.value, value: e.data };
879
876
  }
880
877
  _regex(e, s, n) {
@@ -885,7 +882,7 @@ class q extends _ {
885
882
  });
886
883
  }
887
884
  _addCheck(e) {
888
- return new q({
885
+ return new P({
889
886
  ...this._def,
890
887
  checks: [...this._def.checks, e]
891
888
  });
@@ -1021,19 +1018,19 @@ class q extends _ {
1021
1018
  return this.min(1, h.errToObj(e));
1022
1019
  }
1023
1020
  trim() {
1024
- return new q({
1021
+ return new P({
1025
1022
  ...this._def,
1026
1023
  checks: [...this._def.checks, { kind: "trim" }]
1027
1024
  });
1028
1025
  }
1029
1026
  toLowerCase() {
1030
- return new q({
1027
+ return new P({
1031
1028
  ...this._def,
1032
1029
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1033
1030
  });
1034
1031
  }
1035
1032
  toUpperCase() {
1036
- return new q({
1033
+ return new P({
1037
1034
  ...this._def,
1038
1035
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1039
1036
  });
@@ -1099,17 +1096,17 @@ class q extends _ {
1099
1096
  return e;
1100
1097
  }
1101
1098
  }
1102
- q.create = (t) => new q({
1099
+ P.create = (t) => new P({
1103
1100
  checks: [],
1104
1101
  typeName: p.ZodString,
1105
1102
  coerce: t?.coerce ?? !1,
1106
- ...g(t)
1103
+ ...y(t)
1107
1104
  });
1108
- function It(t, e) {
1105
+ function qt(t, e) {
1109
1106
  const s = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = s > n ? s : n, r = Number.parseInt(t.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
1110
1107
  return r % i / 10 ** a;
1111
1108
  }
1112
- class F extends _ {
1109
+ class X extends v {
1113
1110
  constructor() {
1114
1111
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1115
1112
  }
@@ -1123,9 +1120,9 @@ class F extends _ {
1123
1120
  }), m;
1124
1121
  }
1125
1122
  let n;
1126
- const a = new T();
1123
+ const a = new R();
1127
1124
  for (const r of this._def.checks)
1128
- r.kind === "int" ? v.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1125
+ r.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1129
1126
  code: c.invalid_type,
1130
1127
  expected: "integer",
1131
1128
  received: "float",
@@ -1144,14 +1141,14 @@ class F extends _ {
1144
1141
  inclusive: r.inclusive,
1145
1142
  exact: !1,
1146
1143
  message: r.message
1147
- }), a.dirty()) : r.kind === "multipleOf" ? It(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
1144
+ }), a.dirty()) : r.kind === "multipleOf" ? qt(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
1148
1145
  code: c.not_multiple_of,
1149
1146
  multipleOf: r.value,
1150
1147
  message: r.message
1151
1148
  }), a.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), u(n, {
1152
1149
  code: c.not_finite,
1153
1150
  message: r.message
1154
- }), a.dirty()) : v.assertNever(r);
1151
+ }), a.dirty()) : x.assertNever(r);
1155
1152
  return { status: a.value, value: e.data };
1156
1153
  }
1157
1154
  gte(e, s) {
@@ -1167,7 +1164,7 @@ class F extends _ {
1167
1164
  return this.setLimit("max", e, !1, h.toString(s));
1168
1165
  }
1169
1166
  setLimit(e, s, n, a) {
1170
- return new F({
1167
+ return new X({
1171
1168
  ...this._def,
1172
1169
  checks: [
1173
1170
  ...this._def.checks,
@@ -1181,7 +1178,7 @@ class F extends _ {
1181
1178
  });
1182
1179
  }
1183
1180
  _addCheck(e) {
1184
- return new F({
1181
+ return new X({
1185
1182
  ...this._def,
1186
1183
  checks: [...this._def.checks, e]
1187
1184
  });
@@ -1263,7 +1260,7 @@ class F extends _ {
1263
1260
  return e;
1264
1261
  }
1265
1262
  get isInt() {
1266
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && v.isInteger(e.value));
1263
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
1267
1264
  }
1268
1265
  get isFinite() {
1269
1266
  let e = null, s = null;
@@ -1275,13 +1272,13 @@ class F extends _ {
1275
1272
  return Number.isFinite(s) && Number.isFinite(e);
1276
1273
  }
1277
1274
  }
1278
- F.create = (t) => new F({
1275
+ X.create = (t) => new X({
1279
1276
  checks: [],
1280
1277
  typeName: p.ZodNumber,
1281
1278
  coerce: t?.coerce || !1,
1282
- ...g(t)
1279
+ ...y(t)
1283
1280
  });
1284
- class ne extends _ {
1281
+ class ae extends v {
1285
1282
  constructor() {
1286
1283
  super(...arguments), this.min = this.gte, this.max = this.lte;
1287
1284
  }
@@ -1295,7 +1292,7 @@ class ne extends _ {
1295
1292
  if (this._getType(e) !== f.bigint)
1296
1293
  return this._getInvalidInput(e);
1297
1294
  let n;
1298
- const a = new T();
1295
+ const a = new R();
1299
1296
  for (const r of this._def.checks)
1300
1297
  r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (n = this._getOrReturnCtx(e, n), u(n, {
1301
1298
  code: c.too_small,
@@ -1313,7 +1310,7 @@ class ne extends _ {
1313
1310
  code: c.not_multiple_of,
1314
1311
  multipleOf: r.value,
1315
1312
  message: r.message
1316
- }), a.dirty()) : v.assertNever(r);
1313
+ }), a.dirty()) : x.assertNever(r);
1317
1314
  return { status: a.value, value: e.data };
1318
1315
  }
1319
1316
  _getInvalidInput(e) {
@@ -1337,7 +1334,7 @@ class ne extends _ {
1337
1334
  return this.setLimit("max", e, !1, h.toString(s));
1338
1335
  }
1339
1336
  setLimit(e, s, n, a) {
1340
- return new ne({
1337
+ return new ae({
1341
1338
  ...this._def,
1342
1339
  checks: [
1343
1340
  ...this._def.checks,
@@ -1351,7 +1348,7 @@ class ne extends _ {
1351
1348
  });
1352
1349
  }
1353
1350
  _addCheck(e) {
1354
- return new ne({
1351
+ return new ae({
1355
1352
  ...this._def,
1356
1353
  checks: [...this._def.checks, e]
1357
1354
  });
@@ -1408,13 +1405,13 @@ class ne extends _ {
1408
1405
  return e;
1409
1406
  }
1410
1407
  }
1411
- ne.create = (t) => new ne({
1408
+ ae.create = (t) => new ae({
1412
1409
  checks: [],
1413
1410
  typeName: p.ZodBigInt,
1414
1411
  coerce: t?.coerce ?? !1,
1415
- ...g(t)
1412
+ ...y(t)
1416
1413
  });
1417
- class ye extends _ {
1414
+ class we extends v {
1418
1415
  _parse(e) {
1419
1416
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1420
1417
  const n = this._getOrReturnCtx(e);
@@ -1427,12 +1424,12 @@ class ye extends _ {
1427
1424
  return I(e.data);
1428
1425
  }
1429
1426
  }
1430
- ye.create = (t) => new ye({
1427
+ we.create = (t) => new we({
1431
1428
  typeName: p.ZodBoolean,
1432
1429
  coerce: t?.coerce || !1,
1433
- ...g(t)
1430
+ ...y(t)
1434
1431
  });
1435
- class ce extends _ {
1432
+ class ce extends v {
1436
1433
  _parse(e) {
1437
1434
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1438
1435
  const r = this._getOrReturnCtx(e);
@@ -1448,7 +1445,7 @@ class ce extends _ {
1448
1445
  code: c.invalid_date
1449
1446
  }), m;
1450
1447
  }
1451
- const n = new T();
1448
+ const n = new R();
1452
1449
  let a;
1453
1450
  for (const r of this._def.checks)
1454
1451
  r.kind === "min" ? e.data.getTime() < r.value && (a = this._getOrReturnCtx(e, a), u(a, {
@@ -1465,7 +1462,7 @@ class ce extends _ {
1465
1462
  exact: !1,
1466
1463
  maximum: r.value,
1467
1464
  type: "date"
1468
- }), n.dirty()) : v.assertNever(r);
1465
+ }), n.dirty()) : x.assertNever(r);
1469
1466
  return {
1470
1467
  status: n.value,
1471
1468
  value: new Date(e.data.getTime())
@@ -1508,9 +1505,9 @@ ce.create = (t) => new ce({
1508
1505
  checks: [],
1509
1506
  coerce: t?.coerce || !1,
1510
1507
  typeName: p.ZodDate,
1511
- ...g(t)
1508
+ ...y(t)
1512
1509
  });
1513
- class qe extends _ {
1510
+ class Ge extends v {
1514
1511
  _parse(e) {
1515
1512
  if (this._getType(e) !== f.symbol) {
1516
1513
  const n = this._getOrReturnCtx(e);
@@ -1523,11 +1520,11 @@ class qe extends _ {
1523
1520
  return I(e.data);
1524
1521
  }
1525
1522
  }
1526
- qe.create = (t) => new qe({
1523
+ Ge.create = (t) => new Ge({
1527
1524
  typeName: p.ZodSymbol,
1528
- ...g(t)
1525
+ ...y(t)
1529
1526
  });
1530
- class je extends _ {
1527
+ class Se extends v {
1531
1528
  _parse(e) {
1532
1529
  if (this._getType(e) !== f.undefined) {
1533
1530
  const n = this._getOrReturnCtx(e);
@@ -1540,11 +1537,11 @@ class je extends _ {
1540
1537
  return I(e.data);
1541
1538
  }
1542
1539
  }
1543
- je.create = (t) => new je({
1540
+ Se.create = (t) => new Se({
1544
1541
  typeName: p.ZodUndefined,
1545
- ...g(t)
1542
+ ...y(t)
1546
1543
  });
1547
- class Pe extends _ {
1544
+ class Te extends v {
1548
1545
  _parse(e) {
1549
1546
  if (this._getType(e) !== f.null) {
1550
1547
  const n = this._getOrReturnCtx(e);
@@ -1557,11 +1554,11 @@ class Pe extends _ {
1557
1554
  return I(e.data);
1558
1555
  }
1559
1556
  }
1560
- Pe.create = (t) => new Pe({
1557
+ Te.create = (t) => new Te({
1561
1558
  typeName: p.ZodNull,
1562
- ...g(t)
1559
+ ...y(t)
1563
1560
  });
1564
- class Le extends _ {
1561
+ class ze extends v {
1565
1562
  constructor() {
1566
1563
  super(...arguments), this._any = !0;
1567
1564
  }
@@ -1569,11 +1566,11 @@ class Le extends _ {
1569
1566
  return I(e.data);
1570
1567
  }
1571
1568
  }
1572
- Le.create = (t) => new Le({
1569
+ ze.create = (t) => new ze({
1573
1570
  typeName: p.ZodAny,
1574
- ...g(t)
1571
+ ...y(t)
1575
1572
  });
1576
- class _e extends _ {
1573
+ class Re extends v {
1577
1574
  constructor() {
1578
1575
  super(...arguments), this._unknown = !0;
1579
1576
  }
@@ -1581,11 +1578,11 @@ class _e extends _ {
1581
1578
  return I(e.data);
1582
1579
  }
1583
1580
  }
1584
- _e.create = (t) => new _e({
1581
+ Re.create = (t) => new Re({
1585
1582
  typeName: p.ZodUnknown,
1586
- ...g(t)
1583
+ ...y(t)
1587
1584
  });
1588
- class $ extends _ {
1585
+ class B extends v {
1589
1586
  _parse(e) {
1590
1587
  const s = this._getOrReturnCtx(e);
1591
1588
  return u(s, {
@@ -1595,11 +1592,11 @@ class $ extends _ {
1595
1592
  }), m;
1596
1593
  }
1597
1594
  }
1598
- $.create = (t) => new $({
1595
+ B.create = (t) => new B({
1599
1596
  typeName: p.ZodNever,
1600
- ...g(t)
1597
+ ...y(t)
1601
1598
  });
1602
- class $e extends _ {
1599
+ class De extends v {
1603
1600
  _parse(e) {
1604
1601
  if (this._getType(e) !== f.undefined) {
1605
1602
  const n = this._getOrReturnCtx(e);
@@ -1612,11 +1609,11 @@ class $e extends _ {
1612
1609
  return I(e.data);
1613
1610
  }
1614
1611
  }
1615
- $e.create = (t) => new $e({
1612
+ De.create = (t) => new De({
1616
1613
  typeName: p.ZodVoid,
1617
- ...g(t)
1614
+ ...y(t)
1618
1615
  });
1619
- class N extends _ {
1616
+ class A extends v {
1620
1617
  _parse(e) {
1621
1618
  const { ctx: s, status: n } = this._processInputParams(e), a = this._def;
1622
1619
  if (s.parsedType !== f.array)
@@ -1652,27 +1649,27 @@ class N extends _ {
1652
1649
  exact: !1,
1653
1650
  message: a.maxLength.message
1654
1651
  }), n.dirty()), s.common.async)
1655
- return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new A(s, i, s.path, o)))).then((i) => T.mergeArray(n, i));
1656
- const r = [...s.data].map((i, o) => a.type._parseSync(new A(s, i, s.path, o)));
1657
- return T.mergeArray(n, r);
1652
+ return Promise.all([...s.data].map((i, o) => a.type._parseAsync(new O(s, i, s.path, o)))).then((i) => R.mergeArray(n, i));
1653
+ const r = [...s.data].map((i, o) => a.type._parseSync(new O(s, i, s.path, o)));
1654
+ return R.mergeArray(n, r);
1658
1655
  }
1659
1656
  get element() {
1660
1657
  return this._def.type;
1661
1658
  }
1662
1659
  min(e, s) {
1663
- return new N({
1660
+ return new A({
1664
1661
  ...this._def,
1665
1662
  minLength: { value: e, message: h.toString(s) }
1666
1663
  });
1667
1664
  }
1668
1665
  max(e, s) {
1669
- return new N({
1666
+ return new A({
1670
1667
  ...this._def,
1671
1668
  maxLength: { value: e, message: h.toString(s) }
1672
1669
  });
1673
1670
  }
1674
1671
  length(e, s) {
1675
- return new N({
1672
+ return new A({
1676
1673
  ...this._def,
1677
1674
  exactLength: { value: e, message: h.toString(s) }
1678
1675
  });
@@ -1681,38 +1678,38 @@ class N extends _ {
1681
1678
  return this.min(1, e);
1682
1679
  }
1683
1680
  }
1684
- N.create = (t, e) => new N({
1681
+ A.create = (t, e) => new A({
1685
1682
  type: t,
1686
1683
  minLength: null,
1687
1684
  maxLength: null,
1688
1685
  exactLength: null,
1689
1686
  typeName: p.ZodArray,
1690
- ...g(e)
1687
+ ...y(e)
1691
1688
  });
1692
- function D(t) {
1689
+ function J(t) {
1693
1690
  if (t instanceof w) {
1694
1691
  const e = {};
1695
1692
  for (const s in t.shape) {
1696
1693
  const n = t.shape[s];
1697
- e[s] = L.create(D(n));
1694
+ e[s] = $.create(J(n));
1698
1695
  }
1699
1696
  return new w({
1700
1697
  ...t._def,
1701
1698
  shape: () => e
1702
1699
  });
1703
- } else return t instanceof N ? new N({
1700
+ } else return t instanceof A ? new A({
1704
1701
  ...t._def,
1705
- type: D(t.element)
1706
- }) : t instanceof L ? L.create(D(t.unwrap())) : t instanceof J ? J.create(D(t.unwrap())) : t instanceof U ? U.create(t.items.map((e) => D(e))) : t;
1702
+ type: J(t.element)
1703
+ }) : t instanceof $ ? $.create(J(t.unwrap())) : t instanceof Q ? Q.create(J(t.unwrap())) : t instanceof G ? G.create(t.items.map((e) => J(e))) : t;
1707
1704
  }
1708
- class w extends _ {
1705
+ class w extends v {
1709
1706
  constructor() {
1710
1707
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1711
1708
  }
1712
1709
  _getCached() {
1713
1710
  if (this._cached !== null)
1714
1711
  return this._cached;
1715
- const e = this._def.shape(), s = v.objectKeys(e);
1712
+ const e = this._def.shape(), s = x.objectKeys(e);
1716
1713
  return this._cached = { shape: e, keys: s }, this._cached;
1717
1714
  }
1718
1715
  _parse(e) {
@@ -1725,25 +1722,25 @@ class w extends _ {
1725
1722
  }), m;
1726
1723
  }
1727
1724
  const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), o = [];
1728
- if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
1725
+ if (!(this._def.catchall instanceof B && this._def.unknownKeys === "strip"))
1729
1726
  for (const l in a.data)
1730
1727
  i.includes(l) || o.push(l);
1731
1728
  const d = [];
1732
1729
  for (const l of i) {
1733
- const y = r[l], O = a.data[l];
1730
+ const _ = r[l], M = a.data[l];
1734
1731
  d.push({
1735
1732
  key: { status: "valid", value: l },
1736
- value: y._parse(new A(a, O, a.path, l)),
1733
+ value: _._parse(new O(a, M, a.path, l)),
1737
1734
  alwaysSet: l in a.data
1738
1735
  });
1739
1736
  }
1740
- if (this._def.catchall instanceof $) {
1737
+ if (this._def.catchall instanceof B) {
1741
1738
  const l = this._def.unknownKeys;
1742
1739
  if (l === "passthrough")
1743
- for (const y of o)
1740
+ for (const _ of o)
1744
1741
  d.push({
1745
- key: { status: "valid", value: y },
1746
- value: { status: "valid", value: a.data[y] }
1742
+ key: { status: "valid", value: _ },
1743
+ value: { status: "valid", value: a.data[_] }
1747
1744
  });
1748
1745
  else if (l === "strict")
1749
1746
  o.length > 0 && (u(a, {
@@ -1753,30 +1750,30 @@ class w extends _ {
1753
1750
  else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1754
1751
  } else {
1755
1752
  const l = this._def.catchall;
1756
- for (const y of o) {
1757
- const O = a.data[y];
1753
+ for (const _ of o) {
1754
+ const M = a.data[_];
1758
1755
  d.push({
1759
- key: { status: "valid", value: y },
1756
+ key: { status: "valid", value: _ },
1760
1757
  value: l._parse(
1761
- new A(a, O, a.path, y)
1758
+ new O(a, M, a.path, _)
1762
1759
  //, ctx.child(key), value, getParsedType(value)
1763
1760
  ),
1764
- alwaysSet: y in a.data
1761
+ alwaysSet: _ in a.data
1765
1762
  });
1766
1763
  }
1767
1764
  }
1768
1765
  return a.common.async ? Promise.resolve().then(async () => {
1769
1766
  const l = [];
1770
- for (const y of d) {
1771
- const O = await y.key, M = await y.value;
1767
+ for (const _ of d) {
1768
+ const M = await _.key, Z = await _.value;
1772
1769
  l.push({
1773
- key: O,
1774
- value: M,
1775
- alwaysSet: y.alwaysSet
1770
+ key: M,
1771
+ value: Z,
1772
+ alwaysSet: _.alwaysSet
1776
1773
  });
1777
1774
  }
1778
1775
  return l;
1779
- }).then((l) => T.mergeObjectSync(n, l)) : T.mergeObjectSync(n, d);
1776
+ }).then((l) => R.mergeObjectSync(n, l)) : R.mergeObjectSync(n, d);
1780
1777
  }
1781
1778
  get shape() {
1782
1779
  return this._def.shape();
@@ -1918,7 +1915,7 @@ class w extends _ {
1918
1915
  }
1919
1916
  pick(e) {
1920
1917
  const s = {};
1921
- for (const n of v.objectKeys(e))
1918
+ for (const n of x.objectKeys(e))
1922
1919
  e[n] && this.shape[n] && (s[n] = this.shape[n]);
1923
1920
  return new w({
1924
1921
  ...this._def,
@@ -1927,7 +1924,7 @@ class w extends _ {
1927
1924
  }
1928
1925
  omit(e) {
1929
1926
  const s = {};
1930
- for (const n of v.objectKeys(this.shape))
1927
+ for (const n of x.objectKeys(this.shape))
1931
1928
  e[n] || (s[n] = this.shape[n]);
1932
1929
  return new w({
1933
1930
  ...this._def,
@@ -1938,11 +1935,11 @@ class w extends _ {
1938
1935
  * @deprecated
1939
1936
  */
1940
1937
  deepPartial() {
1941
- return D(this);
1938
+ return J(this);
1942
1939
  }
1943
1940
  partial(e) {
1944
1941
  const s = {};
1945
- for (const n of v.objectKeys(this.shape)) {
1942
+ for (const n of x.objectKeys(this.shape)) {
1946
1943
  const a = this.shape[n];
1947
1944
  e && !e[n] ? s[n] = a : s[n] = a.optional();
1948
1945
  }
@@ -1953,12 +1950,12 @@ class w extends _ {
1953
1950
  }
1954
1951
  required(e) {
1955
1952
  const s = {};
1956
- for (const n of v.objectKeys(this.shape))
1953
+ for (const n of x.objectKeys(this.shape))
1957
1954
  if (e && !e[n])
1958
1955
  s[n] = this.shape[n];
1959
1956
  else {
1960
1957
  let r = this.shape[n];
1961
- for (; r instanceof L; )
1958
+ for (; r instanceof $; )
1962
1959
  r = r._def.innerType;
1963
1960
  s[n] = r;
1964
1961
  }
@@ -1968,31 +1965,31 @@ class w extends _ {
1968
1965
  });
1969
1966
  }
1970
1967
  keyof() {
1971
- return Fe(v.objectKeys(this.shape));
1968
+ return Ye(x.objectKeys(this.shape));
1972
1969
  }
1973
1970
  }
1974
1971
  w.create = (t, e) => new w({
1975
1972
  shape: () => t,
1976
1973
  unknownKeys: "strip",
1977
- catchall: $.create(),
1974
+ catchall: B.create(),
1978
1975
  typeName: p.ZodObject,
1979
- ...g(e)
1976
+ ...y(e)
1980
1977
  });
1981
1978
  w.strictCreate = (t, e) => new w({
1982
1979
  shape: () => t,
1983
1980
  unknownKeys: "strict",
1984
- catchall: $.create(),
1981
+ catchall: B.create(),
1985
1982
  typeName: p.ZodObject,
1986
- ...g(e)
1983
+ ...y(e)
1987
1984
  });
1988
1985
  w.lazycreate = (t, e) => new w({
1989
1986
  shape: t,
1990
1987
  unknownKeys: "strip",
1991
- catchall: $.create(),
1988
+ catchall: B.create(),
1992
1989
  typeName: p.ZodObject,
1993
- ...g(e)
1990
+ ...y(e)
1994
1991
  });
1995
- class ue extends _ {
1992
+ class ue extends v {
1996
1993
  _parse(e) {
1997
1994
  const { ctx: s } = this._processInputParams(e), n = this._def.options;
1998
1995
  function a(r) {
@@ -2002,7 +1999,7 @@ class ue extends _ {
2002
1999
  for (const o of r)
2003
2000
  if (o.result.status === "dirty")
2004
2001
  return s.common.issues.push(...o.ctx.common.issues), o.result;
2005
- const i = r.map((o) => new j(o.ctx.common.issues));
2002
+ const i = r.map((o) => new L(o.ctx.common.issues));
2006
2003
  return u(s, {
2007
2004
  code: c.invalid_union,
2008
2005
  unionErrors: i
@@ -2038,18 +2035,18 @@ class ue extends _ {
2038
2035
  issues: []
2039
2036
  },
2040
2037
  parent: null
2041
- }, y = d._parseSync({
2038
+ }, _ = d._parseSync({
2042
2039
  data: s.data,
2043
2040
  path: s.path,
2044
2041
  parent: l
2045
2042
  });
2046
- if (y.status === "valid")
2047
- return y;
2048
- y.status === "dirty" && !r && (r = { result: y, ctx: l }), l.common.issues.length && i.push(l.common.issues);
2043
+ if (_.status === "valid")
2044
+ return _;
2045
+ _.status === "dirty" && !r && (r = { result: _, ctx: l }), l.common.issues.length && i.push(l.common.issues);
2049
2046
  }
2050
2047
  if (r)
2051
2048
  return s.common.issues.push(...r.ctx.common.issues), r.result;
2052
- const o = i.map((d) => new j(d));
2049
+ const o = i.map((d) => new L(d));
2053
2050
  return u(s, {
2054
2051
  code: c.invalid_union,
2055
2052
  unionErrors: o
@@ -2063,16 +2060,79 @@ class ue extends _ {
2063
2060
  ue.create = (t, e) => new ue({
2064
2061
  options: t,
2065
2062
  typeName: p.ZodUnion,
2066
- ...g(e)
2063
+ ...y(e)
2067
2064
  });
2068
- function ve(t, e) {
2069
- const s = P(t), n = P(e);
2065
+ const j = (t) => t instanceof fe ? j(t.schema) : t instanceof D ? j(t.innerType()) : t instanceof he ? [t.value] : t instanceof z ? t.options : t instanceof Ie ? x.objectValues(t.enum) : t instanceof pe ? j(t._def.innerType) : t instanceof Se ? [void 0] : t instanceof Te ? [null] : t instanceof $ ? [void 0, ...j(t.unwrap())] : t instanceof Q ? [null, ...j(t.unwrap())] : t instanceof Xe || t instanceof ye ? j(t.unwrap()) : t instanceof ge ? j(t._def.innerType) : [];
2066
+ class Ae extends v {
2067
+ _parse(e) {
2068
+ const { ctx: s } = this._processInputParams(e);
2069
+ if (s.parsedType !== f.object)
2070
+ return u(s, {
2071
+ code: c.invalid_type,
2072
+ expected: f.object,
2073
+ received: s.parsedType
2074
+ }), m;
2075
+ const n = this.discriminator, a = s.data[n], r = this.optionsMap.get(a);
2076
+ return r ? s.common.async ? r._parseAsync({
2077
+ data: s.data,
2078
+ path: s.path,
2079
+ parent: s
2080
+ }) : r._parseSync({
2081
+ data: s.data,
2082
+ path: s.path,
2083
+ parent: s
2084
+ }) : (u(s, {
2085
+ code: c.invalid_union_discriminator,
2086
+ options: Array.from(this.optionsMap.keys()),
2087
+ path: [n]
2088
+ }), m);
2089
+ }
2090
+ get discriminator() {
2091
+ return this._def.discriminator;
2092
+ }
2093
+ get options() {
2094
+ return this._def.options;
2095
+ }
2096
+ get optionsMap() {
2097
+ return this._def.optionsMap;
2098
+ }
2099
+ /**
2100
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2101
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2102
+ * have a different value for each object in the union.
2103
+ * @param discriminator the name of the discriminator property
2104
+ * @param types an array of object schemas
2105
+ * @param params
2106
+ */
2107
+ static create(e, s, n) {
2108
+ const a = /* @__PURE__ */ new Map();
2109
+ for (const r of s) {
2110
+ const i = j(r.shape[e]);
2111
+ if (!i.length)
2112
+ throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
2113
+ for (const o of i) {
2114
+ if (a.has(o))
2115
+ throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
2116
+ a.set(o, r);
2117
+ }
2118
+ }
2119
+ return new Ae({
2120
+ typeName: p.ZodDiscriminatedUnion,
2121
+ discriminator: e,
2122
+ options: s,
2123
+ optionsMap: a,
2124
+ ...y(n)
2125
+ });
2126
+ }
2127
+ }
2128
+ function Ce(t, e) {
2129
+ const s = U(t), n = U(e);
2070
2130
  if (t === e)
2071
2131
  return { valid: !0, data: t };
2072
2132
  if (s === f.object && n === f.object) {
2073
- const a = v.objectKeys(e), r = v.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
2133
+ const a = x.objectKeys(e), r = x.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
2074
2134
  for (const o of r) {
2075
- const d = ve(t[o], e[o]);
2135
+ const d = Ce(t[o], e[o]);
2076
2136
  if (!d.valid)
2077
2137
  return { valid: !1 };
2078
2138
  i[o] = d.data;
@@ -2083,7 +2143,7 @@ function ve(t, e) {
2083
2143
  return { valid: !1 };
2084
2144
  const a = [];
2085
2145
  for (let r = 0; r < t.length; r++) {
2086
- const i = t[r], o = e[r], d = ve(i, o);
2146
+ const i = t[r], o = e[r], d = Ce(i, o);
2087
2147
  if (!d.valid)
2088
2148
  return { valid: !1 };
2089
2149
  a.push(d.data);
@@ -2091,13 +2151,13 @@ function ve(t, e) {
2091
2151
  return { valid: !0, data: a };
2092
2152
  } else return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2093
2153
  }
2094
- class de extends _ {
2154
+ class de extends v {
2095
2155
  _parse(e) {
2096
2156
  const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
2097
- if (Oe(r) || Oe(i))
2157
+ if (Ve(r) || Ve(i))
2098
2158
  return m;
2099
- const o = ve(r.value, i.value);
2100
- return o.valid ? ((Me(r) || Me(i)) && s.dirty(), { status: s.value, value: o.data }) : (u(n, {
2159
+ const o = Ce(r.value, i.value);
2160
+ return o.valid ? ((Ue(r) || Ue(i)) && s.dirty(), { status: s.value, value: o.data }) : (u(n, {
2101
2161
  code: c.invalid_intersection_types
2102
2162
  }), m);
2103
2163
  };
@@ -2127,9 +2187,9 @@ de.create = (t, e, s) => new de({
2127
2187
  left: t,
2128
2188
  right: e,
2129
2189
  typeName: p.ZodIntersection,
2130
- ...g(s)
2190
+ ...y(s)
2131
2191
  });
2132
- class U extends _ {
2192
+ class G extends v {
2133
2193
  _parse(e) {
2134
2194
  const { status: s, ctx: n } = this._processInputParams(e);
2135
2195
  if (n.parsedType !== f.array)
@@ -2155,31 +2215,31 @@ class U extends _ {
2155
2215
  }), s.dirty());
2156
2216
  const r = [...n.data].map((i, o) => {
2157
2217
  const d = this._def.items[o] || this._def.rest;
2158
- return d ? d._parse(new A(n, i, n.path, o)) : null;
2218
+ return d ? d._parse(new O(n, i, n.path, o)) : null;
2159
2219
  }).filter((i) => !!i);
2160
- return n.common.async ? Promise.all(r).then((i) => T.mergeArray(s, i)) : T.mergeArray(s, r);
2220
+ return n.common.async ? Promise.all(r).then((i) => R.mergeArray(s, i)) : R.mergeArray(s, r);
2161
2221
  }
2162
2222
  get items() {
2163
2223
  return this._def.items;
2164
2224
  }
2165
2225
  rest(e) {
2166
- return new U({
2226
+ return new G({
2167
2227
  ...this._def,
2168
2228
  rest: e
2169
2229
  });
2170
2230
  }
2171
2231
  }
2172
- U.create = (t, e) => {
2232
+ G.create = (t, e) => {
2173
2233
  if (!Array.isArray(t))
2174
2234
  throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2175
- return new U({
2235
+ return new G({
2176
2236
  items: t,
2177
2237
  typeName: p.ZodTuple,
2178
2238
  rest: null,
2179
- ...g(e)
2239
+ ...y(e)
2180
2240
  });
2181
2241
  };
2182
- class le extends _ {
2242
+ class le extends v {
2183
2243
  get keySchema() {
2184
2244
  return this._def.keyType;
2185
2245
  }
@@ -2197,30 +2257,30 @@ class le extends _ {
2197
2257
  const a = [], r = this._def.keyType, i = this._def.valueType;
2198
2258
  for (const o in n.data)
2199
2259
  a.push({
2200
- key: r._parse(new A(n, o, n.path, o)),
2201
- value: i._parse(new A(n, n.data[o], n.path, o)),
2260
+ key: r._parse(new O(n, o, n.path, o)),
2261
+ value: i._parse(new O(n, n.data[o], n.path, o)),
2202
2262
  alwaysSet: o in n.data
2203
2263
  });
2204
- return n.common.async ? T.mergeObjectAsync(s, a) : T.mergeObjectSync(s, a);
2264
+ return n.common.async ? R.mergeObjectAsync(s, a) : R.mergeObjectSync(s, a);
2205
2265
  }
2206
2266
  get element() {
2207
2267
  return this._def.valueType;
2208
2268
  }
2209
2269
  static create(e, s, n) {
2210
- return s instanceof _ ? new le({
2270
+ return s instanceof v ? new le({
2211
2271
  keyType: e,
2212
2272
  valueType: s,
2213
2273
  typeName: p.ZodRecord,
2214
- ...g(n)
2274
+ ...y(n)
2215
2275
  }) : new le({
2216
- keyType: q.create(),
2276
+ keyType: P.create(),
2217
2277
  valueType: e,
2218
2278
  typeName: p.ZodRecord,
2219
- ...g(s)
2279
+ ...y(s)
2220
2280
  });
2221
2281
  }
2222
2282
  }
2223
- class Ve extends _ {
2283
+ class Qe extends v {
2224
2284
  get keySchema() {
2225
2285
  return this._def.keyType;
2226
2286
  }
@@ -2236,39 +2296,39 @@ class Ve extends _ {
2236
2296
  received: n.parsedType
2237
2297
  }), m;
2238
2298
  const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
2239
- key: a._parse(new A(n, o, n.path, [l, "key"])),
2240
- value: r._parse(new A(n, d, n.path, [l, "value"]))
2299
+ key: a._parse(new O(n, o, n.path, [l, "key"])),
2300
+ value: r._parse(new O(n, d, n.path, [l, "value"]))
2241
2301
  }));
2242
2302
  if (n.common.async) {
2243
2303
  const o = /* @__PURE__ */ new Map();
2244
2304
  return Promise.resolve().then(async () => {
2245
2305
  for (const d of i) {
2246
- const l = await d.key, y = await d.value;
2247
- if (l.status === "aborted" || y.status === "aborted")
2306
+ const l = await d.key, _ = await d.value;
2307
+ if (l.status === "aborted" || _.status === "aborted")
2248
2308
  return m;
2249
- (l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
2309
+ (l.status === "dirty" || _.status === "dirty") && s.dirty(), o.set(l.value, _.value);
2250
2310
  }
2251
2311
  return { status: s.value, value: o };
2252
2312
  });
2253
2313
  } else {
2254
2314
  const o = /* @__PURE__ */ new Map();
2255
2315
  for (const d of i) {
2256
- const l = d.key, y = d.value;
2257
- if (l.status === "aborted" || y.status === "aborted")
2316
+ const l = d.key, _ = d.value;
2317
+ if (l.status === "aborted" || _.status === "aborted")
2258
2318
  return m;
2259
- (l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
2319
+ (l.status === "dirty" || _.status === "dirty") && s.dirty(), o.set(l.value, _.value);
2260
2320
  }
2261
2321
  return { status: s.value, value: o };
2262
2322
  }
2263
2323
  }
2264
2324
  }
2265
- Ve.create = (t, e, s) => new Ve({
2325
+ Qe.create = (t, e, s) => new Qe({
2266
2326
  valueType: e,
2267
2327
  keyType: t,
2268
2328
  typeName: p.ZodMap,
2269
- ...g(s)
2329
+ ...y(s)
2270
2330
  });
2271
- class ae extends _ {
2331
+ class re extends v {
2272
2332
  _parse(e) {
2273
2333
  const { status: s, ctx: n } = this._processInputParams(e);
2274
2334
  if (n.parsedType !== f.set)
@@ -2296,24 +2356,24 @@ class ae extends _ {
2296
2356
  const r = this._def.valueType;
2297
2357
  function i(d) {
2298
2358
  const l = /* @__PURE__ */ new Set();
2299
- for (const y of d) {
2300
- if (y.status === "aborted")
2359
+ for (const _ of d) {
2360
+ if (_.status === "aborted")
2301
2361
  return m;
2302
- y.status === "dirty" && s.dirty(), l.add(y.value);
2362
+ _.status === "dirty" && s.dirty(), l.add(_.value);
2303
2363
  }
2304
2364
  return { status: s.value, value: l };
2305
2365
  }
2306
- const o = [...n.data.values()].map((d, l) => r._parse(new A(n, d, n.path, l)));
2366
+ const o = [...n.data.values()].map((d, l) => r._parse(new O(n, d, n.path, l)));
2307
2367
  return n.common.async ? Promise.all(o).then((d) => i(d)) : i(o);
2308
2368
  }
2309
2369
  min(e, s) {
2310
- return new ae({
2370
+ return new re({
2311
2371
  ...this._def,
2312
2372
  minSize: { value: e, message: h.toString(s) }
2313
2373
  });
2314
2374
  }
2315
2375
  max(e, s) {
2316
- return new ae({
2376
+ return new re({
2317
2377
  ...this._def,
2318
2378
  maxSize: { value: e, message: h.toString(s) }
2319
2379
  });
@@ -2325,14 +2385,14 @@ class ae extends _ {
2325
2385
  return this.min(1, e);
2326
2386
  }
2327
2387
  }
2328
- ae.create = (t, e) => new ae({
2388
+ re.create = (t, e) => new re({
2329
2389
  valueType: t,
2330
2390
  minSize: null,
2331
2391
  maxSize: null,
2332
2392
  typeName: p.ZodSet,
2333
- ...g(e)
2393
+ ...y(e)
2334
2394
  });
2335
- class Ue extends _ {
2395
+ class fe extends v {
2336
2396
  get schema() {
2337
2397
  return this._def.getter();
2338
2398
  }
@@ -2341,12 +2401,12 @@ class Ue extends _ {
2341
2401
  return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
2342
2402
  }
2343
2403
  }
2344
- Ue.create = (t, e) => new Ue({
2404
+ fe.create = (t, e) => new fe({
2345
2405
  getter: t,
2346
2406
  typeName: p.ZodLazy,
2347
- ...g(e)
2407
+ ...y(e)
2348
2408
  });
2349
- class xe extends _ {
2409
+ class he extends v {
2350
2410
  _parse(e) {
2351
2411
  if (e.data !== this._def.value) {
2352
2412
  const s = this._getOrReturnCtx(e);
@@ -2362,24 +2422,24 @@ class xe extends _ {
2362
2422
  return this._def.value;
2363
2423
  }
2364
2424
  }
2365
- xe.create = (t, e) => new xe({
2425
+ he.create = (t, e) => new he({
2366
2426
  value: t,
2367
2427
  typeName: p.ZodLiteral,
2368
- ...g(e)
2428
+ ...y(e)
2369
2429
  });
2370
- function Fe(t, e) {
2371
- return new W({
2430
+ function Ye(t, e) {
2431
+ return new z({
2372
2432
  values: t,
2373
2433
  typeName: p.ZodEnum,
2374
- ...g(e)
2434
+ ...y(e)
2375
2435
  });
2376
2436
  }
2377
- class W extends _ {
2437
+ class z extends v {
2378
2438
  _parse(e) {
2379
2439
  if (typeof e.data != "string") {
2380
2440
  const s = this._getOrReturnCtx(e), n = this._def.values;
2381
2441
  return u(s, {
2382
- expected: v.joinValues(n),
2442
+ expected: x.joinValues(n),
2383
2443
  received: s.parsedType,
2384
2444
  code: c.invalid_type
2385
2445
  }), m;
@@ -2416,32 +2476,32 @@ class W extends _ {
2416
2476
  return e;
2417
2477
  }
2418
2478
  extract(e, s = this._def) {
2419
- return W.create(e, {
2479
+ return z.create(e, {
2420
2480
  ...this._def,
2421
2481
  ...s
2422
2482
  });
2423
2483
  }
2424
2484
  exclude(e, s = this._def) {
2425
- return W.create(this.options.filter((n) => !e.includes(n)), {
2485
+ return z.create(this.options.filter((n) => !e.includes(n)), {
2426
2486
  ...this._def,
2427
2487
  ...s
2428
2488
  });
2429
2489
  }
2430
2490
  }
2431
- W.create = Fe;
2432
- class Be extends _ {
2491
+ z.create = Ye;
2492
+ class Ie extends v {
2433
2493
  _parse(e) {
2434
- const s = v.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2494
+ const s = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2435
2495
  if (n.parsedType !== f.string && n.parsedType !== f.number) {
2436
- const a = v.objectValues(s);
2496
+ const a = x.objectValues(s);
2437
2497
  return u(n, {
2438
- expected: v.joinValues(a),
2498
+ expected: x.joinValues(a),
2439
2499
  received: n.parsedType,
2440
2500
  code: c.invalid_type
2441
2501
  }), m;
2442
2502
  }
2443
- if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2444
- const a = v.objectValues(s);
2503
+ if (this._cache || (this._cache = new Set(x.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2504
+ const a = x.objectValues(s);
2445
2505
  return u(n, {
2446
2506
  received: n.data,
2447
2507
  code: c.invalid_enum_value,
@@ -2454,12 +2514,12 @@ class Be extends _ {
2454
2514
  return this._def.values;
2455
2515
  }
2456
2516
  }
2457
- Be.create = (t, e) => new Be({
2517
+ Ie.create = (t, e) => new Ie({
2458
2518
  values: t,
2459
2519
  typeName: p.ZodNativeEnum,
2460
- ...g(e)
2520
+ ...y(e)
2461
2521
  });
2462
- class fe extends _ {
2522
+ class me extends v {
2463
2523
  unwrap() {
2464
2524
  return this._def.type;
2465
2525
  }
@@ -2478,12 +2538,12 @@ class fe extends _ {
2478
2538
  })));
2479
2539
  }
2480
2540
  }
2481
- fe.create = (t, e) => new fe({
2541
+ me.create = (t, e) => new me({
2482
2542
  type: t,
2483
2543
  typeName: p.ZodPromise,
2484
- ...g(e)
2544
+ ...y(e)
2485
2545
  });
2486
- class H extends _ {
2546
+ class D extends v {
2487
2547
  innerType() {
2488
2548
  return this._def.schema;
2489
2549
  }
@@ -2510,7 +2570,7 @@ class H extends _ {
2510
2570
  path: n.path,
2511
2571
  parent: n
2512
2572
  });
2513
- return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ? K(d.value) : d;
2573
+ return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ? ee(d.value) : d;
2514
2574
  });
2515
2575
  {
2516
2576
  if (s.value === "aborted")
@@ -2520,7 +2580,7 @@ class H extends _ {
2520
2580
  path: n.path,
2521
2581
  parent: n
2522
2582
  });
2523
- return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? K(o.value) : o;
2583
+ return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? ee(o.value) : o;
2524
2584
  }
2525
2585
  }
2526
2586
  if (a.type === "refinement") {
@@ -2549,33 +2609,33 @@ class H extends _ {
2549
2609
  path: n.path,
2550
2610
  parent: n
2551
2611
  });
2552
- if (!Q(i))
2612
+ if (!Y(i))
2553
2613
  return m;
2554
2614
  const o = a.transform(i.value, r);
2555
2615
  if (o instanceof Promise)
2556
2616
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2557
2617
  return { status: s.value, value: o };
2558
2618
  } else
2559
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Q(i) ? Promise.resolve(a.transform(i.value, r)).then((o) => ({
2619
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => Y(i) ? Promise.resolve(a.transform(i.value, r)).then((o) => ({
2560
2620
  status: s.value,
2561
2621
  value: o
2562
2622
  })) : m);
2563
- v.assertNever(a);
2623
+ x.assertNever(a);
2564
2624
  }
2565
2625
  }
2566
- H.create = (t, e, s) => new H({
2626
+ D.create = (t, e, s) => new D({
2567
2627
  schema: t,
2568
2628
  typeName: p.ZodEffects,
2569
2629
  effect: e,
2570
- ...g(s)
2630
+ ...y(s)
2571
2631
  });
2572
- H.createWithPreprocess = (t, e, s) => new H({
2632
+ D.createWithPreprocess = (t, e, s) => new D({
2573
2633
  schema: e,
2574
2634
  effect: { type: "preprocess", transform: t },
2575
2635
  typeName: p.ZodEffects,
2576
- ...g(s)
2636
+ ...y(s)
2577
2637
  });
2578
- class L extends _ {
2638
+ class $ extends v {
2579
2639
  _parse(e) {
2580
2640
  return this._getType(e) === f.undefined ? I(void 0) : this._def.innerType._parse(e);
2581
2641
  }
@@ -2583,12 +2643,12 @@ class L extends _ {
2583
2643
  return this._def.innerType;
2584
2644
  }
2585
2645
  }
2586
- L.create = (t, e) => new L({
2646
+ $.create = (t, e) => new $({
2587
2647
  innerType: t,
2588
2648
  typeName: p.ZodOptional,
2589
- ...g(e)
2649
+ ...y(e)
2590
2650
  });
2591
- class J extends _ {
2651
+ class Q extends v {
2592
2652
  _parse(e) {
2593
2653
  return this._getType(e) === f.null ? I(null) : this._def.innerType._parse(e);
2594
2654
  }
@@ -2596,12 +2656,12 @@ class J extends _ {
2596
2656
  return this._def.innerType;
2597
2657
  }
2598
2658
  }
2599
- J.create = (t, e) => new J({
2659
+ Q.create = (t, e) => new Q({
2600
2660
  innerType: t,
2601
2661
  typeName: p.ZodNullable,
2602
- ...g(e)
2662
+ ...y(e)
2603
2663
  });
2604
- class be extends _ {
2664
+ class pe extends v {
2605
2665
  _parse(e) {
2606
2666
  const { ctx: s } = this._processInputParams(e);
2607
2667
  let n = s.data;
@@ -2615,13 +2675,13 @@ class be extends _ {
2615
2675
  return this._def.innerType;
2616
2676
  }
2617
2677
  }
2618
- be.create = (t, e) => new be({
2678
+ pe.create = (t, e) => new pe({
2619
2679
  innerType: t,
2620
2680
  typeName: p.ZodDefault,
2621
2681
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2622
- ...g(e)
2682
+ ...y(e)
2623
2683
  });
2624
- class ke extends _ {
2684
+ class ge extends v {
2625
2685
  _parse(e) {
2626
2686
  const { ctx: s } = this._processInputParams(e), n = {
2627
2687
  ...s,
@@ -2640,7 +2700,7 @@ class ke extends _ {
2640
2700
  status: "valid",
2641
2701
  value: r.status === "valid" ? r.value : this._def.catchValue({
2642
2702
  get error() {
2643
- return new j(n.common.issues);
2703
+ return new L(n.common.issues);
2644
2704
  },
2645
2705
  input: n.data
2646
2706
  })
@@ -2648,7 +2708,7 @@ class ke extends _ {
2648
2708
  status: "valid",
2649
2709
  value: a.status === "valid" ? a.value : this._def.catchValue({
2650
2710
  get error() {
2651
- return new j(n.common.issues);
2711
+ return new L(n.common.issues);
2652
2712
  },
2653
2713
  input: n.data
2654
2714
  })
@@ -2658,13 +2718,13 @@ class ke extends _ {
2658
2718
  return this._def.innerType;
2659
2719
  }
2660
2720
  }
2661
- ke.create = (t, e) => new ke({
2721
+ ge.create = (t, e) => new ge({
2662
2722
  innerType: t,
2663
2723
  typeName: p.ZodCatch,
2664
2724
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2665
- ...g(e)
2725
+ ...y(e)
2666
2726
  });
2667
- class Ge extends _ {
2727
+ class Fe extends v {
2668
2728
  _parse(e) {
2669
2729
  if (this._getType(e) !== f.nan) {
2670
2730
  const n = this._getOrReturnCtx(e);
@@ -2677,11 +2737,11 @@ class Ge extends _ {
2677
2737
  return { status: "valid", value: e.data };
2678
2738
  }
2679
2739
  }
2680
- Ge.create = (t) => new Ge({
2740
+ Fe.create = (t) => new Fe({
2681
2741
  typeName: p.ZodNaN,
2682
- ...g(t)
2742
+ ...y(t)
2683
2743
  });
2684
- class Et extends _ {
2744
+ class Xe extends v {
2685
2745
  _parse(e) {
2686
2746
  const { ctx: s } = this._processInputParams(e), n = s.data;
2687
2747
  return this._def.type._parse({
@@ -2694,7 +2754,7 @@ class Et extends _ {
2694
2754
  return this._def.type;
2695
2755
  }
2696
2756
  }
2697
- class Re extends _ {
2757
+ class Oe extends v {
2698
2758
  _parse(e) {
2699
2759
  const { status: s, ctx: n } = this._processInputParams(e);
2700
2760
  if (n.common.async)
@@ -2704,7 +2764,7 @@ class Re extends _ {
2704
2764
  path: n.path,
2705
2765
  parent: n
2706
2766
  });
2707
- return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(), K(r.value)) : this._def.out._parseAsync({
2767
+ return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(), ee(r.value)) : this._def.out._parseAsync({
2708
2768
  data: r.value,
2709
2769
  path: n.path,
2710
2770
  parent: n
@@ -2727,277 +2787,335 @@ class Re extends _ {
2727
2787
  }
2728
2788
  }
2729
2789
  static create(e, s) {
2730
- return new Re({
2790
+ return new Oe({
2731
2791
  in: e,
2732
2792
  out: s,
2733
2793
  typeName: p.ZodPipeline
2734
2794
  });
2735
2795
  }
2736
2796
  }
2737
- class we extends _ {
2797
+ class ye extends v {
2738
2798
  _parse(e) {
2739
- const s = this._def.innerType._parse(e), n = (a) => (Q(a) && (a.value = Object.freeze(a.value)), a);
2799
+ const s = this._def.innerType._parse(e), n = (a) => (Y(a) && (a.value = Object.freeze(a.value)), a);
2740
2800
  return oe(s) ? s.then((a) => n(a)) : n(s);
2741
2801
  }
2742
2802
  unwrap() {
2743
2803
  return this._def.innerType;
2744
2804
  }
2745
2805
  }
2746
- we.create = (t, e) => new we({
2806
+ ye.create = (t, e) => new ye({
2747
2807
  innerType: t,
2748
2808
  typeName: p.ZodReadonly,
2749
- ...g(e)
2809
+ ...y(e)
2750
2810
  });
2751
2811
  var p;
2752
2812
  (function(t) {
2753
2813
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2754
2814
  })(p || (p = {}));
2755
- const x = q.create, Te = F.create, V = ye.create, he = _e.create;
2756
- $.create;
2757
- const Nt = N.create, Y = w.create;
2758
- ue.create;
2815
+ const g = P.create, Me = X.create, E = we.create, _e = Re.create;
2816
+ B.create;
2817
+ const ve = A.create, V = w.create, jt = ue.create, Pt = Ae.create;
2759
2818
  de.create;
2760
- U.create;
2761
- const At = le.create, b = xe.create;
2762
- W.create;
2763
- fe.create;
2764
- L.create;
2765
- J.create;
2766
- const Ot = 1, B = Y({
2819
+ G.create;
2820
+ const $t = le.create, Ze = fe.create, b = he.create, Lt = z.create;
2821
+ me.create;
2822
+ $.create;
2823
+ Q.create;
2824
+ const Vt = 2, F = V({
2767
2825
  type: b("qp-bridge"),
2768
- id: x().optional(),
2769
- instanceId: x().optional()
2770
- }), S = B.extend({
2771
- featureVersion: Te().optional()
2772
- }), Mt = B.extend({
2826
+ id: g().optional(),
2827
+ instanceId: g().optional()
2828
+ }), S = F.extend({
2829
+ featureVersion: Me().optional()
2830
+ }), Ut = F.extend({
2773
2831
  status: b("answerChanged"),
2774
- question: x(),
2775
- answer: he()
2776
- }), Zt = B.extend({
2832
+ question: g(),
2833
+ answer: _e()
2834
+ }), Bt = F.extend({
2777
2835
  action: b("commandExecuted"),
2778
- commandName: x()
2779
- }), qt = B.extend({
2836
+ commandName: g()
2837
+ }), Gt = F.extend({
2780
2838
  action: b("questionnaireLoaded")
2781
- }), G = B.extend({
2839
+ }), W = F.extend({
2782
2840
  status: b("success")
2783
- }), jt = B.extend({
2841
+ }), zt = F.extend({
2784
2842
  status: b("error"),
2785
- message: x()
2786
- }), We = Y({
2787
- semanticColor: x().optional(),
2788
- label: x(),
2789
- description: x(),
2790
- disabled: V(),
2791
- required: V(),
2792
- hidden: V(),
2793
- errorMessage: x().optional(),
2794
- answer: he().optional()
2795
- }), Pt = We.partial(), Lt = Y({
2796
- id: x().uuid(),
2797
- name: x(),
2798
- mimeType: x(),
2799
- blobUrl: x()
2800
- }), Ce = At(he()), He = Y({
2801
- label: x(),
2802
- hidden: V(),
2803
- collapsed: V()
2804
- }), $t = He.partial(), Vt = Y({
2805
- entityName: x(),
2806
- id: x(),
2807
- name: x()
2808
- }), Ut = Y({
2809
- isNew: V(),
2810
- id: x().uuid(),
2811
- label: x(),
2812
- description: x().optional(),
2813
- regarding: Vt.optional()
2814
- }), Bt = S.extend({
2843
+ message: g()
2844
+ }), Dt = Lt([
2845
+ "imageMedia",
2846
+ "shortText",
2847
+ "longText",
2848
+ "url",
2849
+ "email",
2850
+ "wholeNumber",
2851
+ "decimalNumber",
2852
+ "date",
2853
+ "dateTime",
2854
+ "singleSelect",
2855
+ "multiSelect",
2856
+ "optionSet",
2857
+ "rating",
2858
+ "yesNo",
2859
+ "signature",
2860
+ "lookup"
2861
+ ]), qe = V({
2862
+ type: Dt,
2863
+ semanticColor: g().optional(),
2864
+ label: g().optional(),
2865
+ description: g().optional(),
2866
+ disabled: E(),
2867
+ required: E(),
2868
+ hidden: E(),
2869
+ errorMessage: g().optional(),
2870
+ answer: _e().optional()
2871
+ }), Qt = qe.partial(), Ft = qe.extend({
2872
+ itemType: b("question"),
2873
+ name: g()
2874
+ }), Wt = V({
2875
+ id: g().uuid(),
2876
+ name: g(),
2877
+ mimeType: g(),
2878
+ blobUrl: g()
2879
+ }), je = $t(_e()), Ke = V({
2880
+ label: g(),
2881
+ hidden: E(),
2882
+ collapsed: E()
2883
+ }), et = Ke.partial(), Ht = Pt("type", [
2884
+ V({
2885
+ itemType: b("staticComponent"),
2886
+ type: b("staticDescription"),
2887
+ name: g(),
2888
+ hidden: E().optional(),
2889
+ content: g()
2890
+ }),
2891
+ V({
2892
+ itemType: b("staticComponent"),
2893
+ type: b("button"),
2894
+ name: g(),
2895
+ hidden: E().optional(),
2896
+ clickText: g(),
2897
+ disabled: E().optional(),
2898
+ semanticColor: g().optional(),
2899
+ commandName: g().optional(),
2900
+ commandLabel: g().optional()
2901
+ })
2902
+ ]), Jt = et.extend({
2903
+ itemType: b("group"),
2904
+ name: g()
2905
+ }), Yt = V({
2906
+ itemType: b("repeatableGroup"),
2907
+ name: g(),
2908
+ label: g().optional(),
2909
+ hidden: E().optional()
2910
+ }), tt = Ze(
2911
+ () => jt([Ft, st, Xt, Ht])
2912
+ ), st = Ze(
2913
+ () => Jt.extend({
2914
+ items: ve(tt)
2915
+ })
2916
+ ), Xt = Ze(
2917
+ () => Yt.extend({
2918
+ groups: ve(st)
2919
+ })
2920
+ ), Kt = V({
2921
+ entityName: g(),
2922
+ id: g(),
2923
+ name: g()
2924
+ }), es = V({
2925
+ isNew: E(),
2926
+ id: g().uuid(),
2927
+ name: g(),
2928
+ label: g(),
2929
+ description: g().optional(),
2930
+ regarding: Kt.optional(),
2931
+ items: ve(tt)
2932
+ }), ts = S.extend({
2815
2933
  action: b("getQuestion"),
2816
- question: x()
2817
- }), Gt = G.extend({
2818
- question: We
2819
- }), zt = S.extend({
2934
+ question: g()
2935
+ }), ss = W.extend({
2936
+ question: qe
2937
+ }), ns = S.extend({
2820
2938
  action: b("setQuestion"),
2821
- question: x(),
2822
- questionData: Pt
2823
- }), Dt = S.extend({
2939
+ question: g(),
2940
+ questionData: Qt
2941
+ }), as = S.extend({
2824
2942
  action: b("getGroup"),
2825
- group: x()
2826
- }), Qt = G.extend({
2827
- group: He
2828
- }), Ft = S.extend({
2943
+ group: g()
2944
+ }), rs = W.extend({
2945
+ group: Ke
2946
+ }), is = S.extend({
2829
2947
  action: b("getQuestionnaire")
2830
- }), Wt = G.extend({
2831
- questionnaire: Ut
2832
- }), Ht = G.extend({
2833
- canSave: V()
2834
- }), Jt = S.extend({
2948
+ }), os = W.extend({
2949
+ questionnaire: es
2950
+ }), cs = W.extend({
2951
+ canSave: E()
2952
+ }), us = S.extend({
2835
2953
  action: b("canSave")
2836
- }), Yt = S.extend({
2954
+ }), ds = S.extend({
2837
2955
  action: b("setGroup"),
2838
- group: x(),
2839
- groupData: $t
2840
- }), Xt = S.extend({
2956
+ group: g(),
2957
+ groupData: et
2958
+ }), ls = S.extend({
2841
2959
  action: b("setAnswer"),
2842
- question: x(),
2843
- answer: he()
2844
- }), Kt = S.extend({
2960
+ question: g(),
2961
+ answer: _e()
2962
+ }), fs = S.extend({
2845
2963
  action: b("busyIndicatorStart")
2846
- }), es = S.extend({
2964
+ }), hs = S.extend({
2847
2965
  action: b("busyIndicatorEnd")
2848
- }), ts = S.extend({
2966
+ }), ms = S.extend({
2849
2967
  action: b("saveQuestionnaire")
2850
- }), ss = S.extend({
2968
+ }), ps = S.extend({
2851
2969
  action: b("completeAndCloseQuestionnaire")
2852
- }), ns = S.extend({
2970
+ }), gs = S.extend({
2853
2971
  action: b("executeCustomCommand"),
2854
- commandName: x()
2855
- }), as = S.extend({
2972
+ commandName: g()
2973
+ }), ys = S.extend({
2856
2974
  action: b("fetchEntities"),
2857
- fetchXml: x()
2858
- }), rs = G.extend({
2859
- entities: Nt(Ce)
2860
- }), is = S.extend({
2975
+ fetchXml: g()
2976
+ }), _s = W.extend({
2977
+ entities: ve(je)
2978
+ }), vs = S.extend({
2861
2979
  action: b("getEntityById"),
2862
- entityName: x(),
2863
- entityId: x()
2864
- }), os = G.extend({
2865
- entity: Ce
2866
- }), cs = S.extend({
2980
+ entityName: g(),
2981
+ entityId: g()
2982
+ }), xs = W.extend({
2983
+ entity: je
2984
+ }), bs = S.extend({
2867
2985
  action: b("saveEntity"),
2868
- entity: Ce
2869
- }), us = S.extend({
2986
+ entity: je
2987
+ }), ks = S.extend({
2870
2988
  action: b("repeatGroup"),
2871
- parentGroupName: x(),
2872
- groupIndex: Te()
2873
- }), ds = S.extend({
2989
+ parentGroupName: g(),
2990
+ groupIndex: Me()
2991
+ }), ws = S.extend({
2874
2992
  action: b("addNewGroup"),
2875
- groupName: x()
2876
- }), ls = S.extend({
2993
+ groupName: g()
2994
+ }), Ss = S.extend({
2877
2995
  action: b("deleteGroup"),
2878
- parentGroupName: x(),
2879
- groupIndex: Te()
2996
+ parentGroupName: g(),
2997
+ groupIndex: Me()
2880
2998
  });
2881
- function Os(t) {
2882
- return Lt.safeParse(t).success;
2999
+ function Ws(t) {
3000
+ return Wt.safeParse(t).success;
2883
3001
  }
2884
- function fs(t) {
2885
- return Mt.safeParse(t).success;
3002
+ function Ts(t) {
3003
+ return Ut.safeParse(t).success;
2886
3004
  }
2887
- function hs(t) {
2888
- return Zt.safeParse(t).success;
3005
+ function Rs(t) {
3006
+ return Bt.safeParse(t).success;
2889
3007
  }
2890
- function ps(t) {
2891
- return qt.safeParse(t).success;
3008
+ function Cs(t) {
3009
+ return Gt.safeParse(t).success;
2892
3010
  }
2893
- function Se(t) {
2894
- return B.safeParse(t).success;
3011
+ function Ee(t) {
3012
+ return F.safeParse(t).success;
2895
3013
  }
2896
- function Ms(t) {
3014
+ function Hs(t) {
2897
3015
  return S.safeParse(t).success;
2898
3016
  }
2899
- function ms(t) {
2900
- return G.safeParse(t).success;
3017
+ function Is(t) {
3018
+ return W.safeParse(t).success;
2901
3019
  }
2902
- function gs(t) {
2903
- return jt.safeParse(t).success;
3020
+ function Es(t) {
3021
+ return zt.safeParse(t).success;
2904
3022
  }
2905
- function Zs(t) {
2906
- return Bt.safeParse(t).success;
3023
+ function Js(t) {
3024
+ return ts.safeParse(t).success;
2907
3025
  }
2908
- function ys(t) {
2909
- return Gt.safeParse(t).success;
3026
+ function Ns(t) {
3027
+ return ss.safeParse(t).success;
2910
3028
  }
2911
- function qs(t) {
2912
- return Xt.safeParse(t).success;
3029
+ function Ys(t) {
3030
+ return ls.safeParse(t).success;
2913
3031
  }
2914
- function js(t) {
2915
- return zt.safeParse(t).success;
3032
+ function Xs(t) {
3033
+ return ns.safeParse(t).success;
2916
3034
  }
2917
- function Ps(t) {
2918
- return Yt.safeParse(t).success;
3035
+ function Ks(t) {
3036
+ return ds.safeParse(t).success;
2919
3037
  }
2920
- function Ls(t) {
2921
- return Dt.safeParse(t).success;
3038
+ function en(t) {
3039
+ return as.safeParse(t).success;
2922
3040
  }
2923
- function $s(t) {
2924
- return Ft.safeParse(t).success;
3041
+ function tn(t) {
3042
+ return is.safeParse(t).success;
2925
3043
  }
2926
- function _s(t) {
2927
- return Qt.safeParse(t).success;
3044
+ function As(t) {
3045
+ return rs.safeParse(t).success;
2928
3046
  }
2929
- function vs(t) {
2930
- return Wt.safeParse(t).success;
3047
+ function Os(t) {
3048
+ return os.safeParse(t).success;
2931
3049
  }
2932
- function Vs(t) {
2933
- return Ht.safeParse(t).success;
3050
+ function sn(t) {
3051
+ return cs.safeParse(t).success;
2934
3052
  }
2935
- function xs(t) {
2936
- return Jt.safeParse(t).success;
3053
+ function Ms(t) {
3054
+ return us.safeParse(t).success;
2937
3055
  }
2938
- function bs(t) {
2939
- return Kt.safeParse(t).success;
3056
+ function Zs(t) {
3057
+ return fs.safeParse(t).success;
2940
3058
  }
2941
- function ks(t) {
2942
- return es.safeParse(t).success;
3059
+ function qs(t) {
3060
+ return hs.safeParse(t).success;
2943
3061
  }
2944
- function Us(t) {
2945
- return ts.safeParse(t).success;
3062
+ function nn(t) {
3063
+ return ms.safeParse(t).success;
2946
3064
  }
2947
- function Bs(t) {
2948
- return ss.safeParse(t).success;
3065
+ function an(t) {
3066
+ return ps.safeParse(t).success;
2949
3067
  }
2950
- function Gs(t) {
2951
- return ns.safeParse(t).success;
3068
+ function rn(t) {
3069
+ return gs.safeParse(t).success;
2952
3070
  }
2953
- function zs(t) {
2954
- return bs(t) || ks(t);
3071
+ function on(t) {
3072
+ return Zs(t) || qs(t);
2955
3073
  }
2956
- function ws(t, e, s) {
2957
- return !Se(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
3074
+ function js(t, e, s) {
3075
+ return !Ee(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
2958
3076
  }
2959
- function Ds(t) {
2960
- return as.safeParse(t).success;
3077
+ function cn(t) {
3078
+ return ys.safeParse(t).success;
2961
3079
  }
2962
- function Ss(t) {
2963
- return rs.safeParse(t).success;
3080
+ function Ps(t) {
3081
+ return _s.safeParse(t).success;
2964
3082
  }
2965
- function Qs(t) {
2966
- return is.safeParse(t).success;
3083
+ function un(t) {
3084
+ return vs.safeParse(t).success;
2967
3085
  }
2968
- function Rs(t) {
2969
- return os.safeParse(t).success;
3086
+ function $s(t) {
3087
+ return xs.safeParse(t).success;
2970
3088
  }
2971
- function Fs(t) {
2972
- return cs.safeParse(t).success;
3089
+ function dn(t) {
3090
+ return bs.safeParse(t).success;
2973
3091
  }
2974
- function Ws(t) {
2975
- return us.safeParse(t).success;
3092
+ function ln(t) {
3093
+ return ks.safeParse(t).success;
2976
3094
  }
2977
- function Hs(t) {
2978
- return ds.safeParse(t).success;
3095
+ function fn(t) {
3096
+ return ws.safeParse(t).success;
2979
3097
  }
2980
- function Js(t) {
2981
- return ls.safeParse(t).success;
3098
+ function hn(t) {
3099
+ return Ss.safeParse(t).success;
2982
3100
  }
2983
- function re(t) {
3101
+ function ie(t) {
2984
3102
  if (t?.instanceId != null)
2985
3103
  return t.instanceId;
2986
3104
  const e = globalThis.__RESCO_QP_BRIDGE_INSTANCE_ID;
2987
3105
  return typeof e == "string" ? e : void 0;
2988
3106
  }
2989
- function Je(t) {
3107
+ function nt(t) {
2990
3108
  if (t instanceof File || t instanceof Blob)
2991
3109
  return URL.createObjectURL(t);
2992
3110
  if (typeof t == "string") {
2993
3111
  if (/^data:/.test(t)) {
2994
3112
  const r = t.match(/^data:([^;]+);base64,(.*)$/);
2995
3113
  if (r) {
2996
- const i = r[1], o = r[2], d = atob(o), l = new ArrayBuffer(d.length), y = new Uint8Array(l);
2997
- for (let M = 0; M < d.length; M++)
2998
- y[M] = d.charCodeAt(M);
2999
- const O = new Blob([l], { type: i });
3000
- return URL.createObjectURL(O);
3114
+ const i = r[1], o = r[2], d = atob(o), l = new ArrayBuffer(d.length), _ = new Uint8Array(l);
3115
+ for (let Z = 0; Z < d.length; Z++)
3116
+ _[Z] = d.charCodeAt(Z);
3117
+ const M = new Blob([l], { type: i });
3118
+ return URL.createObjectURL(M);
3001
3119
  }
3002
3120
  throw new Error("Invalid data URL format. Only base64 data URLs are supported.");
3003
3121
  }
@@ -3013,31 +3131,31 @@ function Je(t) {
3013
3131
  }
3014
3132
  throw new Error("Unsupported content type for blobUrl");
3015
3133
  }
3016
- function Ys(t, e, s, n) {
3134
+ function mn(t, e, s, n) {
3017
3135
  return {
3018
- id: n ?? ze(),
3136
+ id: n ?? We(),
3019
3137
  name: t,
3020
3138
  mimeType: e,
3021
- blobUrl: Je(s)
3139
+ blobUrl: nt(s)
3022
3140
  };
3023
3141
  }
3024
- function Xs(t, e) {
3142
+ function pn(t, e) {
3025
3143
  let s = t.blobUrl;
3026
- return e.content !== void 0 && (s = Je(e.content)), {
3144
+ return e.content !== void 0 && (s = nt(e.content)), {
3027
3145
  ...t,
3028
3146
  ...e,
3029
3147
  blobUrl: s
3030
3148
  };
3031
3149
  }
3032
- Ke.env?.NODE_ENV !== "test" && Ts();
3033
- function Ts() {
3034
- window.addEventListener("message", Ye);
3150
+ it.env?.NODE_ENV !== "test" && Ls();
3151
+ function Ls() {
3152
+ window.addEventListener("message", at);
3035
3153
  }
3036
- function Ks() {
3037
- window.removeEventListener("message", Ye);
3154
+ function gn() {
3155
+ window.removeEventListener("message", at);
3038
3156
  }
3039
- async function en(t) {
3040
- return await Es(
3157
+ async function yn(t) {
3158
+ return await Ds(
3041
3159
  {
3042
3160
  type: "qp-bridge",
3043
3161
  action: "getQuestionnaire"
@@ -3045,7 +3163,36 @@ async function en(t) {
3045
3163
  t
3046
3164
  );
3047
3165
  }
3048
- async function tn(t, e, s) {
3166
+ function Vs(t, e) {
3167
+ Ne(t.items, [], e);
3168
+ }
3169
+ function Us(t) {
3170
+ const e = [];
3171
+ return Vs(t, (s) => e.push(s)), e;
3172
+ }
3173
+ function _n(t) {
3174
+ return Us(t).filter(Bs);
3175
+ }
3176
+ function Bs(t) {
3177
+ return t.itemType === "question";
3178
+ }
3179
+ function Ne(t, e, s) {
3180
+ for (const n of t)
3181
+ switch (s(n, e), n.itemType) {
3182
+ case "question":
3183
+ case "staticComponent":
3184
+ break;
3185
+ case "group":
3186
+ Ne(n.items, [...e, n], s);
3187
+ break;
3188
+ case "repeatableGroup":
3189
+ Ne(n.groups, [...e, n], s);
3190
+ break;
3191
+ default:
3192
+ return n;
3193
+ }
3194
+ }
3195
+ async function vn(t, e, s) {
3049
3196
  await C(
3050
3197
  {
3051
3198
  type: "qp-bridge",
@@ -3056,8 +3203,8 @@ async function tn(t, e, s) {
3056
3203
  s
3057
3204
  );
3058
3205
  }
3059
- async function sn(t, e) {
3060
- return await Cs(
3206
+ async function xn(t, e) {
3207
+ return await Gs(
3061
3208
  {
3062
3209
  type: "qp-bridge",
3063
3210
  action: "getQuestion",
@@ -3066,7 +3213,7 @@ async function sn(t, e) {
3066
3213
  e
3067
3214
  );
3068
3215
  }
3069
- async function nn(t, e, s) {
3216
+ async function bn(t, e, s) {
3070
3217
  await C(
3071
3218
  {
3072
3219
  type: "qp-bridge",
@@ -3077,8 +3224,8 @@ async function nn(t, e, s) {
3077
3224
  s
3078
3225
  );
3079
3226
  }
3080
- async function an(t, e) {
3081
- return await Is(
3227
+ async function kn(t, e) {
3228
+ return await zs(
3082
3229
  {
3083
3230
  type: "qp-bridge",
3084
3231
  action: "getGroup",
@@ -3087,7 +3234,7 @@ async function an(t, e) {
3087
3234
  e
3088
3235
  );
3089
3236
  }
3090
- async function rn(t, e, s) {
3237
+ async function wn(t, e, s) {
3091
3238
  await C(
3092
3239
  {
3093
3240
  type: "qp-bridge",
@@ -3098,9 +3245,9 @@ async function rn(t, e, s) {
3098
3245
  s
3099
3246
  );
3100
3247
  }
3101
- function on(t, e) {
3102
- const s = re(e), n = (a) => {
3103
- fs(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
3248
+ function Sn(t, e) {
3249
+ const s = ie(e), n = (a) => {
3250
+ Ts(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
3104
3251
  };
3105
3252
  return window.addEventListener("message", n), {
3106
3253
  cancelSubscription: () => {
@@ -3108,7 +3255,7 @@ function on(t, e) {
3108
3255
  }
3109
3256
  };
3110
3257
  }
3111
- async function cn(t, e) {
3258
+ async function Tn(t, e) {
3112
3259
  await C(
3113
3260
  {
3114
3261
  type: "qp-bridge",
@@ -3128,7 +3275,7 @@ async function cn(t, e) {
3128
3275
  );
3129
3276
  }
3130
3277
  }
3131
- async function un(t) {
3278
+ async function Rn(t) {
3132
3279
  await C(
3133
3280
  {
3134
3281
  type: "qp-bridge",
@@ -3137,7 +3284,7 @@ async function un(t) {
3137
3284
  t
3138
3285
  );
3139
3286
  }
3140
- async function dn(t) {
3287
+ async function Cn(t) {
3141
3288
  await C(
3142
3289
  {
3143
3290
  type: "qp-bridge",
@@ -3146,7 +3293,7 @@ async function dn(t) {
3146
3293
  t
3147
3294
  );
3148
3295
  }
3149
- async function ln(t, e) {
3296
+ async function In(t, e) {
3150
3297
  await C(
3151
3298
  {
3152
3299
  type: "qp-bridge",
@@ -3156,38 +3303,38 @@ async function ln(t, e) {
3156
3303
  e
3157
3304
  );
3158
3305
  }
3159
- const ee = [], te = [], se = [];
3160
- function fn(t, e) {
3161
- const s = re(e);
3162
- return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
3306
+ const te = [], se = [], ne = [];
3307
+ function En(t, e) {
3308
+ const s = ie(e);
3309
+ return ne.some((n) => n.handler === t && n.instanceId === s) || ne.push({ handler: t, instanceId: s }), {
3163
3310
  cancelSubscription: () => {
3164
- const n = se.findIndex((a) => a.handler === t && a.instanceId === s);
3165
- n !== -1 && se.splice(n, 1);
3311
+ const n = ne.findIndex((a) => a.handler === t && a.instanceId === s);
3312
+ n !== -1 && ne.splice(n, 1);
3166
3313
  }
3167
3314
  };
3168
3315
  }
3169
- function hn(t, e) {
3170
- const s = re(e);
3171
- return te.some((n) => n.handler === t && n.instanceId === s) || te.push({ handler: t, instanceId: s }), {
3316
+ function Nn(t, e) {
3317
+ const s = ie(e);
3318
+ return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
3172
3319
  cancelSubscription: () => {
3173
- const n = te.findIndex((a) => a.handler === t && a.instanceId === s);
3174
- n !== -1 && te.splice(n, 1);
3320
+ const n = se.findIndex((a) => a.handler === t && a.instanceId === s);
3321
+ n !== -1 && se.splice(n, 1);
3175
3322
  }
3176
3323
  };
3177
3324
  }
3178
- function pn(t, e) {
3179
- const s = re(e);
3180
- return ee.some((n) => n.validator === t && n.instanceId === s) || ee.push({ validator: t, instanceId: s }), {
3325
+ function An(t, e) {
3326
+ const s = ie(e);
3327
+ return te.some((n) => n.validator === t && n.instanceId === s) || te.push({ validator: t, instanceId: s }), {
3181
3328
  cancelSubscription: () => {
3182
- const n = ee.findIndex((a) => a.validator === t && a.instanceId === s);
3183
- n !== -1 && ee.splice(n, 1);
3329
+ const n = te.findIndex((a) => a.validator === t && a.instanceId === s);
3330
+ n !== -1 && te.splice(n, 1);
3184
3331
  }
3185
3332
  };
3186
3333
  }
3187
- async function Ye(t) {
3334
+ async function at(t) {
3188
3335
  try {
3189
- if (hs(t.data) && te.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler(t.data.commandName)), ps(t.data) && se.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler()), xs(t.data)) {
3190
- const e = ee.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
3336
+ if (Rs(t.data) && se.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler(t.data.commandName)), Cs(t.data) && ne.filter((e) => e.instanceId === t.data.instanceId).forEach((e) => e.handler()), Ms(t.data)) {
3337
+ const e = te.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
3191
3338
  type: "qp-bridge",
3192
3339
  status: "success",
3193
3340
  id: t.data.id,
@@ -3200,15 +3347,15 @@ async function Ye(t) {
3200
3347
  const s = {
3201
3348
  type: "qp-bridge",
3202
3349
  status: "error",
3203
- id: Se(t.data) ? t.data.id : void 0,
3204
- instanceId: Se(t.data) ? t.data.instanceId : void 0,
3350
+ id: Ee(t.data) ? t.data.id : void 0,
3351
+ instanceId: Ee(t.data) ? t.data.instanceId : void 0,
3205
3352
  message: e instanceof Error ? e.message : "Unknown error"
3206
3353
  };
3207
3354
  window.parent.postMessage(s, "*");
3208
3355
  }
3209
3356
  }
3210
- async function mn(t, e) {
3211
- return await Ns(
3357
+ async function On(t, e) {
3358
+ return await Qs(
3212
3359
  {
3213
3360
  type: "qp-bridge",
3214
3361
  action: "fetchEntities",
@@ -3217,8 +3364,8 @@ async function mn(t, e) {
3217
3364
  e
3218
3365
  );
3219
3366
  }
3220
- async function gn(t, e, s) {
3221
- return await As(
3367
+ async function Mn(t, e, s) {
3368
+ return await Fs(
3222
3369
  {
3223
3370
  type: "qp-bridge",
3224
3371
  action: "getEntityById",
@@ -3228,10 +3375,10 @@ async function gn(t, e, s) {
3228
3375
  s
3229
3376
  );
3230
3377
  }
3231
- function yn() {
3378
+ function Zn() {
3232
3379
  return { isNew: !0 };
3233
3380
  }
3234
- async function _n(t, e) {
3381
+ async function qn(t, e) {
3235
3382
  await C(
3236
3383
  {
3237
3384
  type: "qp-bridge",
@@ -3241,7 +3388,7 @@ async function _n(t, e) {
3241
3388
  e
3242
3389
  );
3243
3390
  }
3244
- async function vn(t, e, s) {
3391
+ async function jn(t, e, s) {
3245
3392
  await C(
3246
3393
  {
3247
3394
  type: "qp-bridge",
@@ -3252,7 +3399,7 @@ async function vn(t, e, s) {
3252
3399
  s
3253
3400
  );
3254
3401
  }
3255
- async function xn(t, e) {
3402
+ async function Pn(t, e) {
3256
3403
  await C(
3257
3404
  {
3258
3405
  type: "qp-bridge",
@@ -3262,7 +3409,7 @@ async function xn(t, e) {
3262
3409
  e
3263
3410
  );
3264
3411
  }
3265
- async function bn(t, e, s) {
3412
+ async function $n(t, e, s) {
3266
3413
  await C(
3267
3414
  {
3268
3415
  type: "qp-bridge",
@@ -3273,156 +3420,165 @@ async function bn(t, e, s) {
3273
3420
  s
3274
3421
  );
3275
3422
  }
3276
- async function X(t, e, s) {
3423
+ async function K(t, e, s) {
3277
3424
  return new Promise((n, a) => {
3278
- const r = ze(), i = re(s), o = (d) => {
3279
- if (ws(d.data, r, i))
3425
+ const r = We(), i = ie(s), o = (d) => {
3426
+ if (js(d.data, r, i))
3280
3427
  return;
3281
3428
  const l = e(d.data);
3282
- l.success ? n(l.data) : gs(d.data) ? a(new Error(d.data.message)) : a(new Error("Unknown message received")), window.removeEventListener("message", o);
3429
+ l.success ? n(l.data) : Es(d.data) ? a(new Error(d.data.message)) : a(new Error("Unknown message received")), window.removeEventListener("message", o);
3283
3430
  };
3284
- window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Ot }, "*");
3431
+ window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Vt }, "*");
3285
3432
  });
3286
3433
  }
3287
- async function Cs(t, e) {
3288
- return X(
3434
+ async function Gs(t, e) {
3435
+ return K(
3289
3436
  t,
3290
- (s) => ys(s) ? { success: !0, data: s.question } : { success: !1 },
3437
+ (s) => Ns(s) ? { success: !0, data: s.question } : { success: !1 },
3291
3438
  e
3292
3439
  );
3293
3440
  }
3294
- async function Is(t, e) {
3295
- return X(
3441
+ async function zs(t, e) {
3442
+ return K(
3296
3443
  t,
3297
- (s) => _s(s) ? { success: !0, data: s.group } : { success: !1 },
3444
+ (s) => As(s) ? { success: !0, data: s.group } : { success: !1 },
3298
3445
  e
3299
3446
  );
3300
3447
  }
3301
- async function Es(t, e) {
3302
- return X(
3448
+ async function Ds(t, e) {
3449
+ return K(
3303
3450
  t,
3304
- (s) => vs(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
3451
+ (s) => Os(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
3305
3452
  e
3306
3453
  );
3307
3454
  }
3308
3455
  function C(t, e) {
3309
- return X(
3456
+ return K(
3310
3457
  t,
3311
- (s) => ms(s) ? { success: !0, data: void 0 } : { success: !1 },
3458
+ (s) => Is(s) ? { success: !0, data: void 0 } : { success: !1 },
3312
3459
  e
3313
3460
  );
3314
3461
  }
3315
- async function Ns(t, e) {
3316
- return X(
3462
+ async function Qs(t, e) {
3463
+ return K(
3317
3464
  t,
3318
- (s) => Ss(s) ? { success: !0, data: s.entities } : { success: !1 },
3465
+ (s) => Ps(s) ? { success: !0, data: s.entities } : { success: !1 },
3319
3466
  e
3320
3467
  );
3321
3468
  }
3322
- async function As(t, e) {
3323
- return X(
3469
+ async function Fs(t, e) {
3470
+ return K(
3324
3471
  t,
3325
- (s) => Rs(s) ? { success: !0, data: s.entity } : { success: !1 },
3472
+ (s) => $s(s) ? { success: !0, data: s.entity } : { success: !1 },
3326
3473
  e
3327
3474
  );
3328
3475
  }
3329
3476
  export {
3330
- Ot as QP_BRIDGE_FEATURE_VERSION,
3331
- xn as addNewGroup,
3332
- ds as addNewGroupRequestMessageSchema,
3333
- es as busyIndicatorEndRequestMessageSchema,
3334
- Kt as busyIndicatorStartRequestMessageSchema,
3335
- Jt as canSaveRequestMessageSchema,
3336
- Ht as canSaveSuccessResponseMessageSchema,
3337
- Zt as commandExecutedMessageSchema,
3338
- dn as completeAndCloseQuestionnaire,
3339
- ss as completeAndCloseQuestionnaireRequestMessageSchema,
3340
- Ys as createMediaItem,
3341
- yn as createNewEntity,
3342
- bn as deleteGroup,
3343
- ls as deleteGroupRequestMessageSchema,
3344
- Ce as entitySchema,
3345
- ln as executeCustomCommand,
3346
- ns as executeCustomCommandRequestMessageSchema,
3347
- mn as fetchEntities,
3348
- as as fetchEntitiesRequestMessageSchema,
3349
- rs as fetchEntitiesSuccessResponseMessageSchema,
3350
- gn as getEntityById,
3351
- is as getEntityByIdRequestMessageSchema,
3352
- os as getEntityByIdSuccessResponseMessageSchema,
3353
- an as getGroup,
3354
- Dt as getGroupRequestMessageSchema,
3355
- Qt as getGroupSuccessResponseMessageSchema,
3356
- sn as getQuestion,
3357
- Bt as getQuestionRequestMessageSchema,
3358
- Gt as getQuestionSuccessResponseMessageSchema,
3359
- en as getQuestionnaire,
3360
- Ft as getQuestionnaireRequestMessageSchema,
3361
- Wt as getQuestionnaireSuccessResponseMessageSchema,
3362
- $t as groupOptionalScheme,
3363
- He as groupSchema,
3364
- Ts as initOnSaveMessageHandler,
3365
- Hs as isAddNewGroupRequestMessage,
3366
- ks as isBusyIndicatorEndRequestMessage,
3367
- bs as isBusyIndicatorStartRequestMessage,
3368
- xs as isCanSaveRequestMessage,
3369
- Vs as isCanSaveSuccessResponseMessage,
3370
- hs as isCommandExecutedMessage,
3371
- Bs as isCompleteAndCloseQuestionnaireRequestMessage,
3372
- Js as isDeleteGroupRequestMessage,
3373
- gs as isErrorMessage,
3374
- Gs as isExecuteCustomCommandRequestMessage,
3375
- Ds as isFetchEntitiesRequestMessage,
3376
- Ss as isFetchEntitiesSuccessResponseMessage,
3377
- Qs as isGetEntityByIdRequestMessage,
3378
- Rs as isGetEntityByIdSuccessResponseMessage,
3379
- Ls as isGetGroupRequestMessage,
3380
- _s as isGetGroupSuccessResponseMessage,
3381
- Zs as isGetQuestionRequestMessage,
3382
- ys as isGetQuestionSuccessResponseMessage,
3383
- $s as isGetQuestionnaireRequestMessage,
3384
- vs as isGetQuestionnaireSuccessResponseMessage,
3385
- Os as isMediaItem,
3386
- ws as isNotRelevantMessage,
3387
- fs as isOnAnswerChangeMessage,
3388
- Se as isQpBridgeMessage,
3389
- Ms as isQpBridgeRequestMessage,
3390
- ps as isQuestionnaireLoadedMessage,
3391
- Ws as isRepeatGroupRequestMessage,
3392
- Fs as isSaveEntityRequestMessage,
3393
- Us as isSaveQuestionnaireRequestMessage,
3394
- qs as isSetAnswerRequestMessage,
3395
- Ps as isSetGroupRequestMessage,
3396
- js as isSetQuestionRequestMessage,
3397
- ms as isSuccessMessage,
3398
- zs as isWithBusyIndicatorRequestMessage,
3399
- Lt as mediaItemSchema,
3400
- on as onAnswerChange,
3401
- Mt as onAnswerChangeMessageSchema,
3402
- hn as onCommandExecuted,
3403
- fn as onQuestionnaireLoaded,
3404
- pn as onSave,
3405
- B as qpBridgeBaseMessageSchema,
3477
+ Vt as QP_BRIDGE_FEATURE_VERSION,
3478
+ Pn as addNewGroup,
3479
+ ws as addNewGroupRequestMessageSchema,
3480
+ hs as busyIndicatorEndRequestMessageSchema,
3481
+ fs as busyIndicatorStartRequestMessageSchema,
3482
+ us as canSaveRequestMessageSchema,
3483
+ cs as canSaveSuccessResponseMessageSchema,
3484
+ Bt as commandExecutedMessageSchema,
3485
+ Cn as completeAndCloseQuestionnaire,
3486
+ ps as completeAndCloseQuestionnaireRequestMessageSchema,
3487
+ mn as createMediaItem,
3488
+ Zn as createNewEntity,
3489
+ $n as deleteGroup,
3490
+ Ss as deleteGroupRequestMessageSchema,
3491
+ je as entitySchema,
3492
+ In as executeCustomCommand,
3493
+ gs as executeCustomCommandRequestMessageSchema,
3494
+ On as fetchEntities,
3495
+ ys as fetchEntitiesRequestMessageSchema,
3496
+ _s as fetchEntitiesSuccessResponseMessageSchema,
3497
+ Us as flattenQuestionnaireItems,
3498
+ _n as flattenQuestions,
3499
+ Mn as getEntityById,
3500
+ vs as getEntityByIdRequestMessageSchema,
3501
+ xs as getEntityByIdSuccessResponseMessageSchema,
3502
+ kn as getGroup,
3503
+ as as getGroupRequestMessageSchema,
3504
+ rs as getGroupSuccessResponseMessageSchema,
3505
+ xn as getQuestion,
3506
+ ts as getQuestionRequestMessageSchema,
3507
+ ss as getQuestionSuccessResponseMessageSchema,
3508
+ yn as getQuestionnaire,
3509
+ is as getQuestionnaireRequestMessageSchema,
3510
+ os as getQuestionnaireSuccessResponseMessageSchema,
3511
+ et as groupOptionalScheme,
3512
+ Ke as groupSchema,
3513
+ Ls as initOnSaveMessageHandler,
3514
+ fn as isAddNewGroupRequestMessage,
3515
+ qs as isBusyIndicatorEndRequestMessage,
3516
+ Zs as isBusyIndicatorStartRequestMessage,
3517
+ Ms as isCanSaveRequestMessage,
3518
+ sn as isCanSaveSuccessResponseMessage,
3519
+ Rs as isCommandExecutedMessage,
3520
+ an as isCompleteAndCloseQuestionnaireRequestMessage,
3521
+ hn as isDeleteGroupRequestMessage,
3522
+ Es as isErrorMessage,
3523
+ rn as isExecuteCustomCommandRequestMessage,
3524
+ cn as isFetchEntitiesRequestMessage,
3525
+ Ps as isFetchEntitiesSuccessResponseMessage,
3526
+ un as isGetEntityByIdRequestMessage,
3527
+ $s as isGetEntityByIdSuccessResponseMessage,
3528
+ en as isGetGroupRequestMessage,
3529
+ As as isGetGroupSuccessResponseMessage,
3530
+ Js as isGetQuestionRequestMessage,
3531
+ Ns as isGetQuestionSuccessResponseMessage,
3532
+ tn as isGetQuestionnaireRequestMessage,
3533
+ Os as isGetQuestionnaireSuccessResponseMessage,
3534
+ Ws as isMediaItem,
3535
+ js as isNotRelevantMessage,
3536
+ Ts as isOnAnswerChangeMessage,
3537
+ Ee as isQpBridgeMessage,
3538
+ Hs as isQpBridgeRequestMessage,
3539
+ Cs as isQuestionnaireLoadedMessage,
3540
+ ln as isRepeatGroupRequestMessage,
3541
+ dn as isSaveEntityRequestMessage,
3542
+ nn as isSaveQuestionnaireRequestMessage,
3543
+ Ys as isSetAnswerRequestMessage,
3544
+ Ks as isSetGroupRequestMessage,
3545
+ Xs as isSetQuestionRequestMessage,
3546
+ Is as isSuccessMessage,
3547
+ on as isWithBusyIndicatorRequestMessage,
3548
+ Wt as mediaItemSchema,
3549
+ Sn as onAnswerChange,
3550
+ Ut as onAnswerChangeMessageSchema,
3551
+ Nn as onCommandExecuted,
3552
+ En as onQuestionnaireLoaded,
3553
+ An as onSave,
3554
+ F as qpBridgeBaseMessageSchema,
3406
3555
  S as qpBridgeRequestMessageSchema,
3407
- Pt as questionOptionalScheme,
3408
- We as questionSchema,
3409
- qt as questionnaireLoadedMessageSchema,
3410
- Ut as questionnaireSchema,
3411
- Ks as removeOnSaveMessageHandler,
3412
- vn as repeatGroup,
3413
- us as repeatGroupRequestMessageSchema,
3414
- jt as responseErrorMessageSchema,
3415
- G as responseSuccessMessageSchema,
3416
- _n as saveEntity,
3417
- cs as saveEntityRequestMessageSchema,
3418
- un as saveQuestionnaire,
3419
- ts as saveQuestionnaireRequestMessageSchema,
3420
- tn as setAnswer,
3421
- Xt as setAnswerRequestMessageSchema,
3422
- rn as setGroup,
3423
- Yt as setGroupRequestMessageSchema,
3424
- nn as setQuestion,
3425
- zt as setQuestionRequestMessageSchema,
3426
- Xs as updateMediaItem,
3427
- cn as withBusyIndicator
3556
+ Qt as questionOptionalScheme,
3557
+ qe as questionSchema,
3558
+ Dt as questionTypeSchema,
3559
+ st as questionnaireGroupSchema,
3560
+ tt as questionnaireItemSchema,
3561
+ Gt as questionnaireLoadedMessageSchema,
3562
+ Ft as questionnaireQuestionSchema,
3563
+ Xt as questionnaireRepeatableGroupSchema,
3564
+ es as questionnaireSchema,
3565
+ Ht as questionnaireStaticComponentSchema,
3566
+ gn as removeOnSaveMessageHandler,
3567
+ jn as repeatGroup,
3568
+ ks as repeatGroupRequestMessageSchema,
3569
+ zt as responseErrorMessageSchema,
3570
+ W as responseSuccessMessageSchema,
3571
+ qn as saveEntity,
3572
+ bs as saveEntityRequestMessageSchema,
3573
+ Rn as saveQuestionnaire,
3574
+ ms as saveQuestionnaireRequestMessageSchema,
3575
+ vn as setAnswer,
3576
+ ls as setAnswerRequestMessageSchema,
3577
+ wn as setGroup,
3578
+ ds as setGroupRequestMessageSchema,
3579
+ bn as setQuestion,
3580
+ ns as setQuestionRequestMessageSchema,
3581
+ Vs as traverseQuestionnaireItems,
3582
+ pn as updateMediaItem,
3583
+ Tn as withBusyIndicator
3428
3584
  };