@resconet/qp-bridge 1.4.0-alpha.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +480 -477
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
var t =
|
|
1
|
+
var pe = { exports: {} }, Ee;
|
|
2
|
+
function Xe() {
|
|
3
|
+
if (Ee) return pe.exports;
|
|
4
|
+
Ee = 1;
|
|
5
|
+
var t = pe.exports = {}, e, s;
|
|
6
6
|
function n() {
|
|
7
7
|
throw new Error("setTimeout has not been defined");
|
|
8
8
|
}
|
|
@@ -72,12 +72,12 @@ function Je() {
|
|
|
72
72
|
if (arguments.length > 1)
|
|
73
73
|
for (var z = 1; z < arguments.length; z++)
|
|
74
74
|
E[z - 1] = arguments[z];
|
|
75
|
-
o.push(new
|
|
75
|
+
o.push(new Ie(k, E)), o.length === 1 && !d && r(M);
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function Ie(k, E) {
|
|
78
78
|
this.fun = k, this.array = E;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
Ie.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
83
|
function Z() {
|
|
@@ -92,28 +92,31 @@ function Je() {
|
|
|
92
92
|
throw new Error("process.chdir is not supported");
|
|
93
93
|
}, t.umask = function() {
|
|
94
94
|
return 0;
|
|
95
|
-
},
|
|
95
|
+
}, pe.exports;
|
|
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);
|
|
96
104
|
}
|
|
97
|
-
var Ye = Je();
|
|
98
105
|
const R = [];
|
|
99
106
|
for (let t = 0; t < 256; ++t)
|
|
100
107
|
R.push((t + 256).toString(16).slice(1));
|
|
101
|
-
function
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
const Ke = new Uint8Array(16);
|
|
105
|
-
function et() {
|
|
106
|
-
return crypto.getRandomValues(Ke);
|
|
107
|
-
}
|
|
108
|
-
function Be(t, e, s) {
|
|
109
|
-
return crypto.randomUUID ? crypto.randomUUID() : tt(t);
|
|
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]];
|
|
110
110
|
}
|
|
111
|
-
|
|
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();
|
|
112
117
|
t = t || {};
|
|
113
|
-
const n = t.random
|
|
114
|
-
|
|
115
|
-
throw new Error("Random bytes length must be >= 16");
|
|
116
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Xe(n);
|
|
118
|
+
const n = t.random || (t.rng || tt)();
|
|
119
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, st(n);
|
|
117
120
|
}
|
|
118
121
|
var v;
|
|
119
122
|
(function(t) {
|
|
@@ -152,14 +155,14 @@ var v;
|
|
|
152
155
|
}
|
|
153
156
|
t.joinValues = n, t.jsonStringifyReplacer = (a, r) => typeof r == "bigint" ? r.toString() : r;
|
|
154
157
|
})(v || (v = {}));
|
|
155
|
-
var
|
|
158
|
+
var Ae;
|
|
156
159
|
(function(t) {
|
|
157
160
|
t.mergeShapes = (e, s) => ({
|
|
158
161
|
...e,
|
|
159
162
|
...s
|
|
160
163
|
// second overwrites first
|
|
161
164
|
});
|
|
162
|
-
})(
|
|
165
|
+
})(Ae || (Ae = {}));
|
|
163
166
|
const f = v.arrayToEnum([
|
|
164
167
|
"string",
|
|
165
168
|
"nan",
|
|
@@ -284,7 +287,7 @@ class j extends Error {
|
|
|
284
287
|
}
|
|
285
288
|
}
|
|
286
289
|
j.create = (t) => new j(t);
|
|
287
|
-
const
|
|
290
|
+
const ge = (t, e) => {
|
|
288
291
|
let s;
|
|
289
292
|
switch (t.code) {
|
|
290
293
|
case c.invalid_type:
|
|
@@ -340,11 +343,11 @@ const pe = (t, e) => {
|
|
|
340
343
|
}
|
|
341
344
|
return { message: s };
|
|
342
345
|
};
|
|
343
|
-
let
|
|
344
|
-
function
|
|
345
|
-
return
|
|
346
|
+
let at = ge;
|
|
347
|
+
function rt() {
|
|
348
|
+
return at;
|
|
346
349
|
}
|
|
347
|
-
const
|
|
350
|
+
const it = (t) => {
|
|
348
351
|
const { data: e, path: s, errorMaps: n, issueData: a } = t, r = [...s, ...a.path || []], i = {
|
|
349
352
|
...a,
|
|
350
353
|
path: r
|
|
@@ -366,7 +369,7 @@ const at = (t) => {
|
|
|
366
369
|
};
|
|
367
370
|
};
|
|
368
371
|
function u(t, e) {
|
|
369
|
-
const s =
|
|
372
|
+
const s = rt(), n = it({
|
|
370
373
|
issueData: e,
|
|
371
374
|
data: t.data,
|
|
372
375
|
path: t.path,
|
|
@@ -377,7 +380,7 @@ function u(t, e) {
|
|
|
377
380
|
// then schema-bound map if available
|
|
378
381
|
s,
|
|
379
382
|
// then global override map
|
|
380
|
-
s ===
|
|
383
|
+
s === ge ? void 0 : ge
|
|
381
384
|
// then global default map
|
|
382
385
|
].filter((a) => !!a)
|
|
383
386
|
});
|
|
@@ -397,7 +400,7 @@ class T {
|
|
|
397
400
|
const n = [];
|
|
398
401
|
for (const a of s) {
|
|
399
402
|
if (a.status === "aborted")
|
|
400
|
-
return
|
|
403
|
+
return m;
|
|
401
404
|
a.status === "dirty" && e.dirty(), n.push(a.value);
|
|
402
405
|
}
|
|
403
406
|
return { status: e.value, value: n };
|
|
@@ -418,15 +421,15 @@ class T {
|
|
|
418
421
|
for (const a of s) {
|
|
419
422
|
const { key: r, value: i } = a;
|
|
420
423
|
if (r.status === "aborted" || i.status === "aborted")
|
|
421
|
-
return
|
|
424
|
+
return m;
|
|
422
425
|
r.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), r.value !== "__proto__" && (typeof i.value < "u" || a.alwaysSet) && (n[r.value] = i.value);
|
|
423
426
|
}
|
|
424
427
|
return { status: e.value, value: n };
|
|
425
428
|
}
|
|
426
429
|
}
|
|
427
|
-
const
|
|
430
|
+
const m = Object.freeze({
|
|
428
431
|
status: "aborted"
|
|
429
|
-
}), K = (t) => ({ status: "dirty", value: t }), I = (t) => ({ status: "valid", value: t }),
|
|
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;
|
|
430
433
|
var h;
|
|
431
434
|
(function(t) {
|
|
432
435
|
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -439,7 +442,7 @@ class A {
|
|
|
439
442
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
440
443
|
}
|
|
441
444
|
}
|
|
442
|
-
const
|
|
445
|
+
const Ze = (t, e) => {
|
|
443
446
|
if (Q(e))
|
|
444
447
|
return { success: !0, data: e.value };
|
|
445
448
|
if (!t.common.issues.length)
|
|
@@ -497,7 +500,7 @@ class _ {
|
|
|
497
500
|
}
|
|
498
501
|
_parseSync(e) {
|
|
499
502
|
const s = this._parse(e);
|
|
500
|
-
if (
|
|
503
|
+
if (oe(s))
|
|
501
504
|
throw new Error("Synchronous parse encountered promise.");
|
|
502
505
|
return s;
|
|
503
506
|
}
|
|
@@ -524,7 +527,7 @@ class _ {
|
|
|
524
527
|
data: e,
|
|
525
528
|
parsedType: P(e)
|
|
526
529
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
527
|
-
return
|
|
530
|
+
return Ze(n, a);
|
|
528
531
|
}
|
|
529
532
|
"~validate"(e) {
|
|
530
533
|
const s = {
|
|
@@ -576,8 +579,8 @@ class _ {
|
|
|
576
579
|
parent: null,
|
|
577
580
|
data: e,
|
|
578
581
|
parsedType: P(e)
|
|
579
|
-
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (
|
|
580
|
-
return
|
|
582
|
+
}, a = this._parse({ data: e, path: n.path, parent: n }), r = await (oe(a) ? a : Promise.resolve(a));
|
|
583
|
+
return Ze(n, r);
|
|
581
584
|
}
|
|
582
585
|
refine(e, s) {
|
|
583
586
|
const n = (a) => typeof s == "string" || typeof s > "u" ? { message: s } : typeof s == "function" ? s(a) : s;
|
|
@@ -595,7 +598,7 @@ class _ {
|
|
|
595
598
|
_refinement(e) {
|
|
596
599
|
return new H({
|
|
597
600
|
schema: this,
|
|
598
|
-
typeName:
|
|
601
|
+
typeName: p.ZodEffects,
|
|
599
602
|
effect: { type: "refinement", refinement: e }
|
|
600
603
|
});
|
|
601
604
|
}
|
|
@@ -622,45 +625,45 @@ class _ {
|
|
|
622
625
|
return N.create(this);
|
|
623
626
|
}
|
|
624
627
|
promise() {
|
|
625
|
-
return
|
|
628
|
+
return fe.create(this, this._def);
|
|
626
629
|
}
|
|
627
630
|
or(e) {
|
|
628
|
-
return
|
|
631
|
+
return ue.create([this, e], this._def);
|
|
629
632
|
}
|
|
630
633
|
and(e) {
|
|
631
|
-
return
|
|
634
|
+
return de.create(this, e, this._def);
|
|
632
635
|
}
|
|
633
636
|
transform(e) {
|
|
634
637
|
return new H({
|
|
635
638
|
...g(this._def),
|
|
636
639
|
schema: this,
|
|
637
|
-
typeName:
|
|
640
|
+
typeName: p.ZodEffects,
|
|
638
641
|
effect: { type: "transform", transform: e }
|
|
639
642
|
});
|
|
640
643
|
}
|
|
641
644
|
default(e) {
|
|
642
645
|
const s = typeof e == "function" ? e : () => e;
|
|
643
|
-
return new
|
|
646
|
+
return new be({
|
|
644
647
|
...g(this._def),
|
|
645
648
|
innerType: this,
|
|
646
649
|
defaultValue: s,
|
|
647
|
-
typeName:
|
|
650
|
+
typeName: p.ZodDefault
|
|
648
651
|
});
|
|
649
652
|
}
|
|
650
653
|
brand() {
|
|
651
|
-
return new
|
|
652
|
-
typeName:
|
|
654
|
+
return new Et({
|
|
655
|
+
typeName: p.ZodBranded,
|
|
653
656
|
type: this,
|
|
654
657
|
...g(this._def)
|
|
655
658
|
});
|
|
656
659
|
}
|
|
657
660
|
catch(e) {
|
|
658
661
|
const s = typeof e == "function" ? e : () => e;
|
|
659
|
-
return new
|
|
662
|
+
return new ke({
|
|
660
663
|
...g(this._def),
|
|
661
664
|
innerType: this,
|
|
662
665
|
catchValue: s,
|
|
663
|
-
typeName:
|
|
666
|
+
typeName: p.ZodCatch
|
|
664
667
|
});
|
|
665
668
|
}
|
|
666
669
|
describe(e) {
|
|
@@ -671,10 +674,10 @@ class _ {
|
|
|
671
674
|
});
|
|
672
675
|
}
|
|
673
676
|
pipe(e) {
|
|
674
|
-
return
|
|
677
|
+
return Re.create(this, e);
|
|
675
678
|
}
|
|
676
679
|
readonly() {
|
|
677
|
-
return
|
|
680
|
+
return we.create(this);
|
|
678
681
|
}
|
|
679
682
|
isOptional() {
|
|
680
683
|
return this.safeParse(void 0).success;
|
|
@@ -683,28 +686,28 @@ class _ {
|
|
|
683
686
|
return this.safeParse(null).success;
|
|
684
687
|
}
|
|
685
688
|
}
|
|
686
|
-
const
|
|
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})+$";
|
|
687
690
|
let me;
|
|
688
|
-
const
|
|
689
|
-
function
|
|
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) {
|
|
690
693
|
let e = "[0-5]\\d";
|
|
691
694
|
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
692
695
|
const s = t.precision ? "+" : "?";
|
|
693
696
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`;
|
|
694
697
|
}
|
|
695
|
-
function
|
|
696
|
-
return new RegExp(`^${
|
|
698
|
+
function wt(t) {
|
|
699
|
+
return new RegExp(`^${Qe(t)}$`);
|
|
697
700
|
}
|
|
698
|
-
function
|
|
699
|
-
let e = `${
|
|
701
|
+
function St(t) {
|
|
702
|
+
let e = `${De}T${Qe(t)}`;
|
|
700
703
|
const s = [];
|
|
701
704
|
return s.push(t.local ? "Z?" : "Z"), t.offset && s.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${s.join("|")})`, new RegExp(`^${e}$`);
|
|
702
705
|
}
|
|
703
|
-
function
|
|
704
|
-
return !!((e === "v4" || !e) &&
|
|
706
|
+
function Rt(t, e) {
|
|
707
|
+
return !!((e === "v4" || !e) && gt.test(t) || (e === "v6" || !e) && _t.test(t));
|
|
705
708
|
}
|
|
706
|
-
function
|
|
707
|
-
if (!
|
|
709
|
+
function Tt(t, e) {
|
|
710
|
+
if (!ft.test(t))
|
|
708
711
|
return !1;
|
|
709
712
|
try {
|
|
710
713
|
const [s] = t.split(".");
|
|
@@ -716,8 +719,8 @@ function St(t, e) {
|
|
|
716
719
|
return !1;
|
|
717
720
|
}
|
|
718
721
|
}
|
|
719
|
-
function
|
|
720
|
-
return !!((e === "v4" || !e) &&
|
|
722
|
+
function Ct(t, e) {
|
|
723
|
+
return !!((e === "v4" || !e) && yt.test(t) || (e === "v6" || !e) && vt.test(t));
|
|
721
724
|
}
|
|
722
725
|
class q extends _ {
|
|
723
726
|
_parse(e) {
|
|
@@ -727,7 +730,7 @@ class q extends _ {
|
|
|
727
730
|
code: c.invalid_type,
|
|
728
731
|
expected: f.string,
|
|
729
732
|
received: r.parsedType
|
|
730
|
-
}),
|
|
733
|
+
}), m;
|
|
731
734
|
}
|
|
732
735
|
const n = new T();
|
|
733
736
|
let a;
|
|
@@ -768,43 +771,43 @@ class q extends _ {
|
|
|
768
771
|
message: r.message
|
|
769
772
|
}), n.dirty());
|
|
770
773
|
} else if (r.kind === "email")
|
|
771
|
-
|
|
774
|
+
pt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
772
775
|
validation: "email",
|
|
773
776
|
code: c.invalid_string,
|
|
774
777
|
message: r.message
|
|
775
778
|
}), n.dirty());
|
|
776
779
|
else if (r.kind === "emoji")
|
|
777
|
-
me || (me = new RegExp(
|
|
780
|
+
me || (me = new RegExp(mt, "u")), me.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
778
781
|
validation: "emoji",
|
|
779
782
|
code: c.invalid_string,
|
|
780
783
|
message: r.message
|
|
781
784
|
}), n.dirty());
|
|
782
785
|
else if (r.kind === "uuid")
|
|
783
|
-
|
|
786
|
+
dt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
784
787
|
validation: "uuid",
|
|
785
788
|
code: c.invalid_string,
|
|
786
789
|
message: r.message
|
|
787
790
|
}), n.dirty());
|
|
788
791
|
else if (r.kind === "nanoid")
|
|
789
|
-
|
|
792
|
+
lt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
790
793
|
validation: "nanoid",
|
|
791
794
|
code: c.invalid_string,
|
|
792
795
|
message: r.message
|
|
793
796
|
}), n.dirty());
|
|
794
797
|
else if (r.kind === "cuid")
|
|
795
|
-
|
|
798
|
+
ot.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
796
799
|
validation: "cuid",
|
|
797
800
|
code: c.invalid_string,
|
|
798
801
|
message: r.message
|
|
799
802
|
}), n.dirty());
|
|
800
803
|
else if (r.kind === "cuid2")
|
|
801
|
-
|
|
804
|
+
ct.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
802
805
|
validation: "cuid2",
|
|
803
806
|
code: c.invalid_string,
|
|
804
807
|
message: r.message
|
|
805
808
|
}), n.dirty());
|
|
806
809
|
else if (r.kind === "ulid")
|
|
807
|
-
|
|
810
|
+
ut.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
808
811
|
validation: "ulid",
|
|
809
812
|
code: c.invalid_string,
|
|
810
813
|
message: r.message
|
|
@@ -835,39 +838,39 @@ class q extends _ {
|
|
|
835
838
|
code: c.invalid_string,
|
|
836
839
|
validation: { endsWith: r.value },
|
|
837
840
|
message: r.message
|
|
838
|
-
}), n.dirty()) : r.kind === "datetime" ?
|
|
841
|
+
}), n.dirty()) : r.kind === "datetime" ? St(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
839
842
|
code: c.invalid_string,
|
|
840
843
|
validation: "datetime",
|
|
841
844
|
message: r.message
|
|
842
|
-
}), n.dirty()) : r.kind === "date" ?
|
|
845
|
+
}), n.dirty()) : r.kind === "date" ? kt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
843
846
|
code: c.invalid_string,
|
|
844
847
|
validation: "date",
|
|
845
848
|
message: r.message
|
|
846
|
-
}), n.dirty()) : r.kind === "time" ?
|
|
849
|
+
}), n.dirty()) : r.kind === "time" ? wt(r).test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
847
850
|
code: c.invalid_string,
|
|
848
851
|
validation: "time",
|
|
849
852
|
message: r.message
|
|
850
|
-
}), n.dirty()) : r.kind === "duration" ?
|
|
853
|
+
}), n.dirty()) : r.kind === "duration" ? ht.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
851
854
|
validation: "duration",
|
|
852
855
|
code: c.invalid_string,
|
|
853
856
|
message: r.message
|
|
854
|
-
}), n.dirty()) : r.kind === "ip" ?
|
|
857
|
+
}), n.dirty()) : r.kind === "ip" ? Rt(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
855
858
|
validation: "ip",
|
|
856
859
|
code: c.invalid_string,
|
|
857
860
|
message: r.message
|
|
858
|
-
}), n.dirty()) : r.kind === "jwt" ?
|
|
861
|
+
}), n.dirty()) : r.kind === "jwt" ? Tt(e.data, r.alg) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
859
862
|
validation: "jwt",
|
|
860
863
|
code: c.invalid_string,
|
|
861
864
|
message: r.message
|
|
862
|
-
}), n.dirty()) : r.kind === "cidr" ?
|
|
865
|
+
}), n.dirty()) : r.kind === "cidr" ? Ct(e.data, r.version) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
863
866
|
validation: "cidr",
|
|
864
867
|
code: c.invalid_string,
|
|
865
868
|
message: r.message
|
|
866
|
-
}), n.dirty()) : r.kind === "base64" ?
|
|
869
|
+
}), n.dirty()) : r.kind === "base64" ? xt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
867
870
|
validation: "base64",
|
|
868
871
|
code: c.invalid_string,
|
|
869
872
|
message: r.message
|
|
870
|
-
}), n.dirty()) : r.kind === "base64url" ?
|
|
873
|
+
}), n.dirty()) : r.kind === "base64url" ? bt.test(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
|
|
871
874
|
validation: "base64url",
|
|
872
875
|
code: c.invalid_string,
|
|
873
876
|
message: r.message
|
|
@@ -1098,11 +1101,11 @@ class q extends _ {
|
|
|
1098
1101
|
}
|
|
1099
1102
|
q.create = (t) => new q({
|
|
1100
1103
|
checks: [],
|
|
1101
|
-
typeName:
|
|
1104
|
+
typeName: p.ZodString,
|
|
1102
1105
|
coerce: t?.coerce ?? !1,
|
|
1103
1106
|
...g(t)
|
|
1104
1107
|
});
|
|
1105
|
-
function
|
|
1108
|
+
function It(t, e) {
|
|
1106
1109
|
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(".", ""));
|
|
1107
1110
|
return r % i / 10 ** a;
|
|
1108
1111
|
}
|
|
@@ -1117,7 +1120,7 @@ class F extends _ {
|
|
|
1117
1120
|
code: c.invalid_type,
|
|
1118
1121
|
expected: f.number,
|
|
1119
1122
|
received: r.parsedType
|
|
1120
|
-
}),
|
|
1123
|
+
}), m;
|
|
1121
1124
|
}
|
|
1122
1125
|
let n;
|
|
1123
1126
|
const a = new T();
|
|
@@ -1141,7 +1144,7 @@ class F extends _ {
|
|
|
1141
1144
|
inclusive: r.inclusive,
|
|
1142
1145
|
exact: !1,
|
|
1143
1146
|
message: r.message
|
|
1144
|
-
}), a.dirty()) : r.kind === "multipleOf" ?
|
|
1147
|
+
}), a.dirty()) : r.kind === "multipleOf" ? It(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), u(n, {
|
|
1145
1148
|
code: c.not_multiple_of,
|
|
1146
1149
|
multipleOf: r.value,
|
|
1147
1150
|
message: r.message
|
|
@@ -1274,7 +1277,7 @@ class F extends _ {
|
|
|
1274
1277
|
}
|
|
1275
1278
|
F.create = (t) => new F({
|
|
1276
1279
|
checks: [],
|
|
1277
|
-
typeName:
|
|
1280
|
+
typeName: p.ZodNumber,
|
|
1278
1281
|
coerce: t?.coerce || !1,
|
|
1279
1282
|
...g(t)
|
|
1280
1283
|
});
|
|
@@ -1319,7 +1322,7 @@ class ne extends _ {
|
|
|
1319
1322
|
code: c.invalid_type,
|
|
1320
1323
|
expected: f.bigint,
|
|
1321
1324
|
received: s.parsedType
|
|
1322
|
-
}),
|
|
1325
|
+
}), m;
|
|
1323
1326
|
}
|
|
1324
1327
|
gte(e, s) {
|
|
1325
1328
|
return this.setLimit("min", e, !0, h.toString(s));
|
|
@@ -1407,11 +1410,11 @@ class ne extends _ {
|
|
|
1407
1410
|
}
|
|
1408
1411
|
ne.create = (t) => new ne({
|
|
1409
1412
|
checks: [],
|
|
1410
|
-
typeName:
|
|
1413
|
+
typeName: p.ZodBigInt,
|
|
1411
1414
|
coerce: t?.coerce ?? !1,
|
|
1412
1415
|
...g(t)
|
|
1413
1416
|
});
|
|
1414
|
-
class
|
|
1417
|
+
class ye extends _ {
|
|
1415
1418
|
_parse(e) {
|
|
1416
1419
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1417
1420
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1419,17 +1422,17 @@ class ge extends _ {
|
|
|
1419
1422
|
code: c.invalid_type,
|
|
1420
1423
|
expected: f.boolean,
|
|
1421
1424
|
received: n.parsedType
|
|
1422
|
-
}),
|
|
1425
|
+
}), m;
|
|
1423
1426
|
}
|
|
1424
1427
|
return I(e.data);
|
|
1425
1428
|
}
|
|
1426
1429
|
}
|
|
1427
|
-
|
|
1428
|
-
typeName:
|
|
1430
|
+
ye.create = (t) => new ye({
|
|
1431
|
+
typeName: p.ZodBoolean,
|
|
1429
1432
|
coerce: t?.coerce || !1,
|
|
1430
1433
|
...g(t)
|
|
1431
1434
|
});
|
|
1432
|
-
class
|
|
1435
|
+
class ce extends _ {
|
|
1433
1436
|
_parse(e) {
|
|
1434
1437
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
|
|
1435
1438
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1437,13 +1440,13 @@ class oe extends _ {
|
|
|
1437
1440
|
code: c.invalid_type,
|
|
1438
1441
|
expected: f.date,
|
|
1439
1442
|
received: r.parsedType
|
|
1440
|
-
}),
|
|
1443
|
+
}), m;
|
|
1441
1444
|
}
|
|
1442
1445
|
if (Number.isNaN(e.data.getTime())) {
|
|
1443
1446
|
const r = this._getOrReturnCtx(e);
|
|
1444
1447
|
return u(r, {
|
|
1445
1448
|
code: c.invalid_date
|
|
1446
|
-
}),
|
|
1449
|
+
}), m;
|
|
1447
1450
|
}
|
|
1448
1451
|
const n = new T();
|
|
1449
1452
|
let a;
|
|
@@ -1469,7 +1472,7 @@ class oe extends _ {
|
|
|
1469
1472
|
};
|
|
1470
1473
|
}
|
|
1471
1474
|
_addCheck(e) {
|
|
1472
|
-
return new
|
|
1475
|
+
return new ce({
|
|
1473
1476
|
...this._def,
|
|
1474
1477
|
checks: [...this._def.checks, e]
|
|
1475
1478
|
});
|
|
@@ -1501,13 +1504,13 @@ class oe extends _ {
|
|
|
1501
1504
|
return e != null ? new Date(e) : null;
|
|
1502
1505
|
}
|
|
1503
1506
|
}
|
|
1504
|
-
|
|
1507
|
+
ce.create = (t) => new ce({
|
|
1505
1508
|
checks: [],
|
|
1506
1509
|
coerce: t?.coerce || !1,
|
|
1507
|
-
typeName:
|
|
1510
|
+
typeName: p.ZodDate,
|
|
1508
1511
|
...g(t)
|
|
1509
1512
|
});
|
|
1510
|
-
class
|
|
1513
|
+
class qe extends _ {
|
|
1511
1514
|
_parse(e) {
|
|
1512
1515
|
if (this._getType(e) !== f.symbol) {
|
|
1513
1516
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1515,16 +1518,16 @@ class Me extends _ {
|
|
|
1515
1518
|
code: c.invalid_type,
|
|
1516
1519
|
expected: f.symbol,
|
|
1517
1520
|
received: n.parsedType
|
|
1518
|
-
}),
|
|
1521
|
+
}), m;
|
|
1519
1522
|
}
|
|
1520
1523
|
return I(e.data);
|
|
1521
1524
|
}
|
|
1522
1525
|
}
|
|
1523
|
-
|
|
1524
|
-
typeName:
|
|
1526
|
+
qe.create = (t) => new qe({
|
|
1527
|
+
typeName: p.ZodSymbol,
|
|
1525
1528
|
...g(t)
|
|
1526
1529
|
});
|
|
1527
|
-
class
|
|
1530
|
+
class je extends _ {
|
|
1528
1531
|
_parse(e) {
|
|
1529
1532
|
if (this._getType(e) !== f.undefined) {
|
|
1530
1533
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1532,16 +1535,16 @@ class Ze extends _ {
|
|
|
1532
1535
|
code: c.invalid_type,
|
|
1533
1536
|
expected: f.undefined,
|
|
1534
1537
|
received: n.parsedType
|
|
1535
|
-
}),
|
|
1538
|
+
}), m;
|
|
1536
1539
|
}
|
|
1537
1540
|
return I(e.data);
|
|
1538
1541
|
}
|
|
1539
1542
|
}
|
|
1540
|
-
|
|
1541
|
-
typeName:
|
|
1543
|
+
je.create = (t) => new je({
|
|
1544
|
+
typeName: p.ZodUndefined,
|
|
1542
1545
|
...g(t)
|
|
1543
1546
|
});
|
|
1544
|
-
class
|
|
1547
|
+
class Pe extends _ {
|
|
1545
1548
|
_parse(e) {
|
|
1546
1549
|
if (this._getType(e) !== f.null) {
|
|
1547
1550
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1549,16 +1552,16 @@ class qe extends _ {
|
|
|
1549
1552
|
code: c.invalid_type,
|
|
1550
1553
|
expected: f.null,
|
|
1551
1554
|
received: n.parsedType
|
|
1552
|
-
}),
|
|
1555
|
+
}), m;
|
|
1553
1556
|
}
|
|
1554
1557
|
return I(e.data);
|
|
1555
1558
|
}
|
|
1556
1559
|
}
|
|
1557
|
-
|
|
1558
|
-
typeName:
|
|
1560
|
+
Pe.create = (t) => new Pe({
|
|
1561
|
+
typeName: p.ZodNull,
|
|
1559
1562
|
...g(t)
|
|
1560
1563
|
});
|
|
1561
|
-
class
|
|
1564
|
+
class Le extends _ {
|
|
1562
1565
|
constructor() {
|
|
1563
1566
|
super(...arguments), this._any = !0;
|
|
1564
1567
|
}
|
|
@@ -1566,11 +1569,11 @@ class je extends _ {
|
|
|
1566
1569
|
return I(e.data);
|
|
1567
1570
|
}
|
|
1568
1571
|
}
|
|
1569
|
-
|
|
1570
|
-
typeName:
|
|
1572
|
+
Le.create = (t) => new Le({
|
|
1573
|
+
typeName: p.ZodAny,
|
|
1571
1574
|
...g(t)
|
|
1572
1575
|
});
|
|
1573
|
-
class
|
|
1576
|
+
class _e extends _ {
|
|
1574
1577
|
constructor() {
|
|
1575
1578
|
super(...arguments), this._unknown = !0;
|
|
1576
1579
|
}
|
|
@@ -1578,8 +1581,8 @@ class ye extends _ {
|
|
|
1578
1581
|
return I(e.data);
|
|
1579
1582
|
}
|
|
1580
1583
|
}
|
|
1581
|
-
|
|
1582
|
-
typeName:
|
|
1584
|
+
_e.create = (t) => new _e({
|
|
1585
|
+
typeName: p.ZodUnknown,
|
|
1583
1586
|
...g(t)
|
|
1584
1587
|
});
|
|
1585
1588
|
class $ extends _ {
|
|
@@ -1589,14 +1592,14 @@ class $ extends _ {
|
|
|
1589
1592
|
code: c.invalid_type,
|
|
1590
1593
|
expected: f.never,
|
|
1591
1594
|
received: s.parsedType
|
|
1592
|
-
}),
|
|
1595
|
+
}), m;
|
|
1593
1596
|
}
|
|
1594
1597
|
}
|
|
1595
1598
|
$.create = (t) => new $({
|
|
1596
|
-
typeName:
|
|
1599
|
+
typeName: p.ZodNever,
|
|
1597
1600
|
...g(t)
|
|
1598
1601
|
});
|
|
1599
|
-
class
|
|
1602
|
+
class $e extends _ {
|
|
1600
1603
|
_parse(e) {
|
|
1601
1604
|
if (this._getType(e) !== f.undefined) {
|
|
1602
1605
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1604,13 +1607,13 @@ class Pe extends _ {
|
|
|
1604
1607
|
code: c.invalid_type,
|
|
1605
1608
|
expected: f.void,
|
|
1606
1609
|
received: n.parsedType
|
|
1607
|
-
}),
|
|
1610
|
+
}), m;
|
|
1608
1611
|
}
|
|
1609
1612
|
return I(e.data);
|
|
1610
1613
|
}
|
|
1611
1614
|
}
|
|
1612
|
-
|
|
1613
|
-
typeName:
|
|
1615
|
+
$e.create = (t) => new $e({
|
|
1616
|
+
typeName: p.ZodVoid,
|
|
1614
1617
|
...g(t)
|
|
1615
1618
|
});
|
|
1616
1619
|
class N extends _ {
|
|
@@ -1621,7 +1624,7 @@ class N extends _ {
|
|
|
1621
1624
|
code: c.invalid_type,
|
|
1622
1625
|
expected: f.array,
|
|
1623
1626
|
received: s.parsedType
|
|
1624
|
-
}),
|
|
1627
|
+
}), m;
|
|
1625
1628
|
if (a.exactLength !== null) {
|
|
1626
1629
|
const i = s.data.length > a.exactLength.value, o = s.data.length < a.exactLength.value;
|
|
1627
1630
|
(i || o) && (u(s, {
|
|
@@ -1683,7 +1686,7 @@ N.create = (t, e) => new N({
|
|
|
1683
1686
|
minLength: null,
|
|
1684
1687
|
maxLength: null,
|
|
1685
1688
|
exactLength: null,
|
|
1686
|
-
typeName:
|
|
1689
|
+
typeName: p.ZodArray,
|
|
1687
1690
|
...g(e)
|
|
1688
1691
|
});
|
|
1689
1692
|
function D(t) {
|
|
@@ -1719,7 +1722,7 @@ class w extends _ {
|
|
|
1719
1722
|
code: c.invalid_type,
|
|
1720
1723
|
expected: f.object,
|
|
1721
1724
|
received: l.parsedType
|
|
1722
|
-
}),
|
|
1725
|
+
}), m;
|
|
1723
1726
|
}
|
|
1724
1727
|
const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), o = [];
|
|
1725
1728
|
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
@@ -1845,7 +1848,7 @@ class w extends _ {
|
|
|
1845
1848
|
...this._def.shape(),
|
|
1846
1849
|
...e._def.shape()
|
|
1847
1850
|
}),
|
|
1848
|
-
typeName:
|
|
1851
|
+
typeName: p.ZodObject
|
|
1849
1852
|
});
|
|
1850
1853
|
}
|
|
1851
1854
|
// merge<
|
|
@@ -1965,31 +1968,31 @@ class w extends _ {
|
|
|
1965
1968
|
});
|
|
1966
1969
|
}
|
|
1967
1970
|
keyof() {
|
|
1968
|
-
return
|
|
1971
|
+
return Fe(v.objectKeys(this.shape));
|
|
1969
1972
|
}
|
|
1970
1973
|
}
|
|
1971
1974
|
w.create = (t, e) => new w({
|
|
1972
1975
|
shape: () => t,
|
|
1973
1976
|
unknownKeys: "strip",
|
|
1974
1977
|
catchall: $.create(),
|
|
1975
|
-
typeName:
|
|
1978
|
+
typeName: p.ZodObject,
|
|
1976
1979
|
...g(e)
|
|
1977
1980
|
});
|
|
1978
1981
|
w.strictCreate = (t, e) => new w({
|
|
1979
1982
|
shape: () => t,
|
|
1980
1983
|
unknownKeys: "strict",
|
|
1981
1984
|
catchall: $.create(),
|
|
1982
|
-
typeName:
|
|
1985
|
+
typeName: p.ZodObject,
|
|
1983
1986
|
...g(e)
|
|
1984
1987
|
});
|
|
1985
1988
|
w.lazycreate = (t, e) => new w({
|
|
1986
1989
|
shape: t,
|
|
1987
1990
|
unknownKeys: "strip",
|
|
1988
1991
|
catchall: $.create(),
|
|
1989
|
-
typeName:
|
|
1992
|
+
typeName: p.ZodObject,
|
|
1990
1993
|
...g(e)
|
|
1991
1994
|
});
|
|
1992
|
-
class
|
|
1995
|
+
class ue extends _ {
|
|
1993
1996
|
_parse(e) {
|
|
1994
1997
|
const { ctx: s } = this._processInputParams(e), n = this._def.options;
|
|
1995
1998
|
function a(r) {
|
|
@@ -2003,7 +2006,7 @@ class ce extends _ {
|
|
|
2003
2006
|
return u(s, {
|
|
2004
2007
|
code: c.invalid_union,
|
|
2005
2008
|
unionErrors: i
|
|
2006
|
-
}),
|
|
2009
|
+
}), m;
|
|
2007
2010
|
}
|
|
2008
2011
|
if (s.common.async)
|
|
2009
2012
|
return Promise.all(n.map(async (r) => {
|
|
@@ -2050,26 +2053,26 @@ class ce extends _ {
|
|
|
2050
2053
|
return u(s, {
|
|
2051
2054
|
code: c.invalid_union,
|
|
2052
2055
|
unionErrors: o
|
|
2053
|
-
}),
|
|
2056
|
+
}), m;
|
|
2054
2057
|
}
|
|
2055
2058
|
}
|
|
2056
2059
|
get options() {
|
|
2057
2060
|
return this._def.options;
|
|
2058
2061
|
}
|
|
2059
2062
|
}
|
|
2060
|
-
|
|
2063
|
+
ue.create = (t, e) => new ue({
|
|
2061
2064
|
options: t,
|
|
2062
|
-
typeName:
|
|
2065
|
+
typeName: p.ZodUnion,
|
|
2063
2066
|
...g(e)
|
|
2064
2067
|
});
|
|
2065
|
-
function
|
|
2068
|
+
function ve(t, e) {
|
|
2066
2069
|
const s = P(t), n = P(e);
|
|
2067
2070
|
if (t === e)
|
|
2068
2071
|
return { valid: !0, data: t };
|
|
2069
2072
|
if (s === f.object && n === f.object) {
|
|
2070
2073
|
const a = v.objectKeys(e), r = v.objectKeys(t).filter((o) => a.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2071
2074
|
for (const o of r) {
|
|
2072
|
-
const d =
|
|
2075
|
+
const d = ve(t[o], e[o]);
|
|
2073
2076
|
if (!d.valid)
|
|
2074
2077
|
return { valid: !1 };
|
|
2075
2078
|
i[o] = d.data;
|
|
@@ -2080,7 +2083,7 @@ function _e(t, e) {
|
|
|
2080
2083
|
return { valid: !1 };
|
|
2081
2084
|
const a = [];
|
|
2082
2085
|
for (let r = 0; r < t.length; r++) {
|
|
2083
|
-
const i = t[r], o = e[r], d =
|
|
2086
|
+
const i = t[r], o = e[r], d = ve(i, o);
|
|
2084
2087
|
if (!d.valid)
|
|
2085
2088
|
return { valid: !1 };
|
|
2086
2089
|
a.push(d.data);
|
|
@@ -2088,15 +2091,15 @@ function _e(t, e) {
|
|
|
2088
2091
|
return { valid: !0, data: a };
|
|
2089
2092
|
} else return s === f.date && n === f.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2090
2093
|
}
|
|
2091
|
-
class
|
|
2094
|
+
class de extends _ {
|
|
2092
2095
|
_parse(e) {
|
|
2093
2096
|
const { status: s, ctx: n } = this._processInputParams(e), a = (r, i) => {
|
|
2094
|
-
if (
|
|
2095
|
-
return
|
|
2096
|
-
const o =
|
|
2097
|
-
return o.valid ? ((
|
|
2097
|
+
if (Oe(r) || Oe(i))
|
|
2098
|
+
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, {
|
|
2098
2101
|
code: c.invalid_intersection_types
|
|
2099
|
-
}),
|
|
2102
|
+
}), m);
|
|
2100
2103
|
};
|
|
2101
2104
|
return n.common.async ? Promise.all([
|
|
2102
2105
|
this._def.left._parseAsync({
|
|
@@ -2120,10 +2123,10 @@ class ue extends _ {
|
|
|
2120
2123
|
}));
|
|
2121
2124
|
}
|
|
2122
2125
|
}
|
|
2123
|
-
|
|
2126
|
+
de.create = (t, e, s) => new de({
|
|
2124
2127
|
left: t,
|
|
2125
2128
|
right: e,
|
|
2126
|
-
typeName:
|
|
2129
|
+
typeName: p.ZodIntersection,
|
|
2127
2130
|
...g(s)
|
|
2128
2131
|
});
|
|
2129
2132
|
class U extends _ {
|
|
@@ -2134,7 +2137,7 @@ class U extends _ {
|
|
|
2134
2137
|
code: c.invalid_type,
|
|
2135
2138
|
expected: f.array,
|
|
2136
2139
|
received: n.parsedType
|
|
2137
|
-
}),
|
|
2140
|
+
}), m;
|
|
2138
2141
|
if (n.data.length < this._def.items.length)
|
|
2139
2142
|
return u(n, {
|
|
2140
2143
|
code: c.too_small,
|
|
@@ -2142,7 +2145,7 @@ class U extends _ {
|
|
|
2142
2145
|
inclusive: !0,
|
|
2143
2146
|
exact: !1,
|
|
2144
2147
|
type: "array"
|
|
2145
|
-
}),
|
|
2148
|
+
}), m;
|
|
2146
2149
|
!this._def.rest && n.data.length > this._def.items.length && (u(n, {
|
|
2147
2150
|
code: c.too_big,
|
|
2148
2151
|
maximum: this._def.items.length,
|
|
@@ -2171,12 +2174,12 @@ U.create = (t, e) => {
|
|
|
2171
2174
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2172
2175
|
return new U({
|
|
2173
2176
|
items: t,
|
|
2174
|
-
typeName:
|
|
2177
|
+
typeName: p.ZodTuple,
|
|
2175
2178
|
rest: null,
|
|
2176
2179
|
...g(e)
|
|
2177
2180
|
});
|
|
2178
2181
|
};
|
|
2179
|
-
class
|
|
2182
|
+
class le extends _ {
|
|
2180
2183
|
get keySchema() {
|
|
2181
2184
|
return this._def.keyType;
|
|
2182
2185
|
}
|
|
@@ -2190,7 +2193,7 @@ class de extends _ {
|
|
|
2190
2193
|
code: c.invalid_type,
|
|
2191
2194
|
expected: f.object,
|
|
2192
2195
|
received: n.parsedType
|
|
2193
|
-
}),
|
|
2196
|
+
}), m;
|
|
2194
2197
|
const a = [], r = this._def.keyType, i = this._def.valueType;
|
|
2195
2198
|
for (const o in n.data)
|
|
2196
2199
|
a.push({
|
|
@@ -2204,20 +2207,20 @@ class de extends _ {
|
|
|
2204
2207
|
return this._def.valueType;
|
|
2205
2208
|
}
|
|
2206
2209
|
static create(e, s, n) {
|
|
2207
|
-
return s instanceof _ ? new
|
|
2210
|
+
return s instanceof _ ? new le({
|
|
2208
2211
|
keyType: e,
|
|
2209
2212
|
valueType: s,
|
|
2210
|
-
typeName:
|
|
2213
|
+
typeName: p.ZodRecord,
|
|
2211
2214
|
...g(n)
|
|
2212
|
-
}) : new
|
|
2215
|
+
}) : new le({
|
|
2213
2216
|
keyType: q.create(),
|
|
2214
2217
|
valueType: e,
|
|
2215
|
-
typeName:
|
|
2218
|
+
typeName: p.ZodRecord,
|
|
2216
2219
|
...g(s)
|
|
2217
2220
|
});
|
|
2218
2221
|
}
|
|
2219
2222
|
}
|
|
2220
|
-
class
|
|
2223
|
+
class Ve extends _ {
|
|
2221
2224
|
get keySchema() {
|
|
2222
2225
|
return this._def.keyType;
|
|
2223
2226
|
}
|
|
@@ -2231,7 +2234,7 @@ class Le extends _ {
|
|
|
2231
2234
|
code: c.invalid_type,
|
|
2232
2235
|
expected: f.map,
|
|
2233
2236
|
received: n.parsedType
|
|
2234
|
-
}),
|
|
2237
|
+
}), m;
|
|
2235
2238
|
const a = this._def.keyType, r = this._def.valueType, i = [...n.data.entries()].map(([o, d], l) => ({
|
|
2236
2239
|
key: a._parse(new A(n, o, n.path, [l, "key"])),
|
|
2237
2240
|
value: r._parse(new A(n, d, n.path, [l, "value"]))
|
|
@@ -2242,7 +2245,7 @@ class Le extends _ {
|
|
|
2242
2245
|
for (const d of i) {
|
|
2243
2246
|
const l = await d.key, y = await d.value;
|
|
2244
2247
|
if (l.status === "aborted" || y.status === "aborted")
|
|
2245
|
-
return
|
|
2248
|
+
return m;
|
|
2246
2249
|
(l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
|
|
2247
2250
|
}
|
|
2248
2251
|
return { status: s.value, value: o };
|
|
@@ -2252,17 +2255,17 @@ class Le extends _ {
|
|
|
2252
2255
|
for (const d of i) {
|
|
2253
2256
|
const l = d.key, y = d.value;
|
|
2254
2257
|
if (l.status === "aborted" || y.status === "aborted")
|
|
2255
|
-
return
|
|
2258
|
+
return m;
|
|
2256
2259
|
(l.status === "dirty" || y.status === "dirty") && s.dirty(), o.set(l.value, y.value);
|
|
2257
2260
|
}
|
|
2258
2261
|
return { status: s.value, value: o };
|
|
2259
2262
|
}
|
|
2260
2263
|
}
|
|
2261
2264
|
}
|
|
2262
|
-
|
|
2265
|
+
Ve.create = (t, e, s) => new Ve({
|
|
2263
2266
|
valueType: e,
|
|
2264
2267
|
keyType: t,
|
|
2265
|
-
typeName:
|
|
2268
|
+
typeName: p.ZodMap,
|
|
2266
2269
|
...g(s)
|
|
2267
2270
|
});
|
|
2268
2271
|
class ae extends _ {
|
|
@@ -2273,7 +2276,7 @@ class ae extends _ {
|
|
|
2273
2276
|
code: c.invalid_type,
|
|
2274
2277
|
expected: f.set,
|
|
2275
2278
|
received: n.parsedType
|
|
2276
|
-
}),
|
|
2279
|
+
}), m;
|
|
2277
2280
|
const a = this._def;
|
|
2278
2281
|
a.minSize !== null && n.data.size < a.minSize.value && (u(n, {
|
|
2279
2282
|
code: c.too_small,
|
|
@@ -2295,7 +2298,7 @@ class ae extends _ {
|
|
|
2295
2298
|
const l = /* @__PURE__ */ new Set();
|
|
2296
2299
|
for (const y of d) {
|
|
2297
2300
|
if (y.status === "aborted")
|
|
2298
|
-
return
|
|
2301
|
+
return m;
|
|
2299
2302
|
y.status === "dirty" && s.dirty(), l.add(y.value);
|
|
2300
2303
|
}
|
|
2301
2304
|
return { status: s.value, value: l };
|
|
@@ -2326,10 +2329,10 @@ ae.create = (t, e) => new ae({
|
|
|
2326
2329
|
valueType: t,
|
|
2327
2330
|
minSize: null,
|
|
2328
2331
|
maxSize: null,
|
|
2329
|
-
typeName:
|
|
2332
|
+
typeName: p.ZodSet,
|
|
2330
2333
|
...g(e)
|
|
2331
2334
|
});
|
|
2332
|
-
class
|
|
2335
|
+
class Ue extends _ {
|
|
2333
2336
|
get schema() {
|
|
2334
2337
|
return this._def.getter();
|
|
2335
2338
|
}
|
|
@@ -2338,12 +2341,12 @@ class $e extends _ {
|
|
|
2338
2341
|
return this._def.getter()._parse({ data: s.data, path: s.path, parent: s });
|
|
2339
2342
|
}
|
|
2340
2343
|
}
|
|
2341
|
-
|
|
2344
|
+
Ue.create = (t, e) => new Ue({
|
|
2342
2345
|
getter: t,
|
|
2343
|
-
typeName:
|
|
2346
|
+
typeName: p.ZodLazy,
|
|
2344
2347
|
...g(e)
|
|
2345
2348
|
});
|
|
2346
|
-
class
|
|
2349
|
+
class xe extends _ {
|
|
2347
2350
|
_parse(e) {
|
|
2348
2351
|
if (e.data !== this._def.value) {
|
|
2349
2352
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2351,7 +2354,7 @@ class ve extends _ {
|
|
|
2351
2354
|
received: s.data,
|
|
2352
2355
|
code: c.invalid_literal,
|
|
2353
2356
|
expected: this._def.value
|
|
2354
|
-
}),
|
|
2357
|
+
}), m;
|
|
2355
2358
|
}
|
|
2356
2359
|
return { status: "valid", value: e.data };
|
|
2357
2360
|
}
|
|
@@ -2359,15 +2362,15 @@ class ve extends _ {
|
|
|
2359
2362
|
return this._def.value;
|
|
2360
2363
|
}
|
|
2361
2364
|
}
|
|
2362
|
-
|
|
2365
|
+
xe.create = (t, e) => new xe({
|
|
2363
2366
|
value: t,
|
|
2364
|
-
typeName:
|
|
2367
|
+
typeName: p.ZodLiteral,
|
|
2365
2368
|
...g(e)
|
|
2366
2369
|
});
|
|
2367
|
-
function
|
|
2370
|
+
function Fe(t, e) {
|
|
2368
2371
|
return new W({
|
|
2369
2372
|
values: t,
|
|
2370
|
-
typeName:
|
|
2373
|
+
typeName: p.ZodEnum,
|
|
2371
2374
|
...g(e)
|
|
2372
2375
|
});
|
|
2373
2376
|
}
|
|
@@ -2379,7 +2382,7 @@ class W extends _ {
|
|
|
2379
2382
|
expected: v.joinValues(n),
|
|
2380
2383
|
received: s.parsedType,
|
|
2381
2384
|
code: c.invalid_type
|
|
2382
|
-
}),
|
|
2385
|
+
}), m;
|
|
2383
2386
|
}
|
|
2384
2387
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2385
2388
|
const s = this._getOrReturnCtx(e), n = this._def.values;
|
|
@@ -2387,7 +2390,7 @@ class W extends _ {
|
|
|
2387
2390
|
received: s.data,
|
|
2388
2391
|
code: c.invalid_enum_value,
|
|
2389
2392
|
options: n
|
|
2390
|
-
}),
|
|
2393
|
+
}), m;
|
|
2391
2394
|
}
|
|
2392
2395
|
return I(e.data);
|
|
2393
2396
|
}
|
|
@@ -2425,8 +2428,8 @@ class W extends _ {
|
|
|
2425
2428
|
});
|
|
2426
2429
|
}
|
|
2427
2430
|
}
|
|
2428
|
-
W.create =
|
|
2429
|
-
class
|
|
2431
|
+
W.create = Fe;
|
|
2432
|
+
class Be extends _ {
|
|
2430
2433
|
_parse(e) {
|
|
2431
2434
|
const s = v.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2432
2435
|
if (n.parsedType !== f.string && n.parsedType !== f.number) {
|
|
@@ -2435,7 +2438,7 @@ class Ve extends _ {
|
|
|
2435
2438
|
expected: v.joinValues(a),
|
|
2436
2439
|
received: n.parsedType,
|
|
2437
2440
|
code: c.invalid_type
|
|
2438
|
-
}),
|
|
2441
|
+
}), m;
|
|
2439
2442
|
}
|
|
2440
2443
|
if (this._cache || (this._cache = new Set(v.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2441
2444
|
const a = v.objectValues(s);
|
|
@@ -2443,7 +2446,7 @@ class Ve extends _ {
|
|
|
2443
2446
|
received: n.data,
|
|
2444
2447
|
code: c.invalid_enum_value,
|
|
2445
2448
|
options: a
|
|
2446
|
-
}),
|
|
2449
|
+
}), m;
|
|
2447
2450
|
}
|
|
2448
2451
|
return I(e.data);
|
|
2449
2452
|
}
|
|
@@ -2451,12 +2454,12 @@ class Ve extends _ {
|
|
|
2451
2454
|
return this._def.values;
|
|
2452
2455
|
}
|
|
2453
2456
|
}
|
|
2454
|
-
|
|
2457
|
+
Be.create = (t, e) => new Be({
|
|
2455
2458
|
values: t,
|
|
2456
|
-
typeName:
|
|
2459
|
+
typeName: p.ZodNativeEnum,
|
|
2457
2460
|
...g(e)
|
|
2458
2461
|
});
|
|
2459
|
-
class
|
|
2462
|
+
class fe extends _ {
|
|
2460
2463
|
unwrap() {
|
|
2461
2464
|
return this._def.type;
|
|
2462
2465
|
}
|
|
@@ -2467,7 +2470,7 @@ class le extends _ {
|
|
|
2467
2470
|
code: c.invalid_type,
|
|
2468
2471
|
expected: f.promise,
|
|
2469
2472
|
received: s.parsedType
|
|
2470
|
-
}),
|
|
2473
|
+
}), m;
|
|
2471
2474
|
const n = s.parsedType === f.promise ? s.data : Promise.resolve(s.data);
|
|
2472
2475
|
return I(n.then((a) => this._def.type.parseAsync(a, {
|
|
2473
2476
|
path: s.path,
|
|
@@ -2475,9 +2478,9 @@ class le extends _ {
|
|
|
2475
2478
|
})));
|
|
2476
2479
|
}
|
|
2477
2480
|
}
|
|
2478
|
-
|
|
2481
|
+
fe.create = (t, e) => new fe({
|
|
2479
2482
|
type: t,
|
|
2480
|
-
typeName:
|
|
2483
|
+
typeName: p.ZodPromise,
|
|
2481
2484
|
...g(e)
|
|
2482
2485
|
});
|
|
2483
2486
|
class H extends _ {
|
|
@@ -2485,7 +2488,7 @@ class H extends _ {
|
|
|
2485
2488
|
return this._def.schema;
|
|
2486
2489
|
}
|
|
2487
2490
|
sourceType() {
|
|
2488
|
-
return this._def.schema._def.typeName ===
|
|
2491
|
+
return this._def.schema._def.typeName === p.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2489
2492
|
}
|
|
2490
2493
|
_parse(e) {
|
|
2491
2494
|
const { status: s, ctx: n } = this._processInputParams(e), a = this._def.effect || null, r = {
|
|
@@ -2501,23 +2504,23 @@ class H extends _ {
|
|
|
2501
2504
|
if (n.common.async)
|
|
2502
2505
|
return Promise.resolve(i).then(async (o) => {
|
|
2503
2506
|
if (s.value === "aborted")
|
|
2504
|
-
return
|
|
2507
|
+
return m;
|
|
2505
2508
|
const d = await this._def.schema._parseAsync({
|
|
2506
2509
|
data: o,
|
|
2507
2510
|
path: n.path,
|
|
2508
2511
|
parent: n
|
|
2509
2512
|
});
|
|
2510
|
-
return d.status === "aborted" ?
|
|
2513
|
+
return d.status === "aborted" ? m : d.status === "dirty" || s.value === "dirty" ? K(d.value) : d;
|
|
2511
2514
|
});
|
|
2512
2515
|
{
|
|
2513
2516
|
if (s.value === "aborted")
|
|
2514
|
-
return
|
|
2517
|
+
return m;
|
|
2515
2518
|
const o = this._def.schema._parseSync({
|
|
2516
2519
|
data: i,
|
|
2517
2520
|
path: n.path,
|
|
2518
2521
|
parent: n
|
|
2519
2522
|
});
|
|
2520
|
-
return o.status === "aborted" ?
|
|
2523
|
+
return o.status === "aborted" ? m : o.status === "dirty" || s.value === "dirty" ? K(o.value) : o;
|
|
2521
2524
|
}
|
|
2522
2525
|
}
|
|
2523
2526
|
if (a.type === "refinement") {
|
|
@@ -2535,9 +2538,9 @@ class H extends _ {
|
|
|
2535
2538
|
path: n.path,
|
|
2536
2539
|
parent: n
|
|
2537
2540
|
});
|
|
2538
|
-
return o.status === "aborted" ?
|
|
2541
|
+
return o.status === "aborted" ? m : (o.status === "dirty" && s.dirty(), i(o.value), { status: s.value, value: o.value });
|
|
2539
2542
|
} else
|
|
2540
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ?
|
|
2543
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? m : (o.status === "dirty" && s.dirty(), i(o.value).then(() => ({ status: s.value, value: o.value }))));
|
|
2541
2544
|
}
|
|
2542
2545
|
if (a.type === "transform")
|
|
2543
2546
|
if (n.common.async === !1) {
|
|
@@ -2547,7 +2550,7 @@ class H extends _ {
|
|
|
2547
2550
|
parent: n
|
|
2548
2551
|
});
|
|
2549
2552
|
if (!Q(i))
|
|
2550
|
-
return
|
|
2553
|
+
return m;
|
|
2551
2554
|
const o = a.transform(i.value, r);
|
|
2552
2555
|
if (o instanceof Promise)
|
|
2553
2556
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
@@ -2556,20 +2559,20 @@ class H extends _ {
|
|
|
2556
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) => ({
|
|
2557
2560
|
status: s.value,
|
|
2558
2561
|
value: o
|
|
2559
|
-
})) :
|
|
2562
|
+
})) : m);
|
|
2560
2563
|
v.assertNever(a);
|
|
2561
2564
|
}
|
|
2562
2565
|
}
|
|
2563
2566
|
H.create = (t, e, s) => new H({
|
|
2564
2567
|
schema: t,
|
|
2565
|
-
typeName:
|
|
2568
|
+
typeName: p.ZodEffects,
|
|
2566
2569
|
effect: e,
|
|
2567
2570
|
...g(s)
|
|
2568
2571
|
});
|
|
2569
2572
|
H.createWithPreprocess = (t, e, s) => new H({
|
|
2570
2573
|
schema: e,
|
|
2571
2574
|
effect: { type: "preprocess", transform: t },
|
|
2572
|
-
typeName:
|
|
2575
|
+
typeName: p.ZodEffects,
|
|
2573
2576
|
...g(s)
|
|
2574
2577
|
});
|
|
2575
2578
|
class L extends _ {
|
|
@@ -2582,7 +2585,7 @@ class L extends _ {
|
|
|
2582
2585
|
}
|
|
2583
2586
|
L.create = (t, e) => new L({
|
|
2584
2587
|
innerType: t,
|
|
2585
|
-
typeName:
|
|
2588
|
+
typeName: p.ZodOptional,
|
|
2586
2589
|
...g(e)
|
|
2587
2590
|
});
|
|
2588
2591
|
class J extends _ {
|
|
@@ -2595,10 +2598,10 @@ class J extends _ {
|
|
|
2595
2598
|
}
|
|
2596
2599
|
J.create = (t, e) => new J({
|
|
2597
2600
|
innerType: t,
|
|
2598
|
-
typeName:
|
|
2601
|
+
typeName: p.ZodNullable,
|
|
2599
2602
|
...g(e)
|
|
2600
2603
|
});
|
|
2601
|
-
class
|
|
2604
|
+
class be extends _ {
|
|
2602
2605
|
_parse(e) {
|
|
2603
2606
|
const { ctx: s } = this._processInputParams(e);
|
|
2604
2607
|
let n = s.data;
|
|
@@ -2612,13 +2615,13 @@ class xe extends _ {
|
|
|
2612
2615
|
return this._def.innerType;
|
|
2613
2616
|
}
|
|
2614
2617
|
}
|
|
2615
|
-
|
|
2618
|
+
be.create = (t, e) => new be({
|
|
2616
2619
|
innerType: t,
|
|
2617
|
-
typeName:
|
|
2620
|
+
typeName: p.ZodDefault,
|
|
2618
2621
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2619
2622
|
...g(e)
|
|
2620
2623
|
});
|
|
2621
|
-
class
|
|
2624
|
+
class ke extends _ {
|
|
2622
2625
|
_parse(e) {
|
|
2623
2626
|
const { ctx: s } = this._processInputParams(e), n = {
|
|
2624
2627
|
...s,
|
|
@@ -2633,7 +2636,7 @@ class be extends _ {
|
|
|
2633
2636
|
...n
|
|
2634
2637
|
}
|
|
2635
2638
|
});
|
|
2636
|
-
return
|
|
2639
|
+
return oe(a) ? a.then((r) => ({
|
|
2637
2640
|
status: "valid",
|
|
2638
2641
|
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
2639
2642
|
get error() {
|
|
@@ -2655,13 +2658,13 @@ class be extends _ {
|
|
|
2655
2658
|
return this._def.innerType;
|
|
2656
2659
|
}
|
|
2657
2660
|
}
|
|
2658
|
-
|
|
2661
|
+
ke.create = (t, e) => new ke({
|
|
2659
2662
|
innerType: t,
|
|
2660
|
-
typeName:
|
|
2663
|
+
typeName: p.ZodCatch,
|
|
2661
2664
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2662
2665
|
...g(e)
|
|
2663
2666
|
});
|
|
2664
|
-
class
|
|
2667
|
+
class Ge extends _ {
|
|
2665
2668
|
_parse(e) {
|
|
2666
2669
|
if (this._getType(e) !== f.nan) {
|
|
2667
2670
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2669,16 +2672,16 @@ class Ue extends _ {
|
|
|
2669
2672
|
code: c.invalid_type,
|
|
2670
2673
|
expected: f.nan,
|
|
2671
2674
|
received: n.parsedType
|
|
2672
|
-
}),
|
|
2675
|
+
}), m;
|
|
2673
2676
|
}
|
|
2674
2677
|
return { status: "valid", value: e.data };
|
|
2675
2678
|
}
|
|
2676
2679
|
}
|
|
2677
|
-
|
|
2678
|
-
typeName:
|
|
2680
|
+
Ge.create = (t) => new Ge({
|
|
2681
|
+
typeName: p.ZodNaN,
|
|
2679
2682
|
...g(t)
|
|
2680
2683
|
});
|
|
2681
|
-
class
|
|
2684
|
+
class Et extends _ {
|
|
2682
2685
|
_parse(e) {
|
|
2683
2686
|
const { ctx: s } = this._processInputParams(e), n = s.data;
|
|
2684
2687
|
return this._def.type._parse({
|
|
@@ -2691,7 +2694,7 @@ class Ct extends _ {
|
|
|
2691
2694
|
return this._def.type;
|
|
2692
2695
|
}
|
|
2693
2696
|
}
|
|
2694
|
-
class
|
|
2697
|
+
class Re extends _ {
|
|
2695
2698
|
_parse(e) {
|
|
2696
2699
|
const { status: s, ctx: n } = this._processInputParams(e);
|
|
2697
2700
|
if (n.common.async)
|
|
@@ -2701,7 +2704,7 @@ class Se extends _ {
|
|
|
2701
2704
|
path: n.path,
|
|
2702
2705
|
parent: n
|
|
2703
2706
|
});
|
|
2704
|
-
return r.status === "aborted" ?
|
|
2707
|
+
return r.status === "aborted" ? m : r.status === "dirty" ? (s.dirty(), K(r.value)) : this._def.out._parseAsync({
|
|
2705
2708
|
data: r.value,
|
|
2706
2709
|
path: n.path,
|
|
2707
2710
|
parent: n
|
|
@@ -2713,7 +2716,7 @@ class Se extends _ {
|
|
|
2713
2716
|
path: n.path,
|
|
2714
2717
|
parent: n
|
|
2715
2718
|
});
|
|
2716
|
-
return a.status === "aborted" ?
|
|
2719
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (s.dirty(), {
|
|
2717
2720
|
status: "dirty",
|
|
2718
2721
|
value: a.value
|
|
2719
2722
|
}) : this._def.out._parseSync({
|
|
@@ -2724,63 +2727,63 @@ class Se extends _ {
|
|
|
2724
2727
|
}
|
|
2725
2728
|
}
|
|
2726
2729
|
static create(e, s) {
|
|
2727
|
-
return new
|
|
2730
|
+
return new Re({
|
|
2728
2731
|
in: e,
|
|
2729
2732
|
out: s,
|
|
2730
|
-
typeName:
|
|
2733
|
+
typeName: p.ZodPipeline
|
|
2731
2734
|
});
|
|
2732
2735
|
}
|
|
2733
2736
|
}
|
|
2734
|
-
class
|
|
2737
|
+
class we extends _ {
|
|
2735
2738
|
_parse(e) {
|
|
2736
2739
|
const s = this._def.innerType._parse(e), n = (a) => (Q(a) && (a.value = Object.freeze(a.value)), a);
|
|
2737
|
-
return
|
|
2740
|
+
return oe(s) ? s.then((a) => n(a)) : n(s);
|
|
2738
2741
|
}
|
|
2739
2742
|
unwrap() {
|
|
2740
2743
|
return this._def.innerType;
|
|
2741
2744
|
}
|
|
2742
2745
|
}
|
|
2743
|
-
|
|
2746
|
+
we.create = (t, e) => new we({
|
|
2744
2747
|
innerType: t,
|
|
2745
|
-
typeName:
|
|
2748
|
+
typeName: p.ZodReadonly,
|
|
2746
2749
|
...g(e)
|
|
2747
2750
|
});
|
|
2748
|
-
var
|
|
2751
|
+
var p;
|
|
2749
2752
|
(function(t) {
|
|
2750
2753
|
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";
|
|
2751
|
-
})(
|
|
2752
|
-
const x = q.create,
|
|
2754
|
+
})(p || (p = {}));
|
|
2755
|
+
const x = q.create, Te = F.create, V = ye.create, he = _e.create;
|
|
2753
2756
|
$.create;
|
|
2754
|
-
const
|
|
2755
|
-
ce.create;
|
|
2757
|
+
const Nt = N.create, Y = w.create;
|
|
2756
2758
|
ue.create;
|
|
2759
|
+
de.create;
|
|
2757
2760
|
U.create;
|
|
2758
|
-
const
|
|
2761
|
+
const At = le.create, b = xe.create;
|
|
2759
2762
|
W.create;
|
|
2760
|
-
|
|
2763
|
+
fe.create;
|
|
2761
2764
|
L.create;
|
|
2762
2765
|
J.create;
|
|
2763
|
-
const
|
|
2766
|
+
const Ot = 1, B = Y({
|
|
2764
2767
|
type: b("qp-bridge"),
|
|
2765
2768
|
id: x().optional(),
|
|
2766
2769
|
instanceId: x().optional()
|
|
2767
2770
|
}), S = B.extend({
|
|
2768
|
-
featureVersion:
|
|
2769
|
-
}),
|
|
2771
|
+
featureVersion: Te().optional()
|
|
2772
|
+
}), Mt = B.extend({
|
|
2770
2773
|
status: b("answerChanged"),
|
|
2771
2774
|
question: x(),
|
|
2772
|
-
answer:
|
|
2773
|
-
}),
|
|
2775
|
+
answer: he()
|
|
2776
|
+
}), Zt = B.extend({
|
|
2774
2777
|
action: b("commandExecuted"),
|
|
2775
2778
|
commandName: x()
|
|
2776
|
-
}),
|
|
2779
|
+
}), qt = B.extend({
|
|
2777
2780
|
action: b("questionnaireLoaded")
|
|
2778
2781
|
}), G = B.extend({
|
|
2779
2782
|
status: b("success")
|
|
2780
|
-
}),
|
|
2783
|
+
}), jt = B.extend({
|
|
2781
2784
|
status: b("error"),
|
|
2782
2785
|
message: x()
|
|
2783
|
-
}),
|
|
2786
|
+
}), We = Y({
|
|
2784
2787
|
semanticColor: x().optional(),
|
|
2785
2788
|
label: x(),
|
|
2786
2789
|
description: x(),
|
|
@@ -2788,187 +2791,181 @@ const Nt = 1, B = Y({
|
|
|
2788
2791
|
required: V(),
|
|
2789
2792
|
hidden: V(),
|
|
2790
2793
|
errorMessage: x().optional(),
|
|
2791
|
-
answer:
|
|
2792
|
-
}),
|
|
2794
|
+
answer: he().optional()
|
|
2795
|
+
}), Pt = We.partial(), Lt = Y({
|
|
2793
2796
|
id: x().uuid(),
|
|
2794
2797
|
name: x(),
|
|
2795
2798
|
mimeType: x(),
|
|
2796
2799
|
blobUrl: x()
|
|
2797
|
-
}),
|
|
2800
|
+
}), Ce = At(he()), He = Y({
|
|
2798
2801
|
label: x(),
|
|
2799
2802
|
hidden: V(),
|
|
2800
2803
|
collapsed: V()
|
|
2801
|
-
}),
|
|
2804
|
+
}), $t = He.partial(), Vt = Y({
|
|
2802
2805
|
entityName: x(),
|
|
2803
2806
|
id: x(),
|
|
2804
2807
|
name: x()
|
|
2805
|
-
}),
|
|
2808
|
+
}), Ut = Y({
|
|
2806
2809
|
isNew: V(),
|
|
2807
2810
|
id: x().uuid(),
|
|
2808
2811
|
label: x(),
|
|
2809
2812
|
description: x().optional(),
|
|
2810
|
-
regarding:
|
|
2811
|
-
}),
|
|
2813
|
+
regarding: Vt.optional()
|
|
2814
|
+
}), Bt = S.extend({
|
|
2812
2815
|
action: b("getQuestion"),
|
|
2813
2816
|
question: x()
|
|
2814
|
-
}),
|
|
2815
|
-
question:
|
|
2816
|
-
}),
|
|
2817
|
+
}), Gt = G.extend({
|
|
2818
|
+
question: We
|
|
2819
|
+
}), zt = S.extend({
|
|
2817
2820
|
action: b("setQuestion"),
|
|
2818
2821
|
question: x(),
|
|
2819
|
-
questionData:
|
|
2820
|
-
}),
|
|
2822
|
+
questionData: Pt
|
|
2823
|
+
}), Dt = S.extend({
|
|
2821
2824
|
action: b("getGroup"),
|
|
2822
2825
|
group: x()
|
|
2823
|
-
}), zt = G.extend({
|
|
2824
|
-
group: Fe
|
|
2825
|
-
}), Dt = S.extend({
|
|
2826
|
-
action: b("getQuestionnaire")
|
|
2827
2826
|
}), Qt = G.extend({
|
|
2828
|
-
|
|
2829
|
-
}), Ft =
|
|
2827
|
+
group: He
|
|
2828
|
+
}), Ft = S.extend({
|
|
2829
|
+
action: b("getQuestionnaire")
|
|
2830
|
+
}), Wt = G.extend({
|
|
2831
|
+
questionnaire: Ut
|
|
2832
|
+
}), Ht = G.extend({
|
|
2830
2833
|
canSave: V()
|
|
2831
|
-
}),
|
|
2834
|
+
}), Jt = S.extend({
|
|
2832
2835
|
action: b("canSave")
|
|
2833
|
-
}),
|
|
2836
|
+
}), Yt = S.extend({
|
|
2834
2837
|
action: b("setGroup"),
|
|
2835
2838
|
group: x(),
|
|
2836
|
-
groupData:
|
|
2837
|
-
}),
|
|
2839
|
+
groupData: $t
|
|
2840
|
+
}), Xt = S.extend({
|
|
2838
2841
|
action: b("setAnswer"),
|
|
2839
2842
|
question: x(),
|
|
2840
|
-
answer:
|
|
2841
|
-
}),
|
|
2843
|
+
answer: he()
|
|
2844
|
+
}), Kt = S.extend({
|
|
2842
2845
|
action: b("busyIndicatorStart")
|
|
2843
|
-
}),
|
|
2846
|
+
}), es = S.extend({
|
|
2844
2847
|
action: b("busyIndicatorEnd")
|
|
2845
|
-
}),
|
|
2848
|
+
}), ts = S.extend({
|
|
2846
2849
|
action: b("saveQuestionnaire")
|
|
2847
|
-
}),
|
|
2850
|
+
}), ss = S.extend({
|
|
2848
2851
|
action: b("completeAndCloseQuestionnaire")
|
|
2849
|
-
}),
|
|
2852
|
+
}), ns = S.extend({
|
|
2850
2853
|
action: b("executeCustomCommand"),
|
|
2851
2854
|
commandName: x()
|
|
2852
|
-
}),
|
|
2855
|
+
}), as = S.extend({
|
|
2853
2856
|
action: b("fetchEntities"),
|
|
2854
2857
|
fetchXml: x()
|
|
2855
|
-
}),
|
|
2856
|
-
entities:
|
|
2857
|
-
}),
|
|
2858
|
+
}), rs = G.extend({
|
|
2859
|
+
entities: Nt(Ce)
|
|
2860
|
+
}), is = S.extend({
|
|
2858
2861
|
action: b("getEntityById"),
|
|
2859
2862
|
entityName: x(),
|
|
2860
2863
|
entityId: x()
|
|
2861
|
-
}),
|
|
2862
|
-
entity:
|
|
2863
|
-
}),
|
|
2864
|
+
}), os = G.extend({
|
|
2865
|
+
entity: Ce
|
|
2866
|
+
}), cs = S.extend({
|
|
2864
2867
|
action: b("saveEntity"),
|
|
2865
|
-
entity:
|
|
2866
|
-
}),
|
|
2868
|
+
entity: Ce
|
|
2869
|
+
}), us = S.extend({
|
|
2867
2870
|
action: b("repeatGroup"),
|
|
2868
2871
|
parentGroupName: x(),
|
|
2869
|
-
groupIndex:
|
|
2870
|
-
}),
|
|
2872
|
+
groupIndex: Te()
|
|
2873
|
+
}), ds = S.extend({
|
|
2871
2874
|
action: b("addNewGroup"),
|
|
2872
2875
|
groupName: x()
|
|
2873
|
-
}),
|
|
2876
|
+
}), ls = S.extend({
|
|
2874
2877
|
action: b("deleteGroup"),
|
|
2875
2878
|
parentGroupName: x(),
|
|
2876
|
-
groupIndex:
|
|
2879
|
+
groupIndex: Te()
|
|
2877
2880
|
});
|
|
2878
|
-
function
|
|
2879
|
-
return
|
|
2880
|
-
}
|
|
2881
|
-
function ds(t) {
|
|
2882
|
-
return At.safeParse(t).success;
|
|
2883
|
-
}
|
|
2884
|
-
function ls(t) {
|
|
2885
|
-
return Ot.safeParse(t).success;
|
|
2881
|
+
function Os(t) {
|
|
2882
|
+
return Lt.safeParse(t).success;
|
|
2886
2883
|
}
|
|
2887
2884
|
function fs(t) {
|
|
2888
2885
|
return Mt.safeParse(t).success;
|
|
2889
2886
|
}
|
|
2890
|
-
function we(t) {
|
|
2891
|
-
return B.safeParse(t).success;
|
|
2892
|
-
}
|
|
2893
|
-
function As(t) {
|
|
2894
|
-
return S.safeParse(t).success;
|
|
2895
|
-
}
|
|
2896
2887
|
function hs(t) {
|
|
2897
|
-
return G.safeParse(t).success;
|
|
2898
|
-
}
|
|
2899
|
-
function ms(t) {
|
|
2900
2888
|
return Zt.safeParse(t).success;
|
|
2901
2889
|
}
|
|
2902
|
-
function Os(t) {
|
|
2903
|
-
return Vt.safeParse(t).success;
|
|
2904
|
-
}
|
|
2905
2890
|
function ps(t) {
|
|
2906
|
-
return
|
|
2891
|
+
return qt.safeParse(t).success;
|
|
2892
|
+
}
|
|
2893
|
+
function Se(t) {
|
|
2894
|
+
return B.safeParse(t).success;
|
|
2907
2895
|
}
|
|
2908
2896
|
function Ms(t) {
|
|
2909
|
-
return
|
|
2897
|
+
return S.safeParse(t).success;
|
|
2898
|
+
}
|
|
2899
|
+
function ms(t) {
|
|
2900
|
+
return G.safeParse(t).success;
|
|
2901
|
+
}
|
|
2902
|
+
function gs(t) {
|
|
2903
|
+
return jt.safeParse(t).success;
|
|
2910
2904
|
}
|
|
2911
2905
|
function Zs(t) {
|
|
2912
2906
|
return Bt.safeParse(t).success;
|
|
2913
2907
|
}
|
|
2914
|
-
function
|
|
2915
|
-
return Ht.safeParse(t).success;
|
|
2916
|
-
}
|
|
2917
|
-
function js(t) {
|
|
2908
|
+
function ys(t) {
|
|
2918
2909
|
return Gt.safeParse(t).success;
|
|
2919
2910
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return
|
|
2911
|
+
function qs(t) {
|
|
2912
|
+
return Xt.safeParse(t).success;
|
|
2922
2913
|
}
|
|
2923
|
-
function
|
|
2914
|
+
function js(t) {
|
|
2924
2915
|
return zt.safeParse(t).success;
|
|
2925
2916
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return
|
|
2917
|
+
function Ps(t) {
|
|
2918
|
+
return Yt.safeParse(t).success;
|
|
2928
2919
|
}
|
|
2929
2920
|
function Ls(t) {
|
|
2921
|
+
return Dt.safeParse(t).success;
|
|
2922
|
+
}
|
|
2923
|
+
function $s(t) {
|
|
2930
2924
|
return Ft.safeParse(t).success;
|
|
2931
2925
|
}
|
|
2932
2926
|
function _s(t) {
|
|
2933
|
-
return
|
|
2927
|
+
return Qt.safeParse(t).success;
|
|
2934
2928
|
}
|
|
2935
2929
|
function vs(t) {
|
|
2936
|
-
return
|
|
2930
|
+
return Wt.safeParse(t).success;
|
|
2931
|
+
}
|
|
2932
|
+
function Vs(t) {
|
|
2933
|
+
return Ht.safeParse(t).success;
|
|
2937
2934
|
}
|
|
2938
2935
|
function xs(t) {
|
|
2939
|
-
return
|
|
2936
|
+
return Jt.safeParse(t).success;
|
|
2940
2937
|
}
|
|
2941
|
-
function
|
|
2938
|
+
function bs(t) {
|
|
2942
2939
|
return Kt.safeParse(t).success;
|
|
2943
2940
|
}
|
|
2944
|
-
function
|
|
2941
|
+
function ks(t) {
|
|
2945
2942
|
return es.safeParse(t).success;
|
|
2946
2943
|
}
|
|
2947
2944
|
function Us(t) {
|
|
2948
2945
|
return ts.safeParse(t).success;
|
|
2949
2946
|
}
|
|
2950
2947
|
function Bs(t) {
|
|
2951
|
-
return vs(t) || xs(t);
|
|
2952
|
-
}
|
|
2953
|
-
function bs(t, e, s) {
|
|
2954
|
-
return !we(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2955
|
-
}
|
|
2956
|
-
function Gs(t) {
|
|
2957
2948
|
return ss.safeParse(t).success;
|
|
2958
2949
|
}
|
|
2959
|
-
function
|
|
2950
|
+
function Gs(t) {
|
|
2960
2951
|
return ns.safeParse(t).success;
|
|
2961
2952
|
}
|
|
2962
2953
|
function zs(t) {
|
|
2954
|
+
return bs(t) || ks(t);
|
|
2955
|
+
}
|
|
2956
|
+
function ws(t, e, s) {
|
|
2957
|
+
return !Se(t) || t.id !== e || s !== void 0 && t.instanceId !== s || !("status" in t);
|
|
2958
|
+
}
|
|
2959
|
+
function Ds(t) {
|
|
2963
2960
|
return as.safeParse(t).success;
|
|
2964
2961
|
}
|
|
2965
|
-
function
|
|
2962
|
+
function Ss(t) {
|
|
2966
2963
|
return rs.safeParse(t).success;
|
|
2967
2964
|
}
|
|
2968
|
-
function
|
|
2965
|
+
function Qs(t) {
|
|
2969
2966
|
return is.safeParse(t).success;
|
|
2970
2967
|
}
|
|
2971
|
-
function
|
|
2968
|
+
function Rs(t) {
|
|
2972
2969
|
return os.safeParse(t).success;
|
|
2973
2970
|
}
|
|
2974
2971
|
function Fs(t) {
|
|
@@ -2977,13 +2974,19 @@ function Fs(t) {
|
|
|
2977
2974
|
function Ws(t) {
|
|
2978
2975
|
return us.safeParse(t).success;
|
|
2979
2976
|
}
|
|
2977
|
+
function Hs(t) {
|
|
2978
|
+
return ds.safeParse(t).success;
|
|
2979
|
+
}
|
|
2980
|
+
function Js(t) {
|
|
2981
|
+
return ls.safeParse(t).success;
|
|
2982
|
+
}
|
|
2980
2983
|
function re(t) {
|
|
2981
2984
|
if (t?.instanceId != null)
|
|
2982
2985
|
return t.instanceId;
|
|
2983
2986
|
const e = globalThis.__RESCO_QP_BRIDGE_INSTANCE_ID;
|
|
2984
2987
|
return typeof e == "string" ? e : void 0;
|
|
2985
2988
|
}
|
|
2986
|
-
function
|
|
2989
|
+
function Je(t) {
|
|
2987
2990
|
if (t instanceof File || t instanceof Blob)
|
|
2988
2991
|
return URL.createObjectURL(t);
|
|
2989
2992
|
if (typeof t == "string") {
|
|
@@ -3010,31 +3013,31 @@ function We(t) {
|
|
|
3010
3013
|
}
|
|
3011
3014
|
throw new Error("Unsupported content type for blobUrl");
|
|
3012
3015
|
}
|
|
3013
|
-
function
|
|
3016
|
+
function Ys(t, e, s, n) {
|
|
3014
3017
|
return {
|
|
3015
|
-
id: n ??
|
|
3018
|
+
id: n ?? ze(),
|
|
3016
3019
|
name: t,
|
|
3017
3020
|
mimeType: e,
|
|
3018
|
-
blobUrl:
|
|
3021
|
+
blobUrl: Je(s)
|
|
3019
3022
|
};
|
|
3020
3023
|
}
|
|
3021
|
-
function
|
|
3024
|
+
function Xs(t, e) {
|
|
3022
3025
|
let s = t.blobUrl;
|
|
3023
|
-
return e.content !== void 0 && (s =
|
|
3026
|
+
return e.content !== void 0 && (s = Je(e.content)), {
|
|
3024
3027
|
...t,
|
|
3025
3028
|
...e,
|
|
3026
3029
|
blobUrl: s
|
|
3027
3030
|
};
|
|
3028
3031
|
}
|
|
3029
|
-
|
|
3030
|
-
function
|
|
3031
|
-
window.addEventListener("message",
|
|
3032
|
+
Ke.env?.NODE_ENV !== "test" && Ts();
|
|
3033
|
+
function Ts() {
|
|
3034
|
+
window.addEventListener("message", Ye);
|
|
3032
3035
|
}
|
|
3033
|
-
function
|
|
3034
|
-
window.removeEventListener("message",
|
|
3036
|
+
function Ks() {
|
|
3037
|
+
window.removeEventListener("message", Ye);
|
|
3035
3038
|
}
|
|
3036
|
-
async function
|
|
3037
|
-
return await
|
|
3039
|
+
async function en(t) {
|
|
3040
|
+
return await Es(
|
|
3038
3041
|
{
|
|
3039
3042
|
type: "qp-bridge",
|
|
3040
3043
|
action: "getQuestionnaire"
|
|
@@ -3042,7 +3045,7 @@ async function Xs(t) {
|
|
|
3042
3045
|
t
|
|
3043
3046
|
);
|
|
3044
3047
|
}
|
|
3045
|
-
async function
|
|
3048
|
+
async function tn(t, e, s) {
|
|
3046
3049
|
await C(
|
|
3047
3050
|
{
|
|
3048
3051
|
type: "qp-bridge",
|
|
@@ -3053,8 +3056,8 @@ async function Ks(t, e, s) {
|
|
|
3053
3056
|
s
|
|
3054
3057
|
);
|
|
3055
3058
|
}
|
|
3056
|
-
async function
|
|
3057
|
-
return await
|
|
3059
|
+
async function sn(t, e) {
|
|
3060
|
+
return await Cs(
|
|
3058
3061
|
{
|
|
3059
3062
|
type: "qp-bridge",
|
|
3060
3063
|
action: "getQuestion",
|
|
@@ -3063,7 +3066,7 @@ async function en(t, e) {
|
|
|
3063
3066
|
e
|
|
3064
3067
|
);
|
|
3065
3068
|
}
|
|
3066
|
-
async function
|
|
3069
|
+
async function nn(t, e, s) {
|
|
3067
3070
|
await C(
|
|
3068
3071
|
{
|
|
3069
3072
|
type: "qp-bridge",
|
|
@@ -3074,8 +3077,8 @@ async function tn(t, e, s) {
|
|
|
3074
3077
|
s
|
|
3075
3078
|
);
|
|
3076
3079
|
}
|
|
3077
|
-
async function
|
|
3078
|
-
return await
|
|
3080
|
+
async function an(t, e) {
|
|
3081
|
+
return await Is(
|
|
3079
3082
|
{
|
|
3080
3083
|
type: "qp-bridge",
|
|
3081
3084
|
action: "getGroup",
|
|
@@ -3084,7 +3087,7 @@ async function sn(t, e) {
|
|
|
3084
3087
|
e
|
|
3085
3088
|
);
|
|
3086
3089
|
}
|
|
3087
|
-
async function
|
|
3090
|
+
async function rn(t, e, s) {
|
|
3088
3091
|
await C(
|
|
3089
3092
|
{
|
|
3090
3093
|
type: "qp-bridge",
|
|
@@ -3095,9 +3098,9 @@ async function nn(t, e, s) {
|
|
|
3095
3098
|
s
|
|
3096
3099
|
);
|
|
3097
3100
|
}
|
|
3098
|
-
function
|
|
3101
|
+
function on(t, e) {
|
|
3099
3102
|
const s = re(e), n = (a) => {
|
|
3100
|
-
|
|
3103
|
+
fs(a.data) && a.data.instanceId === s && t(a.data.question, a.data.answer);
|
|
3101
3104
|
};
|
|
3102
3105
|
return window.addEventListener("message", n), {
|
|
3103
3106
|
cancelSubscription: () => {
|
|
@@ -3105,7 +3108,7 @@ function an(t, e) {
|
|
|
3105
3108
|
}
|
|
3106
3109
|
};
|
|
3107
3110
|
}
|
|
3108
|
-
async function
|
|
3111
|
+
async function cn(t, e) {
|
|
3109
3112
|
await C(
|
|
3110
3113
|
{
|
|
3111
3114
|
type: "qp-bridge",
|
|
@@ -3125,7 +3128,7 @@ async function rn(t, e) {
|
|
|
3125
3128
|
);
|
|
3126
3129
|
}
|
|
3127
3130
|
}
|
|
3128
|
-
async function
|
|
3131
|
+
async function un(t) {
|
|
3129
3132
|
await C(
|
|
3130
3133
|
{
|
|
3131
3134
|
type: "qp-bridge",
|
|
@@ -3134,7 +3137,7 @@ async function on(t) {
|
|
|
3134
3137
|
t
|
|
3135
3138
|
);
|
|
3136
3139
|
}
|
|
3137
|
-
async function
|
|
3140
|
+
async function dn(t) {
|
|
3138
3141
|
await C(
|
|
3139
3142
|
{
|
|
3140
3143
|
type: "qp-bridge",
|
|
@@ -3143,7 +3146,7 @@ async function cn(t) {
|
|
|
3143
3146
|
t
|
|
3144
3147
|
);
|
|
3145
3148
|
}
|
|
3146
|
-
async function
|
|
3149
|
+
async function ln(t, e) {
|
|
3147
3150
|
await C(
|
|
3148
3151
|
{
|
|
3149
3152
|
type: "qp-bridge",
|
|
@@ -3154,7 +3157,7 @@ async function un(t, e) {
|
|
|
3154
3157
|
);
|
|
3155
3158
|
}
|
|
3156
3159
|
const ee = [], te = [], se = [];
|
|
3157
|
-
function
|
|
3160
|
+
function fn(t, e) {
|
|
3158
3161
|
const s = re(e);
|
|
3159
3162
|
return se.some((n) => n.handler === t && n.instanceId === s) || se.push({ handler: t, instanceId: s }), {
|
|
3160
3163
|
cancelSubscription: () => {
|
|
@@ -3163,7 +3166,7 @@ function dn(t, e) {
|
|
|
3163
3166
|
}
|
|
3164
3167
|
};
|
|
3165
3168
|
}
|
|
3166
|
-
function
|
|
3169
|
+
function hn(t, e) {
|
|
3167
3170
|
const s = re(e);
|
|
3168
3171
|
return te.some((n) => n.handler === t && n.instanceId === s) || te.push({ handler: t, instanceId: s }), {
|
|
3169
3172
|
cancelSubscription: () => {
|
|
@@ -3172,7 +3175,7 @@ function ln(t, e) {
|
|
|
3172
3175
|
}
|
|
3173
3176
|
};
|
|
3174
3177
|
}
|
|
3175
|
-
function
|
|
3178
|
+
function pn(t, e) {
|
|
3176
3179
|
const s = re(e);
|
|
3177
3180
|
return ee.some((n) => n.validator === t && n.instanceId === s) || ee.push({ validator: t, instanceId: s }), {
|
|
3178
3181
|
cancelSubscription: () => {
|
|
@@ -3181,9 +3184,9 @@ function fn(t, e) {
|
|
|
3181
3184
|
}
|
|
3182
3185
|
};
|
|
3183
3186
|
}
|
|
3184
|
-
async function
|
|
3187
|
+
async function Ye(t) {
|
|
3185
3188
|
try {
|
|
3186
|
-
if (
|
|
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)) {
|
|
3187
3190
|
const e = ee.filter((a) => a.instanceId === t.data.instanceId), s = await Promise.all(e.map((a) => a.validator())), n = {
|
|
3188
3191
|
type: "qp-bridge",
|
|
3189
3192
|
status: "success",
|
|
@@ -3197,15 +3200,15 @@ async function He(t) {
|
|
|
3197
3200
|
const s = {
|
|
3198
3201
|
type: "qp-bridge",
|
|
3199
3202
|
status: "error",
|
|
3200
|
-
id:
|
|
3201
|
-
instanceId:
|
|
3203
|
+
id: Se(t.data) ? t.data.id : void 0,
|
|
3204
|
+
instanceId: Se(t.data) ? t.data.instanceId : void 0,
|
|
3202
3205
|
message: e instanceof Error ? e.message : "Unknown error"
|
|
3203
3206
|
};
|
|
3204
3207
|
window.parent.postMessage(s, "*");
|
|
3205
3208
|
}
|
|
3206
3209
|
}
|
|
3207
|
-
async function
|
|
3208
|
-
return await
|
|
3210
|
+
async function mn(t, e) {
|
|
3211
|
+
return await Ns(
|
|
3209
3212
|
{
|
|
3210
3213
|
type: "qp-bridge",
|
|
3211
3214
|
action: "fetchEntities",
|
|
@@ -3214,8 +3217,8 @@ async function hn(t, e) {
|
|
|
3214
3217
|
e
|
|
3215
3218
|
);
|
|
3216
3219
|
}
|
|
3217
|
-
async function
|
|
3218
|
-
return await
|
|
3220
|
+
async function gn(t, e, s) {
|
|
3221
|
+
return await As(
|
|
3219
3222
|
{
|
|
3220
3223
|
type: "qp-bridge",
|
|
3221
3224
|
action: "getEntityById",
|
|
@@ -3225,10 +3228,10 @@ async function mn(t, e, s) {
|
|
|
3225
3228
|
s
|
|
3226
3229
|
);
|
|
3227
3230
|
}
|
|
3228
|
-
function
|
|
3231
|
+
function yn() {
|
|
3229
3232
|
return { isNew: !0 };
|
|
3230
3233
|
}
|
|
3231
|
-
async function
|
|
3234
|
+
async function _n(t, e) {
|
|
3232
3235
|
await C(
|
|
3233
3236
|
{
|
|
3234
3237
|
type: "qp-bridge",
|
|
@@ -3238,7 +3241,7 @@ async function gn(t, e) {
|
|
|
3238
3241
|
e
|
|
3239
3242
|
);
|
|
3240
3243
|
}
|
|
3241
|
-
async function
|
|
3244
|
+
async function vn(t, e, s) {
|
|
3242
3245
|
await C(
|
|
3243
3246
|
{
|
|
3244
3247
|
type: "qp-bridge",
|
|
@@ -3249,7 +3252,7 @@ async function yn(t, e, s) {
|
|
|
3249
3252
|
s
|
|
3250
3253
|
);
|
|
3251
3254
|
}
|
|
3252
|
-
async function
|
|
3255
|
+
async function xn(t, e) {
|
|
3253
3256
|
await C(
|
|
3254
3257
|
{
|
|
3255
3258
|
type: "qp-bridge",
|
|
@@ -3259,7 +3262,7 @@ async function _n(t, e) {
|
|
|
3259
3262
|
e
|
|
3260
3263
|
);
|
|
3261
3264
|
}
|
|
3262
|
-
async function
|
|
3265
|
+
async function bn(t, e, s) {
|
|
3263
3266
|
await C(
|
|
3264
3267
|
{
|
|
3265
3268
|
type: "qp-bridge",
|
|
@@ -3272,154 +3275,154 @@ async function vn(t, e, s) {
|
|
|
3272
3275
|
}
|
|
3273
3276
|
async function X(t, e, s) {
|
|
3274
3277
|
return new Promise((n, a) => {
|
|
3275
|
-
const r =
|
|
3276
|
-
if (
|
|
3278
|
+
const r = ze(), i = re(s), o = (d) => {
|
|
3279
|
+
if (ws(d.data, r, i))
|
|
3277
3280
|
return;
|
|
3278
3281
|
const l = e(d.data);
|
|
3279
|
-
l.success ? n(l.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);
|
|
3280
3283
|
};
|
|
3281
|
-
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion:
|
|
3284
|
+
window.addEventListener("message", o), window.parent.postMessage({ ...t, id: r, instanceId: i, featureVersion: Ot }, "*");
|
|
3282
3285
|
});
|
|
3283
3286
|
}
|
|
3284
|
-
async function
|
|
3287
|
+
async function Cs(t, e) {
|
|
3285
3288
|
return X(
|
|
3286
3289
|
t,
|
|
3287
|
-
(s) =>
|
|
3290
|
+
(s) => ys(s) ? { success: !0, data: s.question } : { success: !1 },
|
|
3288
3291
|
e
|
|
3289
3292
|
);
|
|
3290
3293
|
}
|
|
3291
|
-
async function
|
|
3294
|
+
async function Is(t, e) {
|
|
3292
3295
|
return X(
|
|
3293
3296
|
t,
|
|
3294
|
-
(s) =>
|
|
3297
|
+
(s) => _s(s) ? { success: !0, data: s.group } : { success: !1 },
|
|
3295
3298
|
e
|
|
3296
3299
|
);
|
|
3297
3300
|
}
|
|
3298
|
-
async function
|
|
3301
|
+
async function Es(t, e) {
|
|
3299
3302
|
return X(
|
|
3300
3303
|
t,
|
|
3301
|
-
(s) =>
|
|
3304
|
+
(s) => vs(s) ? { success: !0, data: s.questionnaire } : { success: !1 },
|
|
3302
3305
|
e
|
|
3303
3306
|
);
|
|
3304
3307
|
}
|
|
3305
3308
|
function C(t, e) {
|
|
3306
3309
|
return X(
|
|
3307
3310
|
t,
|
|
3308
|
-
(s) =>
|
|
3311
|
+
(s) => ms(s) ? { success: !0, data: void 0 } : { success: !1 },
|
|
3309
3312
|
e
|
|
3310
3313
|
);
|
|
3311
3314
|
}
|
|
3312
|
-
async function
|
|
3315
|
+
async function Ns(t, e) {
|
|
3313
3316
|
return X(
|
|
3314
3317
|
t,
|
|
3315
|
-
(s) =>
|
|
3318
|
+
(s) => Ss(s) ? { success: !0, data: s.entities } : { success: !1 },
|
|
3316
3319
|
e
|
|
3317
3320
|
);
|
|
3318
3321
|
}
|
|
3319
|
-
async function
|
|
3322
|
+
async function As(t, e) {
|
|
3320
3323
|
return X(
|
|
3321
3324
|
t,
|
|
3322
|
-
(s) =>
|
|
3325
|
+
(s) => Rs(s) ? { success: !0, data: s.entity } : { success: !1 },
|
|
3323
3326
|
e
|
|
3324
3327
|
);
|
|
3325
3328
|
}
|
|
3326
3329
|
export {
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
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,
|
|
3402
3405
|
B as qpBridgeBaseMessageSchema,
|
|
3403
3406
|
S as qpBridgeRequestMessageSchema,
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
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,
|
|
3412
3415
|
G as responseSuccessMessageSchema,
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
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
|
|
3425
3428
|
};
|