@golemui/gui-lit 1.0.0-rc.2 → 1.0.0-rc.3
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/CHANGELOG.md +4 -0
- package/index.js +493 -484
- package/index.umd.cjs +58 -58
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { filterTap as
|
|
1
|
+
import { filterTap as At, standardValidate as Ye, isStandardValidateSuccess as Ge } from "@golemui/core";
|
|
2
2
|
import "@golemui/gui-shared";
|
|
3
3
|
import "@golemui/lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { property as
|
|
6
|
-
const
|
|
4
|
+
import { LitElement as St, html as zt } from "lit";
|
|
5
|
+
import { property as Ke, query as Et, customElement as $t } from "lit/decorators.js";
|
|
6
|
+
const qe = {
|
|
7
7
|
LAYOUTS: "LAYOUTS",
|
|
8
8
|
DISPLAYS: "DISPLAYS"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function Ot(e) {
|
|
11
11
|
return function(t, n = () => !0) {
|
|
12
12
|
return {
|
|
13
13
|
kind: "leaf",
|
|
@@ -20,13 +20,13 @@ function $t(e) {
|
|
|
20
20
|
function w(e, t) {
|
|
21
21
|
return typeof e == "function" ? e : { type: t, ...e ?? {} };
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Zt = (e, t) => ({
|
|
24
24
|
type: "ITEMS",
|
|
25
|
-
itemType:
|
|
25
|
+
itemType: qe.DISPLAYS,
|
|
26
26
|
items: [{ render: e }],
|
|
27
27
|
tags: t ?? []
|
|
28
28
|
}), K = /* @__PURE__ */ new Map();
|
|
29
|
-
function
|
|
29
|
+
function Xe(e, t) {
|
|
30
30
|
if (K.has(e))
|
|
31
31
|
throw new Error(`Item type "${e}" is already registered.`);
|
|
32
32
|
K.set(e, t);
|
|
@@ -39,7 +39,7 @@ function q(e) {
|
|
|
39
39
|
);
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function He(e) {
|
|
43
43
|
return K.has(e);
|
|
44
44
|
}
|
|
45
45
|
function h(e) {
|
|
@@ -77,8 +77,8 @@ function h(e) {
|
|
|
77
77
|
...e.buildCustomWidget ? { buildCustomWidget: e.buildCustomWidget } : {},
|
|
78
78
|
...e.getChildren ? { getChildren: e.getChildren } : {}
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
const s =
|
|
80
|
+
Xe(e.itemType, o);
|
|
81
|
+
const s = Ot(e.itemType);
|
|
82
82
|
return { gsl: s, gslByUid: (a, u) => s(u, ((c) => c.uid === a)) };
|
|
83
83
|
}
|
|
84
84
|
function y(e) {
|
|
@@ -104,28 +104,28 @@ function y(e) {
|
|
|
104
104
|
} = e;
|
|
105
105
|
return C;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function Pt(e) {
|
|
108
108
|
return e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
109
109
|
}
|
|
110
110
|
function v(e, t) {
|
|
111
|
-
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label:
|
|
111
|
+
return e.label != null || t.suppressAutomaticLabels || !e.path ? e : { ...e, label: Pt(e.path) };
|
|
112
112
|
}
|
|
113
113
|
function Z(e, t) {
|
|
114
114
|
return e.placeholder != null || t.suppressAutomaticPlaceholders || !e.path ? e : { ...e, placeholder: e.path };
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ct(e) {
|
|
117
117
|
switch (e.type) {
|
|
118
118
|
case "text":
|
|
119
|
-
return It(e);
|
|
120
|
-
case "number":
|
|
121
119
|
return Lt(e);
|
|
120
|
+
case "number":
|
|
121
|
+
return Dt(e);
|
|
122
122
|
case "boolean":
|
|
123
|
-
return
|
|
123
|
+
return It(e);
|
|
124
124
|
default:
|
|
125
125
|
throw new Error(`Unsupported field type "${e.type}"`);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function It(e) {
|
|
129
129
|
const t = y(e);
|
|
130
130
|
return {
|
|
131
131
|
uid: e.uid ?? "",
|
|
@@ -139,7 +139,7 @@ function Ct(e) {
|
|
|
139
139
|
props: t
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Lt(e) {
|
|
143
143
|
const t = y(e);
|
|
144
144
|
return {
|
|
145
145
|
uid: e.uid ?? "",
|
|
@@ -156,7 +156,7 @@ function It(e) {
|
|
|
156
156
|
validator: w(e.validator, "string")
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Dt(e) {
|
|
160
160
|
const t = y(e);
|
|
161
161
|
return {
|
|
162
162
|
uid: e.uid ?? "",
|
|
@@ -187,7 +187,7 @@ h({
|
|
|
187
187
|
return n = Z(n, t), n;
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
|
-
mapToWidget:
|
|
190
|
+
mapToWidget: Ct
|
|
191
191
|
});
|
|
192
192
|
h({
|
|
193
193
|
itemType: "SELECT",
|
|
@@ -498,11 +498,11 @@ h({
|
|
|
498
498
|
props: y(e)
|
|
499
499
|
})
|
|
500
500
|
});
|
|
501
|
-
function
|
|
501
|
+
function Mt(e) {
|
|
502
502
|
const t = {};
|
|
503
503
|
return e.addLabel != null && (t.addLabel = e.addLabel), e.removeLabel != null && (t.removeLabel = e.removeLabel), e.limit != null && (t.limit = e.limit), e.title != null && (t.title = e.title), e.addButtonIcon != null && (t.addButtonIcon = e.addButtonIcon), e.removeButtonIcon != null && (t.removeButtonIcon = e.removeButtonIcon), t;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Nt(e) {
|
|
506
506
|
return {
|
|
507
507
|
uid: e.uid ?? "",
|
|
508
508
|
kind: "input",
|
|
@@ -513,7 +513,7 @@ function Mt(e) {
|
|
|
513
513
|
...e.readonly != null ? { readonly: e.readonly } : {},
|
|
514
514
|
...e.validator != null ? { validator: w(e.validator, "array") } : {},
|
|
515
515
|
props: {
|
|
516
|
-
...
|
|
516
|
+
...Mt(e),
|
|
517
517
|
template: { kind: "layout", type: "flex", children: [], props: { direction: "column" } }
|
|
518
518
|
}
|
|
519
519
|
};
|
|
@@ -522,12 +522,12 @@ function ae(e, t) {
|
|
|
522
522
|
for (const n of e) {
|
|
523
523
|
if (typeof n == "function") continue;
|
|
524
524
|
const r = n;
|
|
525
|
-
typeof r.path == "string" && r.path && (r.path = t + r.path), "children" in r && Array.isArray(r.children) && ae(r.children, t);
|
|
525
|
+
typeof r.path == "string" && r.path && !r.path.startsWith(t) && (r.path = t + r.path), "children" in r && Array.isArray(r.children) && ae(r.children, t);
|
|
526
526
|
const o = r.props;
|
|
527
527
|
o?.template?.children && Array.isArray(o.template.children) && ae(o.template.children, t);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function Rt(e, t) {
|
|
531
531
|
const n = t.walkChildren(t.children ?? []), r = e.kind === "static" ? e.def.path ?? "" : e.fn({})?.path ?? "";
|
|
532
532
|
r && ae(n, r + ".items.");
|
|
533
533
|
const o = {
|
|
@@ -560,25 +560,25 @@ function xt(e) {
|
|
|
560
560
|
children: e.children
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ft(e) {
|
|
564
564
|
return e.children;
|
|
565
565
|
}
|
|
566
|
-
const
|
|
566
|
+
const Wt = {
|
|
567
567
|
parseEntry: xt,
|
|
568
568
|
rollUpSensibleDefaults: () => ({}),
|
|
569
569
|
applySensibleDefaults: (e) => e,
|
|
570
|
-
mapToWidget:
|
|
571
|
-
buildCustomWidget:
|
|
572
|
-
getChildren:
|
|
570
|
+
mapToWidget: Nt,
|
|
571
|
+
buildCustomWidget: Rt,
|
|
572
|
+
getChildren: Ft
|
|
573
573
|
};
|
|
574
|
-
|
|
575
|
-
const
|
|
574
|
+
Xe("REPEATER", Wt);
|
|
575
|
+
const Je = {
|
|
576
576
|
onLoad: "load",
|
|
577
577
|
onChange: "change",
|
|
578
578
|
onFilter: "filter",
|
|
579
579
|
onBlur: "blur"
|
|
580
|
-
},
|
|
581
|
-
class
|
|
580
|
+
}, Ut = Object.keys(Je);
|
|
581
|
+
class jt {
|
|
582
582
|
// ── Action-specific: onClick ───────────────────────────────────
|
|
583
583
|
extractOnClickFromMergeResult(t, n, r) {
|
|
584
584
|
if (t.kind === "dynamic") {
|
|
@@ -614,10 +614,10 @@ class Ut {
|
|
|
614
614
|
const o = { ...t.on || {} };
|
|
615
615
|
let s = !1;
|
|
616
616
|
const i = { ...t };
|
|
617
|
-
for (const a of
|
|
617
|
+
for (const a of Ut) {
|
|
618
618
|
const u = t[a];
|
|
619
619
|
if (u == null) continue;
|
|
620
|
-
const c =
|
|
620
|
+
const c = Je[a];
|
|
621
621
|
if (typeof u == "function") {
|
|
622
622
|
const p = r.next();
|
|
623
623
|
n.set(p, u), o[c] = p, s = !0;
|
|
@@ -627,8 +627,8 @@ class Ut {
|
|
|
627
627
|
return s && (i.on = o), i;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
const me = new
|
|
631
|
-
function
|
|
630
|
+
const me = new jt();
|
|
631
|
+
function Vt(e) {
|
|
632
632
|
const {
|
|
633
633
|
uid: t,
|
|
634
634
|
label: n,
|
|
@@ -659,14 +659,14 @@ function jt(e) {
|
|
|
659
659
|
h({
|
|
660
660
|
itemType: "ACTIONS",
|
|
661
661
|
entryShape: "bare",
|
|
662
|
-
mapToWidget:
|
|
662
|
+
mapToWidget: Vt,
|
|
663
663
|
afterMerge: (e, t) => me.extractOnClickFromMergeResult(
|
|
664
664
|
e,
|
|
665
665
|
t.eventRegistry,
|
|
666
666
|
t.eventIdGenerator
|
|
667
667
|
)
|
|
668
668
|
});
|
|
669
|
-
function
|
|
669
|
+
function Bt(e) {
|
|
670
670
|
const {
|
|
671
671
|
uid: t,
|
|
672
672
|
widgetName: n,
|
|
@@ -688,7 +688,7 @@ function Vt(e) {
|
|
|
688
688
|
children: []
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function Yt(e, t) {
|
|
692
692
|
const n = t.walkChildren(t.children ?? []);
|
|
693
693
|
if (e.kind === "static")
|
|
694
694
|
return { ...t.mapStaticDef(e.def, "LAYOUTS"), children: n };
|
|
@@ -698,17 +698,26 @@ function Bt(e, t) {
|
|
|
698
698
|
return { ...t.mapStaticDef(s, "LAYOUTS"), children: n };
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Gt(e) {
|
|
702
702
|
return e.children;
|
|
703
703
|
}
|
|
704
704
|
h({
|
|
705
705
|
itemType: "LAYOUTS",
|
|
706
706
|
entryShape: "compound",
|
|
707
|
-
mapToWidget:
|
|
708
|
-
buildCustomWidget:
|
|
709
|
-
getChildren:
|
|
707
|
+
mapToWidget: Bt,
|
|
708
|
+
buildCustomWidget: Yt,
|
|
709
|
+
getChildren: Gt
|
|
710
710
|
});
|
|
711
|
-
function
|
|
711
|
+
function we(e) {
|
|
712
|
+
return {
|
|
713
|
+
errors: void 0,
|
|
714
|
+
touched: void 0,
|
|
715
|
+
translate: void 0,
|
|
716
|
+
...e ?? {},
|
|
717
|
+
$form: e?.$form ?? {}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function Kt(e) {
|
|
712
721
|
return {
|
|
713
722
|
uid: "",
|
|
714
723
|
kind: "display",
|
|
@@ -716,7 +725,7 @@ function Gt(e) {
|
|
|
716
725
|
props: { render: e.render }
|
|
717
726
|
};
|
|
718
727
|
}
|
|
719
|
-
function
|
|
728
|
+
function qt(e, t) {
|
|
720
729
|
if (e.kind === "static") {
|
|
721
730
|
const r = e.def;
|
|
722
731
|
return ((o) => ({
|
|
@@ -725,7 +734,7 @@ function Kt(e, t) {
|
|
|
725
734
|
type: "renderer",
|
|
726
735
|
...r.include != null ? { include: r.include } : {},
|
|
727
736
|
...r.exclude != null ? { exclude: r.exclude } : {},
|
|
728
|
-
props: { render: r.render(o
|
|
737
|
+
props: { render: r.render(we(o)) }
|
|
729
738
|
}));
|
|
730
739
|
}
|
|
731
740
|
const n = e.fn;
|
|
@@ -737,15 +746,15 @@ function Kt(e, t) {
|
|
|
737
746
|
type: "renderer",
|
|
738
747
|
...o.include != null ? { include: o.include } : {},
|
|
739
748
|
...o.exclude != null ? { exclude: o.exclude } : {},
|
|
740
|
-
props: { render: o.render(r
|
|
749
|
+
props: { render: o.render(we(r)) }
|
|
741
750
|
};
|
|
742
751
|
});
|
|
743
752
|
}
|
|
744
753
|
h({
|
|
745
754
|
itemType: "DISPLAYS",
|
|
746
755
|
entryShape: "bare",
|
|
747
|
-
mapToWidget:
|
|
748
|
-
buildCustomWidget:
|
|
756
|
+
mapToWidget: Kt,
|
|
757
|
+
buildCustomWidget: qt
|
|
749
758
|
});
|
|
750
759
|
h({
|
|
751
760
|
itemType: "ALERTS",
|
|
@@ -772,7 +781,7 @@ h({
|
|
|
772
781
|
}
|
|
773
782
|
})
|
|
774
783
|
});
|
|
775
|
-
function
|
|
784
|
+
function Xt(e) {
|
|
776
785
|
return {
|
|
777
786
|
uid: e.uid ?? "",
|
|
778
787
|
kind: "layout",
|
|
@@ -785,7 +794,7 @@ function qt(e) {
|
|
|
785
794
|
children: []
|
|
786
795
|
};
|
|
787
796
|
}
|
|
788
|
-
function
|
|
797
|
+
function Ht(e, t) {
|
|
789
798
|
const n = t.walkChildren(t.children ?? []);
|
|
790
799
|
if (e.kind === "static")
|
|
791
800
|
return { ...t.mapStaticDef(e.def, "TABS"), children: n };
|
|
@@ -795,17 +804,17 @@ function Xt(e, t) {
|
|
|
795
804
|
return { ...t.mapStaticDef(s, "TABS"), children: n };
|
|
796
805
|
});
|
|
797
806
|
}
|
|
798
|
-
function
|
|
807
|
+
function Jt(e) {
|
|
799
808
|
return e.children;
|
|
800
809
|
}
|
|
801
810
|
h({
|
|
802
811
|
itemType: "TABS",
|
|
803
812
|
entryShape: "compound",
|
|
804
|
-
mapToWidget:
|
|
805
|
-
buildCustomWidget:
|
|
806
|
-
getChildren:
|
|
813
|
+
mapToWidget: Xt,
|
|
814
|
+
buildCustomWidget: Ht,
|
|
815
|
+
getChildren: Jt
|
|
807
816
|
});
|
|
808
|
-
function
|
|
817
|
+
function Qt(e) {
|
|
809
818
|
return {
|
|
810
819
|
uid: e.uid ?? "",
|
|
811
820
|
kind: "layout",
|
|
@@ -819,7 +828,7 @@ function Jt(e) {
|
|
|
819
828
|
children: []
|
|
820
829
|
};
|
|
821
830
|
}
|
|
822
|
-
function
|
|
831
|
+
function en(e, t) {
|
|
823
832
|
const n = t.walkChildren(t.children ?? []);
|
|
824
833
|
if (e.kind === "static")
|
|
825
834
|
return { ...t.mapStaticDef(e.def, "ACCORDION"), children: n };
|
|
@@ -829,15 +838,15 @@ function Qt(e, t) {
|
|
|
829
838
|
return { ...t.mapStaticDef(s, "ACCORDION"), children: n };
|
|
830
839
|
});
|
|
831
840
|
}
|
|
832
|
-
function
|
|
841
|
+
function tn(e) {
|
|
833
842
|
return e.children;
|
|
834
843
|
}
|
|
835
844
|
h({
|
|
836
845
|
itemType: "ACCORDION",
|
|
837
846
|
entryShape: "compound",
|
|
838
|
-
mapToWidget:
|
|
839
|
-
buildCustomWidget:
|
|
840
|
-
getChildren:
|
|
847
|
+
mapToWidget: Qt,
|
|
848
|
+
buildCustomWidget: en,
|
|
849
|
+
getChildren: tn
|
|
841
850
|
});
|
|
842
851
|
h({
|
|
843
852
|
itemType: "CUSTOM_INPUT",
|
|
@@ -908,7 +917,7 @@ h({
|
|
|
908
917
|
props: e.props ?? {}
|
|
909
918
|
})
|
|
910
919
|
});
|
|
911
|
-
function
|
|
920
|
+
function nn(e) {
|
|
912
921
|
return {
|
|
913
922
|
uid: e.uid ?? "",
|
|
914
923
|
kind: "layout",
|
|
@@ -917,7 +926,7 @@ function tn(e) {
|
|
|
917
926
|
children: []
|
|
918
927
|
};
|
|
919
928
|
}
|
|
920
|
-
function
|
|
929
|
+
function rn(e, t) {
|
|
921
930
|
const n = t.walkChildren(t.children ?? []);
|
|
922
931
|
if (e.kind === "static")
|
|
923
932
|
return { ...t.mapStaticDef(e.def, "CUSTOM_LAYOUT"), children: n };
|
|
@@ -927,15 +936,15 @@ function nn(e, t) {
|
|
|
927
936
|
return { ...t.mapStaticDef(s, "CUSTOM_LAYOUT"), children: n };
|
|
928
937
|
});
|
|
929
938
|
}
|
|
930
|
-
function
|
|
939
|
+
function on(e) {
|
|
931
940
|
return e.children;
|
|
932
941
|
}
|
|
933
942
|
h({
|
|
934
943
|
itemType: "CUSTOM_LAYOUT",
|
|
935
944
|
entryShape: "compound",
|
|
936
|
-
mapToWidget:
|
|
937
|
-
buildCustomWidget:
|
|
938
|
-
getChildren:
|
|
945
|
+
mapToWidget: nn,
|
|
946
|
+
buildCustomWidget: rn,
|
|
947
|
+
getChildren: on
|
|
939
948
|
});
|
|
940
949
|
h({
|
|
941
950
|
itemType: "TAGS",
|
|
@@ -957,7 +966,7 @@ h({
|
|
|
957
966
|
props: y(e)
|
|
958
967
|
})
|
|
959
968
|
});
|
|
960
|
-
const
|
|
969
|
+
const Qe = {
|
|
961
970
|
INPUTS: /* @__PURE__ */ new Set([
|
|
962
971
|
"INPUTS",
|
|
963
972
|
"TEXTAREA",
|
|
@@ -983,11 +992,11 @@ const Je = {
|
|
|
983
992
|
DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
|
|
984
993
|
LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
|
|
985
994
|
};
|
|
986
|
-
function
|
|
987
|
-
const n =
|
|
995
|
+
function sn(e, t) {
|
|
996
|
+
const n = Qe[e];
|
|
988
997
|
return n ? n.has(t) : e === t;
|
|
989
998
|
}
|
|
990
|
-
class
|
|
999
|
+
class an {
|
|
991
1000
|
resolve(t, n) {
|
|
992
1001
|
const r = [];
|
|
993
1002
|
for (const s of n)
|
|
@@ -1004,7 +1013,7 @@ class sn {
|
|
|
1004
1013
|
this.collectFromLeaf(o, n, r);
|
|
1005
1014
|
}
|
|
1006
1015
|
collectFromLeaf(t, n, r) {
|
|
1007
|
-
|
|
1016
|
+
sn(t.selectorType, n.itemType ?? "") && t.matcher(n) && r.push(t);
|
|
1008
1017
|
}
|
|
1009
1018
|
rollUpSensibleDefaults(t) {
|
|
1010
1019
|
const n = /* @__PURE__ */ new Map(), r = (s, i) => {
|
|
@@ -1012,7 +1021,7 @@ class sn {
|
|
|
1012
1021
|
a.push(i), n.set(s, a);
|
|
1013
1022
|
};
|
|
1014
1023
|
for (const s of t) {
|
|
1015
|
-
const i =
|
|
1024
|
+
const i = Qe[s.selectorType];
|
|
1016
1025
|
if (i)
|
|
1017
1026
|
for (const a of i) r(a, s);
|
|
1018
1027
|
else
|
|
@@ -1020,12 +1029,12 @@ class sn {
|
|
|
1020
1029
|
}
|
|
1021
1030
|
const o = {};
|
|
1022
1031
|
for (const [s, i] of n)
|
|
1023
|
-
|
|
1032
|
+
He(s) && (o[s] = q(s).rollUpSensibleDefaults(i));
|
|
1024
1033
|
return o;
|
|
1025
1034
|
}
|
|
1026
1035
|
}
|
|
1027
|
-
const
|
|
1028
|
-
class
|
|
1036
|
+
const un = new an();
|
|
1037
|
+
class cn {
|
|
1029
1038
|
/**
|
|
1030
1039
|
* Deep merges two objects, with right taking precedence over left when properties conflict.
|
|
1031
1040
|
* Arrays are replaced, not merged.
|
|
@@ -1044,8 +1053,8 @@ class un {
|
|
|
1044
1053
|
return r;
|
|
1045
1054
|
}
|
|
1046
1055
|
}
|
|
1047
|
-
const
|
|
1048
|
-
class
|
|
1056
|
+
const ln = new cn();
|
|
1057
|
+
class pn {
|
|
1049
1058
|
constructor(t) {
|
|
1050
1059
|
this.objectUtils = t;
|
|
1051
1060
|
}
|
|
@@ -1096,7 +1105,7 @@ class ln {
|
|
|
1096
1105
|
}
|
|
1097
1106
|
// ── Apply sensible defaults via registry ──
|
|
1098
1107
|
applySensibleDefaults(t, n, r) {
|
|
1099
|
-
if (!
|
|
1108
|
+
if (!He(n)) return t;
|
|
1100
1109
|
const o = r.sensibleDefaults[n] ?? {};
|
|
1101
1110
|
return q(n).applySensibleDefaults(t, o);
|
|
1102
1111
|
}
|
|
@@ -1126,8 +1135,8 @@ class ln {
|
|
|
1126
1135
|
};
|
|
1127
1136
|
}
|
|
1128
1137
|
}
|
|
1129
|
-
const
|
|
1130
|
-
class
|
|
1138
|
+
const dn = new pn(ln);
|
|
1139
|
+
class mn {
|
|
1131
1140
|
mapToWidget(t, n) {
|
|
1132
1141
|
if (t.kind === "dynamic") {
|
|
1133
1142
|
const r = t.fn;
|
|
@@ -1150,8 +1159,8 @@ class dn {
|
|
|
1150
1159
|
return n.size != null && (t.size = n.size), n.defaultValue != null && t.kind === "input" && (t.defaultValue = n.defaultValue), n.on != null && (t.on = n.on), n.include != null && (t.include = n.include), n.exclude != null && (t.exclude = n.exclude), t;
|
|
1151
1160
|
}
|
|
1152
1161
|
}
|
|
1153
|
-
const
|
|
1154
|
-
class
|
|
1162
|
+
const hn = new mn();
|
|
1163
|
+
class fn {
|
|
1155
1164
|
/**
|
|
1156
1165
|
* Ensures the output is always a uniform GslSelector[] of aggregated selectors.
|
|
1157
1166
|
*
|
|
@@ -1176,18 +1185,18 @@ class hn {
|
|
|
1176
1185
|
};
|
|
1177
1186
|
}
|
|
1178
1187
|
}
|
|
1179
|
-
const
|
|
1188
|
+
const bn = new fn(), gn = {
|
|
1180
1189
|
input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
|
|
1181
1190
|
action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
|
|
1182
1191
|
layout: /* @__PURE__ */ new Set(["size"]),
|
|
1183
1192
|
display: /* @__PURE__ */ new Set([])
|
|
1184
|
-
},
|
|
1193
|
+
}, Te = {
|
|
1185
1194
|
onChange: "change",
|
|
1186
1195
|
onLoad: "load",
|
|
1187
1196
|
onFilter: "filter",
|
|
1188
1197
|
onClick: "click"
|
|
1189
1198
|
};
|
|
1190
|
-
class
|
|
1199
|
+
class yn {
|
|
1191
1200
|
/**
|
|
1192
1201
|
* Extracts `states` from a merge result, combining with state-targeted
|
|
1193
1202
|
* GSL leaf selectors from `_gslStates`.
|
|
@@ -1237,11 +1246,11 @@ class gn {
|
|
|
1237
1246
|
const { stateOverrides: s } = n;
|
|
1238
1247
|
if (Object.keys(s).length === 0)
|
|
1239
1248
|
return t;
|
|
1240
|
-
const i = { ...t }, a = t.kind, u =
|
|
1249
|
+
const i = { ...t }, a = t.kind, u = gn[a] || /* @__PURE__ */ new Set();
|
|
1241
1250
|
t.props && (i.props = { ...t.props }), t.on && (i.on = { ...t.on });
|
|
1242
1251
|
for (const [c, p] of Object.entries(s))
|
|
1243
1252
|
for (const [m, f] of Object.entries(p))
|
|
1244
|
-
m === "visible" ? this.applyVisibility(i, c, f) :
|
|
1253
|
+
m === "visible" ? this.applyVisibility(i, c, f) : Te[m] ? this.applyStateEvent(i, c, m, f, r, o) : u.has(m) ? i[`${m}.${c}`] = f : (i.props || (i.props = {}), i.props[`${m}.${c}`] = f);
|
|
1245
1254
|
return i;
|
|
1246
1255
|
}
|
|
1247
1256
|
hasStateData(t) {
|
|
@@ -1259,24 +1268,24 @@ class gn {
|
|
|
1259
1268
|
}
|
|
1260
1269
|
// ── State-suffixed event helpers ──
|
|
1261
1270
|
applyStateEvent(t, n, r, o, s, i) {
|
|
1262
|
-
const a =
|
|
1271
|
+
const a = Te[r];
|
|
1263
1272
|
if (t.on || (t.on = {}), typeof o == "function") {
|
|
1264
1273
|
const u = i.next();
|
|
1265
1274
|
s.set(u, o), t.on[`${a}.${n}`] = u;
|
|
1266
1275
|
} else typeof o == "string" && (t.on[`${a}.${n}`] = o);
|
|
1267
1276
|
}
|
|
1268
1277
|
}
|
|
1269
|
-
const
|
|
1270
|
-
function
|
|
1278
|
+
const _n = new yn();
|
|
1279
|
+
function vn() {
|
|
1271
1280
|
let e = 0;
|
|
1272
1281
|
return { next: () => `event_${e++}` };
|
|
1273
1282
|
}
|
|
1274
|
-
class
|
|
1283
|
+
class kn {
|
|
1275
1284
|
constructor(t, n, r, o, s) {
|
|
1276
1285
|
this.resolver = t, this.merger = n, this.mapper = r, this.eventWiring = o, this.stateExpansion = s;
|
|
1277
1286
|
}
|
|
1278
1287
|
walkAndMap(t, n, r) {
|
|
1279
|
-
const o = /* @__PURE__ */ new Map(), s =
|
|
1288
|
+
const o = /* @__PURE__ */ new Map(), s = vn(), i = { value: 0 }, a = /* @__PURE__ */ new Set();
|
|
1280
1289
|
return { widgets: this.walkItems(
|
|
1281
1290
|
t,
|
|
1282
1291
|
n,
|
|
@@ -1344,10 +1353,10 @@ class vn {
|
|
|
1344
1353
|
if (this.stateExpansion.hasStateData(se))
|
|
1345
1354
|
if (typeof O == "function") {
|
|
1346
1355
|
const T = O;
|
|
1347
|
-
O = ((
|
|
1348
|
-
const
|
|
1356
|
+
O = ((wt) => {
|
|
1357
|
+
const Tt = T(wt);
|
|
1349
1358
|
return this.stateExpansion.applyToWidget(
|
|
1350
|
-
|
|
1359
|
+
Tt,
|
|
1351
1360
|
se,
|
|
1352
1361
|
s,
|
|
1353
1362
|
a
|
|
@@ -1398,7 +1407,7 @@ class vn {
|
|
|
1398
1407
|
return { itemType: n, tags: o, uid: s, type: i };
|
|
1399
1408
|
}
|
|
1400
1409
|
}
|
|
1401
|
-
class
|
|
1410
|
+
class wn {
|
|
1402
1411
|
constructor(t, n) {
|
|
1403
1412
|
this.selectorNormalizer = t, this.walker = n;
|
|
1404
1413
|
}
|
|
@@ -1426,7 +1435,7 @@ class kn {
|
|
|
1426
1435
|
*/
|
|
1427
1436
|
prepareForm(t, n, r) {
|
|
1428
1437
|
const s = (Array.isArray(t) ? [...t] : [t]).map(
|
|
1429
|
-
(u) => typeof u == "function" ?
|
|
1438
|
+
(u) => typeof u == "function" ? Zt(u) : u
|
|
1430
1439
|
), i = this.selectorNormalizer.normalizeSelectors(n), a = {
|
|
1431
1440
|
...this.selectorNormalizer.extractFormConfig(),
|
|
1432
1441
|
...r
|
|
@@ -1437,7 +1446,7 @@ class kn {
|
|
|
1437
1446
|
children: s
|
|
1438
1447
|
};
|
|
1439
1448
|
return {
|
|
1440
|
-
defs: [{ type: "ITEMS", itemType:
|
|
1449
|
+
defs: [{ type: "ITEMS", itemType: qe.LAYOUTS, items: [u], tags: [] }],
|
|
1441
1450
|
gslSelectors: i,
|
|
1442
1451
|
formConfig: a
|
|
1443
1452
|
};
|
|
@@ -1483,37 +1492,37 @@ class kn {
|
|
|
1483
1492
|
}), r.dependencies && (o.dependencies = r.dependencies), r.widgetLoaders && (o.widgetLoaders = r.widgetLoaders), r.validateOn && (o.validateOn = r.validateOn), r.itemRenderers && (o.itemRenderers = r.itemRenderers), o;
|
|
1484
1493
|
}
|
|
1485
1494
|
}
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1495
|
+
const Tn = new kn(
|
|
1496
|
+
un,
|
|
1497
|
+
dn,
|
|
1498
|
+
hn,
|
|
1490
1499
|
me,
|
|
1491
|
-
|
|
1492
|
-
),
|
|
1493
|
-
function
|
|
1494
|
-
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(
|
|
1500
|
+
_n
|
|
1501
|
+
), An = new wn(bn, Tn);
|
|
1502
|
+
function Sn(e) {
|
|
1503
|
+
return typeof e == "function" ? !0 : Array.isArray(e) ? e.length === 0 || e.every(Ae) : Ae(e);
|
|
1495
1504
|
}
|
|
1496
|
-
function
|
|
1505
|
+
function Ae(e) {
|
|
1497
1506
|
if (typeof e == "function") return !0;
|
|
1498
1507
|
if (e === null || typeof e != "object") return !1;
|
|
1499
1508
|
const t = e;
|
|
1500
1509
|
return t.type === "ITEMS" && typeof t.itemType == "string";
|
|
1501
1510
|
}
|
|
1502
|
-
const
|
|
1511
|
+
const Se = Object.freeze({}), zn = Object.freeze({}), ze = /* @__PURE__ */ new WeakMap();
|
|
1503
1512
|
function ie(e, t) {
|
|
1504
1513
|
return e == null ? t : typeof e == "object" ? e : {};
|
|
1505
1514
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (!
|
|
1515
|
+
function En(e, t, n) {
|
|
1516
|
+
if (!Sn(e))
|
|
1508
1517
|
return { formDef: e };
|
|
1509
|
-
const r = ie(e,
|
|
1510
|
-
let i =
|
|
1511
|
-
i || (i = /* @__PURE__ */ new WeakMap(),
|
|
1518
|
+
const r = ie(e, Se), o = ie(t, Se), s = ie(n, zn);
|
|
1519
|
+
let i = ze.get(r);
|
|
1520
|
+
i || (i = /* @__PURE__ */ new WeakMap(), ze.set(r, i));
|
|
1512
1521
|
let a = i.get(o);
|
|
1513
1522
|
a || (a = /* @__PURE__ */ new WeakMap(), i.set(o, a));
|
|
1514
1523
|
const u = a.get(s);
|
|
1515
1524
|
if (u) return u;
|
|
1516
|
-
const c =
|
|
1525
|
+
const c = An.processDxFacade(
|
|
1517
1526
|
e,
|
|
1518
1527
|
t,
|
|
1519
1528
|
n
|
|
@@ -1566,14 +1575,14 @@ class N extends Error {
|
|
|
1566
1575
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1567
1576
|
}
|
|
1568
1577
|
}
|
|
1569
|
-
class
|
|
1578
|
+
class et extends Error {
|
|
1570
1579
|
constructor(t) {
|
|
1571
1580
|
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
1572
1581
|
}
|
|
1573
1582
|
}
|
|
1574
|
-
const
|
|
1583
|
+
const $n = {};
|
|
1575
1584
|
function I(e) {
|
|
1576
|
-
return
|
|
1585
|
+
return $n;
|
|
1577
1586
|
}
|
|
1578
1587
|
function ue(e, t) {
|
|
1579
1588
|
return typeof t == "bigint" ? t.toString() : t;
|
|
@@ -1585,13 +1594,13 @@ function fe(e) {
|
|
|
1585
1594
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1586
1595
|
return e.slice(t, n);
|
|
1587
1596
|
}
|
|
1588
|
-
const
|
|
1597
|
+
const Ee = /* @__PURE__ */ Symbol("evaluating");
|
|
1589
1598
|
function b(e, t, n) {
|
|
1590
1599
|
let r;
|
|
1591
1600
|
Object.defineProperty(e, t, {
|
|
1592
1601
|
get() {
|
|
1593
|
-
if (r !==
|
|
1594
|
-
return r === void 0 && (r =
|
|
1602
|
+
if (r !== Ee)
|
|
1603
|
+
return r === void 0 && (r = Ee, r = n()), r;
|
|
1595
1604
|
},
|
|
1596
1605
|
set(o) {
|
|
1597
1606
|
Object.defineProperty(e, t, {
|
|
@@ -1602,7 +1611,7 @@ function b(e, t, n) {
|
|
|
1602
1611
|
configurable: !0
|
|
1603
1612
|
});
|
|
1604
1613
|
}
|
|
1605
|
-
function
|
|
1614
|
+
function On(...e) {
|
|
1606
1615
|
const t = {};
|
|
1607
1616
|
for (const n of e) {
|
|
1608
1617
|
const r = Object.getOwnPropertyDescriptors(n);
|
|
@@ -1610,30 +1619,30 @@ function $n(...e) {
|
|
|
1610
1619
|
}
|
|
1611
1620
|
return Object.defineProperties({}, t);
|
|
1612
1621
|
}
|
|
1613
|
-
function
|
|
1622
|
+
function Zn(e) {
|
|
1614
1623
|
return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1615
1624
|
}
|
|
1616
|
-
const
|
|
1625
|
+
const tt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
1617
1626
|
};
|
|
1618
|
-
function
|
|
1627
|
+
function $e(e) {
|
|
1619
1628
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1620
1629
|
}
|
|
1621
1630
|
function ce(e) {
|
|
1622
|
-
if (
|
|
1631
|
+
if ($e(e) === !1)
|
|
1623
1632
|
return !1;
|
|
1624
1633
|
const t = e.constructor;
|
|
1625
1634
|
if (t === void 0 || typeof t != "function")
|
|
1626
1635
|
return !0;
|
|
1627
1636
|
const n = t.prototype;
|
|
1628
|
-
return !(
|
|
1637
|
+
return !($e(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1629
1638
|
}
|
|
1630
|
-
function
|
|
1639
|
+
function nt(e) {
|
|
1631
1640
|
return ce(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1632
1641
|
}
|
|
1633
1642
|
function be(e) {
|
|
1634
1643
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1635
1644
|
}
|
|
1636
|
-
function
|
|
1645
|
+
function rt(e, t, n) {
|
|
1637
1646
|
const r = new e._zod.constr(t ?? e._zod.def);
|
|
1638
1647
|
return (!t || n?.parent) && (r._zod.parent = e), r;
|
|
1639
1648
|
}
|
|
@@ -1650,7 +1659,7 @@ function d(e) {
|
|
|
1650
1659
|
}
|
|
1651
1660
|
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
1652
1661
|
}
|
|
1653
|
-
const
|
|
1662
|
+
const Pn = {
|
|
1654
1663
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
1655
1664
|
int32: [-2147483648, 2147483647],
|
|
1656
1665
|
uint32: [0, 4294967295],
|
|
@@ -1665,7 +1674,7 @@ function M(e, t = 0) {
|
|
|
1665
1674
|
return !0;
|
|
1666
1675
|
return !1;
|
|
1667
1676
|
}
|
|
1668
|
-
function
|
|
1677
|
+
function Cn(e, t) {
|
|
1669
1678
|
return t.map((n) => {
|
|
1670
1679
|
var r;
|
|
1671
1680
|
return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
|
|
@@ -1694,7 +1703,7 @@ function W(...e) {
|
|
|
1694
1703
|
inst: r
|
|
1695
1704
|
} : { ...t };
|
|
1696
1705
|
}
|
|
1697
|
-
const
|
|
1706
|
+
const ot = (e, t) => {
|
|
1698
1707
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
1699
1708
|
value: e._zod,
|
|
1700
1709
|
enumerable: !1
|
|
@@ -1705,14 +1714,14 @@ const rt = (e, t) => {
|
|
|
1705
1714
|
value: () => e.message,
|
|
1706
1715
|
enumerable: !1
|
|
1707
1716
|
});
|
|
1708
|
-
},
|
|
1709
|
-
function
|
|
1717
|
+
}, st = l("$ZodError", ot), X = l("$ZodError", ot, { Parent: Error });
|
|
1718
|
+
function In(e, t = (n) => n.message) {
|
|
1710
1719
|
const n = {}, r = [];
|
|
1711
1720
|
for (const o of e.issues)
|
|
1712
1721
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
1713
1722
|
return { formErrors: r, fieldErrors: n };
|
|
1714
1723
|
}
|
|
1715
|
-
function
|
|
1724
|
+
function Ln(e, t = (n) => n.message) {
|
|
1716
1725
|
const n = { _errors: [] }, r = (o) => {
|
|
1717
1726
|
for (const s of o.issues)
|
|
1718
1727
|
if (s.code === "invalid_union" && s.errors.length)
|
|
@@ -1739,71 +1748,71 @@ const H = (e) => (t, n, r, o) => {
|
|
|
1739
1748
|
throw new N();
|
|
1740
1749
|
if (i.issues.length) {
|
|
1741
1750
|
const a = new (o?.Err ?? e)(i.issues.map((u) => L(u, s, I())));
|
|
1742
|
-
throw
|
|
1751
|
+
throw tt(a, o?.callee), a;
|
|
1743
1752
|
}
|
|
1744
1753
|
return i.value;
|
|
1745
|
-
},
|
|
1754
|
+
}, Dn = /* @__PURE__ */ H(X), J = (e) => async (t, n, r, o) => {
|
|
1746
1755
|
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1747
1756
|
let i = t._zod.run({ value: n, issues: [] }, s);
|
|
1748
1757
|
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
1749
1758
|
const a = new (o?.Err ?? e)(i.issues.map((u) => L(u, s, I())));
|
|
1750
|
-
throw
|
|
1759
|
+
throw tt(a, o?.callee), a;
|
|
1751
1760
|
}
|
|
1752
1761
|
return i.value;
|
|
1753
|
-
},
|
|
1762
|
+
}, Mn = /* @__PURE__ */ J(X), Q = (e) => (t, n, r) => {
|
|
1754
1763
|
const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
|
|
1755
1764
|
if (s instanceof Promise)
|
|
1756
1765
|
throw new N();
|
|
1757
1766
|
return s.issues.length ? {
|
|
1758
1767
|
success: !1,
|
|
1759
|
-
error: new (e ??
|
|
1768
|
+
error: new (e ?? st)(s.issues.map((i) => L(i, o, I())))
|
|
1760
1769
|
} : { success: !0, data: s.value };
|
|
1761
|
-
},
|
|
1770
|
+
}, it = /* @__PURE__ */ Q(X), ee = (e) => async (t, n, r) => {
|
|
1762
1771
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
1763
1772
|
let s = t._zod.run({ value: n, issues: [] }, o);
|
|
1764
1773
|
return s instanceof Promise && (s = await s), s.issues.length ? {
|
|
1765
1774
|
success: !1,
|
|
1766
1775
|
error: new e(s.issues.map((i) => L(i, o, I())))
|
|
1767
1776
|
} : { success: !0, data: s.value };
|
|
1768
|
-
},
|
|
1777
|
+
}, at = /* @__PURE__ */ ee(X), Nn = (e) => (t, n, r) => {
|
|
1769
1778
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1770
1779
|
return H(e)(t, n, o);
|
|
1771
|
-
},
|
|
1780
|
+
}, Rn = (e) => (t, n, r) => H(e)(t, n, r), xn = (e) => async (t, n, r) => {
|
|
1772
1781
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1773
1782
|
return J(e)(t, n, o);
|
|
1774
|
-
},
|
|
1783
|
+
}, Fn = (e) => async (t, n, r) => J(e)(t, n, r), Wn = (e) => (t, n, r) => {
|
|
1775
1784
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1776
1785
|
return Q(e)(t, n, o);
|
|
1777
|
-
},
|
|
1786
|
+
}, Un = (e) => (t, n, r) => Q(e)(t, n, r), jn = (e) => async (t, n, r) => {
|
|
1778
1787
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
1779
1788
|
return ee(e)(t, n, o);
|
|
1780
|
-
},
|
|
1781
|
-
function
|
|
1789
|
+
}, Vn = (e) => async (t, n, r) => ee(e)(t, n, r), Bn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, 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)$/, Yn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Gn = /^(?:(?: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])$/, Kn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, qn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, ut = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Xn = /* @__PURE__ */ new RegExp(`^${ut}$`);
|
|
1790
|
+
function ct(e) {
|
|
1782
1791
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1783
1792
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
1784
1793
|
}
|
|
1785
|
-
function Xn(e) {
|
|
1786
|
-
return new RegExp(`^${ut(e)}$`);
|
|
1787
|
-
}
|
|
1788
1794
|
function Hn(e) {
|
|
1789
|
-
|
|
1795
|
+
return new RegExp(`^${ct(e)}$`);
|
|
1796
|
+
}
|
|
1797
|
+
function Jn(e) {
|
|
1798
|
+
const t = ct({ precision: e.precision }), n = ["Z"];
|
|
1790
1799
|
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
1791
1800
|
const r = `${t}(?:${n.join("|")})`;
|
|
1792
|
-
return new RegExp(`^${
|
|
1801
|
+
return new RegExp(`^${ut}T(?:${r})$`);
|
|
1793
1802
|
}
|
|
1794
|
-
const
|
|
1803
|
+
const Qn = (e) => {
|
|
1795
1804
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1796
1805
|
return new RegExp(`^${t}$`);
|
|
1797
|
-
},
|
|
1806
|
+
}, er = /^-?\d+$/, tr = /^-?\d+(?:\.\d+)?/, nr = /^(?:true|false)$/i, rr = /^[^A-Z]*$/, or = /^[^a-z]*$/, S = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
|
|
1798
1807
|
var n;
|
|
1799
1808
|
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
1800
|
-
}),
|
|
1809
|
+
}), lt = {
|
|
1801
1810
|
number: "number",
|
|
1802
1811
|
bigint: "bigint",
|
|
1803
1812
|
object: "date"
|
|
1804
|
-
},
|
|
1813
|
+
}, sr = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
|
|
1805
1814
|
S.init(e, t);
|
|
1806
|
-
const n =
|
|
1815
|
+
const n = lt[typeof t.value];
|
|
1807
1816
|
e._zod.onattach.push((r) => {
|
|
1808
1817
|
const o = r._zod.bag, s = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
1809
1818
|
t.value < s && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
|
|
@@ -1818,9 +1827,9 @@ const Jn = (e) => {
|
|
|
1818
1827
|
continue: !t.abort
|
|
1819
1828
|
});
|
|
1820
1829
|
};
|
|
1821
|
-
}),
|
|
1830
|
+
}), ir = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
|
|
1822
1831
|
S.init(e, t);
|
|
1823
|
-
const n =
|
|
1832
|
+
const n = lt[typeof t.value];
|
|
1824
1833
|
e._zod.onattach.push((r) => {
|
|
1825
1834
|
const o = r._zod.bag, s = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
1826
1835
|
t.value > s && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
|
|
@@ -1835,12 +1844,12 @@ const Jn = (e) => {
|
|
|
1835
1844
|
continue: !t.abort
|
|
1836
1845
|
});
|
|
1837
1846
|
};
|
|
1838
|
-
}),
|
|
1847
|
+
}), ar = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
|
|
1839
1848
|
S.init(e, t), t.format = t.format || "float64";
|
|
1840
|
-
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] =
|
|
1849
|
+
const n = t.format?.includes("int"), r = n ? "int" : "number", [o, s] = Pn[t.format];
|
|
1841
1850
|
e._zod.onattach.push((i) => {
|
|
1842
1851
|
const a = i._zod.bag;
|
|
1843
|
-
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern =
|
|
1852
|
+
a.format = t.format, a.minimum = o, a.maximum = s, n && (a.pattern = er);
|
|
1844
1853
|
}), e._zod.check = (i) => {
|
|
1845
1854
|
const a = i.value;
|
|
1846
1855
|
if (n) {
|
|
@@ -1892,7 +1901,7 @@ const Jn = (e) => {
|
|
|
1892
1901
|
inst: e
|
|
1893
1902
|
});
|
|
1894
1903
|
};
|
|
1895
|
-
}),
|
|
1904
|
+
}), ur = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
|
|
1896
1905
|
var n;
|
|
1897
1906
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1898
1907
|
const o = r.value;
|
|
@@ -1915,7 +1924,7 @@ const Jn = (e) => {
|
|
|
1915
1924
|
continue: !t.abort
|
|
1916
1925
|
});
|
|
1917
1926
|
};
|
|
1918
|
-
}),
|
|
1927
|
+
}), cr = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
|
|
1919
1928
|
var n;
|
|
1920
1929
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1921
1930
|
const o = r.value;
|
|
@@ -1938,7 +1947,7 @@ const Jn = (e) => {
|
|
|
1938
1947
|
continue: !t.abort
|
|
1939
1948
|
});
|
|
1940
1949
|
};
|
|
1941
|
-
}),
|
|
1950
|
+
}), lr = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
|
|
1942
1951
|
var n;
|
|
1943
1952
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1944
1953
|
const o = r.value;
|
|
@@ -1978,7 +1987,7 @@ const Jn = (e) => {
|
|
|
1978
1987
|
});
|
|
1979
1988
|
}) : (r = e._zod).check ?? (r.check = () => {
|
|
1980
1989
|
});
|
|
1981
|
-
}),
|
|
1990
|
+
}), pr = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
|
|
1982
1991
|
te.init(e, t), e._zod.check = (n) => {
|
|
1983
1992
|
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
1984
1993
|
origin: "string",
|
|
@@ -1990,11 +1999,11 @@ const Jn = (e) => {
|
|
|
1990
1999
|
continue: !t.abort
|
|
1991
2000
|
});
|
|
1992
2001
|
};
|
|
1993
|
-
}),
|
|
1994
|
-
t.pattern ?? (t.pattern = nr), te.init(e, t);
|
|
1995
|
-
}), dr = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
2002
|
+
}), dr = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
|
|
1996
2003
|
t.pattern ?? (t.pattern = rr), te.init(e, t);
|
|
1997
|
-
}), mr = /* @__PURE__ */ l("$
|
|
2004
|
+
}), mr = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
|
|
2005
|
+
t.pattern ?? (t.pattern = or), te.init(e, t);
|
|
2006
|
+
}), hr = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
|
|
1998
2007
|
S.init(e, t);
|
|
1999
2008
|
const n = be(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2000
2009
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
@@ -2011,7 +2020,7 @@ const Jn = (e) => {
|
|
|
2011
2020
|
continue: !t.abort
|
|
2012
2021
|
});
|
|
2013
2022
|
};
|
|
2014
|
-
}),
|
|
2023
|
+
}), fr = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
|
|
2015
2024
|
S.init(e, t);
|
|
2016
2025
|
const n = new RegExp(`^${be(t.prefix)}.*`);
|
|
2017
2026
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
@@ -2028,7 +2037,7 @@ const Jn = (e) => {
|
|
|
2028
2037
|
continue: !t.abort
|
|
2029
2038
|
});
|
|
2030
2039
|
};
|
|
2031
|
-
}),
|
|
2040
|
+
}), br = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
|
|
2032
2041
|
S.init(e, t);
|
|
2033
2042
|
const n = new RegExp(`.*${be(t.suffix)}$`);
|
|
2034
2043
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
@@ -2045,17 +2054,17 @@ const Jn = (e) => {
|
|
|
2045
2054
|
continue: !t.abort
|
|
2046
2055
|
});
|
|
2047
2056
|
};
|
|
2048
|
-
}),
|
|
2057
|
+
}), gr = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
|
|
2049
2058
|
S.init(e, t), e._zod.check = (n) => {
|
|
2050
2059
|
n.value = t.tx(n.value);
|
|
2051
2060
|
};
|
|
2052
|
-
}),
|
|
2061
|
+
}), yr = {
|
|
2053
2062
|
major: 4,
|
|
2054
2063
|
minor: 1,
|
|
2055
2064
|
patch: 13
|
|
2056
2065
|
}, _ = /* @__PURE__ */ l("$ZodType", (e, t) => {
|
|
2057
2066
|
var n;
|
|
2058
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
2067
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = yr;
|
|
2059
2068
|
const r = [...e._zod.def.checks ?? []];
|
|
2060
2069
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
2061
2070
|
for (const o of r)
|
|
@@ -2118,17 +2127,17 @@ const Jn = (e) => {
|
|
|
2118
2127
|
e["~standard"] = {
|
|
2119
2128
|
validate: (o) => {
|
|
2120
2129
|
try {
|
|
2121
|
-
const s =
|
|
2130
|
+
const s = it(e, o);
|
|
2122
2131
|
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
2123
2132
|
} catch {
|
|
2124
|
-
return
|
|
2133
|
+
return at(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
2125
2134
|
}
|
|
2126
2135
|
},
|
|
2127
2136
|
vendor: "zod",
|
|
2128
2137
|
version: 1
|
|
2129
2138
|
};
|
|
2130
2139
|
}), ye = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
2131
|
-
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ??
|
|
2140
|
+
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Qn(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2132
2141
|
if (t.coerce)
|
|
2133
2142
|
try {
|
|
2134
2143
|
n.value = String(n.value);
|
|
@@ -2143,7 +2152,7 @@ const Jn = (e) => {
|
|
|
2143
2152
|
};
|
|
2144
2153
|
}), E = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
|
|
2145
2154
|
te.init(e, t), ye.init(e, t);
|
|
2146
|
-
}),
|
|
2155
|
+
}), _r = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
|
|
2147
2156
|
if (t.version) {
|
|
2148
2157
|
const r = {
|
|
2149
2158
|
v1: 1,
|
|
@@ -2157,13 +2166,13 @@ const Jn = (e) => {
|
|
|
2157
2166
|
}[t.version];
|
|
2158
2167
|
if (r === void 0)
|
|
2159
2168
|
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
2160
|
-
t.pattern ?? (t.pattern =
|
|
2169
|
+
t.pattern ?? (t.pattern = Oe(r));
|
|
2161
2170
|
} else
|
|
2162
|
-
t.pattern ?? (t.pattern =
|
|
2171
|
+
t.pattern ?? (t.pattern = Oe());
|
|
2163
2172
|
E.init(e, t);
|
|
2164
|
-
}),
|
|
2165
|
-
t.pattern ?? (t.pattern =
|
|
2166
|
-
}),
|
|
2173
|
+
}), vr = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
|
|
2174
|
+
t.pattern ?? (t.pattern = Yn), E.init(e, t);
|
|
2175
|
+
}), kr = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
2167
2176
|
E.init(e, t), e._zod.check = (n) => {
|
|
2168
2177
|
try {
|
|
2169
2178
|
const r = n.value.trim(), o = new URL(r);
|
|
@@ -2195,18 +2204,18 @@ const Jn = (e) => {
|
|
|
2195
2204
|
});
|
|
2196
2205
|
}
|
|
2197
2206
|
};
|
|
2198
|
-
}),
|
|
2207
|
+
}), wr = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
|
|
2208
|
+
t.pattern ?? (t.pattern = Jn(t)), E.init(e, t);
|
|
2209
|
+
}), Tr = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
|
|
2210
|
+
t.pattern ?? (t.pattern = Xn), E.init(e, t);
|
|
2211
|
+
}), Ar = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
|
|
2199
2212
|
t.pattern ?? (t.pattern = Hn(t)), E.init(e, t);
|
|
2200
|
-
}),
|
|
2201
|
-
t.pattern ?? (t.pattern =
|
|
2202
|
-
}),
|
|
2203
|
-
t.pattern ?? (t.pattern =
|
|
2204
|
-
}),
|
|
2205
|
-
t.pattern ?? (t.pattern =
|
|
2206
|
-
}), Sr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
2207
|
-
t.pattern ?? (t.pattern = Yn), E.init(e, t), e._zod.bag.format = "ipv4";
|
|
2208
|
-
}), zr = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
2209
|
-
t.pattern ?? (t.pattern = Gn), E.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2213
|
+
}), Sr = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
|
|
2214
|
+
t.pattern ?? (t.pattern = Bn), E.init(e, t);
|
|
2215
|
+
}), zr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
|
|
2216
|
+
t.pattern ?? (t.pattern = Gn), E.init(e, t), e._zod.bag.format = "ipv4";
|
|
2217
|
+
}), Er = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
|
|
2218
|
+
t.pattern ?? (t.pattern = Kn), E.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
|
|
2210
2219
|
try {
|
|
2211
2220
|
new URL(`http://[${n.value}]`);
|
|
2212
2221
|
} catch {
|
|
@@ -2219,7 +2228,7 @@ const Jn = (e) => {
|
|
|
2219
2228
|
});
|
|
2220
2229
|
}
|
|
2221
2230
|
};
|
|
2222
|
-
}),
|
|
2231
|
+
}), $r = /* @__PURE__ */ l("$ZodCustomStringFormat", (e, t) => {
|
|
2223
2232
|
E.init(e, t), e._zod.check = (n) => {
|
|
2224
2233
|
t.fn(n.value) || n.issues.push({
|
|
2225
2234
|
code: "invalid_format",
|
|
@@ -2229,8 +2238,8 @@ const Jn = (e) => {
|
|
|
2229
2238
|
continue: !t.abort
|
|
2230
2239
|
});
|
|
2231
2240
|
};
|
|
2232
|
-
}),
|
|
2233
|
-
_.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
2241
|
+
}), pt = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
|
|
2242
|
+
_.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? tr, e._zod.parse = (n, r) => {
|
|
2234
2243
|
if (t.coerce)
|
|
2235
2244
|
try {
|
|
2236
2245
|
n.value = Number(n.value);
|
|
@@ -2248,10 +2257,10 @@ const Jn = (e) => {
|
|
|
2248
2257
|
...s ? { received: s } : {}
|
|
2249
2258
|
}), n;
|
|
2250
2259
|
};
|
|
2251
|
-
}),
|
|
2252
|
-
|
|
2253
|
-
}),
|
|
2254
|
-
_.init(e, t), e._zod.pattern =
|
|
2260
|
+
}), Or = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
|
|
2261
|
+
ar.init(e, t), pt.init(e, t);
|
|
2262
|
+
}), Zr = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
|
|
2263
|
+
_.init(e, t), e._zod.pattern = nr, e._zod.parse = (n, r) => {
|
|
2255
2264
|
if (t.coerce)
|
|
2256
2265
|
try {
|
|
2257
2266
|
n.value = !!n.value;
|
|
@@ -2265,13 +2274,13 @@ const Jn = (e) => {
|
|
|
2265
2274
|
inst: e
|
|
2266
2275
|
}), n;
|
|
2267
2276
|
};
|
|
2268
|
-
}),
|
|
2277
|
+
}), Pr = /* @__PURE__ */ l("$ZodAny", (e, t) => {
|
|
2269
2278
|
_.init(e, t), e._zod.parse = (n) => n;
|
|
2270
2279
|
});
|
|
2271
|
-
function
|
|
2272
|
-
e.issues.length && t.issues.push(...
|
|
2280
|
+
function Ze(e, t, n) {
|
|
2281
|
+
e.issues.length && t.issues.push(...Cn(n, e.issues)), t.value[n] = e.value;
|
|
2273
2282
|
}
|
|
2274
|
-
const
|
|
2283
|
+
const dt = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
2275
2284
|
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2276
2285
|
const o = n.value;
|
|
2277
2286
|
if (!Array.isArray(o))
|
|
@@ -2288,12 +2297,12 @@ const pt = /* @__PURE__ */ l("$ZodArray", (e, t) => {
|
|
|
2288
2297
|
value: a,
|
|
2289
2298
|
issues: []
|
|
2290
2299
|
}, r);
|
|
2291
|
-
u instanceof Promise ? s.push(u.then((c) =>
|
|
2300
|
+
u instanceof Promise ? s.push(u.then((c) => Ze(c, n, i))) : Ze(u, n, i);
|
|
2292
2301
|
}
|
|
2293
2302
|
return s.length ? Promise.all(s).then(() => n) : n;
|
|
2294
2303
|
};
|
|
2295
2304
|
});
|
|
2296
|
-
function
|
|
2305
|
+
function Pe(e, t, n, r) {
|
|
2297
2306
|
for (const s of e)
|
|
2298
2307
|
if (s.issues.length === 0)
|
|
2299
2308
|
return t.value = s.value, t;
|
|
@@ -2305,7 +2314,7 @@ function Ze(e, t, n, r) {
|
|
|
2305
2314
|
errors: e.map((s) => s.issues.map((i) => L(i, r, I())))
|
|
2306
2315
|
}), t);
|
|
2307
2316
|
}
|
|
2308
|
-
const
|
|
2317
|
+
const Cr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
2309
2318
|
_.init(e, t), b(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), b(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), b(e._zod, "values", () => {
|
|
2310
2319
|
if (t.options.every((o) => o._zod.values))
|
|
2311
2320
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
@@ -2334,12 +2343,12 @@ const Pr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
2334
2343
|
a.push(c);
|
|
2335
2344
|
}
|
|
2336
2345
|
}
|
|
2337
|
-
return i ? Promise.all(a).then((u) =>
|
|
2346
|
+
return i ? Promise.all(a).then((u) => Pe(u, o, e, s)) : Pe(a, o, e, s);
|
|
2338
2347
|
};
|
|
2339
|
-
}),
|
|
2348
|
+
}), Ir = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
|
|
2340
2349
|
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2341
2350
|
const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
|
|
2342
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, c]) =>
|
|
2351
|
+
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, c]) => Ce(n, u, c)) : Ce(n, s, i);
|
|
2343
2352
|
};
|
|
2344
2353
|
});
|
|
2345
2354
|
function le(e, t) {
|
|
@@ -2377,7 +2386,7 @@ function le(e, t) {
|
|
|
2377
2386
|
}
|
|
2378
2387
|
return { valid: !1, mergeErrorPath: [] };
|
|
2379
2388
|
}
|
|
2380
|
-
function
|
|
2389
|
+
function Ce(e, t, n) {
|
|
2381
2390
|
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), M(e))
|
|
2382
2391
|
return e;
|
|
2383
2392
|
const r = le(t.value, n.value);
|
|
@@ -2385,10 +2394,10 @@ function Pe(e, t, n) {
|
|
|
2385
2394
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
2386
2395
|
return e.value = r.data, e;
|
|
2387
2396
|
}
|
|
2388
|
-
const
|
|
2397
|
+
const Lr = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
|
|
2389
2398
|
_.init(e, t), e._zod.parse = (n, r) => {
|
|
2390
2399
|
if (r.direction === "backward")
|
|
2391
|
-
throw new
|
|
2400
|
+
throw new et(e.constructor.name);
|
|
2392
2401
|
const o = t.transform(n.value, n);
|
|
2393
2402
|
if (r.async)
|
|
2394
2403
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
|
|
@@ -2397,50 +2406,50 @@ const Ir = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
|
|
|
2397
2406
|
return n.value = o, n;
|
|
2398
2407
|
};
|
|
2399
2408
|
});
|
|
2400
|
-
function
|
|
2409
|
+
function Ie(e, t) {
|
|
2401
2410
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
2402
2411
|
}
|
|
2403
|
-
const
|
|
2412
|
+
const mt = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
2404
2413
|
_.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), b(e._zod, "pattern", () => {
|
|
2405
2414
|
const n = t.innerType._zod.pattern;
|
|
2406
2415
|
return n ? new RegExp(`^(${fe(n.source)})?$`) : void 0;
|
|
2407
2416
|
}), e._zod.parse = (n, r) => {
|
|
2408
2417
|
if (t.innerType._zod.optin === "optional") {
|
|
2409
2418
|
const o = t.innerType._zod.run(n, r);
|
|
2410
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2419
|
+
return o instanceof Promise ? o.then((s) => Ie(s, n.value)) : Ie(o, n.value);
|
|
2411
2420
|
}
|
|
2412
2421
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
2413
2422
|
};
|
|
2414
|
-
}),
|
|
2423
|
+
}), Dr = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
2415
2424
|
_.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "pattern", () => {
|
|
2416
2425
|
const n = t.innerType._zod.pattern;
|
|
2417
2426
|
return n ? new RegExp(`^(${fe(n.source)}|null)$`) : void 0;
|
|
2418
2427
|
}), b(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);
|
|
2419
|
-
}),
|
|
2428
|
+
}), Mr = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
|
|
2420
2429
|
_.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
2421
2430
|
if (r.direction === "backward")
|
|
2422
2431
|
return t.innerType._zod.run(n, r);
|
|
2423
2432
|
if (n.value === void 0)
|
|
2424
2433
|
return n.value = t.defaultValue, n;
|
|
2425
2434
|
const o = t.innerType._zod.run(n, r);
|
|
2426
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2435
|
+
return o instanceof Promise ? o.then((s) => Le(s, t)) : Le(o, t);
|
|
2427
2436
|
};
|
|
2428
2437
|
});
|
|
2429
|
-
function
|
|
2438
|
+
function Le(e, t) {
|
|
2430
2439
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
2431
2440
|
}
|
|
2432
|
-
const
|
|
2441
|
+
const Nr = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
|
|
2433
2442
|
_.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
2434
|
-
}),
|
|
2443
|
+
}), Rr = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
|
|
2435
2444
|
_.init(e, t), b(e._zod, "values", () => {
|
|
2436
2445
|
const n = t.innerType._zod.values;
|
|
2437
2446
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
2438
2447
|
}), e._zod.parse = (n, r) => {
|
|
2439
2448
|
const o = t.innerType._zod.run(n, r);
|
|
2440
|
-
return o instanceof Promise ? o.then((s) =>
|
|
2449
|
+
return o instanceof Promise ? o.then((s) => De(s, e)) : De(o, e);
|
|
2441
2450
|
};
|
|
2442
2451
|
});
|
|
2443
|
-
function
|
|
2452
|
+
function De(e, t) {
|
|
2444
2453
|
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
2445
2454
|
code: "invalid_type",
|
|
2446
2455
|
expected: "nonoptional",
|
|
@@ -2467,7 +2476,7 @@ const xr = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
|
|
|
2467
2476
|
input: n.value
|
|
2468
2477
|
}), n.issues = []), n);
|
|
2469
2478
|
};
|
|
2470
|
-
}),
|
|
2479
|
+
}), Fr = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
|
|
2471
2480
|
_.init(e, t), b(e._zod, "values", () => t.in._zod.values), b(e._zod, "optin", () => t.in._zod.optin), b(e._zod, "optout", () => t.out._zod.optout), b(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
2472
2481
|
if (r.direction === "backward") {
|
|
2473
2482
|
const s = t.out._zod.run(n, r);
|
|
@@ -2480,26 +2489,26 @@ const xr = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
|
|
|
2480
2489
|
function Y(e, t, n) {
|
|
2481
2490
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
2482
2491
|
}
|
|
2483
|
-
const
|
|
2492
|
+
const Wr = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
|
|
2484
2493
|
_.init(e, t), b(e._zod, "propValues", () => t.innerType._zod.propValues), b(e._zod, "values", () => t.innerType._zod.values), b(e._zod, "optin", () => t.innerType?._zod?.optin), b(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
|
|
2485
2494
|
if (r.direction === "backward")
|
|
2486
2495
|
return t.innerType._zod.run(n, r);
|
|
2487
2496
|
const o = t.innerType._zod.run(n, r);
|
|
2488
|
-
return o instanceof Promise ? o.then(
|
|
2497
|
+
return o instanceof Promise ? o.then(Me) : Me(o);
|
|
2489
2498
|
};
|
|
2490
2499
|
});
|
|
2491
|
-
function
|
|
2500
|
+
function Me(e) {
|
|
2492
2501
|
return e.value = Object.freeze(e.value), e;
|
|
2493
2502
|
}
|
|
2494
|
-
const
|
|
2503
|
+
const ht = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
|
|
2495
2504
|
S.init(e, t), _.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
2496
2505
|
const r = n.value, o = t.fn(r);
|
|
2497
2506
|
if (o instanceof Promise)
|
|
2498
|
-
return o.then((s) =>
|
|
2499
|
-
|
|
2507
|
+
return o.then((s) => Ne(s, n, r, e));
|
|
2508
|
+
Ne(o, n, r, e);
|
|
2500
2509
|
};
|
|
2501
2510
|
});
|
|
2502
|
-
function
|
|
2511
|
+
function Ne(e, t, n, r) {
|
|
2503
2512
|
if (!e) {
|
|
2504
2513
|
const o = {
|
|
2505
2514
|
code: "custom",
|
|
@@ -2514,8 +2523,8 @@ function Me(e, t, n, r) {
|
|
|
2514
2523
|
r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(W(o));
|
|
2515
2524
|
}
|
|
2516
2525
|
}
|
|
2517
|
-
var
|
|
2518
|
-
class
|
|
2526
|
+
var Re;
|
|
2527
|
+
class Ur {
|
|
2519
2528
|
constructor() {
|
|
2520
2529
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
2521
2530
|
}
|
|
@@ -2549,18 +2558,18 @@ class Wr {
|
|
|
2549
2558
|
return this._map.has(t);
|
|
2550
2559
|
}
|
|
2551
2560
|
}
|
|
2552
|
-
function
|
|
2553
|
-
return new
|
|
2561
|
+
function jr() {
|
|
2562
|
+
return new Ur();
|
|
2554
2563
|
}
|
|
2555
|
-
(
|
|
2564
|
+
(Re = globalThis).__zod_globalRegistry ?? (Re.__zod_globalRegistry = jr());
|
|
2556
2565
|
const G = globalThis.__zod_globalRegistry;
|
|
2557
|
-
function
|
|
2566
|
+
function Vr(e, t) {
|
|
2558
2567
|
return new e({
|
|
2559
2568
|
type: "string",
|
|
2560
2569
|
...d(t)
|
|
2561
2570
|
});
|
|
2562
2571
|
}
|
|
2563
|
-
function
|
|
2572
|
+
function Br(e, t) {
|
|
2564
2573
|
return new e({
|
|
2565
2574
|
type: "string",
|
|
2566
2575
|
format: "email",
|
|
@@ -2569,7 +2578,7 @@ function Vr(e, t) {
|
|
|
2569
2578
|
...d(t)
|
|
2570
2579
|
});
|
|
2571
2580
|
}
|
|
2572
|
-
function
|
|
2581
|
+
function Yr(e, t) {
|
|
2573
2582
|
return new e({
|
|
2574
2583
|
type: "string",
|
|
2575
2584
|
format: "uuid",
|
|
@@ -2578,7 +2587,7 @@ function Br(e, t) {
|
|
|
2578
2587
|
...d(t)
|
|
2579
2588
|
});
|
|
2580
2589
|
}
|
|
2581
|
-
function
|
|
2590
|
+
function Gr(e, t) {
|
|
2582
2591
|
return new e({
|
|
2583
2592
|
type: "string",
|
|
2584
2593
|
format: "url",
|
|
@@ -2587,7 +2596,7 @@ function Yr(e, t) {
|
|
|
2587
2596
|
...d(t)
|
|
2588
2597
|
});
|
|
2589
2598
|
}
|
|
2590
|
-
function
|
|
2599
|
+
function Kr(e, t) {
|
|
2591
2600
|
return new e({
|
|
2592
2601
|
type: "string",
|
|
2593
2602
|
format: "ipv4",
|
|
@@ -2596,7 +2605,7 @@ function Gr(e, t) {
|
|
|
2596
2605
|
...d(t)
|
|
2597
2606
|
});
|
|
2598
2607
|
}
|
|
2599
|
-
function
|
|
2608
|
+
function qr(e, t) {
|
|
2600
2609
|
return new e({
|
|
2601
2610
|
type: "string",
|
|
2602
2611
|
format: "ipv6",
|
|
@@ -2605,7 +2614,7 @@ function Kr(e, t) {
|
|
|
2605
2614
|
...d(t)
|
|
2606
2615
|
});
|
|
2607
2616
|
}
|
|
2608
|
-
function
|
|
2617
|
+
function Xr(e, t) {
|
|
2609
2618
|
return new e({
|
|
2610
2619
|
type: "string",
|
|
2611
2620
|
format: "datetime",
|
|
@@ -2616,7 +2625,7 @@ function qr(e, t) {
|
|
|
2616
2625
|
...d(t)
|
|
2617
2626
|
});
|
|
2618
2627
|
}
|
|
2619
|
-
function
|
|
2628
|
+
function Hr(e, t) {
|
|
2620
2629
|
return new e({
|
|
2621
2630
|
type: "string",
|
|
2622
2631
|
format: "date",
|
|
@@ -2624,7 +2633,7 @@ function Xr(e, t) {
|
|
|
2624
2633
|
...d(t)
|
|
2625
2634
|
});
|
|
2626
2635
|
}
|
|
2627
|
-
function
|
|
2636
|
+
function Jr(e, t) {
|
|
2628
2637
|
return new e({
|
|
2629
2638
|
type: "string",
|
|
2630
2639
|
format: "time",
|
|
@@ -2633,7 +2642,7 @@ function Hr(e, t) {
|
|
|
2633
2642
|
...d(t)
|
|
2634
2643
|
});
|
|
2635
2644
|
}
|
|
2636
|
-
function
|
|
2645
|
+
function Qr(e, t) {
|
|
2637
2646
|
return new e({
|
|
2638
2647
|
type: "string",
|
|
2639
2648
|
format: "duration",
|
|
@@ -2641,14 +2650,14 @@ function Jr(e, t) {
|
|
|
2641
2650
|
...d(t)
|
|
2642
2651
|
});
|
|
2643
2652
|
}
|
|
2644
|
-
function
|
|
2653
|
+
function eo(e, t) {
|
|
2645
2654
|
return new e({
|
|
2646
2655
|
type: "number",
|
|
2647
2656
|
checks: [],
|
|
2648
2657
|
...d(t)
|
|
2649
2658
|
});
|
|
2650
2659
|
}
|
|
2651
|
-
function
|
|
2660
|
+
function to(e, t) {
|
|
2652
2661
|
return new e({
|
|
2653
2662
|
type: "number",
|
|
2654
2663
|
check: "number_format",
|
|
@@ -2657,27 +2666,27 @@ function eo(e, t) {
|
|
|
2657
2666
|
...d(t)
|
|
2658
2667
|
});
|
|
2659
2668
|
}
|
|
2660
|
-
function
|
|
2669
|
+
function no(e, t) {
|
|
2661
2670
|
return new e({
|
|
2662
2671
|
type: "boolean",
|
|
2663
2672
|
...d(t)
|
|
2664
2673
|
});
|
|
2665
2674
|
}
|
|
2666
|
-
function
|
|
2675
|
+
function ro(e) {
|
|
2667
2676
|
return new e({
|
|
2668
2677
|
type: "any"
|
|
2669
2678
|
});
|
|
2670
2679
|
}
|
|
2671
|
-
function
|
|
2672
|
-
return new
|
|
2680
|
+
function oo(e, t) {
|
|
2681
|
+
return new sr({
|
|
2673
2682
|
check: "less_than",
|
|
2674
2683
|
...d(t),
|
|
2675
2684
|
value: e,
|
|
2676
2685
|
inclusive: !0
|
|
2677
2686
|
});
|
|
2678
2687
|
}
|
|
2679
|
-
function
|
|
2680
|
-
return new
|
|
2688
|
+
function so(e, t) {
|
|
2689
|
+
return new ir({
|
|
2681
2690
|
check: "greater_than",
|
|
2682
2691
|
...d(t),
|
|
2683
2692
|
value: e,
|
|
@@ -2685,94 +2694,94 @@ function oo(e, t) {
|
|
|
2685
2694
|
});
|
|
2686
2695
|
}
|
|
2687
2696
|
function ne(e, t) {
|
|
2688
|
-
return new
|
|
2697
|
+
return new ur({
|
|
2689
2698
|
check: "max_length",
|
|
2690
2699
|
...d(t),
|
|
2691
2700
|
maximum: e
|
|
2692
2701
|
});
|
|
2693
2702
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return new
|
|
2703
|
+
function R(e, t) {
|
|
2704
|
+
return new cr({
|
|
2696
2705
|
check: "min_length",
|
|
2697
2706
|
...d(t),
|
|
2698
2707
|
minimum: e
|
|
2699
2708
|
});
|
|
2700
2709
|
}
|
|
2701
|
-
function
|
|
2702
|
-
return new
|
|
2710
|
+
function ft(e, t) {
|
|
2711
|
+
return new lr({
|
|
2703
2712
|
check: "length_equals",
|
|
2704
2713
|
...d(t),
|
|
2705
2714
|
length: e
|
|
2706
2715
|
});
|
|
2707
2716
|
}
|
|
2708
|
-
function
|
|
2709
|
-
return new
|
|
2717
|
+
function bt(e, t) {
|
|
2718
|
+
return new pr({
|
|
2710
2719
|
check: "string_format",
|
|
2711
2720
|
format: "regex",
|
|
2712
2721
|
...d(t),
|
|
2713
2722
|
pattern: e
|
|
2714
2723
|
});
|
|
2715
2724
|
}
|
|
2716
|
-
function
|
|
2717
|
-
return new
|
|
2725
|
+
function io(e) {
|
|
2726
|
+
return new dr({
|
|
2718
2727
|
check: "string_format",
|
|
2719
2728
|
format: "lowercase",
|
|
2720
2729
|
...d(e)
|
|
2721
2730
|
});
|
|
2722
2731
|
}
|
|
2723
|
-
function
|
|
2724
|
-
return new
|
|
2732
|
+
function ao(e) {
|
|
2733
|
+
return new mr({
|
|
2725
2734
|
check: "string_format",
|
|
2726
2735
|
format: "uppercase",
|
|
2727
2736
|
...d(e)
|
|
2728
2737
|
});
|
|
2729
2738
|
}
|
|
2730
|
-
function
|
|
2731
|
-
return new
|
|
2739
|
+
function uo(e, t) {
|
|
2740
|
+
return new hr({
|
|
2732
2741
|
check: "string_format",
|
|
2733
2742
|
format: "includes",
|
|
2734
2743
|
...d(t),
|
|
2735
2744
|
includes: e
|
|
2736
2745
|
});
|
|
2737
2746
|
}
|
|
2738
|
-
function
|
|
2739
|
-
return new
|
|
2747
|
+
function co(e, t) {
|
|
2748
|
+
return new fr({
|
|
2740
2749
|
check: "string_format",
|
|
2741
2750
|
format: "starts_with",
|
|
2742
2751
|
...d(t),
|
|
2743
2752
|
prefix: e
|
|
2744
2753
|
});
|
|
2745
2754
|
}
|
|
2746
|
-
function
|
|
2747
|
-
return new
|
|
2755
|
+
function lo(e, t) {
|
|
2756
|
+
return new br({
|
|
2748
2757
|
check: "string_format",
|
|
2749
2758
|
format: "ends_with",
|
|
2750
2759
|
...d(t),
|
|
2751
2760
|
suffix: e
|
|
2752
2761
|
});
|
|
2753
2762
|
}
|
|
2754
|
-
function
|
|
2755
|
-
return new
|
|
2763
|
+
function x(e) {
|
|
2764
|
+
return new gr({
|
|
2756
2765
|
check: "overwrite",
|
|
2757
2766
|
tx: e
|
|
2758
2767
|
});
|
|
2759
2768
|
}
|
|
2760
|
-
function
|
|
2761
|
-
return
|
|
2762
|
-
}
|
|
2763
|
-
function po() {
|
|
2764
|
-
return R((e) => e.trim());
|
|
2769
|
+
function po(e) {
|
|
2770
|
+
return x((t) => t.normalize(e));
|
|
2765
2771
|
}
|
|
2766
2772
|
function mo() {
|
|
2767
|
-
return
|
|
2773
|
+
return x((e) => e.trim());
|
|
2768
2774
|
}
|
|
2769
2775
|
function ho() {
|
|
2770
|
-
return
|
|
2776
|
+
return x((e) => e.toLowerCase());
|
|
2771
2777
|
}
|
|
2772
2778
|
function fo() {
|
|
2773
|
-
return
|
|
2779
|
+
return x((e) => e.toUpperCase());
|
|
2774
2780
|
}
|
|
2775
|
-
function bo(
|
|
2781
|
+
function bo() {
|
|
2782
|
+
return x((e) => Zn(e));
|
|
2783
|
+
}
|
|
2784
|
+
function go(e, t, n) {
|
|
2776
2785
|
return new e({
|
|
2777
2786
|
type: "array",
|
|
2778
2787
|
element: t,
|
|
@@ -2782,7 +2791,7 @@ function bo(e, t, n) {
|
|
|
2782
2791
|
...d(n)
|
|
2783
2792
|
});
|
|
2784
2793
|
}
|
|
2785
|
-
function
|
|
2794
|
+
function gt(e, t, n) {
|
|
2786
2795
|
return new e({
|
|
2787
2796
|
type: "custom",
|
|
2788
2797
|
check: "custom",
|
|
@@ -2790,8 +2799,8 @@ function bt(e, t, n) {
|
|
|
2790
2799
|
...d(n)
|
|
2791
2800
|
});
|
|
2792
2801
|
}
|
|
2793
|
-
function
|
|
2794
|
-
const t =
|
|
2802
|
+
function yt(e) {
|
|
2803
|
+
const t = yo((n) => (n.addIssue = (r) => {
|
|
2795
2804
|
if (typeof r == "string")
|
|
2796
2805
|
n.issues.push(W(r, n.value, t._zod.def));
|
|
2797
2806
|
else {
|
|
@@ -2801,14 +2810,14 @@ function gt(e) {
|
|
|
2801
2810
|
}, e(n.value, n)));
|
|
2802
2811
|
return t;
|
|
2803
2812
|
}
|
|
2804
|
-
function
|
|
2813
|
+
function yo(e, t) {
|
|
2805
2814
|
const n = new S({
|
|
2806
2815
|
check: "custom",
|
|
2807
2816
|
...d(t)
|
|
2808
2817
|
});
|
|
2809
2818
|
return n._zod.check = e, n;
|
|
2810
2819
|
}
|
|
2811
|
-
function
|
|
2820
|
+
function _o(e, t, n, r = {}) {
|
|
2812
2821
|
const o = d(r), s = {
|
|
2813
2822
|
...d(r),
|
|
2814
2823
|
check: "string_format",
|
|
@@ -2819,38 +2828,38 @@ function yo(e, t, n, r = {}) {
|
|
|
2819
2828
|
};
|
|
2820
2829
|
return n instanceof RegExp && (s.pattern = n), new e(s);
|
|
2821
2830
|
}
|
|
2822
|
-
const
|
|
2823
|
-
kr.init(e, t), re.init(e, t);
|
|
2824
|
-
});
|
|
2825
|
-
function vo(e) {
|
|
2826
|
-
return qr(_o, e);
|
|
2827
|
-
}
|
|
2828
|
-
const ko = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
2831
|
+
const vo = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
|
|
2829
2832
|
wr.init(e, t), re.init(e, t);
|
|
2830
2833
|
});
|
|
2831
|
-
function
|
|
2832
|
-
return Xr(
|
|
2834
|
+
function ko(e) {
|
|
2835
|
+
return Xr(vo, e);
|
|
2833
2836
|
}
|
|
2834
|
-
const
|
|
2837
|
+
const wo = /* @__PURE__ */ l("ZodISODate", (e, t) => {
|
|
2835
2838
|
Tr.init(e, t), re.init(e, t);
|
|
2836
2839
|
});
|
|
2837
|
-
function
|
|
2838
|
-
return Hr(
|
|
2840
|
+
function To(e) {
|
|
2841
|
+
return Hr(wo, e);
|
|
2839
2842
|
}
|
|
2840
|
-
const
|
|
2843
|
+
const Ao = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
|
|
2841
2844
|
Ar.init(e, t), re.init(e, t);
|
|
2842
2845
|
});
|
|
2843
|
-
function
|
|
2844
|
-
return Jr(
|
|
2846
|
+
function So(e) {
|
|
2847
|
+
return Jr(Ao, e);
|
|
2848
|
+
}
|
|
2849
|
+
const zo = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
|
|
2850
|
+
Sr.init(e, t), re.init(e, t);
|
|
2851
|
+
});
|
|
2852
|
+
function Eo(e) {
|
|
2853
|
+
return Qr(zo, e);
|
|
2845
2854
|
}
|
|
2846
|
-
const
|
|
2847
|
-
|
|
2855
|
+
const $o = (e, t) => {
|
|
2856
|
+
st.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2848
2857
|
format: {
|
|
2849
|
-
value: (n) =>
|
|
2858
|
+
value: (n) => Ln(e, n)
|
|
2850
2859
|
// enumerable: false,
|
|
2851
2860
|
},
|
|
2852
2861
|
flatten: {
|
|
2853
|
-
value: (n) =>
|
|
2862
|
+
value: (n) => In(e, n)
|
|
2854
2863
|
// enumerable: false,
|
|
2855
2864
|
},
|
|
2856
2865
|
addIssue: {
|
|
@@ -2872,14 +2881,14 @@ const Eo = (e, t) => {
|
|
|
2872
2881
|
// enumerable: false,
|
|
2873
2882
|
}
|
|
2874
2883
|
});
|
|
2875
|
-
}, $ = l("ZodError",
|
|
2884
|
+
}, $ = l("ZodError", $o, {
|
|
2876
2885
|
Parent: Error
|
|
2877
|
-
}),
|
|
2886
|
+
}), Oo = /* @__PURE__ */ H($), Zo = /* @__PURE__ */ J($), Po = /* @__PURE__ */ Q($), Co = /* @__PURE__ */ ee($), Io = /* @__PURE__ */ Nn($), Lo = /* @__PURE__ */ Rn($), Do = /* @__PURE__ */ xn($), Mo = /* @__PURE__ */ Fn($), No = /* @__PURE__ */ Wn($), Ro = /* @__PURE__ */ Un($), xo = /* @__PURE__ */ jn($), Fo = /* @__PURE__ */ Vn($), A = /* @__PURE__ */ l("ZodType", (e, t) => (_.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(On(t, {
|
|
2878
2887
|
checks: [
|
|
2879
2888
|
...t.checks ?? [],
|
|
2880
2889
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2881
2890
|
]
|
|
2882
|
-
})), e.clone = (n, r) =>
|
|
2891
|
+
})), e.clone = (n, r) => rt(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Oo(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Po(e, n, r), e.parseAsync = async (n, r) => Zo(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Co(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Io(e, n, r), e.decode = (n, r) => Lo(e, n, r), e.encodeAsync = async (n, r) => Do(e, n, r), e.decodeAsync = async (n, r) => Mo(e, n, r), e.safeEncode = (n, r) => No(e, n, r), e.safeDecode = (n, r) => Ro(e, n, r), e.safeEncodeAsync = async (n, r) => xo(e, n, r), e.safeDecodeAsync = async (n, r) => Fo(e, n, r), e.refine = (n, r) => e.check(ls(n, r)), e.superRefine = (n) => e.check(ps(n)), e.overwrite = (n) => e.check(x(n)), e.optional = () => xe(e), e.nullable = () => Fe(e), e.nullish = () => xe(Fe(e)), e.nonoptional = (n) => rs(e, n), e.array = () => jo(e), e.or = (n) => Bo([e, n]), e.and = (n) => Go(e, n), e.transform = (n) => We(e, qo(n)), e.default = (n) => Qo(e, n), e.prefault = (n) => ts(e, n), e.catch = (n) => ss(e, n), e.pipe = (n) => We(e, n), e.readonly = () => us(e), e.describe = (n) => {
|
|
2883
2892
|
const r = e.clone();
|
|
2884
2893
|
return G.add(r, { description: n }), r;
|
|
2885
2894
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2892,42 +2901,42 @@ const Eo = (e, t) => {
|
|
|
2892
2901
|
return G.get(e);
|
|
2893
2902
|
const r = e.clone();
|
|
2894
2903
|
return G.add(r, n[0]), r;
|
|
2895
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
2904
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Wo = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
2896
2905
|
ye.init(e, t), A.init(e, t);
|
|
2897
2906
|
const n = e._zod.bag;
|
|
2898
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(
|
|
2907
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(bt(...r)), e.includes = (...r) => e.check(uo(...r)), e.startsWith = (...r) => e.check(co(...r)), e.endsWith = (...r) => e.check(lo(...r)), e.min = (...r) => e.check(R(...r)), e.max = (...r) => e.check(ne(...r)), e.length = (...r) => e.check(ft(...r)), e.nonempty = (...r) => e.check(R(1, ...r)), e.lowercase = (r) => e.check(io(r)), e.uppercase = (r) => e.check(ao(r)), e.trim = () => e.check(mo()), e.normalize = (...r) => e.check(po(...r)), e.toLowerCase = () => e.check(ho()), e.toUpperCase = () => e.check(fo()), e.slugify = () => e.check(bo());
|
|
2899
2908
|
}), re = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
2900
|
-
E.init(e, t),
|
|
2901
|
-
}),
|
|
2902
|
-
|
|
2909
|
+
E.init(e, t), Wo.init(e, t);
|
|
2910
|
+
}), Uo = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
2911
|
+
dt.init(e, t), A.init(e, t), e.element = t.element, e.min = (n, r) => e.check(R(n, r)), e.nonempty = (n) => e.check(R(1, n)), e.max = (n, r) => e.check(ne(n, r)), e.length = (n, r) => e.check(ft(n, r)), e.unwrap = () => e.element;
|
|
2903
2912
|
});
|
|
2904
|
-
function
|
|
2905
|
-
return
|
|
2913
|
+
function jo(e, t) {
|
|
2914
|
+
return go(Uo, e, t);
|
|
2906
2915
|
}
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2916
|
+
const Vo = /* @__PURE__ */ l("ZodUnion", (e, t) => {
|
|
2917
|
+
Cr.init(e, t), A.init(e, t), e.options = t.options;
|
|
2909
2918
|
});
|
|
2910
|
-
function
|
|
2911
|
-
return new
|
|
2919
|
+
function Bo(e, t) {
|
|
2920
|
+
return new Vo({
|
|
2912
2921
|
type: "union",
|
|
2913
2922
|
options: e,
|
|
2914
2923
|
...d(t)
|
|
2915
2924
|
});
|
|
2916
2925
|
}
|
|
2917
|
-
const
|
|
2918
|
-
|
|
2926
|
+
const Yo = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
|
|
2927
|
+
Ir.init(e, t), A.init(e, t);
|
|
2919
2928
|
});
|
|
2920
|
-
function
|
|
2921
|
-
return new
|
|
2929
|
+
function Go(e, t) {
|
|
2930
|
+
return new Yo({
|
|
2922
2931
|
type: "intersection",
|
|
2923
2932
|
left: e,
|
|
2924
2933
|
right: t
|
|
2925
2934
|
});
|
|
2926
2935
|
}
|
|
2927
|
-
const
|
|
2928
|
-
|
|
2936
|
+
const Ko = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
2937
|
+
Lr.init(e, t), A.init(e, t), e._zod.parse = (n, r) => {
|
|
2929
2938
|
if (r.direction === "backward")
|
|
2930
|
-
throw new
|
|
2939
|
+
throw new et(e.constructor.name);
|
|
2931
2940
|
n.addIssue = (s) => {
|
|
2932
2941
|
if (typeof s == "string")
|
|
2933
2942
|
n.issues.push(W(s, n.value, t));
|
|
@@ -2940,107 +2949,107 @@ const Go = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
|
2940
2949
|
return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
|
|
2941
2950
|
};
|
|
2942
2951
|
});
|
|
2943
|
-
function
|
|
2944
|
-
return new
|
|
2952
|
+
function qo(e) {
|
|
2953
|
+
return new Ko({
|
|
2945
2954
|
type: "transform",
|
|
2946
2955
|
transform: e
|
|
2947
2956
|
});
|
|
2948
2957
|
}
|
|
2949
|
-
const
|
|
2950
|
-
|
|
2958
|
+
const Xo = /* @__PURE__ */ l("ZodOptional", (e, t) => {
|
|
2959
|
+
mt.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2951
2960
|
});
|
|
2952
2961
|
function xe(e) {
|
|
2953
|
-
return new
|
|
2962
|
+
return new Xo({
|
|
2954
2963
|
type: "optional",
|
|
2955
2964
|
innerType: e
|
|
2956
2965
|
});
|
|
2957
2966
|
}
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2967
|
+
const Ho = /* @__PURE__ */ l("ZodNullable", (e, t) => {
|
|
2968
|
+
Dr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2960
2969
|
});
|
|
2961
|
-
function
|
|
2962
|
-
return new
|
|
2970
|
+
function Fe(e) {
|
|
2971
|
+
return new Ho({
|
|
2963
2972
|
type: "nullable",
|
|
2964
2973
|
innerType: e
|
|
2965
2974
|
});
|
|
2966
2975
|
}
|
|
2967
|
-
const
|
|
2968
|
-
|
|
2976
|
+
const Jo = /* @__PURE__ */ l("ZodDefault", (e, t) => {
|
|
2977
|
+
Mr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2969
2978
|
});
|
|
2970
|
-
function
|
|
2971
|
-
return new
|
|
2979
|
+
function Qo(e, t) {
|
|
2980
|
+
return new Jo({
|
|
2972
2981
|
type: "default",
|
|
2973
2982
|
innerType: e,
|
|
2974
2983
|
get defaultValue() {
|
|
2975
|
-
return typeof t == "function" ? t() :
|
|
2984
|
+
return typeof t == "function" ? t() : nt(t);
|
|
2976
2985
|
}
|
|
2977
2986
|
});
|
|
2978
2987
|
}
|
|
2979
|
-
const
|
|
2980
|
-
|
|
2988
|
+
const es = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
|
|
2989
|
+
Nr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2981
2990
|
});
|
|
2982
|
-
function
|
|
2983
|
-
return new
|
|
2991
|
+
function ts(e, t) {
|
|
2992
|
+
return new es({
|
|
2984
2993
|
type: "prefault",
|
|
2985
2994
|
innerType: e,
|
|
2986
2995
|
get defaultValue() {
|
|
2987
|
-
return typeof t == "function" ? t() :
|
|
2996
|
+
return typeof t == "function" ? t() : nt(t);
|
|
2988
2997
|
}
|
|
2989
2998
|
});
|
|
2990
2999
|
}
|
|
2991
|
-
const
|
|
2992
|
-
|
|
3000
|
+
const ns = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
|
|
3001
|
+
Rr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2993
3002
|
});
|
|
2994
|
-
function
|
|
2995
|
-
return new
|
|
3003
|
+
function rs(e, t) {
|
|
3004
|
+
return new ns({
|
|
2996
3005
|
type: "nonoptional",
|
|
2997
3006
|
innerType: e,
|
|
2998
3007
|
...d(t)
|
|
2999
3008
|
});
|
|
3000
3009
|
}
|
|
3001
|
-
const
|
|
3010
|
+
const os = /* @__PURE__ */ l("ZodCatch", (e, t) => {
|
|
3002
3011
|
xr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3003
3012
|
});
|
|
3004
|
-
function
|
|
3005
|
-
return new
|
|
3013
|
+
function ss(e, t) {
|
|
3014
|
+
return new os({
|
|
3006
3015
|
type: "catch",
|
|
3007
3016
|
innerType: e,
|
|
3008
3017
|
catchValue: typeof t == "function" ? t : () => t
|
|
3009
3018
|
});
|
|
3010
3019
|
}
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3020
|
+
const is = /* @__PURE__ */ l("ZodPipe", (e, t) => {
|
|
3021
|
+
Fr.init(e, t), A.init(e, t), e.in = t.in, e.out = t.out;
|
|
3013
3022
|
});
|
|
3014
|
-
function
|
|
3015
|
-
return new
|
|
3023
|
+
function We(e, t) {
|
|
3024
|
+
return new is({
|
|
3016
3025
|
type: "pipe",
|
|
3017
3026
|
in: e,
|
|
3018
3027
|
out: t
|
|
3019
3028
|
// ...util.normalizeParams(params),
|
|
3020
3029
|
});
|
|
3021
3030
|
}
|
|
3022
|
-
const
|
|
3023
|
-
|
|
3031
|
+
const as = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
|
|
3032
|
+
Wr.init(e, t), A.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3024
3033
|
});
|
|
3025
|
-
function
|
|
3026
|
-
return new
|
|
3034
|
+
function us(e) {
|
|
3035
|
+
return new as({
|
|
3027
3036
|
type: "readonly",
|
|
3028
3037
|
innerType: e
|
|
3029
3038
|
});
|
|
3030
3039
|
}
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3040
|
+
const cs = /* @__PURE__ */ l("ZodCustom", (e, t) => {
|
|
3041
|
+
ht.init(e, t), A.init(e, t);
|
|
3033
3042
|
});
|
|
3034
|
-
function
|
|
3035
|
-
return
|
|
3043
|
+
function ls(e, t = {}) {
|
|
3044
|
+
return gt(cs, e, t);
|
|
3036
3045
|
}
|
|
3037
|
-
function
|
|
3038
|
-
return
|
|
3046
|
+
function ps(e) {
|
|
3047
|
+
return yt(e);
|
|
3039
3048
|
}
|
|
3040
3049
|
const D = /* @__PURE__ */ l("ZodMiniType", (e, t) => {
|
|
3041
3050
|
if (!e._zod)
|
|
3042
3051
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
3043
|
-
_.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) =>
|
|
3052
|
+
_.init(e, t), e.def = t, e.type = t.type, e.parse = (n, r) => Dn(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => it(e, n, r), e.parseAsync = async (n, r) => Mn(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => at(e, n, r), e.check = (...n) => e.clone(
|
|
3044
3053
|
{
|
|
3045
3054
|
...t,
|
|
3046
3055
|
checks: [
|
|
@@ -3049,125 +3058,125 @@ const D = /* @__PURE__ */ l("ZodMiniType", (e, t) => {
|
|
|
3049
3058
|
]
|
|
3050
3059
|
}
|
|
3051
3060
|
// { parent: true }
|
|
3052
|
-
), e.clone = (n, r) =>
|
|
3053
|
-
}),
|
|
3061
|
+
), e.clone = (n, r) => rt(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e));
|
|
3062
|
+
}), _t = /* @__PURE__ */ l("ZodMiniString", (e, t) => {
|
|
3054
3063
|
ye.init(e, t), D.init(e, t);
|
|
3055
3064
|
});
|
|
3056
|
-
function
|
|
3057
|
-
return
|
|
3065
|
+
function Ue(e) {
|
|
3066
|
+
return Vr(_t, e);
|
|
3058
3067
|
}
|
|
3059
3068
|
const F = /* @__PURE__ */ l("ZodMiniStringFormat", (e, t) => {
|
|
3060
|
-
E.init(e, t),
|
|
3061
|
-
}),
|
|
3062
|
-
|
|
3063
|
-
});
|
|
3064
|
-
function ds(e) {
|
|
3065
|
-
return Vr(ps, e);
|
|
3066
|
-
}
|
|
3067
|
-
const ms = /* @__PURE__ */ l("ZodMiniUUID", (e, t) => {
|
|
3068
|
-
yr.init(e, t), F.init(e, t);
|
|
3069
|
+
E.init(e, t), _t.init(e, t);
|
|
3070
|
+
}), ds = /* @__PURE__ */ l("ZodMiniEmail", (e, t) => {
|
|
3071
|
+
vr.init(e, t), F.init(e, t);
|
|
3069
3072
|
});
|
|
3070
|
-
function
|
|
3071
|
-
return Br(
|
|
3073
|
+
function ms(e) {
|
|
3074
|
+
return Br(ds, e);
|
|
3072
3075
|
}
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3076
|
+
const hs = /* @__PURE__ */ l("ZodMiniUUID", (e, t) => {
|
|
3077
|
+
_r.init(e, t), F.init(e, t);
|
|
3075
3078
|
});
|
|
3076
|
-
function
|
|
3077
|
-
return Yr(
|
|
3079
|
+
function fs(e) {
|
|
3080
|
+
return Yr(hs, e);
|
|
3078
3081
|
}
|
|
3079
|
-
const
|
|
3080
|
-
|
|
3082
|
+
const bs = /* @__PURE__ */ l("ZodMiniURL", (e, t) => {
|
|
3083
|
+
kr.init(e, t), F.init(e, t);
|
|
3081
3084
|
});
|
|
3082
|
-
function
|
|
3083
|
-
return Gr(
|
|
3085
|
+
function gs(e) {
|
|
3086
|
+
return Gr(bs, e);
|
|
3084
3087
|
}
|
|
3085
|
-
const
|
|
3088
|
+
const ys = /* @__PURE__ */ l("ZodMiniIPv4", (e, t) => {
|
|
3086
3089
|
zr.init(e, t), F.init(e, t);
|
|
3087
3090
|
});
|
|
3088
|
-
function
|
|
3089
|
-
return Kr(
|
|
3091
|
+
function _s(e) {
|
|
3092
|
+
return Kr(ys, e);
|
|
3090
3093
|
}
|
|
3091
|
-
const
|
|
3094
|
+
const vs = /* @__PURE__ */ l("ZodMiniIPv6", (e, t) => {
|
|
3092
3095
|
Er.init(e, t), F.init(e, t);
|
|
3093
3096
|
});
|
|
3094
|
-
function
|
|
3095
|
-
return
|
|
3097
|
+
function ks(e) {
|
|
3098
|
+
return qr(vs, e);
|
|
3096
3099
|
}
|
|
3097
|
-
const
|
|
3098
|
-
|
|
3100
|
+
const ws = /* @__PURE__ */ l("ZodMiniCustomStringFormat", (e, t) => {
|
|
3101
|
+
$r.init(e, t), F.init(e, t);
|
|
3099
3102
|
});
|
|
3100
|
-
function
|
|
3101
|
-
return
|
|
3103
|
+
function Ts(e) {
|
|
3104
|
+
return _o(ws, "hostname", qn, e);
|
|
3102
3105
|
}
|
|
3103
|
-
const
|
|
3104
|
-
|
|
3106
|
+
const vt = /* @__PURE__ */ l("ZodMiniNumber", (e, t) => {
|
|
3107
|
+
pt.init(e, t), D.init(e, t);
|
|
3105
3108
|
});
|
|
3106
|
-
function
|
|
3107
|
-
return eo(
|
|
3109
|
+
function je(e) {
|
|
3110
|
+
return eo(vt, e);
|
|
3108
3111
|
}
|
|
3109
|
-
const
|
|
3110
|
-
Or.init(e, t),
|
|
3112
|
+
const As = /* @__PURE__ */ l("ZodMiniNumberFormat", (e, t) => {
|
|
3113
|
+
Or.init(e, t), vt.init(e, t);
|
|
3111
3114
|
});
|
|
3112
|
-
function
|
|
3113
|
-
return to(
|
|
3115
|
+
function Ss(e) {
|
|
3116
|
+
return to(As, e);
|
|
3114
3117
|
}
|
|
3115
|
-
const zs = /* @__PURE__ */ l("
|
|
3118
|
+
const zs = /* @__PURE__ */ l("ZodMiniBoolean", (e, t) => {
|
|
3116
3119
|
Zr.init(e, t), D.init(e, t);
|
|
3117
3120
|
});
|
|
3121
|
+
function Ve(e) {
|
|
3122
|
+
return no(zs, e);
|
|
3123
|
+
}
|
|
3124
|
+
const Es = /* @__PURE__ */ l("ZodMiniAny", (e, t) => {
|
|
3125
|
+
Pr.init(e, t), D.init(e, t);
|
|
3126
|
+
});
|
|
3118
3127
|
function pe() {
|
|
3119
|
-
return
|
|
3128
|
+
return ro(Es);
|
|
3120
3129
|
}
|
|
3121
|
-
const
|
|
3122
|
-
|
|
3130
|
+
const $s = /* @__PURE__ */ l("ZodMiniArray", (e, t) => {
|
|
3131
|
+
dt.init(e, t), D.init(e, t);
|
|
3123
3132
|
});
|
|
3124
|
-
function
|
|
3125
|
-
return new
|
|
3133
|
+
function Be(e, t) {
|
|
3134
|
+
return new $s({
|
|
3126
3135
|
type: "array",
|
|
3127
3136
|
element: e,
|
|
3128
3137
|
...d(t)
|
|
3129
3138
|
});
|
|
3130
3139
|
}
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3140
|
+
const Os = /* @__PURE__ */ l("ZodMiniOptional", (e, t) => {
|
|
3141
|
+
mt.init(e, t), D.init(e, t);
|
|
3133
3142
|
});
|
|
3134
|
-
function
|
|
3135
|
-
return new
|
|
3143
|
+
function Zs(e) {
|
|
3144
|
+
return new Os({
|
|
3136
3145
|
type: "optional",
|
|
3137
3146
|
innerType: e
|
|
3138
3147
|
});
|
|
3139
3148
|
}
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3149
|
+
const Ps = /* @__PURE__ */ l("ZodMiniCustom", (e, t) => {
|
|
3150
|
+
ht.init(e, t), D.init(e, t);
|
|
3142
3151
|
});
|
|
3143
3152
|
function k(e, t = {}) {
|
|
3144
|
-
return
|
|
3153
|
+
return gt(Ps, e, t);
|
|
3145
3154
|
}
|
|
3146
|
-
function
|
|
3147
|
-
return
|
|
3155
|
+
function kt(e) {
|
|
3156
|
+
return yt(e);
|
|
3148
3157
|
}
|
|
3149
3158
|
const de = {
|
|
3150
|
-
email: { schema:
|
|
3151
|
-
hostname: { schema:
|
|
3152
|
-
ipv4: { schema:
|
|
3153
|
-
ipv6: { schema:
|
|
3154
|
-
url: { schema:
|
|
3155
|
-
uuid: { schema:
|
|
3156
|
-
date: { schema:
|
|
3157
|
-
time: { schema:
|
|
3158
|
-
"date-time": { schema:
|
|
3159
|
-
duration: { schema:
|
|
3160
|
-
},
|
|
3159
|
+
email: { schema: ms() },
|
|
3160
|
+
hostname: { schema: Ts() },
|
|
3161
|
+
ipv4: { schema: _s() },
|
|
3162
|
+
ipv6: { schema: ks() },
|
|
3163
|
+
url: { schema: gs() },
|
|
3164
|
+
uuid: { schema: fs() },
|
|
3165
|
+
date: { schema: To() },
|
|
3166
|
+
time: { schema: So() },
|
|
3167
|
+
"date-time": { schema: ko() },
|
|
3168
|
+
duration: { schema: Eo() }
|
|
3169
|
+
}, Cs = Object.keys(de), Is = (e) => (t, n) => {
|
|
3161
3170
|
switch (t.type) {
|
|
3162
3171
|
case "string":
|
|
3163
|
-
return
|
|
3172
|
+
return Ls(t, n);
|
|
3164
3173
|
case "integer":
|
|
3165
3174
|
case "number":
|
|
3166
|
-
return Ds(t, n);
|
|
3167
|
-
case "boolean":
|
|
3168
3175
|
return Ms(t, n);
|
|
3169
|
-
case "
|
|
3176
|
+
case "boolean":
|
|
3170
3177
|
return Ns(t, n);
|
|
3178
|
+
case "array":
|
|
3179
|
+
return Rs(t, n);
|
|
3171
3180
|
case "custom": {
|
|
3172
3181
|
if (!e)
|
|
3173
3182
|
throw new Error(
|
|
@@ -3181,10 +3190,10 @@ function g(e, t) {
|
|
|
3181
3190
|
if (e !== void 0)
|
|
3182
3191
|
return typeof e == "string" ? e : t?.translate(e.key, e.params, e.default) ?? e.default;
|
|
3183
3192
|
}
|
|
3184
|
-
function
|
|
3193
|
+
function Ls(e, t) {
|
|
3185
3194
|
return j(e, (n) => {
|
|
3186
3195
|
const r = g(n.messages?.invalid, t);
|
|
3187
|
-
let o = r ?
|
|
3196
|
+
let o = r ? Ue(r) : Ue();
|
|
3188
3197
|
if (n.required === !0) {
|
|
3189
3198
|
const s = g(n.messages?.required, t) ?? "This field is required";
|
|
3190
3199
|
o = o.check(k((i) => i.length > 0, { error: s }));
|
|
@@ -3192,7 +3201,7 @@ function Is(e, t) {
|
|
|
3192
3201
|
if (typeof n.minLength == "number") {
|
|
3193
3202
|
const s = g(n.messages?.minLength, t), i = n.minLength;
|
|
3194
3203
|
o = o.check(
|
|
3195
|
-
s ? k((a) => a.length >= i, { error: s }) :
|
|
3204
|
+
s ? k((a) => a.length >= i, { error: s }) : R(i)
|
|
3196
3205
|
);
|
|
3197
3206
|
}
|
|
3198
3207
|
if (typeof n.maxLength == "number") {
|
|
@@ -3204,7 +3213,7 @@ function Is(e, t) {
|
|
|
3204
3213
|
if (typeof n.pattern == "string") {
|
|
3205
3214
|
const s = g(n.messages?.pattern, t), i = new RegExp(n.pattern);
|
|
3206
3215
|
o = o.check(
|
|
3207
|
-
s ? k((a) => i.test(a), { error: s }) :
|
|
3216
|
+
s ? k((a) => i.test(a), { error: s }) : bt(i)
|
|
3208
3217
|
);
|
|
3209
3218
|
}
|
|
3210
3219
|
if (n.enum) {
|
|
@@ -3216,15 +3225,15 @@ function Is(e, t) {
|
|
|
3216
3225
|
o = o.check(k((i) => i === n.const, s ? { error: s } : void 0));
|
|
3217
3226
|
}
|
|
3218
3227
|
if (n.format !== void 0)
|
|
3219
|
-
if (
|
|
3228
|
+
if (Cs.includes(n.format)) {
|
|
3220
3229
|
const s = g(n.messages?.format, t);
|
|
3221
3230
|
o = o.check(
|
|
3222
|
-
s ?
|
|
3223
|
-
const u =
|
|
3231
|
+
s ? kt((i, a) => {
|
|
3232
|
+
const u = Ye(
|
|
3224
3233
|
de[n.format].schema,
|
|
3225
3234
|
i
|
|
3226
3235
|
);
|
|
3227
|
-
|
|
3236
|
+
Ge(u) || a.addIssue({ code: "custom", path: [], message: s });
|
|
3228
3237
|
}) : de[n.format].schema
|
|
3229
3238
|
);
|
|
3230
3239
|
} else
|
|
@@ -3232,23 +3241,23 @@ function Is(e, t) {
|
|
|
3232
3241
|
return o;
|
|
3233
3242
|
});
|
|
3234
3243
|
}
|
|
3235
|
-
const
|
|
3244
|
+
const Ds = (e, t) => {
|
|
3236
3245
|
if (t === 0)
|
|
3237
3246
|
return !1;
|
|
3238
3247
|
const n = e / t;
|
|
3239
3248
|
return Math.abs(n - Math.round(n)) < 1e-10;
|
|
3240
3249
|
};
|
|
3241
|
-
function
|
|
3250
|
+
function Ms(e, t) {
|
|
3242
3251
|
return j(e, (n) => {
|
|
3243
3252
|
const r = g(n.messages?.invalid, t);
|
|
3244
|
-
let o = r ?
|
|
3245
|
-
if (n.type === "integer" && (o = o.check(
|
|
3253
|
+
let o = r ? je(r) : je();
|
|
3254
|
+
if (n.type === "integer" && (o = o.check(Ss())), n.minimum !== void 0) {
|
|
3246
3255
|
const s = g(n.messages?.minimum, t), i = n.minimum;
|
|
3247
|
-
o = o.check(s ? k((a) => a >= i, { error: s }) :
|
|
3256
|
+
o = o.check(s ? k((a) => a >= i, { error: s }) : so(i));
|
|
3248
3257
|
}
|
|
3249
3258
|
if (n.maximum !== void 0) {
|
|
3250
3259
|
const s = g(n.messages?.maximum, t), i = n.maximum;
|
|
3251
|
-
o = o.check(s ? k((a) => a <= i, { error: s }) :
|
|
3260
|
+
o = o.check(s ? k((a) => a <= i, { error: s }) : oo(i));
|
|
3252
3261
|
}
|
|
3253
3262
|
if (n.exclusiveMinimum !== void 0) {
|
|
3254
3263
|
const s = g(n.messages?.exclusiveMinimum, t), i = n.exclusiveMinimum;
|
|
@@ -3261,7 +3270,7 @@ function Ds(e, t) {
|
|
|
3261
3270
|
if (n.multipleOf !== void 0) {
|
|
3262
3271
|
const s = g(n.messages?.multipleOf, t), i = n.multipleOf;
|
|
3263
3272
|
o = o.check(
|
|
3264
|
-
k((a) =>
|
|
3273
|
+
k((a) => Ds(a, i), s ? { error: s } : void 0)
|
|
3265
3274
|
);
|
|
3266
3275
|
}
|
|
3267
3276
|
if (n.enum) {
|
|
@@ -3275,10 +3284,10 @@ function Ds(e, t) {
|
|
|
3275
3284
|
return o;
|
|
3276
3285
|
});
|
|
3277
3286
|
}
|
|
3278
|
-
function
|
|
3287
|
+
function Ns(e, t) {
|
|
3279
3288
|
return j(e, (n) => {
|
|
3280
3289
|
const r = g(n.messages?.invalid, t);
|
|
3281
|
-
let o = r ?
|
|
3290
|
+
let o = r ? Ve(r) : Ve();
|
|
3282
3291
|
if (n.const !== void 0) {
|
|
3283
3292
|
const s = g(n.messages?.const, t);
|
|
3284
3293
|
o = o.check(k((i) => i === n.const, s ? { error: s } : void 0));
|
|
@@ -3286,10 +3295,10 @@ function Ms(e, t) {
|
|
|
3286
3295
|
return o;
|
|
3287
3296
|
});
|
|
3288
3297
|
}
|
|
3289
|
-
function
|
|
3298
|
+
function Rs(e, t) {
|
|
3290
3299
|
return j(e, (n) => {
|
|
3291
3300
|
const r = g(n.messages?.invalid, t);
|
|
3292
|
-
let o = r ?
|
|
3301
|
+
let o = r ? Be(pe(), r) : Be(pe());
|
|
3293
3302
|
if (n.required === !0) {
|
|
3294
3303
|
const s = g(n.messages?.required, t) ?? "This field is required";
|
|
3295
3304
|
o = o.check(k((i) => i.length > 0, { error: s }));
|
|
@@ -3297,7 +3306,7 @@ function Ns(e, t) {
|
|
|
3297
3306
|
if (typeof n.minItems == "number") {
|
|
3298
3307
|
const s = g(n.messages?.minItems, t), i = n.minItems;
|
|
3299
3308
|
o = o.check(
|
|
3300
|
-
s ? k((a) => a.length >= i, { error: s }) :
|
|
3309
|
+
s ? k((a) => a.length >= i, { error: s }) : R(i)
|
|
3301
3310
|
);
|
|
3302
3311
|
}
|
|
3303
3312
|
if (typeof n.maxItems == "number") {
|
|
@@ -3312,19 +3321,19 @@ function Ns(e, t) {
|
|
|
3312
3321
|
function xs(e, t) {
|
|
3313
3322
|
return j(e, (n) => {
|
|
3314
3323
|
let r = pe();
|
|
3315
|
-
return
|
|
3324
|
+
return At(
|
|
3316
3325
|
Object.keys(n),
|
|
3317
3326
|
// filter non-custom validator keys
|
|
3318
3327
|
(o) => o !== "type" && o !== "required",
|
|
3319
3328
|
(o) => {
|
|
3320
3329
|
const s = n[o], i = t[o], a = i(s);
|
|
3321
3330
|
r = r.check(
|
|
3322
|
-
|
|
3323
|
-
const p =
|
|
3331
|
+
kt((u, c) => {
|
|
3332
|
+
const p = Ye(
|
|
3324
3333
|
a,
|
|
3325
3334
|
u
|
|
3326
3335
|
);
|
|
3327
|
-
if (!
|
|
3336
|
+
if (!Ge(p)) {
|
|
3328
3337
|
const m = p.issues[0];
|
|
3329
3338
|
c.addIssue({
|
|
3330
3339
|
code: "custom",
|
|
@@ -3340,9 +3349,9 @@ function xs(e, t) {
|
|
|
3340
3349
|
}
|
|
3341
3350
|
function j(e, t) {
|
|
3342
3351
|
const n = t(e);
|
|
3343
|
-
return e.required ? n :
|
|
3352
|
+
return e.required ? n : Zs(n);
|
|
3344
3353
|
}
|
|
3345
|
-
const
|
|
3354
|
+
const Fs = {
|
|
3346
3355
|
// ACTION
|
|
3347
3356
|
button: async () => (await import("./button.element-3a7rRHbA.js")).ButtonElement,
|
|
3348
3357
|
// INPUTS
|
|
@@ -3377,12 +3386,12 @@ const Rs = {
|
|
|
3377
3386
|
markdownText: async () => (await import("./markdown-text.element-B8TfVLIO.js")).MarkdownTextElement,
|
|
3378
3387
|
renderer: async () => (await import("./renderer.element-CNyMn2Lu.js")).RendererElement
|
|
3379
3388
|
};
|
|
3380
|
-
var
|
|
3381
|
-
for (var o = r > 1 ? void 0 : r ?
|
|
3389
|
+
var Ws = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, oe = (e, t, n, r) => {
|
|
3390
|
+
for (var o = r > 1 ? void 0 : r ? Us(t, n) : t, s = e.length - 1, i; s >= 0; s--)
|
|
3382
3391
|
(i = e[s]) && (o = (r ? i(t, n, o) : i(o)) || o);
|
|
3383
|
-
return r && o &&
|
|
3392
|
+
return r && o && Ws(t, n, o), o;
|
|
3384
3393
|
};
|
|
3385
|
-
let U = class extends
|
|
3394
|
+
let U = class extends St {
|
|
3386
3395
|
constructor() {
|
|
3387
3396
|
super(...arguments), this.autocomplete = void 0;
|
|
3388
3397
|
}
|
|
@@ -3396,10 +3405,10 @@ let U = class extends At {
|
|
|
3396
3405
|
return this;
|
|
3397
3406
|
}
|
|
3398
3407
|
render() {
|
|
3399
|
-
const e = this.config, t =
|
|
3408
|
+
const e = this.config, t = En(e.formDef, e.formSelectors, e.formConfig), n = {
|
|
3400
3409
|
formDef: t.formDef,
|
|
3401
3410
|
widgetLoaders: {
|
|
3402
|
-
...
|
|
3411
|
+
...Fs,
|
|
3403
3412
|
...t.widgetLoaders,
|
|
3404
3413
|
...e.customWidgetLoaders ?? {}
|
|
3405
3414
|
},
|
|
@@ -3414,10 +3423,10 @@ let U = class extends At {
|
|
|
3414
3423
|
data: e.data,
|
|
3415
3424
|
meta: e.meta,
|
|
3416
3425
|
formName: e.formName
|
|
3417
|
-
}, r =
|
|
3426
|
+
}, r = Is({
|
|
3418
3427
|
...e.customValidators ?? {}
|
|
3419
3428
|
}), o = t.formEvent, s = o ? (i) => o(i.detail) : void 0;
|
|
3420
|
-
return
|
|
3429
|
+
return zt`
|
|
3421
3430
|
<gui-core-form
|
|
3422
3431
|
.config=${n}
|
|
3423
3432
|
.validators=${r}
|
|
@@ -3428,18 +3437,18 @@ let U = class extends At {
|
|
|
3428
3437
|
}
|
|
3429
3438
|
};
|
|
3430
3439
|
oe([
|
|
3431
|
-
|
|
3440
|
+
Ke({ attribute: !1 })
|
|
3432
3441
|
], U.prototype, "config", 2);
|
|
3433
3442
|
oe([
|
|
3434
|
-
|
|
3443
|
+
Ke({ type: String })
|
|
3435
3444
|
], U.prototype, "autocomplete", 2);
|
|
3436
3445
|
oe([
|
|
3437
|
-
|
|
3446
|
+
Et("gui-core-form")
|
|
3438
3447
|
], U.prototype, "coreForm", 2);
|
|
3439
3448
|
U = oe([
|
|
3440
|
-
|
|
3449
|
+
$t("gui-form")
|
|
3441
3450
|
], U);
|
|
3442
3451
|
export {
|
|
3443
3452
|
U as FormElement,
|
|
3444
|
-
|
|
3453
|
+
Fs as widgetLoaders
|
|
3445
3454
|
};
|