@connectedxm/zpl-generator 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -30
- package/dist/index.es.js +238 -202
- package/dist/src/generate.d.ts +11 -4
- package/dist/src/validate.d.ts +25 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -50,10 +50,10 @@ function Xe(e) {
|
|
|
50
50
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
51
51
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ge(e, t) {
|
|
54
54
|
return typeof t == "bigint" ? t.toString() : t;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ce(e) {
|
|
57
57
|
return {
|
|
58
58
|
get value() {
|
|
59
59
|
{
|
|
@@ -63,10 +63,10 @@ function ie(e) {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function be(e) {
|
|
67
67
|
return e == null;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ye(e) {
|
|
70
70
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
71
71
|
return e.slice(t, n);
|
|
72
72
|
}
|
|
@@ -80,13 +80,13 @@ function xt(e, t) {
|
|
|
80
80
|
const s = n > o ? n : o, i = Number.parseInt(e.toFixed(s).replace(".", "")), c = Number.parseInt(t.toFixed(s).replace(".", ""));
|
|
81
81
|
return i % c / 10 ** s;
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const Se = /* @__PURE__ */ Symbol("evaluating");
|
|
84
84
|
function g(e, t, n) {
|
|
85
85
|
let r;
|
|
86
86
|
Object.defineProperty(e, t, {
|
|
87
87
|
get() {
|
|
88
|
-
if (r !==
|
|
89
|
-
return r === void 0 && (r =
|
|
88
|
+
if (r !== Se)
|
|
89
|
+
return r === void 0 && (r = Se, r = n()), r;
|
|
90
90
|
},
|
|
91
91
|
set(o) {
|
|
92
92
|
Object.defineProperty(e, t, {
|
|
@@ -113,7 +113,7 @@ function P(...e) {
|
|
|
113
113
|
}
|
|
114
114
|
return Object.defineProperties({}, t);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ze(e) {
|
|
117
117
|
return JSON.stringify(e);
|
|
118
118
|
}
|
|
119
119
|
function jt(e) {
|
|
@@ -124,7 +124,7 @@ const qe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
124
124
|
function B(e) {
|
|
125
125
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
126
126
|
}
|
|
127
|
-
const Ct =
|
|
127
|
+
const Ct = ce(() => {
|
|
128
128
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
129
129
|
return !1;
|
|
130
130
|
try {
|
|
@@ -333,7 +333,7 @@ function R(e, t, n) {
|
|
|
333
333
|
}
|
|
334
334
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function we(e) {
|
|
337
337
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
338
338
|
}
|
|
339
339
|
function H(...e) {
|
|
@@ -352,7 +352,7 @@ const tt = (e, t) => {
|
|
|
352
352
|
}), Object.defineProperty(e, "issues", {
|
|
353
353
|
value: t,
|
|
354
354
|
enumerable: !1
|
|
355
|
-
}), e.message = JSON.stringify(t,
|
|
355
|
+
}), e.message = JSON.stringify(t, ge, 2), Object.defineProperty(e, "toString", {
|
|
356
356
|
value: () => e.message,
|
|
357
357
|
enumerable: !1
|
|
358
358
|
});
|
|
@@ -384,7 +384,7 @@ function Yt(e, t = (n) => n.message) {
|
|
|
384
384
|
};
|
|
385
385
|
return r(e), n;
|
|
386
386
|
}
|
|
387
|
-
const
|
|
387
|
+
const ze = (e) => (t, n, r, o) => {
|
|
388
388
|
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
|
|
389
389
|
if (i instanceof Promise)
|
|
390
390
|
throw new L();
|
|
@@ -393,7 +393,7 @@ const we = (e) => (t, n, r, o) => {
|
|
|
393
393
|
throw qe(c, o?.callee), c;
|
|
394
394
|
}
|
|
395
395
|
return i.value;
|
|
396
|
-
},
|
|
396
|
+
}, $e = (e) => async (t, n, r, o) => {
|
|
397
397
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
398
398
|
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
399
399
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
@@ -401,7 +401,7 @@ const we = (e) => (t, n, r, o) => {
|
|
|
401
401
|
throw qe(c, o?.callee), c;
|
|
402
402
|
}
|
|
403
403
|
return i.value;
|
|
404
|
-
},
|
|
404
|
+
}, ae = (e) => (t, n, r) => {
|
|
405
405
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
406
406
|
if (s instanceof Promise)
|
|
407
407
|
throw new L();
|
|
@@ -409,26 +409,26 @@ const we = (e) => (t, n, r, o) => {
|
|
|
409
409
|
success: !1,
|
|
410
410
|
error: new (e ?? nt)(s.issues.map((i) => R(i, o, C())))
|
|
411
411
|
} : { success: !0, data: s.value };
|
|
412
|
-
}, Gt = /* @__PURE__ */
|
|
412
|
+
}, Gt = /* @__PURE__ */ ae(rt), ue = (e) => async (t, n, r) => {
|
|
413
413
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
414
414
|
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
415
415
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
416
416
|
success: !1,
|
|
417
417
|
error: new e(s.issues.map((i) => R(i, o, C())))
|
|
418
418
|
} : { success: !0, data: s.value };
|
|
419
|
-
}, Kt = /* @__PURE__ */
|
|
420
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
|
-
return we(e)(t, n, o);
|
|
422
|
-
}, qt = (e) => (t, n, r) => we(e)(t, n, r), Qt = (e) => async (t, n, r) => {
|
|
419
|
+
}, Kt = /* @__PURE__ */ ue(rt), Xt = (e) => (t, n, r) => {
|
|
423
420
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
421
|
return ze(e)(t, n, o);
|
|
425
|
-
},
|
|
422
|
+
}, qt = (e) => (t, n, r) => ze(e)(t, n, r), Qt = (e) => async (t, n, r) => {
|
|
423
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
|
+
return $e(e)(t, n, o);
|
|
425
|
+
}, en = (e) => async (t, n, r) => $e(e)(t, n, r), tn = (e) => (t, n, r) => {
|
|
426
426
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
427
|
-
return
|
|
428
|
-
}, nn = (e) => (t, n, r) =>
|
|
427
|
+
return ae(e)(t, n, o);
|
|
428
|
+
}, nn = (e) => (t, n, r) => ae(e)(t, n, r), rn = (e) => async (t, n, r) => {
|
|
429
429
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
430
|
-
return
|
|
431
|
-
}, on = (e) => async (t, n, r) =>
|
|
430
|
+
return ue(e)(t, n, o);
|
|
431
|
+
}, on = (e) => async (t, n, r) => ue(e)(t, n, r), sn = /^[cC][^\s-]{8,}$/, cn = /^[0-9a-z]+$/, an = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, un = /^[0-9a-vA-V]{20}$/, ln = /^[A-Za-z0-9]{27}$/, fn = /^[a-zA-Z0-9_-]{21}$/, pn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, dn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Oe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, hn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, mn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
432
432
|
function gn() {
|
|
433
433
|
return new RegExp(mn, "u");
|
|
434
434
|
}
|
|
@@ -571,7 +571,7 @@ const Zn = (e) => {
|
|
|
571
571
|
var n;
|
|
572
572
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
573
573
|
const o = r.value;
|
|
574
|
-
return !
|
|
574
|
+
return !be(o) && o.length !== void 0;
|
|
575
575
|
}), e._zod.onattach.push((r) => {
|
|
576
576
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
577
577
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -579,7 +579,7 @@ const Zn = (e) => {
|
|
|
579
579
|
const o = r.value;
|
|
580
580
|
if (o.length <= t.maximum)
|
|
581
581
|
return;
|
|
582
|
-
const i =
|
|
582
|
+
const i = we(o);
|
|
583
583
|
r.issues.push({
|
|
584
584
|
origin: i,
|
|
585
585
|
code: "too_big",
|
|
@@ -594,7 +594,7 @@ const Zn = (e) => {
|
|
|
594
594
|
var n;
|
|
595
595
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
596
596
|
const o = r.value;
|
|
597
|
-
return !
|
|
597
|
+
return !be(o) && o.length !== void 0;
|
|
598
598
|
}), e._zod.onattach.push((r) => {
|
|
599
599
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
600
600
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -602,7 +602,7 @@ const Zn = (e) => {
|
|
|
602
602
|
const o = r.value;
|
|
603
603
|
if (o.length >= t.minimum)
|
|
604
604
|
return;
|
|
605
|
-
const i =
|
|
605
|
+
const i = we(o);
|
|
606
606
|
r.issues.push({
|
|
607
607
|
origin: i,
|
|
608
608
|
code: "too_small",
|
|
@@ -617,7 +617,7 @@ const Zn = (e) => {
|
|
|
617
617
|
var n;
|
|
618
618
|
T.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
619
619
|
const o = r.value;
|
|
620
|
-
return !
|
|
620
|
+
return !be(o) && o.length !== void 0;
|
|
621
621
|
}), e._zod.onattach.push((r) => {
|
|
622
622
|
const o = r._zod.bag;
|
|
623
623
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -625,7 +625,7 @@ const Zn = (e) => {
|
|
|
625
625
|
const o = r.value, s = o.length;
|
|
626
626
|
if (s === t.length)
|
|
627
627
|
return;
|
|
628
|
-
const i =
|
|
628
|
+
const i = we(o), c = s > t.length;
|
|
629
629
|
r.issues.push({
|
|
630
630
|
origin: i,
|
|
631
631
|
...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -636,7 +636,7 @@ const Zn = (e) => {
|
|
|
636
636
|
continue: !t.abort
|
|
637
637
|
});
|
|
638
638
|
};
|
|
639
|
-
}),
|
|
639
|
+
}), le = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
640
640
|
var n, r;
|
|
641
641
|
T.init(e, t), e._zod.onattach.push((o) => {
|
|
642
642
|
const s = o._zod.bag;
|
|
@@ -654,7 +654,7 @@ const Zn = (e) => {
|
|
|
654
654
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
655
655
|
});
|
|
656
656
|
}), Rn = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
657
|
-
|
|
657
|
+
le.init(e, t), e._zod.check = (n) => {
|
|
658
658
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
659
659
|
origin: "string",
|
|
660
660
|
code: "invalid_format",
|
|
@@ -666,9 +666,9 @@ const Zn = (e) => {
|
|
|
666
666
|
});
|
|
667
667
|
};
|
|
668
668
|
}), Fn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
669
|
-
t.pattern ?? (t.pattern = En),
|
|
669
|
+
t.pattern ?? (t.pattern = En), le.init(e, t);
|
|
670
670
|
}), Dn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
671
|
-
t.pattern ?? (t.pattern = In),
|
|
671
|
+
t.pattern ?? (t.pattern = In), le.init(e, t);
|
|
672
672
|
}), Ln = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
673
673
|
T.init(e, t);
|
|
674
674
|
const n = M(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
@@ -826,7 +826,7 @@ const Bn = {
|
|
|
826
826
|
vendor: "zod",
|
|
827
827
|
version: 1
|
|
828
828
|
}));
|
|
829
|
-
}),
|
|
829
|
+
}), ke = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
830
830
|
y.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Zn(e._zod.bag), e._zod.parse = (n, r) => {
|
|
831
831
|
if (t.coerce)
|
|
832
832
|
try {
|
|
@@ -841,7 +841,7 @@ const Bn = {
|
|
|
841
841
|
}), n;
|
|
842
842
|
};
|
|
843
843
|
}), v = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
844
|
-
|
|
844
|
+
le.init(e, t), ke.init(e, t);
|
|
845
845
|
}), Vn = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
846
846
|
t.pattern ?? (t.pattern = dn), v.init(e, t);
|
|
847
847
|
}), Hn = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
@@ -858,9 +858,9 @@ const Bn = {
|
|
|
858
858
|
}[t.version];
|
|
859
859
|
if (r === void 0)
|
|
860
860
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
861
|
-
t.pattern ?? (t.pattern =
|
|
861
|
+
t.pattern ?? (t.pattern = Oe(r));
|
|
862
862
|
} else
|
|
863
|
-
t.pattern ?? (t.pattern =
|
|
863
|
+
t.pattern ?? (t.pattern = Oe());
|
|
864
864
|
v.init(e, t);
|
|
865
865
|
}), Yn = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
866
866
|
t.pattern ?? (t.pattern = hn), v.init(e, t);
|
|
@@ -1073,7 +1073,7 @@ const gr = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
|
1073
1073
|
inst: e
|
|
1074
1074
|
}), n);
|
|
1075
1075
|
});
|
|
1076
|
-
function
|
|
1076
|
+
function Te(e, t, n) {
|
|
1077
1077
|
e.issues.length && t.issues.push(...et(n, e.issues)), t.value[n] = e.value;
|
|
1078
1078
|
}
|
|
1079
1079
|
const wr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
@@ -1093,7 +1093,7 @@ const wr = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
|
1093
1093
|
value: c,
|
|
1094
1094
|
issues: []
|
|
1095
1095
|
}, r);
|
|
1096
|
-
a instanceof Promise ? s.push(a.then((l) =>
|
|
1096
|
+
a instanceof Promise ? s.push(a.then((l) => Te(l, n, i))) : Te(a, n, i);
|
|
1097
1097
|
}
|
|
1098
1098
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
1099
1099
|
};
|
|
@@ -1151,7 +1151,7 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
});
|
|
1153
1153
|
}
|
|
1154
|
-
const r =
|
|
1154
|
+
const r = ce(() => pt(t));
|
|
1155
1155
|
g(e._zod, "propValues", () => {
|
|
1156
1156
|
const c = t.shape, a = {};
|
|
1157
1157
|
for (const l in c) {
|
|
@@ -1179,27 +1179,27 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1179
1179
|
c.value = {};
|
|
1180
1180
|
const f = [], h = i.shape;
|
|
1181
1181
|
for (const p of i.keys) {
|
|
1182
|
-
const m = h[p],
|
|
1183
|
-
|
|
1182
|
+
const m = h[p], z = m._zod.optout === "optional", $ = m._zod.run({ value: l[p], issues: [] }, a);
|
|
1183
|
+
$ instanceof Promise ? f.push($.then((G) => ee(G, c, p, l, z))) : ee($, c, p, l, z);
|
|
1184
1184
|
}
|
|
1185
1185
|
return s ? dt(f, l, c, a, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
|
|
1186
1186
|
};
|
|
1187
1187
|
}), $r = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1188
1188
|
zr.init(e, t);
|
|
1189
|
-
const n = e._zod.parse, r =
|
|
1190
|
-
const m = new Wn(["shape", "payload", "ctx"]),
|
|
1191
|
-
const O =
|
|
1189
|
+
const n = e._zod.parse, r = ce(() => pt(t)), o = (p) => {
|
|
1190
|
+
const m = new Wn(["shape", "payload", "ctx"]), z = r.value, $ = (I) => {
|
|
1191
|
+
const O = Ze(I);
|
|
1192
1192
|
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1193
1193
|
};
|
|
1194
1194
|
m.write("const input = payload.value;");
|
|
1195
1195
|
const G = /* @__PURE__ */ Object.create(null);
|
|
1196
1196
|
let It = 0;
|
|
1197
|
-
for (const I of
|
|
1197
|
+
for (const I of z.keys)
|
|
1198
1198
|
G[I] = `key_${It++}`;
|
|
1199
1199
|
m.write("const newResult = {};");
|
|
1200
|
-
for (const I of
|
|
1201
|
-
const O = G[I], E =
|
|
1202
|
-
m.write(`const ${O} = ${
|
|
1200
|
+
for (const I of z.keys) {
|
|
1201
|
+
const O = G[I], E = Ze(I), Pt = p[I]?._zod?.optout === "optional";
|
|
1202
|
+
m.write(`const ${O} = ${$(I)};`), Pt ? m.write(`
|
|
1203
1203
|
if (${O}.issues.length) {
|
|
1204
1204
|
if (${E} in input) {
|
|
1205
1205
|
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
@@ -1244,16 +1244,16 @@ const zr = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
|
1244
1244
|
let h;
|
|
1245
1245
|
e._zod.parse = (p, m) => {
|
|
1246
1246
|
h ?? (h = r.value);
|
|
1247
|
-
const
|
|
1248
|
-
return i(
|
|
1247
|
+
const z = p.value;
|
|
1248
|
+
return i(z) ? c && l && m?.async === !1 && m.jitless !== !0 ? (s || (s = o(t.shape)), p = s(p, m), f ? dt([], z, p, m, h, e) : p) : n(p, m) : (p.issues.push({
|
|
1249
1249
|
expected: "object",
|
|
1250
1250
|
code: "invalid_type",
|
|
1251
|
-
input:
|
|
1251
|
+
input: z,
|
|
1252
1252
|
inst: e
|
|
1253
1253
|
}), p);
|
|
1254
1254
|
};
|
|
1255
1255
|
});
|
|
1256
|
-
function
|
|
1256
|
+
function Ae(e, t, n, r) {
|
|
1257
1257
|
for (const s of e)
|
|
1258
1258
|
if (s.issues.length === 0)
|
|
1259
1259
|
return t.value = s.value, t;
|
|
@@ -1272,7 +1272,7 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1272
1272
|
}), g(e._zod, "pattern", () => {
|
|
1273
1273
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1274
1274
|
const o = t.options.map((s) => s._zod.pattern);
|
|
1275
|
-
return new RegExp(`^(${o.map((s) =>
|
|
1275
|
+
return new RegExp(`^(${o.map((s) => ye(s.source)).join("|")})$`);
|
|
1276
1276
|
}
|
|
1277
1277
|
});
|
|
1278
1278
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -1294,7 +1294,7 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1294
1294
|
c.push(l);
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
return i ? Promise.all(c).then((a) =>
|
|
1297
|
+
return i ? Promise.all(c).then((a) => Ae(a, o, e, s)) : Ae(c, o, e, s);
|
|
1298
1298
|
};
|
|
1299
1299
|
}), kr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1300
1300
|
t.inclusive = !1, ht.init(e, t);
|
|
@@ -1313,7 +1313,7 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
return o;
|
|
1315
1315
|
});
|
|
1316
|
-
const r =
|
|
1316
|
+
const r = ce(() => {
|
|
1317
1317
|
const o = t.options, s = /* @__PURE__ */ new Map();
|
|
1318
1318
|
for (const i of o) {
|
|
1319
1319
|
const c = i._zod.propValues?.[t.discriminator];
|
|
@@ -1350,10 +1350,10 @@ const ht = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
|
1350
1350
|
}), Sr = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1351
1351
|
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1352
1352
|
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1353
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, l]) =>
|
|
1353
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([a, l]) => Ee(n, a, l)) : Ee(n, s, i);
|
|
1354
1354
|
};
|
|
1355
1355
|
});
|
|
1356
|
-
function
|
|
1356
|
+
function _e(e, t) {
|
|
1357
1357
|
if (e === t)
|
|
1358
1358
|
return { valid: !0, data: e };
|
|
1359
1359
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
@@ -1361,7 +1361,7 @@ function me(e, t) {
|
|
|
1361
1361
|
if (V(e) && V(t)) {
|
|
1362
1362
|
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
1363
1363
|
for (const s of r) {
|
|
1364
|
-
const i =
|
|
1364
|
+
const i = _e(e[s], t[s]);
|
|
1365
1365
|
if (!i.valid)
|
|
1366
1366
|
return {
|
|
1367
1367
|
valid: !1,
|
|
@@ -1376,7 +1376,7 @@ function me(e, t) {
|
|
|
1376
1376
|
return { valid: !1, mergeErrorPath: [] };
|
|
1377
1377
|
const n = [];
|
|
1378
1378
|
for (let r = 0; r < e.length; r++) {
|
|
1379
|
-
const o = e[r], s = t[r], i =
|
|
1379
|
+
const o = e[r], s = t[r], i = _e(o, s);
|
|
1380
1380
|
if (!i.valid)
|
|
1381
1381
|
return {
|
|
1382
1382
|
valid: !1,
|
|
@@ -1388,7 +1388,7 @@ function me(e, t) {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
return { valid: !1, mergeErrorPath: [] };
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Ee(e, t, n) {
|
|
1392
1392
|
const r = /* @__PURE__ */ new Map();
|
|
1393
1393
|
let o;
|
|
1394
1394
|
for (const c of t.issues)
|
|
@@ -1407,7 +1407,7 @@ function Ae(e, t, n) {
|
|
|
1407
1407
|
const s = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
|
|
1408
1408
|
if (s.length && o && e.issues.push({ ...o, keys: s }), D(e))
|
|
1409
1409
|
return e;
|
|
1410
|
-
const i =
|
|
1410
|
+
const i = _e(t.value, n.value);
|
|
1411
1411
|
if (!i.valid)
|
|
1412
1412
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
1413
1413
|
return e.value = i.data, e;
|
|
@@ -1449,17 +1449,17 @@ const Zr = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
|
1449
1449
|
return n.value = o, n;
|
|
1450
1450
|
};
|
|
1451
1451
|
});
|
|
1452
|
-
function
|
|
1452
|
+
function Ie(e, t) {
|
|
1453
1453
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1454
1454
|
}
|
|
1455
1455
|
const mt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1456
1456
|
y.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), g(e._zod, "pattern", () => {
|
|
1457
1457
|
const n = t.innerType._zod.pattern;
|
|
1458
|
-
return n ? new RegExp(`^(${
|
|
1458
|
+
return n ? new RegExp(`^(${ye(n.source)})?$`) : void 0;
|
|
1459
1459
|
}), e._zod.parse = (n, r) => {
|
|
1460
1460
|
if (t.innerType._zod.optin === "optional") {
|
|
1461
1461
|
const o = t.innerType._zod.run(n, r);
|
|
1462
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1462
|
+
return o instanceof Promise ? o.then((s) => Ie(s, n.value)) : Ie(o, n.value);
|
|
1463
1463
|
}
|
|
1464
1464
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1465
1465
|
};
|
|
@@ -1468,7 +1468,7 @@ const mt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
|
1468
1468
|
}), Er = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1469
1469
|
y.init(e, t), g(e._zod, "optin", () => t.innerType._zod.optin), g(e._zod, "optout", () => t.innerType._zod.optout), g(e._zod, "pattern", () => {
|
|
1470
1470
|
const n = t.innerType._zod.pattern;
|
|
1471
|
-
return n ? new RegExp(`^(${
|
|
1471
|
+
return n ? new RegExp(`^(${ye(n.source)}|null)$`) : void 0;
|
|
1472
1472
|
}), g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1473
1473
|
}), Ir = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1474
1474
|
y.init(e, t), e._zod.optin = "optional", g(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
@@ -1477,10 +1477,10 @@ const mt = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
|
1477
1477
|
if (n.value === void 0)
|
|
1478
1478
|
return n.value = t.defaultValue, n;
|
|
1479
1479
|
const o = t.innerType._zod.run(n, r);
|
|
1480
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1480
|
+
return o instanceof Promise ? o.then((s) => Ne(s, t)) : Ne(o, t);
|
|
1481
1481
|
};
|
|
1482
1482
|
});
|
|
1483
|
-
function
|
|
1483
|
+
function Ne(e, t) {
|
|
1484
1484
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1485
1485
|
}
|
|
1486
1486
|
const Nr = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
@@ -1491,10 +1491,10 @@ const Nr = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
|
1491
1491
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1492
1492
|
}), e._zod.parse = (n, r) => {
|
|
1493
1493
|
const o = t.innerType._zod.run(n, r);
|
|
1494
|
-
return o instanceof Promise ? o.then((s) =>
|
|
1494
|
+
return o instanceof Promise ? o.then((s) => Pe(s, e)) : Pe(o, e);
|
|
1495
1495
|
};
|
|
1496
1496
|
});
|
|
1497
|
-
function
|
|
1497
|
+
function Pe(e, t) {
|
|
1498
1498
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1499
1499
|
code: "invalid_type",
|
|
1500
1500
|
expected: "nonoptional",
|
|
@@ -1539,21 +1539,21 @@ const Cr = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
|
1539
1539
|
if (r.direction === "backward")
|
|
1540
1540
|
return t.innerType._zod.run(n, r);
|
|
1541
1541
|
const o = t.innerType._zod.run(n, r);
|
|
1542
|
-
return o instanceof Promise ? o.then(
|
|
1542
|
+
return o instanceof Promise ? o.then(xe) : xe(o);
|
|
1543
1543
|
};
|
|
1544
1544
|
});
|
|
1545
|
-
function
|
|
1545
|
+
function xe(e) {
|
|
1546
1546
|
return e.value = Object.freeze(e.value), e;
|
|
1547
1547
|
}
|
|
1548
1548
|
const Rr = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1549
1549
|
T.init(e, t), y.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1550
1550
|
const r = n.value, o = t.fn(r);
|
|
1551
1551
|
if (o instanceof Promise)
|
|
1552
|
-
return o.then((s) =>
|
|
1553
|
-
|
|
1552
|
+
return o.then((s) => je(s, n, r, e));
|
|
1553
|
+
je(o, n, r, e);
|
|
1554
1554
|
};
|
|
1555
1555
|
});
|
|
1556
|
-
function
|
|
1556
|
+
function je(e, t, n, r) {
|
|
1557
1557
|
if (!e) {
|
|
1558
1558
|
const o = {
|
|
1559
1559
|
code: "custom",
|
|
@@ -1568,7 +1568,7 @@ function xe(e, t, n, r) {
|
|
|
1568
1568
|
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(H(o));
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
|
-
var
|
|
1571
|
+
var Ce;
|
|
1572
1572
|
class Fr {
|
|
1573
1573
|
constructor() {
|
|
1574
1574
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
@@ -1601,7 +1601,7 @@ class Fr {
|
|
|
1601
1601
|
function Dr() {
|
|
1602
1602
|
return new Fr();
|
|
1603
1603
|
}
|
|
1604
|
-
(
|
|
1604
|
+
(Ce = globalThis).__zod_globalRegistry ?? (Ce.__zod_globalRegistry = Dr());
|
|
1605
1605
|
const J = globalThis.__zod_globalRegistry;
|
|
1606
1606
|
// @__NO_SIDE_EFFECTS__
|
|
1607
1607
|
function Lr(e, t) {
|
|
@@ -1621,7 +1621,7 @@ function Mr(e, t) {
|
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
// @__NO_SIDE_EFFECTS__
|
|
1624
|
-
function
|
|
1624
|
+
function Re(e, t) {
|
|
1625
1625
|
return new e({
|
|
1626
1626
|
type: "string",
|
|
1627
1627
|
format: "guid",
|
|
@@ -1912,7 +1912,7 @@ function _o(e, t) {
|
|
|
1912
1912
|
});
|
|
1913
1913
|
}
|
|
1914
1914
|
// @__NO_SIDE_EFFECTS__
|
|
1915
|
-
function
|
|
1915
|
+
function Fe(e, t) {
|
|
1916
1916
|
return new at({
|
|
1917
1917
|
check: "less_than",
|
|
1918
1918
|
...d(t),
|
|
@@ -1921,7 +1921,7 @@ function Re(e, t) {
|
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
1923
|
// @__NO_SIDE_EFFECTS__
|
|
1924
|
-
function
|
|
1924
|
+
function de(e, t) {
|
|
1925
1925
|
return new at({
|
|
1926
1926
|
check: "less_than",
|
|
1927
1927
|
...d(t),
|
|
@@ -1930,7 +1930,7 @@ function fe(e, t) {
|
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
1932
|
// @__NO_SIDE_EFFECTS__
|
|
1933
|
-
function
|
|
1933
|
+
function De(e, t) {
|
|
1934
1934
|
return new ut({
|
|
1935
1935
|
check: "greater_than",
|
|
1936
1936
|
...d(t),
|
|
@@ -1939,7 +1939,7 @@ function Fe(e, t) {
|
|
|
1939
1939
|
});
|
|
1940
1940
|
}
|
|
1941
1941
|
// @__NO_SIDE_EFFECTS__
|
|
1942
|
-
function
|
|
1942
|
+
function he(e, t) {
|
|
1943
1943
|
return new ut({
|
|
1944
1944
|
check: "greater_than",
|
|
1945
1945
|
...d(t),
|
|
@@ -1948,7 +1948,7 @@ function pe(e, t) {
|
|
|
1948
1948
|
});
|
|
1949
1949
|
}
|
|
1950
1950
|
// @__NO_SIDE_EFFECTS__
|
|
1951
|
-
function
|
|
1951
|
+
function Le(e, t) {
|
|
1952
1952
|
return new Nn({
|
|
1953
1953
|
check: "multiple_of",
|
|
1954
1954
|
...d(t),
|
|
@@ -2162,7 +2162,7 @@ function bt(e, t) {
|
|
|
2162
2162
|
const o = (i) => {
|
|
2163
2163
|
const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
2164
2164
|
if (e.external) {
|
|
2165
|
-
const h = e.external.registry.get(i[0])?.id, p = e.external.uri ?? ((
|
|
2165
|
+
const h = e.external.registry.get(i[0])?.id, p = e.external.uri ?? ((z) => z);
|
|
2166
2166
|
if (h)
|
|
2167
2167
|
return { ref: p(h) };
|
|
2168
2168
|
const m = i[1].defId ?? i[1].schema.id ?? `schema${e.counter++}`;
|
|
@@ -2230,11 +2230,11 @@ function yt(e, t) {
|
|
|
2230
2230
|
r(f);
|
|
2231
2231
|
const p = e.seen.get(f), m = p.schema;
|
|
2232
2232
|
if (m.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(m)) : Object.assign(a, m), Object.assign(a, l), i._zod.parent === f)
|
|
2233
|
-
for (const
|
|
2234
|
-
|
|
2233
|
+
for (const $ in a)
|
|
2234
|
+
$ === "$ref" || $ === "allOf" || $ in l || delete a[$];
|
|
2235
2235
|
if (m.$ref && p.def)
|
|
2236
|
-
for (const
|
|
2237
|
-
|
|
2236
|
+
for (const $ in a)
|
|
2237
|
+
$ === "$ref" || $ === "allOf" || $ in p.def && JSON.stringify(a[$]) === JSON.stringify(p.def[$]) && delete a[$];
|
|
2238
2238
|
}
|
|
2239
2239
|
const h = i._zod.parent;
|
|
2240
2240
|
if (h && h !== f) {
|
|
@@ -2504,13 +2504,13 @@ const ui = (e, t) => {
|
|
|
2504
2504
|
},
|
|
2505
2505
|
addIssue: {
|
|
2506
2506
|
value: (n) => {
|
|
2507
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2507
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2508
2508
|
}
|
|
2509
2509
|
// enumerable: false,
|
|
2510
2510
|
},
|
|
2511
2511
|
addIssues: {
|
|
2512
2512
|
value: (n) => {
|
|
2513
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2513
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, ge, 2);
|
|
2514
2514
|
}
|
|
2515
2515
|
// enumerable: false,
|
|
2516
2516
|
},
|
|
@@ -2523,7 +2523,7 @@ const ui = (e, t) => {
|
|
|
2523
2523
|
});
|
|
2524
2524
|
}, A = u("ZodError", ui, {
|
|
2525
2525
|
Parent: Error
|
|
2526
|
-
}), li = /* @__PURE__ */
|
|
2526
|
+
}), li = /* @__PURE__ */ ze(A), fi = /* @__PURE__ */ $e(A), pi = /* @__PURE__ */ ae(A), di = /* @__PURE__ */ ue(A), hi = /* @__PURE__ */ Xt(A), mi = /* @__PURE__ */ qt(A), gi = /* @__PURE__ */ Qt(A), _i = /* @__PURE__ */ en(A), vi = /* @__PURE__ */ tn(A), bi = /* @__PURE__ */ nn(A), yi = /* @__PURE__ */ rn(A), wi = /* @__PURE__ */ on(A), w = /* @__PURE__ */ u("ZodType", (e, t) => (y.init(e, t), Object.assign(e["~standard"], {
|
|
2527
2527
|
jsonSchema: {
|
|
2528
2528
|
input: ne(e, "input"),
|
|
2529
2529
|
output: ne(e, "output")
|
|
@@ -2535,7 +2535,7 @@ const ui = (e, t) => {
|
|
|
2535
2535
|
]
|
|
2536
2536
|
}), {
|
|
2537
2537
|
parent: !0
|
|
2538
|
-
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => li(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => pi(e, n, r), e.parseAsync = async (n, r) => fi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => di(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => hi(e, n, r), e.decode = (n, r) => mi(e, n, r), e.encodeAsync = async (n, r) => gi(e, n, r), e.decodeAsync = async (n, r) => _i(e, n, r), e.safeEncode = (n, r) => vi(e, n, r), e.safeDecode = (n, r) => bi(e, n, r), e.safeEncodeAsync = async (n, r) => yi(e, n, r), e.safeDecodeAsync = async (n, r) => wi(e, n, r), e.refine = (n, r) => e.check(ms(n, r)), e.superRefine = (n) => e.check(gs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ U(n)), e.optional = () =>
|
|
2538
|
+
}), e.with = e.check, e.clone = (n, r) => x(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => li(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => pi(e, n, r), e.parseAsync = async (n, r) => fi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => di(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => hi(e, n, r), e.decode = (n, r) => mi(e, n, r), e.encodeAsync = async (n, r) => gi(e, n, r), e.decodeAsync = async (n, r) => _i(e, n, r), e.safeEncode = (n, r) => vi(e, n, r), e.safeDecode = (n, r) => bi(e, n, r), e.safeEncodeAsync = async (n, r) => yi(e, n, r), e.safeDecodeAsync = async (n, r) => wi(e, n, r), e.refine = (n, r) => e.check(ms(n, r)), e.superRefine = (n) => e.check(gs(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ U(n)), e.optional = () => Be(e), e.exactOptional = () => ns(e), e.nullable = () => Ve(e), e.nullish = () => Be(Ve(e)), e.nonoptional = (n) => as(e, n), e.array = () => re(e), e.or = (n) => Hi([e, n]), e.and = (n) => Xi(e, n), e.transform = (n) => He(e, es(n)), e.default = (n) => is(e, n), e.prefault = (n) => cs(e, n), e.catch = (n) => ls(e, n), e.pipe = (n) => He(e, n), e.readonly = () => ds(e), e.describe = (n) => {
|
|
2539
2539
|
const r = e.clone();
|
|
2540
2540
|
return J.add(r, { description: n }), r;
|
|
2541
2541
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2549,11 +2549,11 @@ const ui = (e, t) => {
|
|
|
2549
2549
|
const r = e.clone();
|
|
2550
2550
|
return J.add(r, n[0]), r;
|
|
2551
2551
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), zt = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2552
|
-
|
|
2552
|
+
ke.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => jo(e, r, o);
|
|
2553
2553
|
const n = e._zod.bag;
|
|
2554
2554
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ vo(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ wo(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ zo(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ $o(...r)), e.min = (...r) => e.check(/* @__PURE__ */ te(...r)), e.max = (...r) => e.check(/* @__PURE__ */ gt(...r)), e.length = (...r) => e.check(/* @__PURE__ */ _t(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ te(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ bo(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ yo(r)), e.trim = () => e.check(/* @__PURE__ */ So()), e.normalize = (...r) => e.check(/* @__PURE__ */ ko(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ Zo()), e.toUpperCase = () => e.check(/* @__PURE__ */ Oo()), e.slugify = () => e.check(/* @__PURE__ */ To());
|
|
2555
2555
|
}), zi = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2556
|
-
|
|
2556
|
+
ke.init(e, t), zt.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Mr($i, n)), e.url = (n) => e.check(/* @__PURE__ */ Vr(ki, n)), e.jwt = (n) => e.check(/* @__PURE__ */ co(Di, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Hr(Si, n)), e.guid = (n) => e.check(/* @__PURE__ */ Re(Me, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Ur(q, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Jr(q, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Wr(q, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Br(q, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Yr(Zi, n)), e.guid = (n) => e.check(/* @__PURE__ */ Re(Me, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Gr(Oi, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Kr(Ti, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Xr(Ai, n)), e.base64 = (n) => e.check(/* @__PURE__ */ oo(Ci, n)), e.base64url = (n) => e.check(/* @__PURE__ */ io(Ri, n)), e.xid = (n) => e.check(/* @__PURE__ */ qr(Ei, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Qr(Ii, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ eo(Ni, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ to(Pi, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ no(xi, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ ro(ji, n)), e.e164 = (n) => e.check(/* @__PURE__ */ so(Fi, n)), e.datetime = (n) => e.check(ni(n)), e.date = (n) => e.check(oi(n)), e.time = (n) => e.check(si(n)), e.duration = (n) => e.check(ai(n));
|
|
2557
2557
|
});
|
|
2558
2558
|
function N(e) {
|
|
2559
2559
|
return /* @__PURE__ */ Lr(zi, e);
|
|
@@ -2562,7 +2562,7 @@ const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2562
2562
|
v.init(e, t), zt.init(e, t);
|
|
2563
2563
|
}), $i = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2564
2564
|
Yn.init(e, t), b.init(e, t);
|
|
2565
|
-
}),
|
|
2565
|
+
}), Me = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2566
2566
|
Vn.init(e, t), b.init(e, t);
|
|
2567
2567
|
}), q = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2568
2568
|
Hn.init(e, t), b.init(e, t);
|
|
@@ -2599,7 +2599,7 @@ const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
|
2599
2599
|
}), Di = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2600
2600
|
gr.init(e, t), b.init(e, t);
|
|
2601
2601
|
}), $t = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2602
|
-
ft.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => Co(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */
|
|
2602
|
+
ft.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => Co(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ he(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ he(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ Fe(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ de(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ de(r, o)), e.int = (r) => e.check(Ue(r)), e.safe = (r) => e.check(Ue(r)), e.positive = (r) => e.check(/* @__PURE__ */ De(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ he(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ Fe(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ de(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ Le(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ Le(r, o)), e.finite = () => e;
|
|
2603
2603
|
const n = e._zod.bag;
|
|
2604
2604
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2605
2605
|
});
|
|
@@ -2609,19 +2609,19 @@ function _(e) {
|
|
|
2609
2609
|
const Li = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2610
2610
|
_r.init(e, t), $t.init(e, t);
|
|
2611
2611
|
});
|
|
2612
|
-
function
|
|
2612
|
+
function Ue(e) {
|
|
2613
2613
|
return /* @__PURE__ */ ho(Li, e);
|
|
2614
2614
|
}
|
|
2615
2615
|
const Mi = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2616
2616
|
vr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ro(e, n, r);
|
|
2617
2617
|
});
|
|
2618
|
-
function
|
|
2618
|
+
function Je(e) {
|
|
2619
2619
|
return /* @__PURE__ */ mo(Mi, e);
|
|
2620
2620
|
}
|
|
2621
2621
|
const Ui = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2622
2622
|
br.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Do();
|
|
2623
2623
|
});
|
|
2624
|
-
function
|
|
2624
|
+
function We() {
|
|
2625
2625
|
return /* @__PURE__ */ go(Ui);
|
|
2626
2626
|
}
|
|
2627
2627
|
const Ji = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
@@ -2633,13 +2633,13 @@ function Wi(e) {
|
|
|
2633
2633
|
const Bi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2634
2634
|
wr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wo(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ te(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ te(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ gt(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ _t(n, r)), e.unwrap = () => e.element;
|
|
2635
2635
|
});
|
|
2636
|
-
function
|
|
2636
|
+
function re(e, t) {
|
|
2637
2637
|
return /* @__PURE__ */ Ao(Bi, e, t);
|
|
2638
2638
|
}
|
|
2639
2639
|
const Vi = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2640
|
-
$r.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n, r, o), g(e, "shape", () => t.shape), e.keyof = () => St(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall:
|
|
2640
|
+
$r.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bo(e, n, r, o), g(e, "shape", () => t.shape), e.keyof = () => St(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: We() }), e.loose = () => e.clone({ ...e._zod.def, catchall: We() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Wi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Ut(e, n), e.safeExtend = (n) => Jt(e, n), e.merge = (n) => Wt(e, n), e.pick = (n) => Lt(e, n), e.omit = (n) => Mt(e, n), e.partial = (...n) => Bt(Zt, e, n[0]), e.required = (...n) => Vt(Ot, e, n[0]);
|
|
2641
2641
|
});
|
|
2642
|
-
function
|
|
2642
|
+
function fe(e, t) {
|
|
2643
2643
|
const n = {
|
|
2644
2644
|
type: "object",
|
|
2645
2645
|
shape: e ?? {},
|
|
@@ -2678,7 +2678,7 @@ function Xi(e, t) {
|
|
|
2678
2678
|
right: t
|
|
2679
2679
|
});
|
|
2680
2680
|
}
|
|
2681
|
-
const
|
|
2681
|
+
const oe = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2682
2682
|
Zr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (r, o, s) => Lo(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2683
2683
|
const n = new Set(Object.keys(t.entries));
|
|
2684
2684
|
e.extract = (r, o) => {
|
|
@@ -2688,7 +2688,7 @@ const re = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2688
2688
|
s[i] = t.entries[i];
|
|
2689
2689
|
else
|
|
2690
2690
|
throw new Error(`Key ${i} not found in enum`);
|
|
2691
|
-
return new
|
|
2691
|
+
return new oe({
|
|
2692
2692
|
...t,
|
|
2693
2693
|
checks: [],
|
|
2694
2694
|
...d(o),
|
|
@@ -2701,7 +2701,7 @@ const re = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2701
2701
|
delete s[i];
|
|
2702
2702
|
else
|
|
2703
2703
|
throw new Error(`Key ${i} not found in enum`);
|
|
2704
|
-
return new
|
|
2704
|
+
return new oe({
|
|
2705
2705
|
...t,
|
|
2706
2706
|
checks: [],
|
|
2707
2707
|
...d(o),
|
|
@@ -2711,14 +2711,14 @@ const re = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
|
2711
2711
|
});
|
|
2712
2712
|
function St(e, t) {
|
|
2713
2713
|
const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2714
|
-
return new
|
|
2714
|
+
return new oe({
|
|
2715
2715
|
type: "enum",
|
|
2716
2716
|
entries: n,
|
|
2717
2717
|
...d(t)
|
|
2718
2718
|
});
|
|
2719
2719
|
}
|
|
2720
2720
|
function k(e, t) {
|
|
2721
|
-
return new
|
|
2721
|
+
return new oe({
|
|
2722
2722
|
type: "enum",
|
|
2723
2723
|
entries: e,
|
|
2724
2724
|
...d(t)
|
|
@@ -2765,7 +2765,7 @@ function es(e) {
|
|
|
2765
2765
|
const Zt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2766
2766
|
mt.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => wt(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2767
2767
|
});
|
|
2768
|
-
function
|
|
2768
|
+
function Be(e) {
|
|
2769
2769
|
return new Zt({
|
|
2770
2770
|
type: "optional",
|
|
2771
2771
|
innerType: e
|
|
@@ -2783,7 +2783,7 @@ function ns(e) {
|
|
|
2783
2783
|
const rs = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2784
2784
|
Er.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Yo(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
|
|
2785
2785
|
});
|
|
2786
|
-
function
|
|
2786
|
+
function Ve(e) {
|
|
2787
2787
|
return new rs({
|
|
2788
2788
|
type: "nullable",
|
|
2789
2789
|
innerType: e
|
|
@@ -2836,7 +2836,7 @@ function ls(e, t) {
|
|
|
2836
2836
|
const fs = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
2837
2837
|
jr.init(e, t), w.init(e, t), e._zod.processJSONSchema = (n, r, o) => Qo(e, n, r, o), e.in = t.in, e.out = t.out;
|
|
2838
2838
|
});
|
|
2839
|
-
function
|
|
2839
|
+
function He(e, t) {
|
|
2840
2840
|
return new fs({
|
|
2841
2841
|
type: "pipe",
|
|
2842
2842
|
in: e,
|
|
@@ -2915,12 +2915,12 @@ const _s = {
|
|
|
2915
2915
|
}, xs = k(Ps), js = {
|
|
2916
2916
|
AllMedia: "Y",
|
|
2917
2917
|
ContinuousOnly: "N"
|
|
2918
|
-
}, Cs = k(js),
|
|
2918
|
+
}, Cs = k(js), ve = {
|
|
2919
2919
|
NoRotation: "N",
|
|
2920
2920
|
Rotate90: "R",
|
|
2921
2921
|
Rotate180: "I",
|
|
2922
2922
|
Rotate270: "B"
|
|
2923
|
-
}, Tt = k(
|
|
2923
|
+
}, Tt = k(ve), At = {
|
|
2924
2924
|
Left: "L",
|
|
2925
2925
|
Right: "R",
|
|
2926
2926
|
Center: "C",
|
|
@@ -2937,7 +2937,7 @@ const _s = {
|
|
|
2937
2937
|
}, Ls = k(Ds), Ms = {
|
|
2938
2938
|
Yes: "Y",
|
|
2939
2939
|
No: "N"
|
|
2940
|
-
},
|
|
2940
|
+
}, me = k(Ms), Y = {
|
|
2941
2941
|
Start: "start",
|
|
2942
2942
|
End: "end"
|
|
2943
2943
|
}, Us = k(Y), Js = {
|
|
@@ -2953,11 +2953,11 @@ const _s = {
|
|
|
2953
2953
|
Uppercase: "Uppercase",
|
|
2954
2954
|
Lowercase: "Lowercase",
|
|
2955
2955
|
Capitalize: "Capitalize"
|
|
2956
|
-
}, Bs = k(W),
|
|
2956
|
+
}, Bs = k(W), Vs = fe({
|
|
2957
2957
|
word: N(),
|
|
2958
|
-
width: _(),
|
|
2959
|
-
spaceWidth: _()
|
|
2960
|
-
}),
|
|
2958
|
+
width: _().min(0),
|
|
2959
|
+
spaceWidth: _().min(0)
|
|
2960
|
+
}), pe = fe({
|
|
2961
2961
|
name: N(),
|
|
2962
2962
|
x: _().int(),
|
|
2963
2963
|
y: _().int(),
|
|
@@ -2966,9 +2966,9 @@ const _s = {
|
|
|
2966
2966
|
sourceType: Ws,
|
|
2967
2967
|
sourceLookup: N(),
|
|
2968
2968
|
sourceSeperator: N(),
|
|
2969
|
-
hideEmpty:
|
|
2970
|
-
editable:
|
|
2971
|
-
}),
|
|
2969
|
+
hideEmpty: Je(),
|
|
2970
|
+
editable: Je()
|
|
2971
|
+
}), Hs = pe.extend({
|
|
2972
2972
|
type: j("text"),
|
|
2973
2973
|
// ^A font, height
|
|
2974
2974
|
font: N().regex(/^[A-Z0-9]$/, "Font must be a single character A-Z or 0-9"),
|
|
@@ -2985,17 +2985,18 @@ const _s = {
|
|
|
2985
2985
|
transformation: Bs,
|
|
2986
2986
|
maxCharacters: _().int().min(1).max(100),
|
|
2987
2987
|
measuredWidth: _().min(0).optional(),
|
|
2988
|
+
wordWidths: re(Vs).optional(),
|
|
2988
2989
|
minFontHeight: _().int().min(1).max(32e3).optional()
|
|
2989
|
-
}),
|
|
2990
|
+
}), Ys = pe.extend({
|
|
2990
2991
|
type: j("barcode"),
|
|
2991
2992
|
// ^BY barWidth
|
|
2992
2993
|
barWidth: _().int().min(1).max(100),
|
|
2993
2994
|
// ^BC orientation, height, line, lineAbove, checkDigit
|
|
2994
2995
|
orientation: Tt,
|
|
2995
2996
|
height: _().int().min(1).max(32e3),
|
|
2996
|
-
line:
|
|
2997
|
-
lineAbove:
|
|
2998
|
-
checkDigit:
|
|
2997
|
+
line: me,
|
|
2998
|
+
lineAbove: me,
|
|
2999
|
+
checkDigit: me,
|
|
2999
3000
|
// Horizontal anchor: which point on the barcode lines up with x.
|
|
3000
3001
|
// Left (default when omitted) → x is the left edge of the barcode
|
|
3001
3002
|
// Center → x is the horizontal center
|
|
@@ -3003,7 +3004,7 @@ const _s = {
|
|
|
3003
3004
|
// Vertical anchor is controlled by `verticalAlignment` (Start → ^FO top edge,
|
|
3004
3005
|
// End → ^FT bottom edge), so the two fields combine to address 6 anchor points.
|
|
3005
3006
|
alignment: Fs.optional()
|
|
3006
|
-
}),
|
|
3007
|
+
}), Gs = pe.extend({
|
|
3007
3008
|
type: j("qrcode"),
|
|
3008
3009
|
// ^BQ orientation, model, magnification, errorCorrection, mask
|
|
3009
3010
|
orientation: j("N"),
|
|
@@ -3011,7 +3012,7 @@ const _s = {
|
|
|
3011
3012
|
magnification: _().int().min(1).max(100),
|
|
3012
3013
|
errorCorrection: Ls,
|
|
3013
3014
|
mask: _().int().min(0).max(7)
|
|
3014
|
-
}),
|
|
3015
|
+
}), Ks = pe.extend({
|
|
3015
3016
|
type: j("image"),
|
|
3016
3017
|
// ^CF imagePath
|
|
3017
3018
|
data: N(),
|
|
@@ -3019,12 +3020,12 @@ const _s = {
|
|
|
3019
3020
|
// match string — or, for multi-value sources (e.g. multi-select responses),
|
|
3020
3021
|
// contains it as one of its comma-separated values.
|
|
3021
3022
|
valueMatch: N().optional()
|
|
3022
|
-
}),
|
|
3023
|
-
Vs,
|
|
3023
|
+
}), Xs = Gi("type", [
|
|
3024
3024
|
Hs,
|
|
3025
3025
|
Ys,
|
|
3026
|
-
Gs
|
|
3027
|
-
|
|
3026
|
+
Gs,
|
|
3027
|
+
Ks
|
|
3028
|
+
]), qs = fe({
|
|
3028
3029
|
alias: N().length(1),
|
|
3029
3030
|
name: St([
|
|
3030
3031
|
// DEFAULT
|
|
@@ -3043,7 +3044,7 @@ const _s = {
|
|
|
3043
3044
|
"GT Walsheim",
|
|
3044
3045
|
"Domain Display"
|
|
3045
3046
|
])
|
|
3046
|
-
}),
|
|
3047
|
+
}), Qs = {
|
|
3047
3048
|
// DEFAULT
|
|
3048
3049
|
Arial: "ARIAL.TTF",
|
|
3049
3050
|
"Open Sans": "OPEN_SANS.TTF",
|
|
@@ -3059,7 +3060,7 @@ const _s = {
|
|
|
3059
3060
|
London: "LONDON.TTF",
|
|
3060
3061
|
"GT Walsheim": "GT_WALSHEIM.TTF",
|
|
3061
3062
|
"Domain Display": "DOMAIN_DISPLAY.TTF"
|
|
3062
|
-
}, Et =
|
|
3063
|
+
}, Et = fe({
|
|
3063
3064
|
type: j("thermal"),
|
|
3064
3065
|
// ~TA adjustment
|
|
3065
3066
|
tearOffAdjustment: _().int().min(0).max(120),
|
|
@@ -3096,31 +3097,31 @@ const _s = {
|
|
|
3096
3097
|
labelLength: _().int().min(1).max(32e3),
|
|
3097
3098
|
allMedia: Cs,
|
|
3098
3099
|
// Fields
|
|
3099
|
-
fields:
|
|
3100
|
-
fonts:
|
|
3100
|
+
fields: re(Xs),
|
|
3101
|
+
fonts: re(qs)
|
|
3101
3102
|
});
|
|
3102
|
-
function
|
|
3103
|
+
function mc(e) {
|
|
3103
3104
|
return Et.safeParse(e);
|
|
3104
3105
|
}
|
|
3105
|
-
function
|
|
3106
|
+
function gc(e) {
|
|
3106
3107
|
return Et.parse(e);
|
|
3107
3108
|
}
|
|
3108
|
-
const
|
|
3109
|
-
function
|
|
3109
|
+
const ie = 1.05;
|
|
3110
|
+
function _c(e, t, n) {
|
|
3110
3111
|
if (e.type === "thermal")
|
|
3111
|
-
return
|
|
3112
|
+
return ec(e, t, n);
|
|
3112
3113
|
throw new Error(`Unsupported badge type: ${e.type}`);
|
|
3113
3114
|
}
|
|
3114
|
-
function
|
|
3115
|
-
const r = ["^XA",
|
|
3115
|
+
function ec(e, t, n) {
|
|
3116
|
+
const r = ["^XA", tc(e)];
|
|
3116
3117
|
for (const o of e.fields) {
|
|
3117
|
-
const s =
|
|
3118
|
+
const s = nc(o, t, n?.[o.name]);
|
|
3118
3119
|
s && r.push(s);
|
|
3119
3120
|
}
|
|
3120
3121
|
return r.push("^XZ"), r.join(`
|
|
3121
3122
|
`);
|
|
3122
3123
|
}
|
|
3123
|
-
function
|
|
3124
|
+
function tc(e) {
|
|
3124
3125
|
const n = [
|
|
3125
3126
|
"^CI28",
|
|
3126
3127
|
`~TA${String(e.tearOffAdjustment).padStart(3, "0")}`,
|
|
@@ -3140,29 +3141,29 @@ function ec(e) {
|
|
|
3140
3141
|
`^LL${e.labelLength},${e.allMedia}`
|
|
3141
3142
|
);
|
|
3142
3143
|
for (const r of e.fonts)
|
|
3143
|
-
n.push(`^CW${r.alias},E:${
|
|
3144
|
+
n.push(`^CW${r.alias},E:${Qs[r.name]}`);
|
|
3144
3145
|
return n.join(`
|
|
3145
3146
|
`);
|
|
3146
3147
|
}
|
|
3147
|
-
function
|
|
3148
|
-
let r = n ??
|
|
3148
|
+
function nc(e, t, n) {
|
|
3149
|
+
let r = n ?? rc(e, t);
|
|
3149
3150
|
if (typeof r == "string")
|
|
3150
3151
|
switch (e.type) {
|
|
3151
3152
|
case "text":
|
|
3152
|
-
return r =
|
|
3153
|
+
return r = oc(e, r), ic(e, r);
|
|
3153
3154
|
case "barcode":
|
|
3154
|
-
return
|
|
3155
|
+
return lc(e, r);
|
|
3155
3156
|
case "qrcode":
|
|
3156
|
-
return
|
|
3157
|
+
return fc(e, r);
|
|
3157
3158
|
case "image":
|
|
3158
|
-
return
|
|
3159
|
+
return pc(e, r) ? dc(e, r) : void 0;
|
|
3159
3160
|
default: {
|
|
3160
3161
|
const o = e;
|
|
3161
3162
|
throw new Error(`Unsupported field type: ${o.type}`);
|
|
3162
3163
|
}
|
|
3163
3164
|
}
|
|
3164
3165
|
}
|
|
3165
|
-
function
|
|
3166
|
+
function rc(e, t) {
|
|
3166
3167
|
if (!t) return String(e.defaultValue ?? "");
|
|
3167
3168
|
const n = [], r = e.sourceLookup.split(",");
|
|
3168
3169
|
for (const o of r) {
|
|
@@ -3208,11 +3209,11 @@ function nc(e, t) {
|
|
|
3208
3209
|
if (h != null && h !== "") {
|
|
3209
3210
|
const p = String(h);
|
|
3210
3211
|
if (f !== void 0) {
|
|
3211
|
-
const
|
|
3212
|
-
if (
|
|
3213
|
-
const
|
|
3214
|
-
if (
|
|
3215
|
-
i =
|
|
3212
|
+
const z = p.split(",")[f];
|
|
3213
|
+
if (z !== void 0) {
|
|
3214
|
+
const $ = z.trim();
|
|
3215
|
+
if ($) {
|
|
3216
|
+
i = $;
|
|
3216
3217
|
break;
|
|
3217
3218
|
}
|
|
3218
3219
|
}
|
|
@@ -3226,7 +3227,7 @@ function nc(e, t) {
|
|
|
3226
3227
|
}
|
|
3227
3228
|
return n.length === 0 ? e.hideEmpty ? void 0 : String(e.defaultValue ?? "").trim() : n.join(String(e.sourceSeperator ?? " ")).trim();
|
|
3228
3229
|
}
|
|
3229
|
-
function
|
|
3230
|
+
function oc(e, t) {
|
|
3230
3231
|
switch (e.transformation) {
|
|
3231
3232
|
case W.None:
|
|
3232
3233
|
break;
|
|
@@ -3242,56 +3243,89 @@ function rc(e, t) {
|
|
|
3242
3243
|
}
|
|
3243
3244
|
return e.maxCharacters !== void 0 && (t = t.slice(0, e.maxCharacters)), t;
|
|
3244
3245
|
}
|
|
3245
|
-
function
|
|
3246
|
-
const n = e.fontOrientation, r =
|
|
3246
|
+
function ic(e, t) {
|
|
3247
|
+
const n = e.fontOrientation, r = ac(e, t), o = `^A${e.font}${n},${r}`;
|
|
3247
3248
|
let s = "^FO", i = e.maxLines;
|
|
3248
3249
|
if (e.verticalAlignment === Y.End) {
|
|
3249
3250
|
s = "^FT";
|
|
3250
|
-
const a =
|
|
3251
|
+
const a = se(e, t, r);
|
|
3251
3252
|
i = Math.min(a, e.maxLines);
|
|
3252
3253
|
}
|
|
3253
3254
|
const c = `^FB${e.maxWidth},${i},${e.lineSpacing},${e.alignment},${e.hangingIndent}`;
|
|
3254
3255
|
return e.alignment === At.Center && (t = t + "\\&"), `${s}${e.x},${e.y}${o}${c}^FD${t}^FS`;
|
|
3255
3256
|
}
|
|
3256
|
-
function
|
|
3257
|
-
|
|
3257
|
+
function sc(e) {
|
|
3258
|
+
return e.split("\\&").map((t) => t.split(/\s+/).filter(Boolean));
|
|
3259
|
+
}
|
|
3260
|
+
function cc(e, t, n) {
|
|
3261
|
+
const r = e.wordWidths;
|
|
3262
|
+
if (!r || r.length === 0 || e.maxWidth <= 0)
|
|
3263
|
+
return;
|
|
3264
|
+
const o = sc(t), s = o.flat();
|
|
3265
|
+
if (s.length !== r.length) return;
|
|
3266
|
+
for (let a = 0; a < s.length; a++)
|
|
3267
|
+
if (s[a] !== r[a].word) return;
|
|
3268
|
+
let i = 0, c = 0;
|
|
3269
|
+
for (const a of o) {
|
|
3270
|
+
if (a.length === 0) {
|
|
3271
|
+
i += 1;
|
|
3272
|
+
continue;
|
|
3273
|
+
}
|
|
3274
|
+
let l = 1, f = 0;
|
|
3275
|
+
for (let h = 0; h < a.length; h++, c++) {
|
|
3276
|
+
const p = r[c].width * n * ie, m = r[c].spaceWidth * n * ie;
|
|
3277
|
+
if (f > 0 && f + m + p <= e.maxWidth) {
|
|
3278
|
+
f += m + p;
|
|
3279
|
+
continue;
|
|
3280
|
+
}
|
|
3281
|
+
f > 0 && (l += 1);
|
|
3282
|
+
const z = Math.max(0, Math.ceil(p / e.maxWidth) - 1);
|
|
3283
|
+
l += z, f = p - z * e.maxWidth;
|
|
3284
|
+
}
|
|
3285
|
+
i += l;
|
|
3286
|
+
}
|
|
3287
|
+
return i;
|
|
3288
|
+
}
|
|
3289
|
+
function se(e, t, n) {
|
|
3290
|
+
const r = e.fontHeight > 0 ? n / e.fontHeight : 1, o = cc(e, t, r);
|
|
3291
|
+
if (o !== void 0) return o;
|
|
3258
3292
|
if (e.measuredWidth !== void 0 && e.maxWidth > 0) {
|
|
3259
|
-
const
|
|
3260
|
-
return Math.max(1, Math.floor((
|
|
3293
|
+
const f = e.measuredWidth * r * ie;
|
|
3294
|
+
return Math.max(1, Math.floor((f + 10) / e.maxWidth) + 1);
|
|
3261
3295
|
}
|
|
3262
|
-
const
|
|
3263
|
-
if (
|
|
3264
|
-
const
|
|
3265
|
-
let
|
|
3266
|
-
for (const
|
|
3267
|
-
|
|
3296
|
+
const s = t.split("\\&"), i = e.charsPerLine ?? 0;
|
|
3297
|
+
if (i <= 0) return s.length;
|
|
3298
|
+
const a = (r > 0 ? i / r : i) / ie;
|
|
3299
|
+
let l = 0;
|
|
3300
|
+
for (const f of s)
|
|
3301
|
+
l += Math.max(
|
|
3268
3302
|
1,
|
|
3269
|
-
Math.ceil(
|
|
3303
|
+
Math.ceil(f.length / a)
|
|
3270
3304
|
);
|
|
3271
|
-
return
|
|
3305
|
+
return l;
|
|
3272
3306
|
}
|
|
3273
|
-
function
|
|
3274
|
-
return
|
|
3307
|
+
function vc(e, t) {
|
|
3308
|
+
return se(e, t, e.fontHeight);
|
|
3275
3309
|
}
|
|
3276
|
-
function
|
|
3310
|
+
function ac(e, t) {
|
|
3277
3311
|
const n = e.minFontHeight ?? 1;
|
|
3278
|
-
if (e.fontHeight <= n ||
|
|
3312
|
+
if (e.fontHeight <= n || se(e, t, e.fontHeight) <= e.maxLines)
|
|
3279
3313
|
return e.fontHeight;
|
|
3280
3314
|
let r = n, o = e.fontHeight, s = n;
|
|
3281
3315
|
for (; r <= o; ) {
|
|
3282
3316
|
const i = Math.floor((r + o) / 2);
|
|
3283
|
-
|
|
3317
|
+
se(e, t, i) <= e.maxLines ? (s = i, r = i + 1) : o = i - 1;
|
|
3284
3318
|
}
|
|
3285
3319
|
return s;
|
|
3286
3320
|
}
|
|
3287
|
-
function
|
|
3321
|
+
function uc(e, t) {
|
|
3288
3322
|
return ((/^\d+$/.test(e) ? Math.ceil(e.length / 2) : e.length) * 11 + 35) * t;
|
|
3289
3323
|
}
|
|
3290
3324
|
function Ye(e, t) {
|
|
3291
|
-
const n =
|
|
3292
|
-
return e.orientation ===
|
|
3325
|
+
const n = uc(t, e.barWidth);
|
|
3326
|
+
return e.orientation === ve.Rotate90 || e.orientation === ve.Rotate270 ? e.height : n;
|
|
3293
3327
|
}
|
|
3294
|
-
function
|
|
3328
|
+
function lc(e, t) {
|
|
3295
3329
|
let n = "^FO";
|
|
3296
3330
|
e.verticalAlignment === Y.End && (n = "^FT");
|
|
3297
3331
|
let r = e.x;
|
|
@@ -3306,17 +3340,17 @@ function cc(e, t) {
|
|
|
3306
3340
|
const s = `^BY${e.barWidth}`, i = `^BC${e.orientation},${e.height},${e.line},${e.lineAbove},${e.checkDigit},A`;
|
|
3307
3341
|
return `${n}${r},${e.y}${s}${i}^FD${t}^FS`;
|
|
3308
3342
|
}
|
|
3309
|
-
function
|
|
3343
|
+
function fc(e, t) {
|
|
3310
3344
|
let n = "^FO";
|
|
3311
3345
|
e.verticalAlignment === Y.End && (n = "^FT");
|
|
3312
3346
|
const r = `^BQ${e.orientation},${e.model},${e.magnification},${e.errorCorrection},${e.mask}`;
|
|
3313
3347
|
return `${n}${e.x},${e.y}${r}^FDQA,${t}^FS`;
|
|
3314
3348
|
}
|
|
3315
|
-
function
|
|
3349
|
+
function pc(e, t) {
|
|
3316
3350
|
const n = e.valueMatch?.trim();
|
|
3317
3351
|
return !n || t.trim() === n ? !0 : t.split(",").some((r) => r.trim() === n);
|
|
3318
3352
|
}
|
|
3319
|
-
function
|
|
3353
|
+
function dc(e, t) {
|
|
3320
3354
|
if (t === "") return "";
|
|
3321
3355
|
let n = "^FO";
|
|
3322
3356
|
return e.verticalAlignment === Y.End && (n = "^FT"), `${n}${e.x},${e.y}^GF${e.data}^FS`;
|
|
@@ -3325,8 +3359,8 @@ export {
|
|
|
3325
3359
|
js as AllMediaMode,
|
|
3326
3360
|
_s as BackfeedAction,
|
|
3327
3361
|
Q as BarcodeAlignment,
|
|
3328
|
-
|
|
3329
|
-
|
|
3362
|
+
Qs as FontFamilyToFontZPLName,
|
|
3363
|
+
ve as FontOrientation,
|
|
3330
3364
|
bs as MediaType,
|
|
3331
3365
|
Ss as MirrorMode,
|
|
3332
3366
|
Is as PostPrintMode,
|
|
@@ -3342,19 +3376,20 @@ export {
|
|
|
3342
3376
|
Y as VerticalAlignment,
|
|
3343
3377
|
Ms as YesNo,
|
|
3344
3378
|
Cs as allMediaModeSchema,
|
|
3379
|
+
oc as applyTextTransformation,
|
|
3345
3380
|
vs as backfeedActionSchema,
|
|
3346
3381
|
Et as badgeSchema,
|
|
3347
3382
|
Fs as barcodeAlignmentSchema,
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3383
|
+
Ys as barcodeFieldSchema,
|
|
3384
|
+
ac as calculateFittedFontHeight,
|
|
3385
|
+
vc as countLines,
|
|
3386
|
+
se as countLinesAtHeight,
|
|
3387
|
+
Xs as fieldSchema,
|
|
3353
3388
|
Tt as fontOrientationSchema,
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3389
|
+
qs as fontSchema,
|
|
3390
|
+
_c as generate,
|
|
3391
|
+
rc as getFieldValue,
|
|
3392
|
+
Ks as imageFieldSchema,
|
|
3358
3393
|
ys as mediaTypeSchema,
|
|
3359
3394
|
Zs as mirrorModeSchema,
|
|
3360
3395
|
Ns as postPrintModeSchema,
|
|
@@ -3362,16 +3397,17 @@ export {
|
|
|
3362
3397
|
Ts as printDensityAdjustmentSchema,
|
|
3363
3398
|
ks as printOrientationSchema,
|
|
3364
3399
|
Ls as qrCodeErrorCorrectionSchema,
|
|
3365
|
-
|
|
3400
|
+
Gs as qrcodeFieldSchema,
|
|
3366
3401
|
Es as reverseModeSchema,
|
|
3367
3402
|
Ws as sourceTypeSchema,
|
|
3368
3403
|
Rs as textAlignmentSchema,
|
|
3369
|
-
|
|
3404
|
+
Hs as textFieldSchema,
|
|
3370
3405
|
Bs as textTransformationSchema,
|
|
3371
3406
|
zs as thermalMediaTypeSchema,
|
|
3372
|
-
|
|
3373
|
-
|
|
3407
|
+
sc as tokenizeWords,
|
|
3408
|
+
mc as validateBadge,
|
|
3409
|
+
gc as validateBadgeOrThrow,
|
|
3374
3410
|
Us as verticalAlignmentSchema,
|
|
3375
|
-
|
|
3376
|
-
|
|
3411
|
+
Vs as wordWidthSchema,
|
|
3412
|
+
me as yesNoSchema
|
|
3377
3413
|
};
|