@cccsaurora/clue-ui 1.2.8-dev.326 → 1.2.8
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/ActionForm-1iQtvort.js +4470 -0
- package/AnnotationDetails-CcXHDi0B.js +160 -0
- package/AnnotationPreview-BLEnPDVF.js +140 -0
- package/ClueEnrichContext-B8X0Nw9n.js +424 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-BiTi0iqu.js +180 -0
- package/_Uint8Array-BQNOM9Rr.js +101 -0
- package/_baseAssignValue-CNMLQZco.js +20 -0
- package/_baseClone-BnT-6pyM.js +207 -0
- package/_baseExtremum-Ca2EHgy2.js +16 -0
- package/_baseFlatten-Bfr_Molw.js +72 -0
- package/_baseGet-DSZygzyq.js +79 -0
- package/_baseIsEqual-VgvaAFZG.js +147 -0
- package/_baseIteratee-Dbfsw5z8.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-BJcj69PL.js +79 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-k3TuAnxT.js +53 -0
- package/_getPrototype-Cr1Mk7BC.js +5 -0
- package/_getTag-CK2Sffaq.js +90 -0
- package/_isIterateeCall-DkJP7Rbx.js +13 -0
- package/_setToArray-C7yMOeww.js +29 -0
- package/cloneDeep-CF8TtLHr.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +10 -21
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +119 -158
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +33 -43
- package/countBy-CdYegFSu.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-CH7kz5Ix.js +8 -0
- package/groupBy-br8xmD2R.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +31 -47
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BHAe_V9n.js +12768 -0
- package/index-BK-zfYhR.js +358 -0
- package/index-CA5CUNZO.js +975 -0
- package/index-Dj5C04IX.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +60 -60
- package/maxBy-Bc0dYHcO.js +8 -0
- package/package.json +1 -1
- package/sortBy-DY2JBf9n.js +75 -0
- package/sumBy-DuMASLPd.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-Ct9Ygter.js +2292 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-DmwSUrum.js +129 -0
- package/ActionForm-CPNudc44.js +0 -5973
- package/AnnotationDetails-CeWJZ845.js +0 -175
- package/AnnotationPreview-BzWMQSXa.js +0 -188
- package/ClueEnrichContext-CpzPSHQm.js +0 -549
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-WmuDdwuH.js +0 -222
- package/_Uint8Array-B7JqpgFX.js +0 -128
- package/_baseAssignValue-CGTuELqU.js +0 -25
- package/_baseClone-CkNrTyhm.js +0 -283
- package/_baseExtremum-kob8QXyt.js +0 -18
- package/_baseFlatten-jIR_sN_-.js +0 -92
- package/_baseGet-Bx3A4Qfp.js +0 -108
- package/_baseIsEqual-C5OTWzTk.js +0 -208
- package/_baseIteratee-avi7MX2o.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BI9GIHMF.js +0 -115
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-QD8MzKwe.js +0 -63
- package/_getPrototype-CU0j_POw.js +0 -5
- package/_getTag-Ckxxfr88.js +0 -126
- package/_isIterateeCall-Ds3sw2SF.js +0 -17
- package/_setToArray-CaPKQhcz.js +0 -33
- package/cloneDeep-DJrLSw8W.js +0 -8
- package/countBy-c6S3dvSW.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-DSsNkRQs.js +0 -8
- package/groupBy-xqz-n0Vd.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-AMfoEg_6.js +0 -696
- package/index-B6C2a_Lg.js +0 -1172
- package/index-C12gPw2W.js +0 -17698
- package/index-DCKkHTvx.js +0 -15750
- package/index-JcKyZeoY.js +0 -465
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/maxBy-IKHzFrCS.js +0 -8
- package/sortBy-DfSj8IoJ.js +0 -96
- package/sumBy-D-hb_NY-.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-Z1LFp01b.js +0 -3289
- package/utils-HmNPuoDB.js +0 -199
|
@@ -0,0 +1,4470 @@
|
|
|
1
|
+
import { jsx as M, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import { materialRenderers as Eo, materialCells as So } from "@jsonforms/material-renderers";
|
|
3
|
+
import { JsonForms as Po } from "@jsonforms/react";
|
|
4
|
+
import { Modal as bs, Paper as Es, Stack as se, Typography as ke, Divider as Dt, LinearProgress as ko, Button as ot, IconButton as No, Box as et, CircularProgress as Co, Collapse as jo } from "@mui/material";
|
|
5
|
+
import Ss from "./components/display/icons/Iconified.js";
|
|
6
|
+
import { J as Ro } from "./index-BK-zfYhR.js";
|
|
7
|
+
import { ClueComponentContext as ft } from "./hooks/ClueComponentContext.js";
|
|
8
|
+
import { g as Oo } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
9
|
+
import { x as To, y as Ps, z as Io } from "./index-BHAe_V9n.js";
|
|
10
|
+
import { a as Ht } from "./useClueTypeConfig-Ct9Ygter.js";
|
|
11
|
+
import { d as ks } from "./_baseGet-DSZygzyq.js";
|
|
12
|
+
import { b as Mo } from "./_baseSlice-M5RKzt1A.js";
|
|
13
|
+
import { i as Vo } from "./utils-DmwSUrum.js";
|
|
14
|
+
import { useState as de, useRef as Fo, useMemo as Ne, useEffect as Wt, memo as Ns, useCallback as Oe } from "react";
|
|
15
|
+
import { u as je, c as Ko, a as qo } from "./index-Dj5C04IX.js";
|
|
16
|
+
import dt from "./components/ErrorBoundary.js";
|
|
17
|
+
import { adaptSchema as Uo } from "./components/actions/form/schemaAdapter.js";
|
|
18
|
+
import { I as zo } from "./iconify-BBckr5AQ.js";
|
|
19
|
+
import { C as Ao } from "./ClueEnrichContext-B8X0Nw9n.js";
|
|
20
|
+
import { ClueFetcherContext as Lo } from "./hooks/ClueFetcherContext.js";
|
|
21
|
+
import Go from "./components/ClassificationChip.js";
|
|
22
|
+
import Jo from "./components/actions/formats/index.js";
|
|
23
|
+
import { SNACKBAR_EVENT_ID as yt } from "./data/event.js";
|
|
24
|
+
import { dayjs as Ho } from "./utils/time.js";
|
|
25
|
+
import { safeDispatchEvent as _t } from "./utils/window.js";
|
|
26
|
+
import Bo from "./hooks/useClue.js";
|
|
27
|
+
import { i as Qo } from "./isNil-CjWwlQS3.js";
|
|
28
|
+
function Xo(e, t, r) {
|
|
29
|
+
var s = e.length;
|
|
30
|
+
return r = r === void 0 ? s : r, !t && r >= s ? e : Mo(e, t, r);
|
|
31
|
+
}
|
|
32
|
+
var Yo = "\\ud800-\\udfff", Zo = "\\u0300-\\u036f", Do = "\\ufe20-\\ufe2f", Wo = "\\u20d0-\\u20ff", xo = Zo + Do + Wo, en = "\\ufe0e\\ufe0f", tn = "\\u200d", rn = RegExp("[" + tn + Yo + xo + en + "]");
|
|
33
|
+
function Cs(e) {
|
|
34
|
+
return rn.test(e);
|
|
35
|
+
}
|
|
36
|
+
function sn(e) {
|
|
37
|
+
return e.split("");
|
|
38
|
+
}
|
|
39
|
+
var js = "\\ud800-\\udfff", on = "\\u0300-\\u036f", nn = "\\ufe20-\\ufe2f", an = "\\u20d0-\\u20ff", cn = on + nn + an, ln = "\\ufe0e\\ufe0f", dn = "[" + js + "]", xt = "[" + cn + "]", er = "\\ud83c[\\udffb-\\udfff]", un = "(?:" + xt + "|" + er + ")", Rs = "[^" + js + "]", Os = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ts = "[\\ud800-\\udbff][\\udc00-\\udfff]", fn = "\\u200d", Is = un + "?", Ms = "[" + ln + "]?", mn = "(?:" + fn + "(?:" + [Rs, Os, Ts].join("|") + ")" + Ms + Is + ")*", hn = Ms + Is + mn, pn = "(?:" + [Rs + xt + "?", xt, Os, Ts, dn].join("|") + ")", yn = RegExp(er + "(?=" + er + ")|" + pn + hn, "g");
|
|
40
|
+
function _n(e) {
|
|
41
|
+
return e.match(yn) || [];
|
|
42
|
+
}
|
|
43
|
+
function vn(e) {
|
|
44
|
+
return Cs(e) ? _n(e) : sn(e);
|
|
45
|
+
}
|
|
46
|
+
function $n(e) {
|
|
47
|
+
return function(t) {
|
|
48
|
+
t = ks(t);
|
|
49
|
+
var r = Cs(t) ? vn(t) : void 0, s = r ? r[0] : t.charAt(0), o = r ? Xo(r, 1).join("") : t.slice(1);
|
|
50
|
+
return s[e]() + o;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var gn = $n("toUpperCase");
|
|
54
|
+
function wn(e) {
|
|
55
|
+
return gn(ks(e).toLowerCase());
|
|
56
|
+
}
|
|
57
|
+
var tr = { exports: {} }, Vs = {}, fe = {}, Qe = {}, mt = {}, q = {}, ut = {};
|
|
58
|
+
(function(e) {
|
|
59
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
|
|
60
|
+
class t {
|
|
61
|
+
}
|
|
62
|
+
e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
63
|
+
class r extends t {
|
|
64
|
+
constructor($) {
|
|
65
|
+
if (super(), !e.IDENTIFIER.test($))
|
|
66
|
+
throw new Error("CodeGen: name must be a valid identifier");
|
|
67
|
+
this.str = $;
|
|
68
|
+
}
|
|
69
|
+
toString() {
|
|
70
|
+
return this.str;
|
|
71
|
+
}
|
|
72
|
+
emptyStr() {
|
|
73
|
+
return !1;
|
|
74
|
+
}
|
|
75
|
+
get names() {
|
|
76
|
+
return { [this.str]: 1 };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
e.Name = r;
|
|
80
|
+
class s extends t {
|
|
81
|
+
constructor($) {
|
|
82
|
+
super(), this._items = typeof $ == "string" ? [$] : $;
|
|
83
|
+
}
|
|
84
|
+
toString() {
|
|
85
|
+
return this.str;
|
|
86
|
+
}
|
|
87
|
+
emptyStr() {
|
|
88
|
+
if (this._items.length > 1)
|
|
89
|
+
return !1;
|
|
90
|
+
const $ = this._items[0];
|
|
91
|
+
return $ === "" || $ === '""';
|
|
92
|
+
}
|
|
93
|
+
get str() {
|
|
94
|
+
var $;
|
|
95
|
+
return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((P, R) => `${P}${R}`, "");
|
|
96
|
+
}
|
|
97
|
+
get names() {
|
|
98
|
+
var $;
|
|
99
|
+
return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((P, R) => (R instanceof r && (P[R.str] = (P[R.str] || 0) + 1), P), {});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
e._Code = s, e.nil = new s("");
|
|
103
|
+
function o(f, ...$) {
|
|
104
|
+
const P = [f[0]];
|
|
105
|
+
let R = 0;
|
|
106
|
+
for (; R < $.length; )
|
|
107
|
+
d(P, $[R]), P.push(f[++R]);
|
|
108
|
+
return new s(P);
|
|
109
|
+
}
|
|
110
|
+
e._ = o;
|
|
111
|
+
const a = new s("+");
|
|
112
|
+
function i(f, ...$) {
|
|
113
|
+
const P = [E(f[0])];
|
|
114
|
+
let R = 0;
|
|
115
|
+
for (; R < $.length; )
|
|
116
|
+
P.push(a), d(P, $[R]), P.push(a, E(f[++R]));
|
|
117
|
+
return u(P), new s(P);
|
|
118
|
+
}
|
|
119
|
+
e.str = i;
|
|
120
|
+
function d(f, $) {
|
|
121
|
+
$ instanceof s ? f.push(...$._items) : $ instanceof r ? f.push($) : f.push(y($));
|
|
122
|
+
}
|
|
123
|
+
e.addCodeArg = d;
|
|
124
|
+
function u(f) {
|
|
125
|
+
let $ = 1;
|
|
126
|
+
for (; $ < f.length - 1; ) {
|
|
127
|
+
if (f[$] === a) {
|
|
128
|
+
const P = l(f[$ - 1], f[$ + 1]);
|
|
129
|
+
if (P !== void 0) {
|
|
130
|
+
f.splice($ - 1, 3, P);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
f[$++] = "+";
|
|
134
|
+
}
|
|
135
|
+
$++;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function l(f, $) {
|
|
139
|
+
if ($ === '""')
|
|
140
|
+
return f;
|
|
141
|
+
if (f === '""')
|
|
142
|
+
return $;
|
|
143
|
+
if (typeof f == "string")
|
|
144
|
+
return $ instanceof r || f[f.length - 1] !== '"' ? void 0 : typeof $ != "string" ? `${f.slice(0, -1)}${$}"` : $[0] === '"' ? f.slice(0, -1) + $.slice(1) : void 0;
|
|
145
|
+
if (typeof $ == "string" && $[0] === '"' && !(f instanceof r))
|
|
146
|
+
return `"${f}${$.slice(1)}`;
|
|
147
|
+
}
|
|
148
|
+
function m(f, $) {
|
|
149
|
+
return $.emptyStr() ? f : f.emptyStr() ? $ : i`${f}${$}`;
|
|
150
|
+
}
|
|
151
|
+
e.strConcat = m;
|
|
152
|
+
function y(f) {
|
|
153
|
+
return typeof f == "number" || typeof f == "boolean" || f === null ? f : E(Array.isArray(f) ? f.join(",") : f);
|
|
154
|
+
}
|
|
155
|
+
function b(f) {
|
|
156
|
+
return new s(E(f));
|
|
157
|
+
}
|
|
158
|
+
e.stringify = b;
|
|
159
|
+
function E(f) {
|
|
160
|
+
return JSON.stringify(f).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
161
|
+
}
|
|
162
|
+
e.safeStringify = E;
|
|
163
|
+
function g(f) {
|
|
164
|
+
return typeof f == "string" && e.IDENTIFIER.test(f) ? new s(`.${f}`) : o`[${f}]`;
|
|
165
|
+
}
|
|
166
|
+
e.getProperty = g;
|
|
167
|
+
function v(f) {
|
|
168
|
+
if (typeof f == "string" && e.IDENTIFIER.test(f))
|
|
169
|
+
return new s(`${f}`);
|
|
170
|
+
throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`);
|
|
171
|
+
}
|
|
172
|
+
e.getEsmExportName = v;
|
|
173
|
+
function h(f) {
|
|
174
|
+
return new s(f.toString());
|
|
175
|
+
}
|
|
176
|
+
e.regexpCode = h;
|
|
177
|
+
})(ut);
|
|
178
|
+
var rr = {};
|
|
179
|
+
(function(e) {
|
|
180
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
|
|
181
|
+
const t = ut;
|
|
182
|
+
class r extends Error {
|
|
183
|
+
constructor(l) {
|
|
184
|
+
super(`CodeGen: "code" for ${l} not defined`), this.value = l.value;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
var s;
|
|
188
|
+
(function(u) {
|
|
189
|
+
u[u.Started = 0] = "Started", u[u.Completed = 1] = "Completed";
|
|
190
|
+
})(s || (e.UsedValueState = s = {})), e.varKinds = {
|
|
191
|
+
const: new t.Name("const"),
|
|
192
|
+
let: new t.Name("let"),
|
|
193
|
+
var: new t.Name("var")
|
|
194
|
+
};
|
|
195
|
+
class o {
|
|
196
|
+
constructor({ prefixes: l, parent: m } = {}) {
|
|
197
|
+
this._names = {}, this._prefixes = l, this._parent = m;
|
|
198
|
+
}
|
|
199
|
+
toName(l) {
|
|
200
|
+
return l instanceof t.Name ? l : this.name(l);
|
|
201
|
+
}
|
|
202
|
+
name(l) {
|
|
203
|
+
return new t.Name(this._newName(l));
|
|
204
|
+
}
|
|
205
|
+
_newName(l) {
|
|
206
|
+
const m = this._names[l] || this._nameGroup(l);
|
|
207
|
+
return `${l}${m.index++}`;
|
|
208
|
+
}
|
|
209
|
+
_nameGroup(l) {
|
|
210
|
+
var m, y;
|
|
211
|
+
if (!((y = (m = this._parent) === null || m === void 0 ? void 0 : m._prefixes) === null || y === void 0) && y.has(l) || this._prefixes && !this._prefixes.has(l))
|
|
212
|
+
throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);
|
|
213
|
+
return this._names[l] = { prefix: l, index: 0 };
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
e.Scope = o;
|
|
217
|
+
class a extends t.Name {
|
|
218
|
+
constructor(l, m) {
|
|
219
|
+
super(m), this.prefix = l;
|
|
220
|
+
}
|
|
221
|
+
setValue(l, { property: m, itemIndex: y }) {
|
|
222
|
+
this.value = l, this.scopePath = (0, t._)`.${new t.Name(m)}[${y}]`;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
e.ValueScopeName = a;
|
|
226
|
+
const i = (0, t._)`\n`;
|
|
227
|
+
class d extends o {
|
|
228
|
+
constructor(l) {
|
|
229
|
+
super(l), this._values = {}, this._scope = l.scope, this.opts = { ...l, _n: l.lines ? i : t.nil };
|
|
230
|
+
}
|
|
231
|
+
get() {
|
|
232
|
+
return this._scope;
|
|
233
|
+
}
|
|
234
|
+
name(l) {
|
|
235
|
+
return new a(l, this._newName(l));
|
|
236
|
+
}
|
|
237
|
+
value(l, m) {
|
|
238
|
+
var y;
|
|
239
|
+
if (m.ref === void 0)
|
|
240
|
+
throw new Error("CodeGen: ref must be passed in value");
|
|
241
|
+
const b = this.toName(l), { prefix: E } = b, g = (y = m.key) !== null && y !== void 0 ? y : m.ref;
|
|
242
|
+
let v = this._values[E];
|
|
243
|
+
if (v) {
|
|
244
|
+
const $ = v.get(g);
|
|
245
|
+
if ($)
|
|
246
|
+
return $;
|
|
247
|
+
} else
|
|
248
|
+
v = this._values[E] = /* @__PURE__ */ new Map();
|
|
249
|
+
v.set(g, b);
|
|
250
|
+
const h = this._scope[E] || (this._scope[E] = []), f = h.length;
|
|
251
|
+
return h[f] = m.ref, b.setValue(m, { property: E, itemIndex: f }), b;
|
|
252
|
+
}
|
|
253
|
+
getValue(l, m) {
|
|
254
|
+
const y = this._values[l];
|
|
255
|
+
if (y)
|
|
256
|
+
return y.get(m);
|
|
257
|
+
}
|
|
258
|
+
scopeRefs(l, m = this._values) {
|
|
259
|
+
return this._reduceValues(m, (y) => {
|
|
260
|
+
if (y.scopePath === void 0)
|
|
261
|
+
throw new Error(`CodeGen: name "${y}" has no value`);
|
|
262
|
+
return (0, t._)`${l}${y.scopePath}`;
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
scopeCode(l = this._values, m, y) {
|
|
266
|
+
return this._reduceValues(l, (b) => {
|
|
267
|
+
if (b.value === void 0)
|
|
268
|
+
throw new Error(`CodeGen: name "${b}" has no value`);
|
|
269
|
+
return b.value.code;
|
|
270
|
+
}, m, y);
|
|
271
|
+
}
|
|
272
|
+
_reduceValues(l, m, y = {}, b) {
|
|
273
|
+
let E = t.nil;
|
|
274
|
+
for (const g in l) {
|
|
275
|
+
const v = l[g];
|
|
276
|
+
if (!v)
|
|
277
|
+
continue;
|
|
278
|
+
const h = y[g] = y[g] || /* @__PURE__ */ new Map();
|
|
279
|
+
v.forEach((f) => {
|
|
280
|
+
if (h.has(f))
|
|
281
|
+
return;
|
|
282
|
+
h.set(f, s.Started);
|
|
283
|
+
let $ = m(f);
|
|
284
|
+
if ($) {
|
|
285
|
+
const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
286
|
+
E = (0, t._)`${E}${P} ${f} = ${$};${this.opts._n}`;
|
|
287
|
+
} else if ($ = b == null ? void 0 : b(f))
|
|
288
|
+
E = (0, t._)`${E}${$}${this.opts._n}`;
|
|
289
|
+
else
|
|
290
|
+
throw new r(f);
|
|
291
|
+
h.set(f, s.Completed);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return E;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
e.ValueScope = d;
|
|
298
|
+
})(rr);
|
|
299
|
+
(function(e) {
|
|
300
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
|
|
301
|
+
const t = ut, r = rr;
|
|
302
|
+
var s = ut;
|
|
303
|
+
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
304
|
+
return s._;
|
|
305
|
+
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
306
|
+
return s.str;
|
|
307
|
+
} }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() {
|
|
308
|
+
return s.strConcat;
|
|
309
|
+
} }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
|
|
310
|
+
return s.nil;
|
|
311
|
+
} }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() {
|
|
312
|
+
return s.getProperty;
|
|
313
|
+
} }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
|
|
314
|
+
return s.stringify;
|
|
315
|
+
} }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() {
|
|
316
|
+
return s.regexpCode;
|
|
317
|
+
} }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
|
|
318
|
+
return s.Name;
|
|
319
|
+
} });
|
|
320
|
+
var o = rr;
|
|
321
|
+
Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
|
|
322
|
+
return o.Scope;
|
|
323
|
+
} }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
|
|
324
|
+
return o.ValueScope;
|
|
325
|
+
} }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
|
|
326
|
+
return o.ValueScopeName;
|
|
327
|
+
} }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
|
|
328
|
+
return o.varKinds;
|
|
329
|
+
} }), e.operators = {
|
|
330
|
+
GT: new t._Code(">"),
|
|
331
|
+
GTE: new t._Code(">="),
|
|
332
|
+
LT: new t._Code("<"),
|
|
333
|
+
LTE: new t._Code("<="),
|
|
334
|
+
EQ: new t._Code("==="),
|
|
335
|
+
NEQ: new t._Code("!=="),
|
|
336
|
+
NOT: new t._Code("!"),
|
|
337
|
+
OR: new t._Code("||"),
|
|
338
|
+
AND: new t._Code("&&"),
|
|
339
|
+
ADD: new t._Code("+")
|
|
340
|
+
};
|
|
341
|
+
class a {
|
|
342
|
+
optimizeNodes() {
|
|
343
|
+
return this;
|
|
344
|
+
}
|
|
345
|
+
optimizeNames(n, c) {
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
class i extends a {
|
|
350
|
+
constructor(n, c, w) {
|
|
351
|
+
super(), this.varKind = n, this.name = c, this.rhs = w;
|
|
352
|
+
}
|
|
353
|
+
render({ es5: n, _n: c }) {
|
|
354
|
+
const w = n ? r.varKinds.var : this.varKind, j = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
355
|
+
return `${w} ${this.name}${j};` + c;
|
|
356
|
+
}
|
|
357
|
+
optimizeNames(n, c) {
|
|
358
|
+
if (n[this.name.str])
|
|
359
|
+
return this.rhs && (this.rhs = B(this.rhs, n, c)), this;
|
|
360
|
+
}
|
|
361
|
+
get names() {
|
|
362
|
+
return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
class d extends a {
|
|
366
|
+
constructor(n, c, w) {
|
|
367
|
+
super(), this.lhs = n, this.rhs = c, this.sideEffects = w;
|
|
368
|
+
}
|
|
369
|
+
render({ _n: n }) {
|
|
370
|
+
return `${this.lhs} = ${this.rhs};` + n;
|
|
371
|
+
}
|
|
372
|
+
optimizeNames(n, c) {
|
|
373
|
+
if (!(this.lhs instanceof t.Name && !n[this.lhs.str] && !this.sideEffects))
|
|
374
|
+
return this.rhs = B(this.rhs, n, c), this;
|
|
375
|
+
}
|
|
376
|
+
get names() {
|
|
377
|
+
const n = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
|
|
378
|
+
return z(n, this.rhs);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
class u extends d {
|
|
382
|
+
constructor(n, c, w, j) {
|
|
383
|
+
super(n, w, j), this.op = c;
|
|
384
|
+
}
|
|
385
|
+
render({ _n: n }) {
|
|
386
|
+
return `${this.lhs} ${this.op}= ${this.rhs};` + n;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
class l extends a {
|
|
390
|
+
constructor(n) {
|
|
391
|
+
super(), this.label = n, this.names = {};
|
|
392
|
+
}
|
|
393
|
+
render({ _n: n }) {
|
|
394
|
+
return `${this.label}:` + n;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
class m extends a {
|
|
398
|
+
constructor(n) {
|
|
399
|
+
super(), this.label = n, this.names = {};
|
|
400
|
+
}
|
|
401
|
+
render({ _n: n }) {
|
|
402
|
+
return `break${this.label ? ` ${this.label}` : ""};` + n;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
class y extends a {
|
|
406
|
+
constructor(n) {
|
|
407
|
+
super(), this.error = n;
|
|
408
|
+
}
|
|
409
|
+
render({ _n: n }) {
|
|
410
|
+
return `throw ${this.error};` + n;
|
|
411
|
+
}
|
|
412
|
+
get names() {
|
|
413
|
+
return this.error.names;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
class b extends a {
|
|
417
|
+
constructor(n) {
|
|
418
|
+
super(), this.code = n;
|
|
419
|
+
}
|
|
420
|
+
render({ _n: n }) {
|
|
421
|
+
return `${this.code};` + n;
|
|
422
|
+
}
|
|
423
|
+
optimizeNodes() {
|
|
424
|
+
return `${this.code}` ? this : void 0;
|
|
425
|
+
}
|
|
426
|
+
optimizeNames(n, c) {
|
|
427
|
+
return this.code = B(this.code, n, c), this;
|
|
428
|
+
}
|
|
429
|
+
get names() {
|
|
430
|
+
return this.code instanceof t._CodeOrName ? this.code.names : {};
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
class E extends a {
|
|
434
|
+
constructor(n = []) {
|
|
435
|
+
super(), this.nodes = n;
|
|
436
|
+
}
|
|
437
|
+
render(n) {
|
|
438
|
+
return this.nodes.reduce((c, w) => c + w.render(n), "");
|
|
439
|
+
}
|
|
440
|
+
optimizeNodes() {
|
|
441
|
+
const { nodes: n } = this;
|
|
442
|
+
let c = n.length;
|
|
443
|
+
for (; c--; ) {
|
|
444
|
+
const w = n[c].optimizeNodes();
|
|
445
|
+
Array.isArray(w) ? n.splice(c, 1, ...w) : w ? n[c] = w : n.splice(c, 1);
|
|
446
|
+
}
|
|
447
|
+
return n.length > 0 ? this : void 0;
|
|
448
|
+
}
|
|
449
|
+
optimizeNames(n, c) {
|
|
450
|
+
const { nodes: w } = this;
|
|
451
|
+
let j = w.length;
|
|
452
|
+
for (; j--; ) {
|
|
453
|
+
const O = w[j];
|
|
454
|
+
O.optimizeNames(n, c) || (ee(n, O.names), w.splice(j, 1));
|
|
455
|
+
}
|
|
456
|
+
return w.length > 0 ? this : void 0;
|
|
457
|
+
}
|
|
458
|
+
get names() {
|
|
459
|
+
return this.nodes.reduce((n, c) => ie(n, c.names), {});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
class g extends E {
|
|
463
|
+
render(n) {
|
|
464
|
+
return "{" + n._n + super.render(n) + "}" + n._n;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
class v extends E {
|
|
468
|
+
}
|
|
469
|
+
class h extends g {
|
|
470
|
+
}
|
|
471
|
+
h.kind = "else";
|
|
472
|
+
class f extends g {
|
|
473
|
+
constructor(n, c) {
|
|
474
|
+
super(c), this.condition = n;
|
|
475
|
+
}
|
|
476
|
+
render(n) {
|
|
477
|
+
let c = `if(${this.condition})` + super.render(n);
|
|
478
|
+
return this.else && (c += "else " + this.else.render(n)), c;
|
|
479
|
+
}
|
|
480
|
+
optimizeNodes() {
|
|
481
|
+
super.optimizeNodes();
|
|
482
|
+
const n = this.condition;
|
|
483
|
+
if (n === !0)
|
|
484
|
+
return this.nodes;
|
|
485
|
+
let c = this.else;
|
|
486
|
+
if (c) {
|
|
487
|
+
const w = c.optimizeNodes();
|
|
488
|
+
c = this.else = Array.isArray(w) ? new h(w) : w;
|
|
489
|
+
}
|
|
490
|
+
if (c)
|
|
491
|
+
return n === !1 ? c instanceof f ? c : c.nodes : this.nodes.length ? this : new f(Ke(n), c instanceof f ? [c] : c.nodes);
|
|
492
|
+
if (!(n === !1 || !this.nodes.length))
|
|
493
|
+
return this;
|
|
494
|
+
}
|
|
495
|
+
optimizeNames(n, c) {
|
|
496
|
+
var w;
|
|
497
|
+
if (this.else = (w = this.else) === null || w === void 0 ? void 0 : w.optimizeNames(n, c), !!(super.optimizeNames(n, c) || this.else))
|
|
498
|
+
return this.condition = B(this.condition, n, c), this;
|
|
499
|
+
}
|
|
500
|
+
get names() {
|
|
501
|
+
const n = super.names;
|
|
502
|
+
return z(n, this.condition), this.else && ie(n, this.else.names), n;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
f.kind = "if";
|
|
506
|
+
class $ extends g {
|
|
507
|
+
}
|
|
508
|
+
$.kind = "for";
|
|
509
|
+
class P extends $ {
|
|
510
|
+
constructor(n) {
|
|
511
|
+
super(), this.iteration = n;
|
|
512
|
+
}
|
|
513
|
+
render(n) {
|
|
514
|
+
return `for(${this.iteration})` + super.render(n);
|
|
515
|
+
}
|
|
516
|
+
optimizeNames(n, c) {
|
|
517
|
+
if (super.optimizeNames(n, c))
|
|
518
|
+
return this.iteration = B(this.iteration, n, c), this;
|
|
519
|
+
}
|
|
520
|
+
get names() {
|
|
521
|
+
return ie(super.names, this.iteration.names);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
class R extends $ {
|
|
525
|
+
constructor(n, c, w, j) {
|
|
526
|
+
super(), this.varKind = n, this.name = c, this.from = w, this.to = j;
|
|
527
|
+
}
|
|
528
|
+
render(n) {
|
|
529
|
+
const c = n.es5 ? r.varKinds.var : this.varKind, { name: w, from: j, to: O } = this;
|
|
530
|
+
return `for(${c} ${w}=${j}; ${w}<${O}; ${w}++)` + super.render(n);
|
|
531
|
+
}
|
|
532
|
+
get names() {
|
|
533
|
+
const n = z(super.names, this.from);
|
|
534
|
+
return z(n, this.to);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
class C extends $ {
|
|
538
|
+
constructor(n, c, w, j) {
|
|
539
|
+
super(), this.loop = n, this.varKind = c, this.name = w, this.iterable = j;
|
|
540
|
+
}
|
|
541
|
+
render(n) {
|
|
542
|
+
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(n);
|
|
543
|
+
}
|
|
544
|
+
optimizeNames(n, c) {
|
|
545
|
+
if (super.optimizeNames(n, c))
|
|
546
|
+
return this.iterable = B(this.iterable, n, c), this;
|
|
547
|
+
}
|
|
548
|
+
get names() {
|
|
549
|
+
return ie(super.names, this.iterable.names);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
class L extends g {
|
|
553
|
+
constructor(n, c, w) {
|
|
554
|
+
super(), this.name = n, this.args = c, this.async = w;
|
|
555
|
+
}
|
|
556
|
+
render(n) {
|
|
557
|
+
return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(n);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
L.kind = "func";
|
|
561
|
+
class H extends E {
|
|
562
|
+
render(n) {
|
|
563
|
+
return "return " + super.render(n);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
H.kind = "return";
|
|
567
|
+
class oe extends g {
|
|
568
|
+
render(n) {
|
|
569
|
+
let c = "try" + super.render(n);
|
|
570
|
+
return this.catch && (c += this.catch.render(n)), this.finally && (c += this.finally.render(n)), c;
|
|
571
|
+
}
|
|
572
|
+
optimizeNodes() {
|
|
573
|
+
var n, c;
|
|
574
|
+
return super.optimizeNodes(), (n = this.catch) === null || n === void 0 || n.optimizeNodes(), (c = this.finally) === null || c === void 0 || c.optimizeNodes(), this;
|
|
575
|
+
}
|
|
576
|
+
optimizeNames(n, c) {
|
|
577
|
+
var w, j;
|
|
578
|
+
return super.optimizeNames(n, c), (w = this.catch) === null || w === void 0 || w.optimizeNames(n, c), (j = this.finally) === null || j === void 0 || j.optimizeNames(n, c), this;
|
|
579
|
+
}
|
|
580
|
+
get names() {
|
|
581
|
+
const n = super.names;
|
|
582
|
+
return this.catch && ie(n, this.catch.names), this.finally && ie(n, this.finally.names), n;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
class ae extends g {
|
|
586
|
+
constructor(n) {
|
|
587
|
+
super(), this.error = n;
|
|
588
|
+
}
|
|
589
|
+
render(n) {
|
|
590
|
+
return `catch(${this.error})` + super.render(n);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
ae.kind = "catch";
|
|
594
|
+
class me extends g {
|
|
595
|
+
render(n) {
|
|
596
|
+
return "finally" + super.render(n);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
me.kind = "finally";
|
|
600
|
+
class Ee {
|
|
601
|
+
constructor(n, c = {}) {
|
|
602
|
+
this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...c, _n: c.lines ? `
|
|
603
|
+
` : "" }, this._extScope = n, this._scope = new r.Scope({ parent: n }), this._nodes = [new v()];
|
|
604
|
+
}
|
|
605
|
+
toString() {
|
|
606
|
+
return this._root.render(this.opts);
|
|
607
|
+
}
|
|
608
|
+
// returns unique name in the internal scope
|
|
609
|
+
name(n) {
|
|
610
|
+
return this._scope.name(n);
|
|
611
|
+
}
|
|
612
|
+
// reserves unique name in the external scope
|
|
613
|
+
scopeName(n) {
|
|
614
|
+
return this._extScope.name(n);
|
|
615
|
+
}
|
|
616
|
+
// reserves unique name in the external scope and assigns value to it
|
|
617
|
+
scopeValue(n, c) {
|
|
618
|
+
const w = this._extScope.value(n, c);
|
|
619
|
+
return (this._values[w.prefix] || (this._values[w.prefix] = /* @__PURE__ */ new Set())).add(w), w;
|
|
620
|
+
}
|
|
621
|
+
getScopeValue(n, c) {
|
|
622
|
+
return this._extScope.getValue(n, c);
|
|
623
|
+
}
|
|
624
|
+
// return code that assigns values in the external scope to the names that are used internally
|
|
625
|
+
// (same names that were returned by gen.scopeName or gen.scopeValue)
|
|
626
|
+
scopeRefs(n) {
|
|
627
|
+
return this._extScope.scopeRefs(n, this._values);
|
|
628
|
+
}
|
|
629
|
+
scopeCode() {
|
|
630
|
+
return this._extScope.scopeCode(this._values);
|
|
631
|
+
}
|
|
632
|
+
_def(n, c, w, j) {
|
|
633
|
+
const O = this._scope.toName(c);
|
|
634
|
+
return w !== void 0 && j && (this._constants[O.str] = w), this._leafNode(new i(n, O, w)), O;
|
|
635
|
+
}
|
|
636
|
+
// `const` declaration (`var` in es5 mode)
|
|
637
|
+
const(n, c, w) {
|
|
638
|
+
return this._def(r.varKinds.const, n, c, w);
|
|
639
|
+
}
|
|
640
|
+
// `let` declaration with optional assignment (`var` in es5 mode)
|
|
641
|
+
let(n, c, w) {
|
|
642
|
+
return this._def(r.varKinds.let, n, c, w);
|
|
643
|
+
}
|
|
644
|
+
// `var` declaration with optional assignment
|
|
645
|
+
var(n, c, w) {
|
|
646
|
+
return this._def(r.varKinds.var, n, c, w);
|
|
647
|
+
}
|
|
648
|
+
// assignment code
|
|
649
|
+
assign(n, c, w) {
|
|
650
|
+
return this._leafNode(new d(n, c, w));
|
|
651
|
+
}
|
|
652
|
+
// `+=` code
|
|
653
|
+
add(n, c) {
|
|
654
|
+
return this._leafNode(new u(n, e.operators.ADD, c));
|
|
655
|
+
}
|
|
656
|
+
// appends passed SafeExpr to code or executes Block
|
|
657
|
+
code(n) {
|
|
658
|
+
return typeof n == "function" ? n() : n !== t.nil && this._leafNode(new b(n)), this;
|
|
659
|
+
}
|
|
660
|
+
// returns code for object literal for the passed argument list of key-value pairs
|
|
661
|
+
object(...n) {
|
|
662
|
+
const c = ["{"];
|
|
663
|
+
for (const [w, j] of n)
|
|
664
|
+
c.length > 1 && c.push(","), c.push(w), (w !== j || this.opts.es5) && (c.push(":"), (0, t.addCodeArg)(c, j));
|
|
665
|
+
return c.push("}"), new t._Code(c);
|
|
666
|
+
}
|
|
667
|
+
// `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
|
|
668
|
+
if(n, c, w) {
|
|
669
|
+
if (this._blockNode(new f(n)), c && w)
|
|
670
|
+
this.code(c).else().code(w).endIf();
|
|
671
|
+
else if (c)
|
|
672
|
+
this.code(c).endIf();
|
|
673
|
+
else if (w)
|
|
674
|
+
throw new Error('CodeGen: "else" body without "then" body');
|
|
675
|
+
return this;
|
|
676
|
+
}
|
|
677
|
+
// `else if` clause - invalid without `if` or after `else` clauses
|
|
678
|
+
elseIf(n) {
|
|
679
|
+
return this._elseNode(new f(n));
|
|
680
|
+
}
|
|
681
|
+
// `else` clause - only valid after `if` or `else if` clauses
|
|
682
|
+
else() {
|
|
683
|
+
return this._elseNode(new h());
|
|
684
|
+
}
|
|
685
|
+
// end `if` statement (needed if gen.if was used only with condition)
|
|
686
|
+
endIf() {
|
|
687
|
+
return this._endBlockNode(f, h);
|
|
688
|
+
}
|
|
689
|
+
_for(n, c) {
|
|
690
|
+
return this._blockNode(n), c && this.code(c).endFor(), this;
|
|
691
|
+
}
|
|
692
|
+
// a generic `for` clause (or statement if `forBody` is passed)
|
|
693
|
+
for(n, c) {
|
|
694
|
+
return this._for(new P(n), c);
|
|
695
|
+
}
|
|
696
|
+
// `for` statement for a range of values
|
|
697
|
+
forRange(n, c, w, j, O = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
|
|
698
|
+
const A = this._scope.toName(n);
|
|
699
|
+
return this._for(new R(O, A, c, w), () => j(A));
|
|
700
|
+
}
|
|
701
|
+
// `for-of` statement (in es5 mode replace with a normal for loop)
|
|
702
|
+
forOf(n, c, w, j = r.varKinds.const) {
|
|
703
|
+
const O = this._scope.toName(n);
|
|
704
|
+
if (this.opts.es5) {
|
|
705
|
+
const A = c instanceof t.Name ? c : this.var("_arr", c);
|
|
706
|
+
return this.forRange("_i", 0, (0, t._)`${A}.length`, (U) => {
|
|
707
|
+
this.var(O, (0, t._)`${A}[${U}]`), w(O);
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
return this._for(new C("of", j, O, c), () => w(O));
|
|
711
|
+
}
|
|
712
|
+
// `for-in` statement.
|
|
713
|
+
// With option `ownProperties` replaced with a `for-of` loop for object keys
|
|
714
|
+
forIn(n, c, w, j = this.opts.es5 ? r.varKinds.var : r.varKinds.const) {
|
|
715
|
+
if (this.opts.ownProperties)
|
|
716
|
+
return this.forOf(n, (0, t._)`Object.keys(${c})`, w);
|
|
717
|
+
const O = this._scope.toName(n);
|
|
718
|
+
return this._for(new C("in", j, O, c), () => w(O));
|
|
719
|
+
}
|
|
720
|
+
// end `for` loop
|
|
721
|
+
endFor() {
|
|
722
|
+
return this._endBlockNode($);
|
|
723
|
+
}
|
|
724
|
+
// `label` statement
|
|
725
|
+
label(n) {
|
|
726
|
+
return this._leafNode(new l(n));
|
|
727
|
+
}
|
|
728
|
+
// `break` statement
|
|
729
|
+
break(n) {
|
|
730
|
+
return this._leafNode(new m(n));
|
|
731
|
+
}
|
|
732
|
+
// `return` statement
|
|
733
|
+
return(n) {
|
|
734
|
+
const c = new H();
|
|
735
|
+
if (this._blockNode(c), this.code(n), c.nodes.length !== 1)
|
|
736
|
+
throw new Error('CodeGen: "return" should have one node');
|
|
737
|
+
return this._endBlockNode(H);
|
|
738
|
+
}
|
|
739
|
+
// `try` statement
|
|
740
|
+
try(n, c, w) {
|
|
741
|
+
if (!c && !w)
|
|
742
|
+
throw new Error('CodeGen: "try" without "catch" and "finally"');
|
|
743
|
+
const j = new oe();
|
|
744
|
+
if (this._blockNode(j), this.code(n), c) {
|
|
745
|
+
const O = this.name("e");
|
|
746
|
+
this._currNode = j.catch = new ae(O), c(O);
|
|
747
|
+
}
|
|
748
|
+
return w && (this._currNode = j.finally = new me(), this.code(w)), this._endBlockNode(ae, me);
|
|
749
|
+
}
|
|
750
|
+
// `throw` statement
|
|
751
|
+
throw(n) {
|
|
752
|
+
return this._leafNode(new y(n));
|
|
753
|
+
}
|
|
754
|
+
// start self-balancing block
|
|
755
|
+
block(n, c) {
|
|
756
|
+
return this._blockStarts.push(this._nodes.length), n && this.code(n).endBlock(c), this;
|
|
757
|
+
}
|
|
758
|
+
// end the current self-balancing block
|
|
759
|
+
endBlock(n) {
|
|
760
|
+
const c = this._blockStarts.pop();
|
|
761
|
+
if (c === void 0)
|
|
762
|
+
throw new Error("CodeGen: not in self-balancing block");
|
|
763
|
+
const w = this._nodes.length - c;
|
|
764
|
+
if (w < 0 || n !== void 0 && w !== n)
|
|
765
|
+
throw new Error(`CodeGen: wrong number of nodes: ${w} vs ${n} expected`);
|
|
766
|
+
return this._nodes.length = c, this;
|
|
767
|
+
}
|
|
768
|
+
// `function` heading (or definition if funcBody is passed)
|
|
769
|
+
func(n, c = t.nil, w, j) {
|
|
770
|
+
return this._blockNode(new L(n, c, w)), j && this.code(j).endFunc(), this;
|
|
771
|
+
}
|
|
772
|
+
// end function definition
|
|
773
|
+
endFunc() {
|
|
774
|
+
return this._endBlockNode(L);
|
|
775
|
+
}
|
|
776
|
+
optimize(n = 1) {
|
|
777
|
+
for (; n-- > 0; )
|
|
778
|
+
this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
|
|
779
|
+
}
|
|
780
|
+
_leafNode(n) {
|
|
781
|
+
return this._currNode.nodes.push(n), this;
|
|
782
|
+
}
|
|
783
|
+
_blockNode(n) {
|
|
784
|
+
this._currNode.nodes.push(n), this._nodes.push(n);
|
|
785
|
+
}
|
|
786
|
+
_endBlockNode(n, c) {
|
|
787
|
+
const w = this._currNode;
|
|
788
|
+
if (w instanceof n || c && w instanceof c)
|
|
789
|
+
return this._nodes.pop(), this;
|
|
790
|
+
throw new Error(`CodeGen: not in block "${c ? `${n.kind}/${c.kind}` : n.kind}"`);
|
|
791
|
+
}
|
|
792
|
+
_elseNode(n) {
|
|
793
|
+
const c = this._currNode;
|
|
794
|
+
if (!(c instanceof f))
|
|
795
|
+
throw new Error('CodeGen: "else" without "if"');
|
|
796
|
+
return this._currNode = c.else = n, this;
|
|
797
|
+
}
|
|
798
|
+
get _root() {
|
|
799
|
+
return this._nodes[0];
|
|
800
|
+
}
|
|
801
|
+
get _currNode() {
|
|
802
|
+
const n = this._nodes;
|
|
803
|
+
return n[n.length - 1];
|
|
804
|
+
}
|
|
805
|
+
set _currNode(n) {
|
|
806
|
+
const c = this._nodes;
|
|
807
|
+
c[c.length - 1] = n;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
e.CodeGen = Ee;
|
|
811
|
+
function ie(_, n) {
|
|
812
|
+
for (const c in n)
|
|
813
|
+
_[c] = (_[c] || 0) + (n[c] || 0);
|
|
814
|
+
return _;
|
|
815
|
+
}
|
|
816
|
+
function z(_, n) {
|
|
817
|
+
return n instanceof t._CodeOrName ? ie(_, n.names) : _;
|
|
818
|
+
}
|
|
819
|
+
function B(_, n, c) {
|
|
820
|
+
if (_ instanceof t.Name)
|
|
821
|
+
return w(_);
|
|
822
|
+
if (!j(_))
|
|
823
|
+
return _;
|
|
824
|
+
return new t._Code(_._items.reduce((O, A) => (A instanceof t.Name && (A = w(A)), A instanceof t._Code ? O.push(...A._items) : O.push(A), O), []));
|
|
825
|
+
function w(O) {
|
|
826
|
+
const A = c[O.str];
|
|
827
|
+
return A === void 0 || n[O.str] !== 1 ? O : (delete n[O.str], A);
|
|
828
|
+
}
|
|
829
|
+
function j(O) {
|
|
830
|
+
return O instanceof t._Code && O._items.some((A) => A instanceof t.Name && n[A.str] === 1 && c[A.str] !== void 0);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function ee(_, n) {
|
|
834
|
+
for (const c in n)
|
|
835
|
+
_[c] = (_[c] || 0) - (n[c] || 0);
|
|
836
|
+
}
|
|
837
|
+
function Ke(_) {
|
|
838
|
+
return typeof _ == "boolean" || typeof _ == "number" || _ === null ? !_ : (0, t._)`!${S(_)}`;
|
|
839
|
+
}
|
|
840
|
+
e.not = Ke;
|
|
841
|
+
const qe = p(e.operators.AND);
|
|
842
|
+
function $e(..._) {
|
|
843
|
+
return _.reduce(qe);
|
|
844
|
+
}
|
|
845
|
+
e.and = $e;
|
|
846
|
+
const he = p(e.operators.OR);
|
|
847
|
+
function k(..._) {
|
|
848
|
+
return _.reduce(he);
|
|
849
|
+
}
|
|
850
|
+
e.or = k;
|
|
851
|
+
function p(_) {
|
|
852
|
+
return (n, c) => n === t.nil ? c : c === t.nil ? n : (0, t._)`${S(n)} ${_} ${S(c)}`;
|
|
853
|
+
}
|
|
854
|
+
function S(_) {
|
|
855
|
+
return _ instanceof t.Name ? _ : (0, t._)`(${_})`;
|
|
856
|
+
}
|
|
857
|
+
})(q);
|
|
858
|
+
var N = {};
|
|
859
|
+
Object.defineProperty(N, "__esModule", { value: !0 });
|
|
860
|
+
N.checkStrictMode = N.getErrorPath = N.Type = N.useFunc = N.setEvaluated = N.evaluatedPropsToName = N.mergeEvaluated = N.eachItem = N.unescapeJsonPointer = N.escapeJsonPointer = N.escapeFragment = N.unescapeFragment = N.schemaRefOrVal = N.schemaHasRulesButRef = N.schemaHasRules = N.checkUnknownRules = N.alwaysValidSchema = N.toHash = void 0;
|
|
861
|
+
const G = q, bn = ut;
|
|
862
|
+
function En(e) {
|
|
863
|
+
const t = {};
|
|
864
|
+
for (const r of e)
|
|
865
|
+
t[r] = !0;
|
|
866
|
+
return t;
|
|
867
|
+
}
|
|
868
|
+
N.toHash = En;
|
|
869
|
+
function Sn(e, t) {
|
|
870
|
+
return typeof t == "boolean" ? t : Object.keys(t).length === 0 ? !0 : (Fs(e, t), !Ks(t, e.self.RULES.all));
|
|
871
|
+
}
|
|
872
|
+
N.alwaysValidSchema = Sn;
|
|
873
|
+
function Fs(e, t = e.schema) {
|
|
874
|
+
const { opts: r, self: s } = e;
|
|
875
|
+
if (!r.strictSchema || typeof t == "boolean")
|
|
876
|
+
return;
|
|
877
|
+
const o = s.RULES.keywords;
|
|
878
|
+
for (const a in t)
|
|
879
|
+
o[a] || zs(e, `unknown keyword: "${a}"`);
|
|
880
|
+
}
|
|
881
|
+
N.checkUnknownRules = Fs;
|
|
882
|
+
function Ks(e, t) {
|
|
883
|
+
if (typeof e == "boolean")
|
|
884
|
+
return !e;
|
|
885
|
+
for (const r in e)
|
|
886
|
+
if (t[r])
|
|
887
|
+
return !0;
|
|
888
|
+
return !1;
|
|
889
|
+
}
|
|
890
|
+
N.schemaHasRules = Ks;
|
|
891
|
+
function Pn(e, t) {
|
|
892
|
+
if (typeof e == "boolean")
|
|
893
|
+
return !e;
|
|
894
|
+
for (const r in e)
|
|
895
|
+
if (r !== "$ref" && t.all[r])
|
|
896
|
+
return !0;
|
|
897
|
+
return !1;
|
|
898
|
+
}
|
|
899
|
+
N.schemaHasRulesButRef = Pn;
|
|
900
|
+
function kn({ topSchemaRef: e, schemaPath: t }, r, s, o) {
|
|
901
|
+
if (!o) {
|
|
902
|
+
if (typeof r == "number" || typeof r == "boolean")
|
|
903
|
+
return r;
|
|
904
|
+
if (typeof r == "string")
|
|
905
|
+
return (0, G._)`${r}`;
|
|
906
|
+
}
|
|
907
|
+
return (0, G._)`${e}${t}${(0, G.getProperty)(s)}`;
|
|
908
|
+
}
|
|
909
|
+
N.schemaRefOrVal = kn;
|
|
910
|
+
function Nn(e) {
|
|
911
|
+
return qs(decodeURIComponent(e));
|
|
912
|
+
}
|
|
913
|
+
N.unescapeFragment = Nn;
|
|
914
|
+
function Cn(e) {
|
|
915
|
+
return encodeURIComponent(lr(e));
|
|
916
|
+
}
|
|
917
|
+
N.escapeFragment = Cn;
|
|
918
|
+
function lr(e) {
|
|
919
|
+
return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
920
|
+
}
|
|
921
|
+
N.escapeJsonPointer = lr;
|
|
922
|
+
function qs(e) {
|
|
923
|
+
return e.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
924
|
+
}
|
|
925
|
+
N.unescapeJsonPointer = qs;
|
|
926
|
+
function jn(e, t) {
|
|
927
|
+
if (Array.isArray(e))
|
|
928
|
+
for (const r of e)
|
|
929
|
+
t(r);
|
|
930
|
+
else
|
|
931
|
+
t(e);
|
|
932
|
+
}
|
|
933
|
+
N.eachItem = jn;
|
|
934
|
+
function es({ mergeNames: e, mergeToName: t, mergeValues: r, resultToName: s }) {
|
|
935
|
+
return (o, a, i, d) => {
|
|
936
|
+
const u = i === void 0 ? a : i instanceof G.Name ? (a instanceof G.Name ? e(o, a, i) : t(o, a, i), i) : a instanceof G.Name ? (t(o, i, a), a) : r(a, i);
|
|
937
|
+
return d === G.Name && !(u instanceof G.Name) ? s(o, u) : u;
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
N.mergeEvaluated = {
|
|
941
|
+
props: es({
|
|
942
|
+
mergeNames: (e, t, r) => e.if((0, G._)`${r} !== true && ${t} !== undefined`, () => {
|
|
943
|
+
e.if((0, G._)`${t} === true`, () => e.assign(r, !0), () => e.assign(r, (0, G._)`${r} || {}`).code((0, G._)`Object.assign(${r}, ${t})`));
|
|
944
|
+
}),
|
|
945
|
+
mergeToName: (e, t, r) => e.if((0, G._)`${r} !== true`, () => {
|
|
946
|
+
t === !0 ? e.assign(r, !0) : (e.assign(r, (0, G._)`${r} || {}`), dr(e, r, t));
|
|
947
|
+
}),
|
|
948
|
+
mergeValues: (e, t) => e === !0 ? !0 : { ...e, ...t },
|
|
949
|
+
resultToName: Us
|
|
950
|
+
}),
|
|
951
|
+
items: es({
|
|
952
|
+
mergeNames: (e, t, r) => e.if((0, G._)`${r} !== true && ${t} !== undefined`, () => e.assign(r, (0, G._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),
|
|
953
|
+
mergeToName: (e, t, r) => e.if((0, G._)`${r} !== true`, () => e.assign(r, t === !0 ? !0 : (0, G._)`${r} > ${t} ? ${r} : ${t}`)),
|
|
954
|
+
mergeValues: (e, t) => e === !0 ? !0 : Math.max(e, t),
|
|
955
|
+
resultToName: (e, t) => e.var("items", t)
|
|
956
|
+
})
|
|
957
|
+
};
|
|
958
|
+
function Us(e, t) {
|
|
959
|
+
if (t === !0)
|
|
960
|
+
return e.var("props", !0);
|
|
961
|
+
const r = e.var("props", (0, G._)`{}`);
|
|
962
|
+
return t !== void 0 && dr(e, r, t), r;
|
|
963
|
+
}
|
|
964
|
+
N.evaluatedPropsToName = Us;
|
|
965
|
+
function dr(e, t, r) {
|
|
966
|
+
Object.keys(r).forEach((s) => e.assign((0, G._)`${t}${(0, G.getProperty)(s)}`, !0));
|
|
967
|
+
}
|
|
968
|
+
N.setEvaluated = dr;
|
|
969
|
+
const ts = {};
|
|
970
|
+
function Rn(e, t) {
|
|
971
|
+
return e.scopeValue("func", {
|
|
972
|
+
ref: t,
|
|
973
|
+
code: ts[t.code] || (ts[t.code] = new bn._Code(t.code))
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
N.useFunc = Rn;
|
|
977
|
+
var sr;
|
|
978
|
+
(function(e) {
|
|
979
|
+
e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
|
|
980
|
+
})(sr || (N.Type = sr = {}));
|
|
981
|
+
function On(e, t, r) {
|
|
982
|
+
if (e instanceof G.Name) {
|
|
983
|
+
const s = t === sr.Num;
|
|
984
|
+
return r ? s ? (0, G._)`"[" + ${e} + "]"` : (0, G._)`"['" + ${e} + "']"` : s ? (0, G._)`"/" + ${e}` : (0, G._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
985
|
+
}
|
|
986
|
+
return r ? (0, G.getProperty)(e).toString() : "/" + lr(e);
|
|
987
|
+
}
|
|
988
|
+
N.getErrorPath = On;
|
|
989
|
+
function zs(e, t, r = e.opts.strictSchema) {
|
|
990
|
+
if (r) {
|
|
991
|
+
if (t = `strict mode: ${t}`, r === !0)
|
|
992
|
+
throw new Error(t);
|
|
993
|
+
e.self.logger.warn(t);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
N.checkStrictMode = zs;
|
|
997
|
+
var ve = {};
|
|
998
|
+
Object.defineProperty(ve, "__esModule", { value: !0 });
|
|
999
|
+
const D = q, Tn = {
|
|
1000
|
+
// validation function arguments
|
|
1001
|
+
data: new D.Name("data"),
|
|
1002
|
+
// data passed to validation function
|
|
1003
|
+
// args passed from referencing schema
|
|
1004
|
+
valCxt: new D.Name("valCxt"),
|
|
1005
|
+
// validation/data context - should not be used directly, it is destructured to the names below
|
|
1006
|
+
instancePath: new D.Name("instancePath"),
|
|
1007
|
+
parentData: new D.Name("parentData"),
|
|
1008
|
+
parentDataProperty: new D.Name("parentDataProperty"),
|
|
1009
|
+
rootData: new D.Name("rootData"),
|
|
1010
|
+
// root data - same as the data passed to the first/top validation function
|
|
1011
|
+
dynamicAnchors: new D.Name("dynamicAnchors"),
|
|
1012
|
+
// used to support recursiveRef and dynamicRef
|
|
1013
|
+
// function scoped variables
|
|
1014
|
+
vErrors: new D.Name("vErrors"),
|
|
1015
|
+
// null or array of validation errors
|
|
1016
|
+
errors: new D.Name("errors"),
|
|
1017
|
+
// counter of validation errors
|
|
1018
|
+
this: new D.Name("this"),
|
|
1019
|
+
// "globals"
|
|
1020
|
+
self: new D.Name("self"),
|
|
1021
|
+
scope: new D.Name("scope"),
|
|
1022
|
+
// JTD serialize/parse name for JSON string and position
|
|
1023
|
+
json: new D.Name("json"),
|
|
1024
|
+
jsonPos: new D.Name("jsonPos"),
|
|
1025
|
+
jsonLen: new D.Name("jsonLen"),
|
|
1026
|
+
jsonPart: new D.Name("jsonPart")
|
|
1027
|
+
};
|
|
1028
|
+
ve.default = Tn;
|
|
1029
|
+
(function(e) {
|
|
1030
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
|
|
1031
|
+
const t = q, r = N, s = ve;
|
|
1032
|
+
e.keywordError = {
|
|
1033
|
+
message: ({ keyword: h }) => (0, t.str)`must pass "${h}" keyword validation`
|
|
1034
|
+
}, e.keyword$DataError = {
|
|
1035
|
+
message: ({ keyword: h, schemaType: f }) => f ? (0, t.str)`"${h}" keyword must be ${f} ($data)` : (0, t.str)`"${h}" keyword is invalid ($data)`
|
|
1036
|
+
};
|
|
1037
|
+
function o(h, f = e.keywordError, $, P) {
|
|
1038
|
+
const { it: R } = h, { gen: C, compositeRule: L, allErrors: H } = R, oe = y(h, f, $);
|
|
1039
|
+
P ?? (L || H) ? u(C, oe) : l(R, (0, t._)`[${oe}]`);
|
|
1040
|
+
}
|
|
1041
|
+
e.reportError = o;
|
|
1042
|
+
function a(h, f = e.keywordError, $) {
|
|
1043
|
+
const { it: P } = h, { gen: R, compositeRule: C, allErrors: L } = P, H = y(h, f, $);
|
|
1044
|
+
u(R, H), C || L || l(P, s.default.vErrors);
|
|
1045
|
+
}
|
|
1046
|
+
e.reportExtraError = a;
|
|
1047
|
+
function i(h, f) {
|
|
1048
|
+
h.assign(s.default.errors, f), h.if((0, t._)`${s.default.vErrors} !== null`, () => h.if(f, () => h.assign((0, t._)`${s.default.vErrors}.length`, f), () => h.assign(s.default.vErrors, null)));
|
|
1049
|
+
}
|
|
1050
|
+
e.resetErrorsCount = i;
|
|
1051
|
+
function d({ gen: h, keyword: f, schemaValue: $, data: P, errsCount: R, it: C }) {
|
|
1052
|
+
if (R === void 0)
|
|
1053
|
+
throw new Error("ajv implementation error");
|
|
1054
|
+
const L = h.name("err");
|
|
1055
|
+
h.forRange("i", R, s.default.errors, (H) => {
|
|
1056
|
+
h.const(L, (0, t._)`${s.default.vErrors}[${H}]`), h.if((0, t._)`${L}.instancePath === undefined`, () => h.assign((0, t._)`${L}.instancePath`, (0, t.strConcat)(s.default.instancePath, C.errorPath))), h.assign((0, t._)`${L}.schemaPath`, (0, t.str)`${C.errSchemaPath}/${f}`), C.opts.verbose && (h.assign((0, t._)`${L}.schema`, $), h.assign((0, t._)`${L}.data`, P));
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
e.extendErrors = d;
|
|
1060
|
+
function u(h, f) {
|
|
1061
|
+
const $ = h.const("err", f);
|
|
1062
|
+
h.if((0, t._)`${s.default.vErrors} === null`, () => h.assign(s.default.vErrors, (0, t._)`[${$}]`), (0, t._)`${s.default.vErrors}.push(${$})`), h.code((0, t._)`${s.default.errors}++`);
|
|
1063
|
+
}
|
|
1064
|
+
function l(h, f) {
|
|
1065
|
+
const { gen: $, validateName: P, schemaEnv: R } = h;
|
|
1066
|
+
R.$async ? $.throw((0, t._)`new ${h.ValidationError}(${f})`) : ($.assign((0, t._)`${P}.errors`, f), $.return(!1));
|
|
1067
|
+
}
|
|
1068
|
+
const m = {
|
|
1069
|
+
keyword: new t.Name("keyword"),
|
|
1070
|
+
schemaPath: new t.Name("schemaPath"),
|
|
1071
|
+
// also used in JTD errors
|
|
1072
|
+
params: new t.Name("params"),
|
|
1073
|
+
propertyName: new t.Name("propertyName"),
|
|
1074
|
+
message: new t.Name("message"),
|
|
1075
|
+
schema: new t.Name("schema"),
|
|
1076
|
+
parentSchema: new t.Name("parentSchema")
|
|
1077
|
+
};
|
|
1078
|
+
function y(h, f, $) {
|
|
1079
|
+
const { createErrors: P } = h.it;
|
|
1080
|
+
return P === !1 ? (0, t._)`{}` : b(h, f, $);
|
|
1081
|
+
}
|
|
1082
|
+
function b(h, f, $ = {}) {
|
|
1083
|
+
const { gen: P, it: R } = h, C = [
|
|
1084
|
+
E(R, $),
|
|
1085
|
+
g(h, $)
|
|
1086
|
+
];
|
|
1087
|
+
return v(h, f, C), P.object(...C);
|
|
1088
|
+
}
|
|
1089
|
+
function E({ errorPath: h }, { instancePath: f }) {
|
|
1090
|
+
const $ = f ? (0, t.str)`${h}${(0, r.getErrorPath)(f, r.Type.Str)}` : h;
|
|
1091
|
+
return [s.default.instancePath, (0, t.strConcat)(s.default.instancePath, $)];
|
|
1092
|
+
}
|
|
1093
|
+
function g({ keyword: h, it: { errSchemaPath: f } }, { schemaPath: $, parentSchema: P }) {
|
|
1094
|
+
let R = P ? f : (0, t.str)`${f}/${h}`;
|
|
1095
|
+
return $ && (R = (0, t.str)`${R}${(0, r.getErrorPath)($, r.Type.Str)}`), [m.schemaPath, R];
|
|
1096
|
+
}
|
|
1097
|
+
function v(h, { params: f, message: $ }, P) {
|
|
1098
|
+
const { keyword: R, data: C, schemaValue: L, it: H } = h, { opts: oe, propertyName: ae, topSchemaRef: me, schemaPath: Ee } = H;
|
|
1099
|
+
P.push([m.keyword, R], [m.params, typeof f == "function" ? f(h) : f || (0, t._)`{}`]), oe.messages && P.push([m.message, typeof $ == "function" ? $(h) : $]), oe.verbose && P.push([m.schema, L], [m.parentSchema, (0, t._)`${me}${Ee}`], [s.default.data, C]), ae && P.push([m.propertyName, ae]);
|
|
1100
|
+
}
|
|
1101
|
+
})(mt);
|
|
1102
|
+
Object.defineProperty(Qe, "__esModule", { value: !0 });
|
|
1103
|
+
Qe.boolOrEmptySchema = Qe.topBoolOrEmptySchema = void 0;
|
|
1104
|
+
const In = mt, Mn = q, Vn = ve, Fn = {
|
|
1105
|
+
message: "boolean schema is false"
|
|
1106
|
+
};
|
|
1107
|
+
function Kn(e) {
|
|
1108
|
+
const { gen: t, schema: r, validateName: s } = e;
|
|
1109
|
+
r === !1 ? As(e, !1) : typeof r == "object" && r.$async === !0 ? t.return(Vn.default.data) : (t.assign((0, Mn._)`${s}.errors`, null), t.return(!0));
|
|
1110
|
+
}
|
|
1111
|
+
Qe.topBoolOrEmptySchema = Kn;
|
|
1112
|
+
function qn(e, t) {
|
|
1113
|
+
const { gen: r, schema: s } = e;
|
|
1114
|
+
s === !1 ? (r.var(t, !1), As(e)) : r.var(t, !0);
|
|
1115
|
+
}
|
|
1116
|
+
Qe.boolOrEmptySchema = qn;
|
|
1117
|
+
function As(e, t) {
|
|
1118
|
+
const { gen: r, data: s } = e, o = {
|
|
1119
|
+
gen: r,
|
|
1120
|
+
keyword: "false schema",
|
|
1121
|
+
data: s,
|
|
1122
|
+
schema: !1,
|
|
1123
|
+
schemaCode: !1,
|
|
1124
|
+
schemaValue: !1,
|
|
1125
|
+
params: {},
|
|
1126
|
+
it: e
|
|
1127
|
+
};
|
|
1128
|
+
(0, In.reportError)(o, Fn, void 0, t);
|
|
1129
|
+
}
|
|
1130
|
+
var X = {}, Ve = {};
|
|
1131
|
+
Object.defineProperty(Ve, "__esModule", { value: !0 });
|
|
1132
|
+
Ve.getRules = Ve.isJSONType = void 0;
|
|
1133
|
+
const Un = ["string", "number", "integer", "boolean", "null", "object", "array"], zn = new Set(Un);
|
|
1134
|
+
function An(e) {
|
|
1135
|
+
return typeof e == "string" && zn.has(e);
|
|
1136
|
+
}
|
|
1137
|
+
Ve.isJSONType = An;
|
|
1138
|
+
function Ln() {
|
|
1139
|
+
const e = {
|
|
1140
|
+
number: { type: "number", rules: [] },
|
|
1141
|
+
string: { type: "string", rules: [] },
|
|
1142
|
+
array: { type: "array", rules: [] },
|
|
1143
|
+
object: { type: "object", rules: [] }
|
|
1144
|
+
};
|
|
1145
|
+
return {
|
|
1146
|
+
types: { ...e, integer: !0, boolean: !0, null: !0 },
|
|
1147
|
+
rules: [{ rules: [] }, e.number, e.string, e.array, e.object],
|
|
1148
|
+
post: { rules: [] },
|
|
1149
|
+
all: {},
|
|
1150
|
+
keywords: {}
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
Ve.getRules = Ln;
|
|
1154
|
+
var we = {};
|
|
1155
|
+
Object.defineProperty(we, "__esModule", { value: !0 });
|
|
1156
|
+
we.shouldUseRule = we.shouldUseGroup = we.schemaHasRulesForType = void 0;
|
|
1157
|
+
function Gn({ schema: e, self: t }, r) {
|
|
1158
|
+
const s = t.RULES.types[r];
|
|
1159
|
+
return s && s !== !0 && Ls(e, s);
|
|
1160
|
+
}
|
|
1161
|
+
we.schemaHasRulesForType = Gn;
|
|
1162
|
+
function Ls(e, t) {
|
|
1163
|
+
return t.rules.some((r) => Gs(e, r));
|
|
1164
|
+
}
|
|
1165
|
+
we.shouldUseGroup = Ls;
|
|
1166
|
+
function Gs(e, t) {
|
|
1167
|
+
var r;
|
|
1168
|
+
return e[t.keyword] !== void 0 || ((r = t.definition.implements) === null || r === void 0 ? void 0 : r.some((s) => e[s] !== void 0));
|
|
1169
|
+
}
|
|
1170
|
+
we.shouldUseRule = Gs;
|
|
1171
|
+
Object.defineProperty(X, "__esModule", { value: !0 });
|
|
1172
|
+
X.reportTypeError = X.checkDataTypes = X.checkDataType = X.coerceAndCheckDataType = X.getJSONTypes = X.getSchemaTypes = X.DataType = void 0;
|
|
1173
|
+
const Jn = Ve, Hn = we, Bn = mt, F = q, Js = N;
|
|
1174
|
+
var He;
|
|
1175
|
+
(function(e) {
|
|
1176
|
+
e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
|
|
1177
|
+
})(He || (X.DataType = He = {}));
|
|
1178
|
+
function Qn(e) {
|
|
1179
|
+
const t = Hs(e.type);
|
|
1180
|
+
if (t.includes("null")) {
|
|
1181
|
+
if (e.nullable === !1)
|
|
1182
|
+
throw new Error("type: null contradicts nullable: false");
|
|
1183
|
+
} else {
|
|
1184
|
+
if (!t.length && e.nullable !== void 0)
|
|
1185
|
+
throw new Error('"nullable" cannot be used without "type"');
|
|
1186
|
+
e.nullable === !0 && t.push("null");
|
|
1187
|
+
}
|
|
1188
|
+
return t;
|
|
1189
|
+
}
|
|
1190
|
+
X.getSchemaTypes = Qn;
|
|
1191
|
+
function Hs(e) {
|
|
1192
|
+
const t = Array.isArray(e) ? e : e ? [e] : [];
|
|
1193
|
+
if (t.every(Jn.isJSONType))
|
|
1194
|
+
return t;
|
|
1195
|
+
throw new Error("type must be JSONType or JSONType[]: " + t.join(","));
|
|
1196
|
+
}
|
|
1197
|
+
X.getJSONTypes = Hs;
|
|
1198
|
+
function Xn(e, t) {
|
|
1199
|
+
const { gen: r, data: s, opts: o } = e, a = Yn(t, o.coerceTypes), i = t.length > 0 && !(a.length === 0 && t.length === 1 && (0, Hn.schemaHasRulesForType)(e, t[0]));
|
|
1200
|
+
if (i) {
|
|
1201
|
+
const d = ur(t, s, o.strictNumbers, He.Wrong);
|
|
1202
|
+
r.if(d, () => {
|
|
1203
|
+
a.length ? Zn(e, t, a) : fr(e);
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
return i;
|
|
1207
|
+
}
|
|
1208
|
+
X.coerceAndCheckDataType = Xn;
|
|
1209
|
+
const Bs = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
1210
|
+
function Yn(e, t) {
|
|
1211
|
+
return t ? e.filter((r) => Bs.has(r) || t === "array" && r === "array") : [];
|
|
1212
|
+
}
|
|
1213
|
+
function Zn(e, t, r) {
|
|
1214
|
+
const { gen: s, data: o, opts: a } = e, i = s.let("dataType", (0, F._)`typeof ${o}`), d = s.let("coerced", (0, F._)`undefined`);
|
|
1215
|
+
a.coerceTypes === "array" && s.if((0, F._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`, () => s.assign(o, (0, F._)`${o}[0]`).assign(i, (0, F._)`typeof ${o}`).if(ur(t, o, a.strictNumbers), () => s.assign(d, o))), s.if((0, F._)`${d} !== undefined`);
|
|
1216
|
+
for (const l of r)
|
|
1217
|
+
(Bs.has(l) || l === "array" && a.coerceTypes === "array") && u(l);
|
|
1218
|
+
s.else(), fr(e), s.endIf(), s.if((0, F._)`${d} !== undefined`, () => {
|
|
1219
|
+
s.assign(o, d), Dn(e, d);
|
|
1220
|
+
});
|
|
1221
|
+
function u(l) {
|
|
1222
|
+
switch (l) {
|
|
1223
|
+
case "string":
|
|
1224
|
+
s.elseIf((0, F._)`${i} == "number" || ${i} == "boolean"`).assign(d, (0, F._)`"" + ${o}`).elseIf((0, F._)`${o} === null`).assign(d, (0, F._)`""`);
|
|
1225
|
+
return;
|
|
1226
|
+
case "number":
|
|
1227
|
+
s.elseIf((0, F._)`${i} == "boolean" || ${o} === null
|
|
1228
|
+
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(d, (0, F._)`+${o}`);
|
|
1229
|
+
return;
|
|
1230
|
+
case "integer":
|
|
1231
|
+
s.elseIf((0, F._)`${i} === "boolean" || ${o} === null
|
|
1232
|
+
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(d, (0, F._)`+${o}`);
|
|
1233
|
+
return;
|
|
1234
|
+
case "boolean":
|
|
1235
|
+
s.elseIf((0, F._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(d, !1).elseIf((0, F._)`${o} === "true" || ${o} === 1`).assign(d, !0);
|
|
1236
|
+
return;
|
|
1237
|
+
case "null":
|
|
1238
|
+
s.elseIf((0, F._)`${o} === "" || ${o} === 0 || ${o} === false`), s.assign(d, null);
|
|
1239
|
+
return;
|
|
1240
|
+
case "array":
|
|
1241
|
+
s.elseIf((0, F._)`${i} === "string" || ${i} === "number"
|
|
1242
|
+
|| ${i} === "boolean" || ${o} === null`).assign(d, (0, F._)`[${o}]`);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
function Dn({ gen: e, parentData: t, parentDataProperty: r }, s) {
|
|
1247
|
+
e.if((0, F._)`${t} !== undefined`, () => e.assign((0, F._)`${t}[${r}]`, s));
|
|
1248
|
+
}
|
|
1249
|
+
function or(e, t, r, s = He.Correct) {
|
|
1250
|
+
const o = s === He.Correct ? F.operators.EQ : F.operators.NEQ;
|
|
1251
|
+
let a;
|
|
1252
|
+
switch (e) {
|
|
1253
|
+
case "null":
|
|
1254
|
+
return (0, F._)`${t} ${o} null`;
|
|
1255
|
+
case "array":
|
|
1256
|
+
a = (0, F._)`Array.isArray(${t})`;
|
|
1257
|
+
break;
|
|
1258
|
+
case "object":
|
|
1259
|
+
a = (0, F._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
|
|
1260
|
+
break;
|
|
1261
|
+
case "integer":
|
|
1262
|
+
a = i((0, F._)`!(${t} % 1) && !isNaN(${t})`);
|
|
1263
|
+
break;
|
|
1264
|
+
case "number":
|
|
1265
|
+
a = i();
|
|
1266
|
+
break;
|
|
1267
|
+
default:
|
|
1268
|
+
return (0, F._)`typeof ${t} ${o} ${e}`;
|
|
1269
|
+
}
|
|
1270
|
+
return s === He.Correct ? a : (0, F.not)(a);
|
|
1271
|
+
function i(d = F.nil) {
|
|
1272
|
+
return (0, F.and)((0, F._)`typeof ${t} == "number"`, d, r ? (0, F._)`isFinite(${t})` : F.nil);
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
X.checkDataType = or;
|
|
1276
|
+
function ur(e, t, r, s) {
|
|
1277
|
+
if (e.length === 1)
|
|
1278
|
+
return or(e[0], t, r, s);
|
|
1279
|
+
let o;
|
|
1280
|
+
const a = (0, Js.toHash)(e);
|
|
1281
|
+
if (a.array && a.object) {
|
|
1282
|
+
const i = (0, F._)`typeof ${t} != "object"`;
|
|
1283
|
+
o = a.null ? i : (0, F._)`!${t} || ${i}`, delete a.null, delete a.array, delete a.object;
|
|
1284
|
+
} else
|
|
1285
|
+
o = F.nil;
|
|
1286
|
+
a.number && delete a.integer;
|
|
1287
|
+
for (const i in a)
|
|
1288
|
+
o = (0, F.and)(o, or(i, t, r, s));
|
|
1289
|
+
return o;
|
|
1290
|
+
}
|
|
1291
|
+
X.checkDataTypes = ur;
|
|
1292
|
+
const Wn = {
|
|
1293
|
+
message: ({ schema: e }) => `must be ${e}`,
|
|
1294
|
+
params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, F._)`{type: ${e}}` : (0, F._)`{type: ${t}}`
|
|
1295
|
+
};
|
|
1296
|
+
function fr(e) {
|
|
1297
|
+
const t = xn(e);
|
|
1298
|
+
(0, Bn.reportError)(t, Wn);
|
|
1299
|
+
}
|
|
1300
|
+
X.reportTypeError = fr;
|
|
1301
|
+
function xn(e) {
|
|
1302
|
+
const { gen: t, data: r, schema: s } = e, o = (0, Js.schemaRefOrVal)(e, s, "type");
|
|
1303
|
+
return {
|
|
1304
|
+
gen: t,
|
|
1305
|
+
keyword: "type",
|
|
1306
|
+
data: r,
|
|
1307
|
+
schema: s.type,
|
|
1308
|
+
schemaCode: o,
|
|
1309
|
+
schemaValue: o,
|
|
1310
|
+
parentSchema: s,
|
|
1311
|
+
params: {},
|
|
1312
|
+
it: e
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
var Rt = {};
|
|
1316
|
+
Object.defineProperty(Rt, "__esModule", { value: !0 });
|
|
1317
|
+
Rt.assignDefaults = void 0;
|
|
1318
|
+
const Ae = q, ea = N;
|
|
1319
|
+
function ta(e, t) {
|
|
1320
|
+
const { properties: r, items: s } = e.schema;
|
|
1321
|
+
if (t === "object" && r)
|
|
1322
|
+
for (const o in r)
|
|
1323
|
+
rs(e, o, r[o].default);
|
|
1324
|
+
else t === "array" && Array.isArray(s) && s.forEach((o, a) => rs(e, a, o.default));
|
|
1325
|
+
}
|
|
1326
|
+
Rt.assignDefaults = ta;
|
|
1327
|
+
function rs(e, t, r) {
|
|
1328
|
+
const { gen: s, compositeRule: o, data: a, opts: i } = e;
|
|
1329
|
+
if (r === void 0)
|
|
1330
|
+
return;
|
|
1331
|
+
const d = (0, Ae._)`${a}${(0, Ae.getProperty)(t)}`;
|
|
1332
|
+
if (o) {
|
|
1333
|
+
(0, ea.checkStrictMode)(e, `default is ignored for: ${d}`);
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
let u = (0, Ae._)`${d} === undefined`;
|
|
1337
|
+
i.useDefaults === "empty" && (u = (0, Ae._)`${u} || ${d} === null || ${d} === ""`), s.if(u, (0, Ae._)`${d} = ${(0, Ae.stringify)(r)}`);
|
|
1338
|
+
}
|
|
1339
|
+
var _e = {}, K = {};
|
|
1340
|
+
Object.defineProperty(K, "__esModule", { value: !0 });
|
|
1341
|
+
K.validateUnion = K.validateArray = K.usePattern = K.callValidateCode = K.schemaProperties = K.allSchemaProperties = K.noPropertyInData = K.propertyInData = K.isOwnProperty = K.hasPropFunc = K.reportMissingProp = K.checkMissingProp = K.checkReportMissingProp = void 0;
|
|
1342
|
+
const J = q, mr = N, Se = ve, ra = N;
|
|
1343
|
+
function sa(e, t) {
|
|
1344
|
+
const { gen: r, data: s, it: o } = e;
|
|
1345
|
+
r.if(pr(r, s, t, o.opts.ownProperties), () => {
|
|
1346
|
+
e.setParams({ missingProperty: (0, J._)`${t}` }, !0), e.error();
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
K.checkReportMissingProp = sa;
|
|
1350
|
+
function oa({ gen: e, data: t, it: { opts: r } }, s, o) {
|
|
1351
|
+
return (0, J.or)(...s.map((a) => (0, J.and)(pr(e, t, a, r.ownProperties), (0, J._)`${o} = ${a}`)));
|
|
1352
|
+
}
|
|
1353
|
+
K.checkMissingProp = oa;
|
|
1354
|
+
function na(e, t) {
|
|
1355
|
+
e.setParams({ missingProperty: t }, !0), e.error();
|
|
1356
|
+
}
|
|
1357
|
+
K.reportMissingProp = na;
|
|
1358
|
+
function Qs(e) {
|
|
1359
|
+
return e.scopeValue("func", {
|
|
1360
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
1361
|
+
ref: Object.prototype.hasOwnProperty,
|
|
1362
|
+
code: (0, J._)`Object.prototype.hasOwnProperty`
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
K.hasPropFunc = Qs;
|
|
1366
|
+
function hr(e, t, r) {
|
|
1367
|
+
return (0, J._)`${Qs(e)}.call(${t}, ${r})`;
|
|
1368
|
+
}
|
|
1369
|
+
K.isOwnProperty = hr;
|
|
1370
|
+
function aa(e, t, r, s) {
|
|
1371
|
+
const o = (0, J._)`${t}${(0, J.getProperty)(r)} !== undefined`;
|
|
1372
|
+
return s ? (0, J._)`${o} && ${hr(e, t, r)}` : o;
|
|
1373
|
+
}
|
|
1374
|
+
K.propertyInData = aa;
|
|
1375
|
+
function pr(e, t, r, s) {
|
|
1376
|
+
const o = (0, J._)`${t}${(0, J.getProperty)(r)} === undefined`;
|
|
1377
|
+
return s ? (0, J.or)(o, (0, J.not)(hr(e, t, r))) : o;
|
|
1378
|
+
}
|
|
1379
|
+
K.noPropertyInData = pr;
|
|
1380
|
+
function Xs(e) {
|
|
1381
|
+
return e ? Object.keys(e).filter((t) => t !== "__proto__") : [];
|
|
1382
|
+
}
|
|
1383
|
+
K.allSchemaProperties = Xs;
|
|
1384
|
+
function ia(e, t) {
|
|
1385
|
+
return Xs(t).filter((r) => !(0, mr.alwaysValidSchema)(e, t[r]));
|
|
1386
|
+
}
|
|
1387
|
+
K.schemaProperties = ia;
|
|
1388
|
+
function ca({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: s, schemaPath: o, errorPath: a }, it: i }, d, u, l) {
|
|
1389
|
+
const m = l ? (0, J._)`${e}, ${t}, ${s}${o}` : t, y = [
|
|
1390
|
+
[Se.default.instancePath, (0, J.strConcat)(Se.default.instancePath, a)],
|
|
1391
|
+
[Se.default.parentData, i.parentData],
|
|
1392
|
+
[Se.default.parentDataProperty, i.parentDataProperty],
|
|
1393
|
+
[Se.default.rootData, Se.default.rootData]
|
|
1394
|
+
];
|
|
1395
|
+
i.opts.dynamicRef && y.push([Se.default.dynamicAnchors, Se.default.dynamicAnchors]);
|
|
1396
|
+
const b = (0, J._)`${m}, ${r.object(...y)}`;
|
|
1397
|
+
return u !== J.nil ? (0, J._)`${d}.call(${u}, ${b})` : (0, J._)`${d}(${b})`;
|
|
1398
|
+
}
|
|
1399
|
+
K.callValidateCode = ca;
|
|
1400
|
+
const la = (0, J._)`new RegExp`;
|
|
1401
|
+
function da({ gen: e, it: { opts: t } }, r) {
|
|
1402
|
+
const s = t.unicodeRegExp ? "u" : "", { regExp: o } = t.code, a = o(r, s);
|
|
1403
|
+
return e.scopeValue("pattern", {
|
|
1404
|
+
key: a.toString(),
|
|
1405
|
+
ref: a,
|
|
1406
|
+
code: (0, J._)`${o.code === "new RegExp" ? la : (0, ra.useFunc)(e, o)}(${r}, ${s})`
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
K.usePattern = da;
|
|
1410
|
+
function ua(e) {
|
|
1411
|
+
const { gen: t, data: r, keyword: s, it: o } = e, a = t.name("valid");
|
|
1412
|
+
if (o.allErrors) {
|
|
1413
|
+
const d = t.let("valid", !0);
|
|
1414
|
+
return i(() => t.assign(d, !1)), d;
|
|
1415
|
+
}
|
|
1416
|
+
return t.var(a, !0), i(() => t.break()), a;
|
|
1417
|
+
function i(d) {
|
|
1418
|
+
const u = t.const("len", (0, J._)`${r}.length`);
|
|
1419
|
+
t.forRange("i", 0, u, (l) => {
|
|
1420
|
+
e.subschema({
|
|
1421
|
+
keyword: s,
|
|
1422
|
+
dataProp: l,
|
|
1423
|
+
dataPropType: mr.Type.Num
|
|
1424
|
+
}, a), t.if((0, J.not)(a), d);
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
K.validateArray = ua;
|
|
1429
|
+
function fa(e) {
|
|
1430
|
+
const { gen: t, schema: r, keyword: s, it: o } = e;
|
|
1431
|
+
if (!Array.isArray(r))
|
|
1432
|
+
throw new Error("ajv implementation error");
|
|
1433
|
+
if (r.some((u) => (0, mr.alwaysValidSchema)(o, u)) && !o.opts.unevaluated)
|
|
1434
|
+
return;
|
|
1435
|
+
const i = t.let("valid", !1), d = t.name("_valid");
|
|
1436
|
+
t.block(() => r.forEach((u, l) => {
|
|
1437
|
+
const m = e.subschema({
|
|
1438
|
+
keyword: s,
|
|
1439
|
+
schemaProp: l,
|
|
1440
|
+
compositeRule: !0
|
|
1441
|
+
}, d);
|
|
1442
|
+
t.assign(i, (0, J._)`${i} || ${d}`), e.mergeValidEvaluated(m, d) || t.if((0, J.not)(i));
|
|
1443
|
+
})), e.result(i, () => e.reset(), () => e.error(!0));
|
|
1444
|
+
}
|
|
1445
|
+
K.validateUnion = fa;
|
|
1446
|
+
Object.defineProperty(_e, "__esModule", { value: !0 });
|
|
1447
|
+
_e.validateKeywordUsage = _e.validSchemaType = _e.funcKeywordCode = _e.macroKeywordCode = void 0;
|
|
1448
|
+
const x = q, Te = ve, ma = K, ha = mt;
|
|
1449
|
+
function pa(e, t) {
|
|
1450
|
+
const { gen: r, keyword: s, schema: o, parentSchema: a, it: i } = e, d = t.macro.call(i.self, o, a, i), u = Ys(r, s, d);
|
|
1451
|
+
i.opts.validateSchema !== !1 && i.self.validateSchema(d, !0);
|
|
1452
|
+
const l = r.name("valid");
|
|
1453
|
+
e.subschema({
|
|
1454
|
+
schema: d,
|
|
1455
|
+
schemaPath: x.nil,
|
|
1456
|
+
errSchemaPath: `${i.errSchemaPath}/${s}`,
|
|
1457
|
+
topSchemaRef: u,
|
|
1458
|
+
compositeRule: !0
|
|
1459
|
+
}, l), e.pass(l, () => e.error(!0));
|
|
1460
|
+
}
|
|
1461
|
+
_e.macroKeywordCode = pa;
|
|
1462
|
+
function ya(e, t) {
|
|
1463
|
+
var r;
|
|
1464
|
+
const { gen: s, keyword: o, schema: a, parentSchema: i, $data: d, it: u } = e;
|
|
1465
|
+
va(u, t);
|
|
1466
|
+
const l = !d && t.compile ? t.compile.call(u.self, a, i, u) : t.validate, m = Ys(s, o, l), y = s.let("valid");
|
|
1467
|
+
e.block$data(y, b), e.ok((r = t.valid) !== null && r !== void 0 ? r : y);
|
|
1468
|
+
function b() {
|
|
1469
|
+
if (t.errors === !1)
|
|
1470
|
+
v(), t.modifying && ss(e), h(() => e.error());
|
|
1471
|
+
else {
|
|
1472
|
+
const f = t.async ? E() : g();
|
|
1473
|
+
t.modifying && ss(e), h(() => _a(e, f));
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
function E() {
|
|
1477
|
+
const f = s.let("ruleErrs", null);
|
|
1478
|
+
return s.try(() => v((0, x._)`await `), ($) => s.assign(y, !1).if((0, x._)`${$} instanceof ${u.ValidationError}`, () => s.assign(f, (0, x._)`${$}.errors`), () => s.throw($))), f;
|
|
1479
|
+
}
|
|
1480
|
+
function g() {
|
|
1481
|
+
const f = (0, x._)`${m}.errors`;
|
|
1482
|
+
return s.assign(f, null), v(x.nil), f;
|
|
1483
|
+
}
|
|
1484
|
+
function v(f = t.async ? (0, x._)`await ` : x.nil) {
|
|
1485
|
+
const $ = u.opts.passContext ? Te.default.this : Te.default.self, P = !("compile" in t && !d || t.schema === !1);
|
|
1486
|
+
s.assign(y, (0, x._)`${f}${(0, ma.callValidateCode)(e, m, $, P)}`, t.modifying);
|
|
1487
|
+
}
|
|
1488
|
+
function h(f) {
|
|
1489
|
+
var $;
|
|
1490
|
+
s.if((0, x.not)(($ = t.valid) !== null && $ !== void 0 ? $ : y), f);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
_e.funcKeywordCode = ya;
|
|
1494
|
+
function ss(e) {
|
|
1495
|
+
const { gen: t, data: r, it: s } = e;
|
|
1496
|
+
t.if(s.parentData, () => t.assign(r, (0, x._)`${s.parentData}[${s.parentDataProperty}]`));
|
|
1497
|
+
}
|
|
1498
|
+
function _a(e, t) {
|
|
1499
|
+
const { gen: r } = e;
|
|
1500
|
+
r.if((0, x._)`Array.isArray(${t})`, () => {
|
|
1501
|
+
r.assign(Te.default.vErrors, (0, x._)`${Te.default.vErrors} === null ? ${t} : ${Te.default.vErrors}.concat(${t})`).assign(Te.default.errors, (0, x._)`${Te.default.vErrors}.length`), (0, ha.extendErrors)(e);
|
|
1502
|
+
}, () => e.error());
|
|
1503
|
+
}
|
|
1504
|
+
function va({ schemaEnv: e }, t) {
|
|
1505
|
+
if (t.async && !e.$async)
|
|
1506
|
+
throw new Error("async keyword in sync schema");
|
|
1507
|
+
}
|
|
1508
|
+
function Ys(e, t, r) {
|
|
1509
|
+
if (r === void 0)
|
|
1510
|
+
throw new Error(`keyword "${t}" failed to compile`);
|
|
1511
|
+
return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, x.stringify)(r) });
|
|
1512
|
+
}
|
|
1513
|
+
function $a(e, t, r = !1) {
|
|
1514
|
+
return !t.length || t.some((s) => s === "array" ? Array.isArray(e) : s === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == s || r && typeof e > "u");
|
|
1515
|
+
}
|
|
1516
|
+
_e.validSchemaType = $a;
|
|
1517
|
+
function ga({ schema: e, opts: t, self: r, errSchemaPath: s }, o, a) {
|
|
1518
|
+
if (Array.isArray(o.keyword) ? !o.keyword.includes(a) : o.keyword !== a)
|
|
1519
|
+
throw new Error("ajv implementation error");
|
|
1520
|
+
const i = o.dependencies;
|
|
1521
|
+
if (i != null && i.some((d) => !Object.prototype.hasOwnProperty.call(e, d)))
|
|
1522
|
+
throw new Error(`parent schema must have dependencies of ${a}: ${i.join(",")}`);
|
|
1523
|
+
if (o.validateSchema && !o.validateSchema(e[a])) {
|
|
1524
|
+
const u = `keyword "${a}" value is invalid at path "${s}": ` + r.errorsText(o.validateSchema.errors);
|
|
1525
|
+
if (t.validateSchema === "log")
|
|
1526
|
+
r.logger.error(u);
|
|
1527
|
+
else
|
|
1528
|
+
throw new Error(u);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
_e.validateKeywordUsage = ga;
|
|
1532
|
+
var Ce = {};
|
|
1533
|
+
Object.defineProperty(Ce, "__esModule", { value: !0 });
|
|
1534
|
+
Ce.extendSubschemaMode = Ce.extendSubschemaData = Ce.getSubschema = void 0;
|
|
1535
|
+
const ye = q, Zs = N;
|
|
1536
|
+
function wa(e, { keyword: t, schemaProp: r, schema: s, schemaPath: o, errSchemaPath: a, topSchemaRef: i }) {
|
|
1537
|
+
if (t !== void 0 && s !== void 0)
|
|
1538
|
+
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
1539
|
+
if (t !== void 0) {
|
|
1540
|
+
const d = e.schema[t];
|
|
1541
|
+
return r === void 0 ? {
|
|
1542
|
+
schema: d,
|
|
1543
|
+
schemaPath: (0, ye._)`${e.schemaPath}${(0, ye.getProperty)(t)}`,
|
|
1544
|
+
errSchemaPath: `${e.errSchemaPath}/${t}`
|
|
1545
|
+
} : {
|
|
1546
|
+
schema: d[r],
|
|
1547
|
+
schemaPath: (0, ye._)`${e.schemaPath}${(0, ye.getProperty)(t)}${(0, ye.getProperty)(r)}`,
|
|
1548
|
+
errSchemaPath: `${e.errSchemaPath}/${t}/${(0, Zs.escapeFragment)(r)}`
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
if (s !== void 0) {
|
|
1552
|
+
if (o === void 0 || a === void 0 || i === void 0)
|
|
1553
|
+
throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
|
|
1554
|
+
return {
|
|
1555
|
+
schema: s,
|
|
1556
|
+
schemaPath: o,
|
|
1557
|
+
topSchemaRef: i,
|
|
1558
|
+
errSchemaPath: a
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
throw new Error('either "keyword" or "schema" must be passed');
|
|
1562
|
+
}
|
|
1563
|
+
Ce.getSubschema = wa;
|
|
1564
|
+
function ba(e, t, { dataProp: r, dataPropType: s, data: o, dataTypes: a, propertyName: i }) {
|
|
1565
|
+
if (o !== void 0 && r !== void 0)
|
|
1566
|
+
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
1567
|
+
const { gen: d } = t;
|
|
1568
|
+
if (r !== void 0) {
|
|
1569
|
+
const { errorPath: l, dataPathArr: m, opts: y } = t, b = d.let("data", (0, ye._)`${t.data}${(0, ye.getProperty)(r)}`, !0);
|
|
1570
|
+
u(b), e.errorPath = (0, ye.str)`${l}${(0, Zs.getErrorPath)(r, s, y.jsPropertySyntax)}`, e.parentDataProperty = (0, ye._)`${r}`, e.dataPathArr = [...m, e.parentDataProperty];
|
|
1571
|
+
}
|
|
1572
|
+
if (o !== void 0) {
|
|
1573
|
+
const l = o instanceof ye.Name ? o : d.let("data", o, !0);
|
|
1574
|
+
u(l), i !== void 0 && (e.propertyName = i);
|
|
1575
|
+
}
|
|
1576
|
+
a && (e.dataTypes = a);
|
|
1577
|
+
function u(l) {
|
|
1578
|
+
e.data = l, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = /* @__PURE__ */ new Set(), e.parentData = t.data, e.dataNames = [...t.dataNames, l];
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
Ce.extendSubschemaData = ba;
|
|
1582
|
+
function Ea(e, { jtdDiscriminator: t, jtdMetadata: r, compositeRule: s, createErrors: o, allErrors: a }) {
|
|
1583
|
+
s !== void 0 && (e.compositeRule = s), o !== void 0 && (e.createErrors = o), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = r;
|
|
1584
|
+
}
|
|
1585
|
+
Ce.extendSubschemaMode = Ea;
|
|
1586
|
+
var Z = {};
|
|
1587
|
+
Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
1588
|
+
Z.getSchemaRefs = Z.resolveUrl = Z.normalizeId = Z._getFullPath = Z.getFullPath = Z.inlineRef = void 0;
|
|
1589
|
+
const Sa = N, Pa = Ps, ka = To, Na = /* @__PURE__ */ new Set([
|
|
1590
|
+
"type",
|
|
1591
|
+
"format",
|
|
1592
|
+
"pattern",
|
|
1593
|
+
"maxLength",
|
|
1594
|
+
"minLength",
|
|
1595
|
+
"maxProperties",
|
|
1596
|
+
"minProperties",
|
|
1597
|
+
"maxItems",
|
|
1598
|
+
"minItems",
|
|
1599
|
+
"maximum",
|
|
1600
|
+
"minimum",
|
|
1601
|
+
"uniqueItems",
|
|
1602
|
+
"multipleOf",
|
|
1603
|
+
"required",
|
|
1604
|
+
"enum",
|
|
1605
|
+
"const"
|
|
1606
|
+
]);
|
|
1607
|
+
function Ca(e, t = !0) {
|
|
1608
|
+
return typeof e == "boolean" ? !0 : t === !0 ? !nr(e) : t ? Ds(e) <= t : !1;
|
|
1609
|
+
}
|
|
1610
|
+
Z.inlineRef = Ca;
|
|
1611
|
+
const ja = /* @__PURE__ */ new Set([
|
|
1612
|
+
"$ref",
|
|
1613
|
+
"$recursiveRef",
|
|
1614
|
+
"$recursiveAnchor",
|
|
1615
|
+
"$dynamicRef",
|
|
1616
|
+
"$dynamicAnchor"
|
|
1617
|
+
]);
|
|
1618
|
+
function nr(e) {
|
|
1619
|
+
for (const t in e) {
|
|
1620
|
+
if (ja.has(t))
|
|
1621
|
+
return !0;
|
|
1622
|
+
const r = e[t];
|
|
1623
|
+
if (Array.isArray(r) && r.some(nr) || typeof r == "object" && nr(r))
|
|
1624
|
+
return !0;
|
|
1625
|
+
}
|
|
1626
|
+
return !1;
|
|
1627
|
+
}
|
|
1628
|
+
function Ds(e) {
|
|
1629
|
+
let t = 0;
|
|
1630
|
+
for (const r in e) {
|
|
1631
|
+
if (r === "$ref")
|
|
1632
|
+
return 1 / 0;
|
|
1633
|
+
if (t++, !Na.has(r) && (typeof e[r] == "object" && (0, Sa.eachItem)(e[r], (s) => t += Ds(s)), t === 1 / 0))
|
|
1634
|
+
return 1 / 0;
|
|
1635
|
+
}
|
|
1636
|
+
return t;
|
|
1637
|
+
}
|
|
1638
|
+
function Ws(e, t = "", r) {
|
|
1639
|
+
r !== !1 && (t = Be(t));
|
|
1640
|
+
const s = e.parse(t);
|
|
1641
|
+
return xs(e, s);
|
|
1642
|
+
}
|
|
1643
|
+
Z.getFullPath = Ws;
|
|
1644
|
+
function xs(e, t) {
|
|
1645
|
+
return e.serialize(t).split("#")[0] + "#";
|
|
1646
|
+
}
|
|
1647
|
+
Z._getFullPath = xs;
|
|
1648
|
+
const Ra = /#\/?$/;
|
|
1649
|
+
function Be(e) {
|
|
1650
|
+
return e ? e.replace(Ra, "") : "";
|
|
1651
|
+
}
|
|
1652
|
+
Z.normalizeId = Be;
|
|
1653
|
+
function Oa(e, t, r) {
|
|
1654
|
+
return r = Be(r), e.resolve(t, r);
|
|
1655
|
+
}
|
|
1656
|
+
Z.resolveUrl = Oa;
|
|
1657
|
+
const Ta = /^[a-z_][-a-z0-9._]*$/i;
|
|
1658
|
+
function Ia(e, t) {
|
|
1659
|
+
if (typeof e == "boolean")
|
|
1660
|
+
return {};
|
|
1661
|
+
const { schemaId: r, uriResolver: s } = this.opts, o = Be(e[r] || t), a = { "": o }, i = Ws(s, o, !1), d = {}, u = /* @__PURE__ */ new Set();
|
|
1662
|
+
return ka(e, { allKeys: !0 }, (y, b, E, g) => {
|
|
1663
|
+
if (g === void 0)
|
|
1664
|
+
return;
|
|
1665
|
+
const v = i + b;
|
|
1666
|
+
let h = a[g];
|
|
1667
|
+
typeof y[r] == "string" && (h = f.call(this, y[r])), $.call(this, y.$anchor), $.call(this, y.$dynamicAnchor), a[b] = h;
|
|
1668
|
+
function f(P) {
|
|
1669
|
+
const R = this.opts.uriResolver.resolve;
|
|
1670
|
+
if (P = Be(h ? R(h, P) : P), u.has(P))
|
|
1671
|
+
throw m(P);
|
|
1672
|
+
u.add(P);
|
|
1673
|
+
let C = this.refs[P];
|
|
1674
|
+
return typeof C == "string" && (C = this.refs[C]), typeof C == "object" ? l(y, C.schema, P) : P !== Be(v) && (P[0] === "#" ? (l(y, d[P], P), d[P] = y) : this.refs[P] = v), P;
|
|
1675
|
+
}
|
|
1676
|
+
function $(P) {
|
|
1677
|
+
if (typeof P == "string") {
|
|
1678
|
+
if (!Ta.test(P))
|
|
1679
|
+
throw new Error(`invalid anchor "${P}"`);
|
|
1680
|
+
f.call(this, `#${P}`);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
}), d;
|
|
1684
|
+
function l(y, b, E) {
|
|
1685
|
+
if (b !== void 0 && !Pa(y, b))
|
|
1686
|
+
throw m(E);
|
|
1687
|
+
}
|
|
1688
|
+
function m(y) {
|
|
1689
|
+
return new Error(`reference "${y}" resolves to more than one schema`);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
Z.getSchemaRefs = Ia;
|
|
1693
|
+
Object.defineProperty(fe, "__esModule", { value: !0 });
|
|
1694
|
+
fe.getData = fe.KeywordCxt = fe.validateFunctionCode = void 0;
|
|
1695
|
+
const eo = Qe, os = X, yr = we, kt = X, Ma = Rt, nt = _e, Bt = Ce, T = q, I = ve, Va = Z, be = N, tt = mt;
|
|
1696
|
+
function Fa(e) {
|
|
1697
|
+
if (so(e) && (oo(e), ro(e))) {
|
|
1698
|
+
Ua(e);
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
to(e, () => (0, eo.topBoolOrEmptySchema)(e));
|
|
1702
|
+
}
|
|
1703
|
+
fe.validateFunctionCode = Fa;
|
|
1704
|
+
function to({ gen: e, validateName: t, schema: r, schemaEnv: s, opts: o }, a) {
|
|
1705
|
+
o.code.es5 ? e.func(t, (0, T._)`${I.default.data}, ${I.default.valCxt}`, s.$async, () => {
|
|
1706
|
+
e.code((0, T._)`"use strict"; ${ns(r, o)}`), qa(e, o), e.code(a);
|
|
1707
|
+
}) : e.func(t, (0, T._)`${I.default.data}, ${Ka(o)}`, s.$async, () => e.code(ns(r, o)).code(a));
|
|
1708
|
+
}
|
|
1709
|
+
function Ka(e) {
|
|
1710
|
+
return (0, T._)`{${I.default.instancePath}="", ${I.default.parentData}, ${I.default.parentDataProperty}, ${I.default.rootData}=${I.default.data}${e.dynamicRef ? (0, T._)`, ${I.default.dynamicAnchors}={}` : T.nil}}={}`;
|
|
1711
|
+
}
|
|
1712
|
+
function qa(e, t) {
|
|
1713
|
+
e.if(I.default.valCxt, () => {
|
|
1714
|
+
e.var(I.default.instancePath, (0, T._)`${I.default.valCxt}.${I.default.instancePath}`), e.var(I.default.parentData, (0, T._)`${I.default.valCxt}.${I.default.parentData}`), e.var(I.default.parentDataProperty, (0, T._)`${I.default.valCxt}.${I.default.parentDataProperty}`), e.var(I.default.rootData, (0, T._)`${I.default.valCxt}.${I.default.rootData}`), t.dynamicRef && e.var(I.default.dynamicAnchors, (0, T._)`${I.default.valCxt}.${I.default.dynamicAnchors}`);
|
|
1715
|
+
}, () => {
|
|
1716
|
+
e.var(I.default.instancePath, (0, T._)`""`), e.var(I.default.parentData, (0, T._)`undefined`), e.var(I.default.parentDataProperty, (0, T._)`undefined`), e.var(I.default.rootData, I.default.data), t.dynamicRef && e.var(I.default.dynamicAnchors, (0, T._)`{}`);
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
function Ua(e) {
|
|
1720
|
+
const { schema: t, opts: r, gen: s } = e;
|
|
1721
|
+
to(e, () => {
|
|
1722
|
+
r.$comment && t.$comment && ao(e), Ja(e), s.let(I.default.vErrors, null), s.let(I.default.errors, 0), r.unevaluated && za(e), no(e), Qa(e);
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
function za(e) {
|
|
1726
|
+
const { gen: t, validateName: r } = e;
|
|
1727
|
+
e.evaluated = t.const("evaluated", (0, T._)`${r}.evaluated`), t.if((0, T._)`${e.evaluated}.dynamicProps`, () => t.assign((0, T._)`${e.evaluated}.props`, (0, T._)`undefined`)), t.if((0, T._)`${e.evaluated}.dynamicItems`, () => t.assign((0, T._)`${e.evaluated}.items`, (0, T._)`undefined`));
|
|
1728
|
+
}
|
|
1729
|
+
function ns(e, t) {
|
|
1730
|
+
const r = typeof e == "object" && e[t.schemaId];
|
|
1731
|
+
return r && (t.code.source || t.code.process) ? (0, T._)`/*# sourceURL=${r} */` : T.nil;
|
|
1732
|
+
}
|
|
1733
|
+
function Aa(e, t) {
|
|
1734
|
+
if (so(e) && (oo(e), ro(e))) {
|
|
1735
|
+
La(e, t);
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
(0, eo.boolOrEmptySchema)(e, t);
|
|
1739
|
+
}
|
|
1740
|
+
function ro({ schema: e, self: t }) {
|
|
1741
|
+
if (typeof e == "boolean")
|
|
1742
|
+
return !e;
|
|
1743
|
+
for (const r in e)
|
|
1744
|
+
if (t.RULES.all[r])
|
|
1745
|
+
return !0;
|
|
1746
|
+
return !1;
|
|
1747
|
+
}
|
|
1748
|
+
function so(e) {
|
|
1749
|
+
return typeof e.schema != "boolean";
|
|
1750
|
+
}
|
|
1751
|
+
function La(e, t) {
|
|
1752
|
+
const { schema: r, gen: s, opts: o } = e;
|
|
1753
|
+
o.$comment && r.$comment && ao(e), Ha(e), Ba(e);
|
|
1754
|
+
const a = s.const("_errs", I.default.errors);
|
|
1755
|
+
no(e, a), s.var(t, (0, T._)`${a} === ${I.default.errors}`);
|
|
1756
|
+
}
|
|
1757
|
+
function oo(e) {
|
|
1758
|
+
(0, be.checkUnknownRules)(e), Ga(e);
|
|
1759
|
+
}
|
|
1760
|
+
function no(e, t) {
|
|
1761
|
+
if (e.opts.jtd)
|
|
1762
|
+
return as(e, [], !1, t);
|
|
1763
|
+
const r = (0, os.getSchemaTypes)(e.schema), s = (0, os.coerceAndCheckDataType)(e, r);
|
|
1764
|
+
as(e, r, !s, t);
|
|
1765
|
+
}
|
|
1766
|
+
function Ga(e) {
|
|
1767
|
+
const { schema: t, errSchemaPath: r, opts: s, self: o } = e;
|
|
1768
|
+
t.$ref && s.ignoreKeywordsWithRef && (0, be.schemaHasRulesButRef)(t, o.RULES) && o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);
|
|
1769
|
+
}
|
|
1770
|
+
function Ja(e) {
|
|
1771
|
+
const { schema: t, opts: r } = e;
|
|
1772
|
+
t.default !== void 0 && r.useDefaults && r.strictSchema && (0, be.checkStrictMode)(e, "default is ignored in the schema root");
|
|
1773
|
+
}
|
|
1774
|
+
function Ha(e) {
|
|
1775
|
+
const t = e.schema[e.opts.schemaId];
|
|
1776
|
+
t && (e.baseId = (0, Va.resolveUrl)(e.opts.uriResolver, e.baseId, t));
|
|
1777
|
+
}
|
|
1778
|
+
function Ba(e) {
|
|
1779
|
+
if (e.schema.$async && !e.schemaEnv.$async)
|
|
1780
|
+
throw new Error("async schema in sync schema");
|
|
1781
|
+
}
|
|
1782
|
+
function ao({ gen: e, schemaEnv: t, schema: r, errSchemaPath: s, opts: o }) {
|
|
1783
|
+
const a = r.$comment;
|
|
1784
|
+
if (o.$comment === !0)
|
|
1785
|
+
e.code((0, T._)`${I.default.self}.logger.log(${a})`);
|
|
1786
|
+
else if (typeof o.$comment == "function") {
|
|
1787
|
+
const i = (0, T.str)`${s}/$comment`, d = e.scopeValue("root", { ref: t.root });
|
|
1788
|
+
e.code((0, T._)`${I.default.self}.opts.$comment(${a}, ${i}, ${d}.schema)`);
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
function Qa(e) {
|
|
1792
|
+
const { gen: t, schemaEnv: r, validateName: s, ValidationError: o, opts: a } = e;
|
|
1793
|
+
r.$async ? t.if((0, T._)`${I.default.errors} === 0`, () => t.return(I.default.data), () => t.throw((0, T._)`new ${o}(${I.default.vErrors})`)) : (t.assign((0, T._)`${s}.errors`, I.default.vErrors), a.unevaluated && Xa(e), t.return((0, T._)`${I.default.errors} === 0`));
|
|
1794
|
+
}
|
|
1795
|
+
function Xa({ gen: e, evaluated: t, props: r, items: s }) {
|
|
1796
|
+
r instanceof T.Name && e.assign((0, T._)`${t}.props`, r), s instanceof T.Name && e.assign((0, T._)`${t}.items`, s);
|
|
1797
|
+
}
|
|
1798
|
+
function as(e, t, r, s) {
|
|
1799
|
+
const { gen: o, schema: a, data: i, allErrors: d, opts: u, self: l } = e, { RULES: m } = l;
|
|
1800
|
+
if (a.$ref && (u.ignoreKeywordsWithRef || !(0, be.schemaHasRulesButRef)(a, m))) {
|
|
1801
|
+
o.block(() => lo(e, "$ref", m.all.$ref.definition));
|
|
1802
|
+
return;
|
|
1803
|
+
}
|
|
1804
|
+
u.jtd || Ya(e, t), o.block(() => {
|
|
1805
|
+
for (const b of m.rules)
|
|
1806
|
+
y(b);
|
|
1807
|
+
y(m.post);
|
|
1808
|
+
});
|
|
1809
|
+
function y(b) {
|
|
1810
|
+
(0, yr.shouldUseGroup)(a, b) && (b.type ? (o.if((0, kt.checkDataType)(b.type, i, u.strictNumbers)), is(e, b), t.length === 1 && t[0] === b.type && r && (o.else(), (0, kt.reportTypeError)(e)), o.endIf()) : is(e, b), d || o.if((0, T._)`${I.default.errors} === ${s || 0}`));
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
function is(e, t) {
|
|
1814
|
+
const { gen: r, schema: s, opts: { useDefaults: o } } = e;
|
|
1815
|
+
o && (0, Ma.assignDefaults)(e, t.type), r.block(() => {
|
|
1816
|
+
for (const a of t.rules)
|
|
1817
|
+
(0, yr.shouldUseRule)(s, a) && lo(e, a.keyword, a.definition, t.type);
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
function Ya(e, t) {
|
|
1821
|
+
e.schemaEnv.meta || !e.opts.strictTypes || (Za(e, t), e.opts.allowUnionTypes || Da(e, t), Wa(e, e.dataTypes));
|
|
1822
|
+
}
|
|
1823
|
+
function Za(e, t) {
|
|
1824
|
+
if (t.length) {
|
|
1825
|
+
if (!e.dataTypes.length) {
|
|
1826
|
+
e.dataTypes = t;
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1829
|
+
t.forEach((r) => {
|
|
1830
|
+
io(e.dataTypes, r) || _r(e, `type "${r}" not allowed by context "${e.dataTypes.join(",")}"`);
|
|
1831
|
+
}), ei(e, t);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
function Da(e, t) {
|
|
1835
|
+
t.length > 1 && !(t.length === 2 && t.includes("null")) && _r(e, "use allowUnionTypes to allow union type keyword");
|
|
1836
|
+
}
|
|
1837
|
+
function Wa(e, t) {
|
|
1838
|
+
const r = e.self.RULES.all;
|
|
1839
|
+
for (const s in r) {
|
|
1840
|
+
const o = r[s];
|
|
1841
|
+
if (typeof o == "object" && (0, yr.shouldUseRule)(e.schema, o)) {
|
|
1842
|
+
const { type: a } = o.definition;
|
|
1843
|
+
a.length && !a.some((i) => xa(t, i)) && _r(e, `missing type "${a.join(",")}" for keyword "${s}"`);
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
function xa(e, t) {
|
|
1848
|
+
return e.includes(t) || t === "number" && e.includes("integer");
|
|
1849
|
+
}
|
|
1850
|
+
function io(e, t) {
|
|
1851
|
+
return e.includes(t) || t === "integer" && e.includes("number");
|
|
1852
|
+
}
|
|
1853
|
+
function ei(e, t) {
|
|
1854
|
+
const r = [];
|
|
1855
|
+
for (const s of e.dataTypes)
|
|
1856
|
+
io(t, s) ? r.push(s) : t.includes("integer") && s === "number" && r.push("integer");
|
|
1857
|
+
e.dataTypes = r;
|
|
1858
|
+
}
|
|
1859
|
+
function _r(e, t) {
|
|
1860
|
+
const r = e.schemaEnv.baseId + e.errSchemaPath;
|
|
1861
|
+
t += ` at "${r}" (strictTypes)`, (0, be.checkStrictMode)(e, t, e.opts.strictTypes);
|
|
1862
|
+
}
|
|
1863
|
+
class co {
|
|
1864
|
+
constructor(t, r, s) {
|
|
1865
|
+
if ((0, nt.validateKeywordUsage)(t, r, s), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = s, this.data = t.data, this.schema = t.schema[s], this.$data = r.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, be.schemaRefOrVal)(t, this.schema, s, this.$data), this.schemaType = r.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = r, this.$data)
|
|
1866
|
+
this.schemaCode = t.gen.const("vSchema", uo(this.$data, t));
|
|
1867
|
+
else if (this.schemaCode = this.schemaValue, !(0, nt.validSchemaType)(this.schema, r.schemaType, r.allowUndefined))
|
|
1868
|
+
throw new Error(`${s} value must be ${JSON.stringify(r.schemaType)}`);
|
|
1869
|
+
("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = t.gen.const("_errs", I.default.errors));
|
|
1870
|
+
}
|
|
1871
|
+
result(t, r, s) {
|
|
1872
|
+
this.failResult((0, T.not)(t), r, s);
|
|
1873
|
+
}
|
|
1874
|
+
failResult(t, r, s) {
|
|
1875
|
+
this.gen.if(t), s ? s() : this.error(), r ? (this.gen.else(), r(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1876
|
+
}
|
|
1877
|
+
pass(t, r) {
|
|
1878
|
+
this.failResult((0, T.not)(t), void 0, r);
|
|
1879
|
+
}
|
|
1880
|
+
fail(t) {
|
|
1881
|
+
if (t === void 0) {
|
|
1882
|
+
this.error(), this.allErrors || this.gen.if(!1);
|
|
1883
|
+
return;
|
|
1884
|
+
}
|
|
1885
|
+
this.gen.if(t), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
|
|
1886
|
+
}
|
|
1887
|
+
fail$data(t) {
|
|
1888
|
+
if (!this.$data)
|
|
1889
|
+
return this.fail(t);
|
|
1890
|
+
const { schemaCode: r } = this;
|
|
1891
|
+
this.fail((0, T._)`${r} !== undefined && (${(0, T.or)(this.invalid$data(), t)})`);
|
|
1892
|
+
}
|
|
1893
|
+
error(t, r, s) {
|
|
1894
|
+
if (r) {
|
|
1895
|
+
this.setParams(r), this._error(t, s), this.setParams({});
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
this._error(t, s);
|
|
1899
|
+
}
|
|
1900
|
+
_error(t, r) {
|
|
1901
|
+
(t ? tt.reportExtraError : tt.reportError)(this, this.def.error, r);
|
|
1902
|
+
}
|
|
1903
|
+
$dataError() {
|
|
1904
|
+
(0, tt.reportError)(this, this.def.$dataError || tt.keyword$DataError);
|
|
1905
|
+
}
|
|
1906
|
+
reset() {
|
|
1907
|
+
if (this.errsCount === void 0)
|
|
1908
|
+
throw new Error('add "trackErrors" to keyword definition');
|
|
1909
|
+
(0, tt.resetErrorsCount)(this.gen, this.errsCount);
|
|
1910
|
+
}
|
|
1911
|
+
ok(t) {
|
|
1912
|
+
this.allErrors || this.gen.if(t);
|
|
1913
|
+
}
|
|
1914
|
+
setParams(t, r) {
|
|
1915
|
+
r ? Object.assign(this.params, t) : this.params = t;
|
|
1916
|
+
}
|
|
1917
|
+
block$data(t, r, s = T.nil) {
|
|
1918
|
+
this.gen.block(() => {
|
|
1919
|
+
this.check$data(t, s), r();
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
check$data(t = T.nil, r = T.nil) {
|
|
1923
|
+
if (!this.$data)
|
|
1924
|
+
return;
|
|
1925
|
+
const { gen: s, schemaCode: o, schemaType: a, def: i } = this;
|
|
1926
|
+
s.if((0, T.or)((0, T._)`${o} === undefined`, r)), t !== T.nil && s.assign(t, !0), (a.length || i.validateSchema) && (s.elseIf(this.invalid$data()), this.$dataError(), t !== T.nil && s.assign(t, !1)), s.else();
|
|
1927
|
+
}
|
|
1928
|
+
invalid$data() {
|
|
1929
|
+
const { gen: t, schemaCode: r, schemaType: s, def: o, it: a } = this;
|
|
1930
|
+
return (0, T.or)(i(), d());
|
|
1931
|
+
function i() {
|
|
1932
|
+
if (s.length) {
|
|
1933
|
+
if (!(r instanceof T.Name))
|
|
1934
|
+
throw new Error("ajv implementation error");
|
|
1935
|
+
const u = Array.isArray(s) ? s : [s];
|
|
1936
|
+
return (0, T._)`${(0, kt.checkDataTypes)(u, r, a.opts.strictNumbers, kt.DataType.Wrong)}`;
|
|
1937
|
+
}
|
|
1938
|
+
return T.nil;
|
|
1939
|
+
}
|
|
1940
|
+
function d() {
|
|
1941
|
+
if (o.validateSchema) {
|
|
1942
|
+
const u = t.scopeValue("validate$data", { ref: o.validateSchema });
|
|
1943
|
+
return (0, T._)`!${u}(${r})`;
|
|
1944
|
+
}
|
|
1945
|
+
return T.nil;
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
subschema(t, r) {
|
|
1949
|
+
const s = (0, Bt.getSubschema)(this.it, t);
|
|
1950
|
+
(0, Bt.extendSubschemaData)(s, this.it, t), (0, Bt.extendSubschemaMode)(s, t);
|
|
1951
|
+
const o = { ...this.it, ...s, items: void 0, props: void 0 };
|
|
1952
|
+
return Aa(o, r), o;
|
|
1953
|
+
}
|
|
1954
|
+
mergeEvaluated(t, r) {
|
|
1955
|
+
const { it: s, gen: o } = this;
|
|
1956
|
+
s.opts.unevaluated && (s.props !== !0 && t.props !== void 0 && (s.props = be.mergeEvaluated.props(o, t.props, s.props, r)), s.items !== !0 && t.items !== void 0 && (s.items = be.mergeEvaluated.items(o, t.items, s.items, r)));
|
|
1957
|
+
}
|
|
1958
|
+
mergeValidEvaluated(t, r) {
|
|
1959
|
+
const { it: s, gen: o } = this;
|
|
1960
|
+
if (s.opts.unevaluated && (s.props !== !0 || s.items !== !0))
|
|
1961
|
+
return o.if(r, () => this.mergeEvaluated(t, T.Name)), !0;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
fe.KeywordCxt = co;
|
|
1965
|
+
function lo(e, t, r, s) {
|
|
1966
|
+
const o = new co(e, r, t);
|
|
1967
|
+
"code" in r ? r.code(o, s) : o.$data && r.validate ? (0, nt.funcKeywordCode)(o, r) : "macro" in r ? (0, nt.macroKeywordCode)(o, r) : (r.compile || r.validate) && (0, nt.funcKeywordCode)(o, r);
|
|
1968
|
+
}
|
|
1969
|
+
const ti = /^\/(?:[^~]|~0|~1)*$/, ri = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
1970
|
+
function uo(e, { dataLevel: t, dataNames: r, dataPathArr: s }) {
|
|
1971
|
+
let o, a;
|
|
1972
|
+
if (e === "")
|
|
1973
|
+
return I.default.rootData;
|
|
1974
|
+
if (e[0] === "/") {
|
|
1975
|
+
if (!ti.test(e))
|
|
1976
|
+
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
1977
|
+
o = e, a = I.default.rootData;
|
|
1978
|
+
} else {
|
|
1979
|
+
const l = ri.exec(e);
|
|
1980
|
+
if (!l)
|
|
1981
|
+
throw new Error(`Invalid JSON-pointer: ${e}`);
|
|
1982
|
+
const m = +l[1];
|
|
1983
|
+
if (o = l[2], o === "#") {
|
|
1984
|
+
if (m >= t)
|
|
1985
|
+
throw new Error(u("property/index", m));
|
|
1986
|
+
return s[t - m];
|
|
1987
|
+
}
|
|
1988
|
+
if (m > t)
|
|
1989
|
+
throw new Error(u("data", m));
|
|
1990
|
+
if (a = r[t - m], !o)
|
|
1991
|
+
return a;
|
|
1992
|
+
}
|
|
1993
|
+
let i = a;
|
|
1994
|
+
const d = o.split("/");
|
|
1995
|
+
for (const l of d)
|
|
1996
|
+
l && (a = (0, T._)`${a}${(0, T.getProperty)((0, be.unescapeJsonPointer)(l))}`, i = (0, T._)`${i} && ${a}`);
|
|
1997
|
+
return i;
|
|
1998
|
+
function u(l, m) {
|
|
1999
|
+
return `Cannot access ${l} ${m} levels up, current level is ${t}`;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
fe.getData = uo;
|
|
2003
|
+
var ht = {};
|
|
2004
|
+
Object.defineProperty(ht, "__esModule", { value: !0 });
|
|
2005
|
+
class si extends Error {
|
|
2006
|
+
constructor(t) {
|
|
2007
|
+
super("validation failed"), this.errors = t, this.ajv = this.validation = !0;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
ht.default = si;
|
|
2011
|
+
var Ye = {};
|
|
2012
|
+
Object.defineProperty(Ye, "__esModule", { value: !0 });
|
|
2013
|
+
const Qt = Z;
|
|
2014
|
+
class oi extends Error {
|
|
2015
|
+
constructor(t, r, s, o) {
|
|
2016
|
+
super(o || `can't resolve reference ${s} from id ${r}`), this.missingRef = (0, Qt.resolveUrl)(t, r, s), this.missingSchema = (0, Qt.normalizeId)((0, Qt.getFullPath)(t, this.missingRef));
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
Ye.default = oi;
|
|
2020
|
+
var re = {};
|
|
2021
|
+
Object.defineProperty(re, "__esModule", { value: !0 });
|
|
2022
|
+
re.resolveSchema = re.getCompilingSchema = re.resolveRef = re.compileSchema = re.SchemaEnv = void 0;
|
|
2023
|
+
const ce = q, ni = ht, Re = ve, ue = Z, cs = N, ai = fe;
|
|
2024
|
+
class Ot {
|
|
2025
|
+
constructor(t) {
|
|
2026
|
+
var r;
|
|
2027
|
+
this.refs = {}, this.dynamicAnchors = {};
|
|
2028
|
+
let s;
|
|
2029
|
+
typeof t.schema == "object" && (s = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (r = t.baseId) !== null && r !== void 0 ? r : (0, ue.normalizeId)(s == null ? void 0 : s[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = s == null ? void 0 : s.$async, this.refs = {};
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
re.SchemaEnv = Ot;
|
|
2033
|
+
function vr(e) {
|
|
2034
|
+
const t = fo.call(this, e);
|
|
2035
|
+
if (t)
|
|
2036
|
+
return t;
|
|
2037
|
+
const r = (0, ue.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: s, lines: o } = this.opts.code, { ownProperties: a } = this.opts, i = new ce.CodeGen(this.scope, { es5: s, lines: o, ownProperties: a });
|
|
2038
|
+
let d;
|
|
2039
|
+
e.$async && (d = i.scopeValue("Error", {
|
|
2040
|
+
ref: ni.default,
|
|
2041
|
+
code: (0, ce._)`require("ajv/dist/runtime/validation_error").default`
|
|
2042
|
+
}));
|
|
2043
|
+
const u = i.scopeName("validate");
|
|
2044
|
+
e.validateName = u;
|
|
2045
|
+
const l = {
|
|
2046
|
+
gen: i,
|
|
2047
|
+
allErrors: this.opts.allErrors,
|
|
2048
|
+
data: Re.default.data,
|
|
2049
|
+
parentData: Re.default.parentData,
|
|
2050
|
+
parentDataProperty: Re.default.parentDataProperty,
|
|
2051
|
+
dataNames: [Re.default.data],
|
|
2052
|
+
dataPathArr: [ce.nil],
|
|
2053
|
+
// TODO can its length be used as dataLevel if nil is removed?
|
|
2054
|
+
dataLevel: 0,
|
|
2055
|
+
dataTypes: [],
|
|
2056
|
+
definedProperties: /* @__PURE__ */ new Set(),
|
|
2057
|
+
topSchemaRef: i.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, ce.stringify)(e.schema) } : { ref: e.schema }),
|
|
2058
|
+
validateName: u,
|
|
2059
|
+
ValidationError: d,
|
|
2060
|
+
schema: e.schema,
|
|
2061
|
+
schemaEnv: e,
|
|
2062
|
+
rootId: r,
|
|
2063
|
+
baseId: e.baseId || r,
|
|
2064
|
+
schemaPath: ce.nil,
|
|
2065
|
+
errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
|
|
2066
|
+
errorPath: (0, ce._)`""`,
|
|
2067
|
+
opts: this.opts,
|
|
2068
|
+
self: this
|
|
2069
|
+
};
|
|
2070
|
+
let m;
|
|
2071
|
+
try {
|
|
2072
|
+
this._compilations.add(e), (0, ai.validateFunctionCode)(l), i.optimize(this.opts.code.optimize);
|
|
2073
|
+
const y = i.toString();
|
|
2074
|
+
m = `${i.scopeRefs(Re.default.scope)}return ${y}`, this.opts.code.process && (m = this.opts.code.process(m, e));
|
|
2075
|
+
const E = new Function(`${Re.default.self}`, `${Re.default.scope}`, m)(this, this.scope.get());
|
|
2076
|
+
if (this.scope.value(u, { ref: E }), E.errors = null, E.schema = e.schema, E.schemaEnv = e, e.$async && (E.$async = !0), this.opts.code.source === !0 && (E.source = { validateName: u, validateCode: y, scopeValues: i._values }), this.opts.unevaluated) {
|
|
2077
|
+
const { props: g, items: v } = l;
|
|
2078
|
+
E.evaluated = {
|
|
2079
|
+
props: g instanceof ce.Name ? void 0 : g,
|
|
2080
|
+
items: v instanceof ce.Name ? void 0 : v,
|
|
2081
|
+
dynamicProps: g instanceof ce.Name,
|
|
2082
|
+
dynamicItems: v instanceof ce.Name
|
|
2083
|
+
}, E.source && (E.source.evaluated = (0, ce.stringify)(E.evaluated));
|
|
2084
|
+
}
|
|
2085
|
+
return e.validate = E, e;
|
|
2086
|
+
} catch (y) {
|
|
2087
|
+
throw delete e.validate, delete e.validateName, m && this.logger.error("Error compiling schema, function code:", m), y;
|
|
2088
|
+
} finally {
|
|
2089
|
+
this._compilations.delete(e);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
re.compileSchema = vr;
|
|
2093
|
+
function ii(e, t, r) {
|
|
2094
|
+
var s;
|
|
2095
|
+
r = (0, ue.resolveUrl)(this.opts.uriResolver, t, r);
|
|
2096
|
+
const o = e.refs[r];
|
|
2097
|
+
if (o)
|
|
2098
|
+
return o;
|
|
2099
|
+
let a = di.call(this, e, r);
|
|
2100
|
+
if (a === void 0) {
|
|
2101
|
+
const i = (s = e.localRefs) === null || s === void 0 ? void 0 : s[r], { schemaId: d } = this.opts;
|
|
2102
|
+
i && (a = new Ot({ schema: i, schemaId: d, root: e, baseId: t }));
|
|
2103
|
+
}
|
|
2104
|
+
if (a !== void 0)
|
|
2105
|
+
return e.refs[r] = ci.call(this, a);
|
|
2106
|
+
}
|
|
2107
|
+
re.resolveRef = ii;
|
|
2108
|
+
function ci(e) {
|
|
2109
|
+
return (0, ue.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : vr.call(this, e);
|
|
2110
|
+
}
|
|
2111
|
+
function fo(e) {
|
|
2112
|
+
for (const t of this._compilations)
|
|
2113
|
+
if (li(t, e))
|
|
2114
|
+
return t;
|
|
2115
|
+
}
|
|
2116
|
+
re.getCompilingSchema = fo;
|
|
2117
|
+
function li(e, t) {
|
|
2118
|
+
return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
|
|
2119
|
+
}
|
|
2120
|
+
function di(e, t) {
|
|
2121
|
+
let r;
|
|
2122
|
+
for (; typeof (r = this.refs[t]) == "string"; )
|
|
2123
|
+
t = r;
|
|
2124
|
+
return r || this.schemas[t] || Tt.call(this, e, t);
|
|
2125
|
+
}
|
|
2126
|
+
function Tt(e, t) {
|
|
2127
|
+
const r = this.opts.uriResolver.parse(t), s = (0, ue._getFullPath)(this.opts.uriResolver, r);
|
|
2128
|
+
let o = (0, ue.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
|
|
2129
|
+
if (Object.keys(e.schema).length > 0 && s === o)
|
|
2130
|
+
return Xt.call(this, r, e);
|
|
2131
|
+
const a = (0, ue.normalizeId)(s), i = this.refs[a] || this.schemas[a];
|
|
2132
|
+
if (typeof i == "string") {
|
|
2133
|
+
const d = Tt.call(this, e, i);
|
|
2134
|
+
return typeof (d == null ? void 0 : d.schema) != "object" ? void 0 : Xt.call(this, r, d);
|
|
2135
|
+
}
|
|
2136
|
+
if (typeof (i == null ? void 0 : i.schema) == "object") {
|
|
2137
|
+
if (i.validate || vr.call(this, i), a === (0, ue.normalizeId)(t)) {
|
|
2138
|
+
const { schema: d } = i, { schemaId: u } = this.opts, l = d[u];
|
|
2139
|
+
return l && (o = (0, ue.resolveUrl)(this.opts.uriResolver, o, l)), new Ot({ schema: d, schemaId: u, root: e, baseId: o });
|
|
2140
|
+
}
|
|
2141
|
+
return Xt.call(this, r, i);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
re.resolveSchema = Tt;
|
|
2145
|
+
const ui = /* @__PURE__ */ new Set([
|
|
2146
|
+
"properties",
|
|
2147
|
+
"patternProperties",
|
|
2148
|
+
"enum",
|
|
2149
|
+
"dependencies",
|
|
2150
|
+
"definitions"
|
|
2151
|
+
]);
|
|
2152
|
+
function Xt(e, { baseId: t, schema: r, root: s }) {
|
|
2153
|
+
var o;
|
|
2154
|
+
if (((o = e.fragment) === null || o === void 0 ? void 0 : o[0]) !== "/")
|
|
2155
|
+
return;
|
|
2156
|
+
for (const d of e.fragment.slice(1).split("/")) {
|
|
2157
|
+
if (typeof r == "boolean")
|
|
2158
|
+
return;
|
|
2159
|
+
const u = r[(0, cs.unescapeFragment)(d)];
|
|
2160
|
+
if (u === void 0)
|
|
2161
|
+
return;
|
|
2162
|
+
r = u;
|
|
2163
|
+
const l = typeof r == "object" && r[this.opts.schemaId];
|
|
2164
|
+
!ui.has(d) && l && (t = (0, ue.resolveUrl)(this.opts.uriResolver, t, l));
|
|
2165
|
+
}
|
|
2166
|
+
let a;
|
|
2167
|
+
if (typeof r != "boolean" && r.$ref && !(0, cs.schemaHasRulesButRef)(r, this.RULES)) {
|
|
2168
|
+
const d = (0, ue.resolveUrl)(this.opts.uriResolver, t, r.$ref);
|
|
2169
|
+
a = Tt.call(this, s, d);
|
|
2170
|
+
}
|
|
2171
|
+
const { schemaId: i } = this.opts;
|
|
2172
|
+
if (a = a || new Ot({ schema: r, schemaId: i, root: s, baseId: t }), a.schema !== a.root.schema)
|
|
2173
|
+
return a;
|
|
2174
|
+
}
|
|
2175
|
+
const fi = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", mi = "Meta-schema for $data reference (JSON AnySchema extension proposal)", hi = "object", pi = [
|
|
2176
|
+
"$data"
|
|
2177
|
+
], yi = {
|
|
2178
|
+
$data: {
|
|
2179
|
+
type: "string",
|
|
2180
|
+
anyOf: [
|
|
2181
|
+
{
|
|
2182
|
+
format: "relative-json-pointer"
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
format: "json-pointer"
|
|
2186
|
+
}
|
|
2187
|
+
]
|
|
2188
|
+
}
|
|
2189
|
+
}, _i = !1, vi = {
|
|
2190
|
+
$id: fi,
|
|
2191
|
+
description: mi,
|
|
2192
|
+
type: hi,
|
|
2193
|
+
required: pi,
|
|
2194
|
+
properties: yi,
|
|
2195
|
+
additionalProperties: _i
|
|
2196
|
+
};
|
|
2197
|
+
var $r = {};
|
|
2198
|
+
Object.defineProperty($r, "__esModule", { value: !0 });
|
|
2199
|
+
const mo = Io;
|
|
2200
|
+
mo.code = 'require("ajv/dist/runtime/uri").default';
|
|
2201
|
+
$r.default = mo;
|
|
2202
|
+
(function(e) {
|
|
2203
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
|
|
2204
|
+
var t = fe;
|
|
2205
|
+
Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
|
|
2206
|
+
return t.KeywordCxt;
|
|
2207
|
+
} });
|
|
2208
|
+
var r = q;
|
|
2209
|
+
Object.defineProperty(e, "_", { enumerable: !0, get: function() {
|
|
2210
|
+
return r._;
|
|
2211
|
+
} }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
|
|
2212
|
+
return r.str;
|
|
2213
|
+
} }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
|
|
2214
|
+
return r.stringify;
|
|
2215
|
+
} }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
|
|
2216
|
+
return r.nil;
|
|
2217
|
+
} }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
|
|
2218
|
+
return r.Name;
|
|
2219
|
+
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
2220
|
+
return r.CodeGen;
|
|
2221
|
+
} });
|
|
2222
|
+
const s = ht, o = Ye, a = Ve, i = re, d = q, u = Z, l = X, m = N, y = vi, b = $r, E = (k, p) => new RegExp(k, p);
|
|
2223
|
+
E.code = "new RegExp";
|
|
2224
|
+
const g = ["removeAdditional", "useDefaults", "coerceTypes"], v = /* @__PURE__ */ new Set([
|
|
2225
|
+
"validate",
|
|
2226
|
+
"serialize",
|
|
2227
|
+
"parse",
|
|
2228
|
+
"wrapper",
|
|
2229
|
+
"root",
|
|
2230
|
+
"schema",
|
|
2231
|
+
"keyword",
|
|
2232
|
+
"pattern",
|
|
2233
|
+
"formats",
|
|
2234
|
+
"validate$data",
|
|
2235
|
+
"func",
|
|
2236
|
+
"obj",
|
|
2237
|
+
"Error"
|
|
2238
|
+
]), h = {
|
|
2239
|
+
errorDataPath: "",
|
|
2240
|
+
format: "`validateFormats: false` can be used instead.",
|
|
2241
|
+
nullable: '"nullable" keyword is supported by default.',
|
|
2242
|
+
jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
|
|
2243
|
+
extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
|
|
2244
|
+
missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
|
|
2245
|
+
processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
|
|
2246
|
+
sourceCode: "Use option `code: {source: true}`",
|
|
2247
|
+
strictDefaults: "It is default now, see option `strict`.",
|
|
2248
|
+
strictKeywords: "It is default now, see option `strict`.",
|
|
2249
|
+
uniqueItems: '"uniqueItems" keyword is always validated.',
|
|
2250
|
+
unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
|
|
2251
|
+
cache: "Map is used as cache, schema object as key.",
|
|
2252
|
+
serialize: "Map is used as cache, schema object as key.",
|
|
2253
|
+
ajvErrors: "It is default now."
|
|
2254
|
+
}, f = {
|
|
2255
|
+
ignoreKeywordsWithRef: "",
|
|
2256
|
+
jsPropertySyntax: "",
|
|
2257
|
+
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
2258
|
+
}, $ = 200;
|
|
2259
|
+
function P(k) {
|
|
2260
|
+
var p, S, _, n, c, w, j, O, A, U, V, pe, Ue, We, ge, ze, Vt, Ft, Kt, qt, Ut, zt, At, Lt, Gt;
|
|
2261
|
+
const xe = k.strict, Jt = (p = k.code) === null || p === void 0 ? void 0 : p.optimize, Wr = Jt === !0 || Jt === void 0 ? 1 : Jt || 0, xr = (_ = (S = k.code) === null || S === void 0 ? void 0 : S.regExp) !== null && _ !== void 0 ? _ : E, bo = (n = k.uriResolver) !== null && n !== void 0 ? n : b.default;
|
|
2262
|
+
return {
|
|
2263
|
+
strictSchema: (w = (c = k.strictSchema) !== null && c !== void 0 ? c : xe) !== null && w !== void 0 ? w : !0,
|
|
2264
|
+
strictNumbers: (O = (j = k.strictNumbers) !== null && j !== void 0 ? j : xe) !== null && O !== void 0 ? O : !0,
|
|
2265
|
+
strictTypes: (U = (A = k.strictTypes) !== null && A !== void 0 ? A : xe) !== null && U !== void 0 ? U : "log",
|
|
2266
|
+
strictTuples: (pe = (V = k.strictTuples) !== null && V !== void 0 ? V : xe) !== null && pe !== void 0 ? pe : "log",
|
|
2267
|
+
strictRequired: (We = (Ue = k.strictRequired) !== null && Ue !== void 0 ? Ue : xe) !== null && We !== void 0 ? We : !1,
|
|
2268
|
+
code: k.code ? { ...k.code, optimize: Wr, regExp: xr } : { optimize: Wr, regExp: xr },
|
|
2269
|
+
loopRequired: (ge = k.loopRequired) !== null && ge !== void 0 ? ge : $,
|
|
2270
|
+
loopEnum: (ze = k.loopEnum) !== null && ze !== void 0 ? ze : $,
|
|
2271
|
+
meta: (Vt = k.meta) !== null && Vt !== void 0 ? Vt : !0,
|
|
2272
|
+
messages: (Ft = k.messages) !== null && Ft !== void 0 ? Ft : !0,
|
|
2273
|
+
inlineRefs: (Kt = k.inlineRefs) !== null && Kt !== void 0 ? Kt : !0,
|
|
2274
|
+
schemaId: (qt = k.schemaId) !== null && qt !== void 0 ? qt : "$id",
|
|
2275
|
+
addUsedSchema: (Ut = k.addUsedSchema) !== null && Ut !== void 0 ? Ut : !0,
|
|
2276
|
+
validateSchema: (zt = k.validateSchema) !== null && zt !== void 0 ? zt : !0,
|
|
2277
|
+
validateFormats: (At = k.validateFormats) !== null && At !== void 0 ? At : !0,
|
|
2278
|
+
unicodeRegExp: (Lt = k.unicodeRegExp) !== null && Lt !== void 0 ? Lt : !0,
|
|
2279
|
+
int32range: (Gt = k.int32range) !== null && Gt !== void 0 ? Gt : !0,
|
|
2280
|
+
uriResolver: bo
|
|
2281
|
+
};
|
|
2282
|
+
}
|
|
2283
|
+
class R {
|
|
2284
|
+
constructor(p = {}) {
|
|
2285
|
+
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), p = this.opts = { ...p, ...P(p) };
|
|
2286
|
+
const { es5: S, lines: _ } = this.opts.code;
|
|
2287
|
+
this.scope = new d.ValueScope({ scope: {}, prefixes: v, es5: S, lines: _ }), this.logger = ie(p.logger);
|
|
2288
|
+
const n = p.validateFormats;
|
|
2289
|
+
p.validateFormats = !1, this.RULES = (0, a.getRules)(), C.call(this, h, p, "NOT SUPPORTED"), C.call(this, f, p, "DEPRECATED", "warn"), this._metaOpts = me.call(this), p.formats && oe.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), p.keywords && ae.call(this, p.keywords), typeof p.meta == "object" && this.addMetaSchema(p.meta), H.call(this), p.validateFormats = n;
|
|
2290
|
+
}
|
|
2291
|
+
_addVocabularies() {
|
|
2292
|
+
this.addKeyword("$async");
|
|
2293
|
+
}
|
|
2294
|
+
_addDefaultMetaSchema() {
|
|
2295
|
+
const { $data: p, meta: S, schemaId: _ } = this.opts;
|
|
2296
|
+
let n = y;
|
|
2297
|
+
_ === "id" && (n = { ...y }, n.id = n.$id, delete n.$id), S && p && this.addMetaSchema(n, n[_], !1);
|
|
2298
|
+
}
|
|
2299
|
+
defaultMeta() {
|
|
2300
|
+
const { meta: p, schemaId: S } = this.opts;
|
|
2301
|
+
return this.opts.defaultMeta = typeof p == "object" ? p[S] || p : void 0;
|
|
2302
|
+
}
|
|
2303
|
+
validate(p, S) {
|
|
2304
|
+
let _;
|
|
2305
|
+
if (typeof p == "string") {
|
|
2306
|
+
if (_ = this.getSchema(p), !_)
|
|
2307
|
+
throw new Error(`no schema with key or ref "${p}"`);
|
|
2308
|
+
} else
|
|
2309
|
+
_ = this.compile(p);
|
|
2310
|
+
const n = _(S);
|
|
2311
|
+
return "$async" in _ || (this.errors = _.errors), n;
|
|
2312
|
+
}
|
|
2313
|
+
compile(p, S) {
|
|
2314
|
+
const _ = this._addSchema(p, S);
|
|
2315
|
+
return _.validate || this._compileSchemaEnv(_);
|
|
2316
|
+
}
|
|
2317
|
+
compileAsync(p, S) {
|
|
2318
|
+
if (typeof this.opts.loadSchema != "function")
|
|
2319
|
+
throw new Error("options.loadSchema should be a function");
|
|
2320
|
+
const { loadSchema: _ } = this.opts;
|
|
2321
|
+
return n.call(this, p, S);
|
|
2322
|
+
async function n(U, V) {
|
|
2323
|
+
await c.call(this, U.$schema);
|
|
2324
|
+
const pe = this._addSchema(U, V);
|
|
2325
|
+
return pe.validate || w.call(this, pe);
|
|
2326
|
+
}
|
|
2327
|
+
async function c(U) {
|
|
2328
|
+
U && !this.getSchema(U) && await n.call(this, { $ref: U }, !0);
|
|
2329
|
+
}
|
|
2330
|
+
async function w(U) {
|
|
2331
|
+
try {
|
|
2332
|
+
return this._compileSchemaEnv(U);
|
|
2333
|
+
} catch (V) {
|
|
2334
|
+
if (!(V instanceof o.default))
|
|
2335
|
+
throw V;
|
|
2336
|
+
return j.call(this, V), await O.call(this, V.missingSchema), w.call(this, U);
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
function j({ missingSchema: U, missingRef: V }) {
|
|
2340
|
+
if (this.refs[U])
|
|
2341
|
+
throw new Error(`AnySchema ${U} is loaded but ${V} cannot be resolved`);
|
|
2342
|
+
}
|
|
2343
|
+
async function O(U) {
|
|
2344
|
+
const V = await A.call(this, U);
|
|
2345
|
+
this.refs[U] || await c.call(this, V.$schema), this.refs[U] || this.addSchema(V, U, S);
|
|
2346
|
+
}
|
|
2347
|
+
async function A(U) {
|
|
2348
|
+
const V = this._loading[U];
|
|
2349
|
+
if (V)
|
|
2350
|
+
return V;
|
|
2351
|
+
try {
|
|
2352
|
+
return await (this._loading[U] = _(U));
|
|
2353
|
+
} finally {
|
|
2354
|
+
delete this._loading[U];
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
// Adds schema to the instance
|
|
2359
|
+
addSchema(p, S, _, n = this.opts.validateSchema) {
|
|
2360
|
+
if (Array.isArray(p)) {
|
|
2361
|
+
for (const w of p)
|
|
2362
|
+
this.addSchema(w, void 0, _, n);
|
|
2363
|
+
return this;
|
|
2364
|
+
}
|
|
2365
|
+
let c;
|
|
2366
|
+
if (typeof p == "object") {
|
|
2367
|
+
const { schemaId: w } = this.opts;
|
|
2368
|
+
if (c = p[w], c !== void 0 && typeof c != "string")
|
|
2369
|
+
throw new Error(`schema ${w} must be string`);
|
|
2370
|
+
}
|
|
2371
|
+
return S = (0, u.normalizeId)(S || c), this._checkUnique(S), this.schemas[S] = this._addSchema(p, _, S, n, !0), this;
|
|
2372
|
+
}
|
|
2373
|
+
// Add schema that will be used to validate other schemas
|
|
2374
|
+
// options in META_IGNORE_OPTIONS are alway set to false
|
|
2375
|
+
addMetaSchema(p, S, _ = this.opts.validateSchema) {
|
|
2376
|
+
return this.addSchema(p, S, !0, _), this;
|
|
2377
|
+
}
|
|
2378
|
+
// Validate schema against its meta-schema
|
|
2379
|
+
validateSchema(p, S) {
|
|
2380
|
+
if (typeof p == "boolean")
|
|
2381
|
+
return !0;
|
|
2382
|
+
let _;
|
|
2383
|
+
if (_ = p.$schema, _ !== void 0 && typeof _ != "string")
|
|
2384
|
+
throw new Error("$schema must be a string");
|
|
2385
|
+
if (_ = _ || this.opts.defaultMeta || this.defaultMeta(), !_)
|
|
2386
|
+
return this.logger.warn("meta-schema not available"), this.errors = null, !0;
|
|
2387
|
+
const n = this.validate(_, p);
|
|
2388
|
+
if (!n && S) {
|
|
2389
|
+
const c = "schema is invalid: " + this.errorsText();
|
|
2390
|
+
if (this.opts.validateSchema === "log")
|
|
2391
|
+
this.logger.error(c);
|
|
2392
|
+
else
|
|
2393
|
+
throw new Error(c);
|
|
2394
|
+
}
|
|
2395
|
+
return n;
|
|
2396
|
+
}
|
|
2397
|
+
// Get compiled schema by `key` or `ref`.
|
|
2398
|
+
// (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
|
|
2399
|
+
getSchema(p) {
|
|
2400
|
+
let S;
|
|
2401
|
+
for (; typeof (S = L.call(this, p)) == "string"; )
|
|
2402
|
+
p = S;
|
|
2403
|
+
if (S === void 0) {
|
|
2404
|
+
const { schemaId: _ } = this.opts, n = new i.SchemaEnv({ schema: {}, schemaId: _ });
|
|
2405
|
+
if (S = i.resolveSchema.call(this, n, p), !S)
|
|
2406
|
+
return;
|
|
2407
|
+
this.refs[p] = S;
|
|
2408
|
+
}
|
|
2409
|
+
return S.validate || this._compileSchemaEnv(S);
|
|
2410
|
+
}
|
|
2411
|
+
// Remove cached schema(s).
|
|
2412
|
+
// If no parameter is passed all schemas but meta-schemas are removed.
|
|
2413
|
+
// If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
|
|
2414
|
+
// Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
|
|
2415
|
+
removeSchema(p) {
|
|
2416
|
+
if (p instanceof RegExp)
|
|
2417
|
+
return this._removeAllSchemas(this.schemas, p), this._removeAllSchemas(this.refs, p), this;
|
|
2418
|
+
switch (typeof p) {
|
|
2419
|
+
case "undefined":
|
|
2420
|
+
return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
|
|
2421
|
+
case "string": {
|
|
2422
|
+
const S = L.call(this, p);
|
|
2423
|
+
return typeof S == "object" && this._cache.delete(S.schema), delete this.schemas[p], delete this.refs[p], this;
|
|
2424
|
+
}
|
|
2425
|
+
case "object": {
|
|
2426
|
+
const S = p;
|
|
2427
|
+
this._cache.delete(S);
|
|
2428
|
+
let _ = p[this.opts.schemaId];
|
|
2429
|
+
return _ && (_ = (0, u.normalizeId)(_), delete this.schemas[_], delete this.refs[_]), this;
|
|
2430
|
+
}
|
|
2431
|
+
default:
|
|
2432
|
+
throw new Error("ajv.removeSchema: invalid parameter");
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
// add "vocabulary" - a collection of keywords
|
|
2436
|
+
addVocabulary(p) {
|
|
2437
|
+
for (const S of p)
|
|
2438
|
+
this.addKeyword(S);
|
|
2439
|
+
return this;
|
|
2440
|
+
}
|
|
2441
|
+
addKeyword(p, S) {
|
|
2442
|
+
let _;
|
|
2443
|
+
if (typeof p == "string")
|
|
2444
|
+
_ = p, typeof S == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), S.keyword = _);
|
|
2445
|
+
else if (typeof p == "object" && S === void 0) {
|
|
2446
|
+
if (S = p, _ = S.keyword, Array.isArray(_) && !_.length)
|
|
2447
|
+
throw new Error("addKeywords: keyword must be string or non-empty array");
|
|
2448
|
+
} else
|
|
2449
|
+
throw new Error("invalid addKeywords parameters");
|
|
2450
|
+
if (B.call(this, _, S), !S)
|
|
2451
|
+
return (0, m.eachItem)(_, (c) => ee.call(this, c)), this;
|
|
2452
|
+
qe.call(this, S);
|
|
2453
|
+
const n = {
|
|
2454
|
+
...S,
|
|
2455
|
+
type: (0, l.getJSONTypes)(S.type),
|
|
2456
|
+
schemaType: (0, l.getJSONTypes)(S.schemaType)
|
|
2457
|
+
};
|
|
2458
|
+
return (0, m.eachItem)(_, n.type.length === 0 ? (c) => ee.call(this, c, n) : (c) => n.type.forEach((w) => ee.call(this, c, n, w))), this;
|
|
2459
|
+
}
|
|
2460
|
+
getKeyword(p) {
|
|
2461
|
+
const S = this.RULES.all[p];
|
|
2462
|
+
return typeof S == "object" ? S.definition : !!S;
|
|
2463
|
+
}
|
|
2464
|
+
// Remove keyword
|
|
2465
|
+
removeKeyword(p) {
|
|
2466
|
+
const { RULES: S } = this;
|
|
2467
|
+
delete S.keywords[p], delete S.all[p];
|
|
2468
|
+
for (const _ of S.rules) {
|
|
2469
|
+
const n = _.rules.findIndex((c) => c.keyword === p);
|
|
2470
|
+
n >= 0 && _.rules.splice(n, 1);
|
|
2471
|
+
}
|
|
2472
|
+
return this;
|
|
2473
|
+
}
|
|
2474
|
+
// Add format
|
|
2475
|
+
addFormat(p, S) {
|
|
2476
|
+
return typeof S == "string" && (S = new RegExp(S)), this.formats[p] = S, this;
|
|
2477
|
+
}
|
|
2478
|
+
errorsText(p = this.errors, { separator: S = ", ", dataVar: _ = "data" } = {}) {
|
|
2479
|
+
return !p || p.length === 0 ? "No errors" : p.map((n) => `${_}${n.instancePath} ${n.message}`).reduce((n, c) => n + S + c);
|
|
2480
|
+
}
|
|
2481
|
+
$dataMetaSchema(p, S) {
|
|
2482
|
+
const _ = this.RULES.all;
|
|
2483
|
+
p = JSON.parse(JSON.stringify(p));
|
|
2484
|
+
for (const n of S) {
|
|
2485
|
+
const c = n.split("/").slice(1);
|
|
2486
|
+
let w = p;
|
|
2487
|
+
for (const j of c)
|
|
2488
|
+
w = w[j];
|
|
2489
|
+
for (const j in _) {
|
|
2490
|
+
const O = _[j];
|
|
2491
|
+
if (typeof O != "object")
|
|
2492
|
+
continue;
|
|
2493
|
+
const { $data: A } = O.definition, U = w[j];
|
|
2494
|
+
A && U && (w[j] = he(U));
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
return p;
|
|
2498
|
+
}
|
|
2499
|
+
_removeAllSchemas(p, S) {
|
|
2500
|
+
for (const _ in p) {
|
|
2501
|
+
const n = p[_];
|
|
2502
|
+
(!S || S.test(_)) && (typeof n == "string" ? delete p[_] : n && !n.meta && (this._cache.delete(n.schema), delete p[_]));
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
_addSchema(p, S, _, n = this.opts.validateSchema, c = this.opts.addUsedSchema) {
|
|
2506
|
+
let w;
|
|
2507
|
+
const { schemaId: j } = this.opts;
|
|
2508
|
+
if (typeof p == "object")
|
|
2509
|
+
w = p[j];
|
|
2510
|
+
else {
|
|
2511
|
+
if (this.opts.jtd)
|
|
2512
|
+
throw new Error("schema must be object");
|
|
2513
|
+
if (typeof p != "boolean")
|
|
2514
|
+
throw new Error("schema must be object or boolean");
|
|
2515
|
+
}
|
|
2516
|
+
let O = this._cache.get(p);
|
|
2517
|
+
if (O !== void 0)
|
|
2518
|
+
return O;
|
|
2519
|
+
_ = (0, u.normalizeId)(w || _);
|
|
2520
|
+
const A = u.getSchemaRefs.call(this, p, _);
|
|
2521
|
+
return O = new i.SchemaEnv({ schema: p, schemaId: j, meta: S, baseId: _, localRefs: A }), this._cache.set(O.schema, O), c && !_.startsWith("#") && (_ && this._checkUnique(_), this.refs[_] = O), n && this.validateSchema(p, !0), O;
|
|
2522
|
+
}
|
|
2523
|
+
_checkUnique(p) {
|
|
2524
|
+
if (this.schemas[p] || this.refs[p])
|
|
2525
|
+
throw new Error(`schema with key or id "${p}" already exists`);
|
|
2526
|
+
}
|
|
2527
|
+
_compileSchemaEnv(p) {
|
|
2528
|
+
if (p.meta ? this._compileMetaSchema(p) : i.compileSchema.call(this, p), !p.validate)
|
|
2529
|
+
throw new Error("ajv implementation error");
|
|
2530
|
+
return p.validate;
|
|
2531
|
+
}
|
|
2532
|
+
_compileMetaSchema(p) {
|
|
2533
|
+
const S = this.opts;
|
|
2534
|
+
this.opts = this._metaOpts;
|
|
2535
|
+
try {
|
|
2536
|
+
i.compileSchema.call(this, p);
|
|
2537
|
+
} finally {
|
|
2538
|
+
this.opts = S;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
R.ValidationError = s.default, R.MissingRefError = o.default, e.default = R;
|
|
2543
|
+
function C(k, p, S, _ = "error") {
|
|
2544
|
+
for (const n in k) {
|
|
2545
|
+
const c = n;
|
|
2546
|
+
c in p && this.logger[_](`${S}: option ${n}. ${k[c]}`);
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
function L(k) {
|
|
2550
|
+
return k = (0, u.normalizeId)(k), this.schemas[k] || this.refs[k];
|
|
2551
|
+
}
|
|
2552
|
+
function H() {
|
|
2553
|
+
const k = this.opts.schemas;
|
|
2554
|
+
if (k)
|
|
2555
|
+
if (Array.isArray(k))
|
|
2556
|
+
this.addSchema(k);
|
|
2557
|
+
else
|
|
2558
|
+
for (const p in k)
|
|
2559
|
+
this.addSchema(k[p], p);
|
|
2560
|
+
}
|
|
2561
|
+
function oe() {
|
|
2562
|
+
for (const k in this.opts.formats) {
|
|
2563
|
+
const p = this.opts.formats[k];
|
|
2564
|
+
p && this.addFormat(k, p);
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
function ae(k) {
|
|
2568
|
+
if (Array.isArray(k)) {
|
|
2569
|
+
this.addVocabulary(k);
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2572
|
+
this.logger.warn("keywords option as map is deprecated, pass array");
|
|
2573
|
+
for (const p in k) {
|
|
2574
|
+
const S = k[p];
|
|
2575
|
+
S.keyword || (S.keyword = p), this.addKeyword(S);
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
function me() {
|
|
2579
|
+
const k = { ...this.opts };
|
|
2580
|
+
for (const p of g)
|
|
2581
|
+
delete k[p];
|
|
2582
|
+
return k;
|
|
2583
|
+
}
|
|
2584
|
+
const Ee = { log() {
|
|
2585
|
+
}, warn() {
|
|
2586
|
+
}, error() {
|
|
2587
|
+
} };
|
|
2588
|
+
function ie(k) {
|
|
2589
|
+
if (k === !1)
|
|
2590
|
+
return Ee;
|
|
2591
|
+
if (k === void 0)
|
|
2592
|
+
return console;
|
|
2593
|
+
if (k.log && k.warn && k.error)
|
|
2594
|
+
return k;
|
|
2595
|
+
throw new Error("logger must implement log, warn and error methods");
|
|
2596
|
+
}
|
|
2597
|
+
const z = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
2598
|
+
function B(k, p) {
|
|
2599
|
+
const { RULES: S } = this;
|
|
2600
|
+
if ((0, m.eachItem)(k, (_) => {
|
|
2601
|
+
if (S.keywords[_])
|
|
2602
|
+
throw new Error(`Keyword ${_} is already defined`);
|
|
2603
|
+
if (!z.test(_))
|
|
2604
|
+
throw new Error(`Keyword ${_} has invalid name`);
|
|
2605
|
+
}), !!p && p.$data && !("code" in p || "validate" in p))
|
|
2606
|
+
throw new Error('$data keyword must have "code" or "validate" function');
|
|
2607
|
+
}
|
|
2608
|
+
function ee(k, p, S) {
|
|
2609
|
+
var _;
|
|
2610
|
+
const n = p == null ? void 0 : p.post;
|
|
2611
|
+
if (S && n)
|
|
2612
|
+
throw new Error('keyword with "post" flag cannot have "type"');
|
|
2613
|
+
const { RULES: c } = this;
|
|
2614
|
+
let w = n ? c.post : c.rules.find(({ type: O }) => O === S);
|
|
2615
|
+
if (w || (w = { type: S, rules: [] }, c.rules.push(w)), c.keywords[k] = !0, !p)
|
|
2616
|
+
return;
|
|
2617
|
+
const j = {
|
|
2618
|
+
keyword: k,
|
|
2619
|
+
definition: {
|
|
2620
|
+
...p,
|
|
2621
|
+
type: (0, l.getJSONTypes)(p.type),
|
|
2622
|
+
schemaType: (0, l.getJSONTypes)(p.schemaType)
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
p.before ? Ke.call(this, w, j, p.before) : w.rules.push(j), c.all[k] = j, (_ = p.implements) === null || _ === void 0 || _.forEach((O) => this.addKeyword(O));
|
|
2626
|
+
}
|
|
2627
|
+
function Ke(k, p, S) {
|
|
2628
|
+
const _ = k.rules.findIndex((n) => n.keyword === S);
|
|
2629
|
+
_ >= 0 ? k.rules.splice(_, 0, p) : (k.rules.push(p), this.logger.warn(`rule ${S} is not defined`));
|
|
2630
|
+
}
|
|
2631
|
+
function qe(k) {
|
|
2632
|
+
let { metaSchema: p } = k;
|
|
2633
|
+
p !== void 0 && (k.$data && this.opts.$data && (p = he(p)), k.validateSchema = this.compile(p, !0));
|
|
2634
|
+
}
|
|
2635
|
+
const $e = {
|
|
2636
|
+
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
2637
|
+
};
|
|
2638
|
+
function he(k) {
|
|
2639
|
+
return { anyOf: [k, $e] };
|
|
2640
|
+
}
|
|
2641
|
+
})(Vs);
|
|
2642
|
+
var gr = {}, wr = {}, br = {};
|
|
2643
|
+
Object.defineProperty(br, "__esModule", { value: !0 });
|
|
2644
|
+
const $i = {
|
|
2645
|
+
keyword: "id",
|
|
2646
|
+
code() {
|
|
2647
|
+
throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
|
|
2648
|
+
}
|
|
2649
|
+
};
|
|
2650
|
+
br.default = $i;
|
|
2651
|
+
var Fe = {};
|
|
2652
|
+
Object.defineProperty(Fe, "__esModule", { value: !0 });
|
|
2653
|
+
Fe.callRef = Fe.getValidate = void 0;
|
|
2654
|
+
const gi = Ye, ls = K, te = q, Le = ve, ds = re, vt = N, wi = {
|
|
2655
|
+
keyword: "$ref",
|
|
2656
|
+
schemaType: "string",
|
|
2657
|
+
code(e) {
|
|
2658
|
+
const { gen: t, schema: r, it: s } = e, { baseId: o, schemaEnv: a, validateName: i, opts: d, self: u } = s, { root: l } = a;
|
|
2659
|
+
if ((r === "#" || r === "#/") && o === l.baseId)
|
|
2660
|
+
return y();
|
|
2661
|
+
const m = ds.resolveRef.call(u, l, o, r);
|
|
2662
|
+
if (m === void 0)
|
|
2663
|
+
throw new gi.default(s.opts.uriResolver, o, r);
|
|
2664
|
+
if (m instanceof ds.SchemaEnv)
|
|
2665
|
+
return b(m);
|
|
2666
|
+
return E(m);
|
|
2667
|
+
function y() {
|
|
2668
|
+
if (a === l)
|
|
2669
|
+
return Et(e, i, a, a.$async);
|
|
2670
|
+
const g = t.scopeValue("root", { ref: l });
|
|
2671
|
+
return Et(e, (0, te._)`${g}.validate`, l, l.$async);
|
|
2672
|
+
}
|
|
2673
|
+
function b(g) {
|
|
2674
|
+
const v = ho(e, g);
|
|
2675
|
+
Et(e, v, g, g.$async);
|
|
2676
|
+
}
|
|
2677
|
+
function E(g) {
|
|
2678
|
+
const v = t.scopeValue("schema", d.code.source === !0 ? { ref: g, code: (0, te.stringify)(g) } : { ref: g }), h = t.name("valid"), f = e.subschema({
|
|
2679
|
+
schema: g,
|
|
2680
|
+
dataTypes: [],
|
|
2681
|
+
schemaPath: te.nil,
|
|
2682
|
+
topSchemaRef: v,
|
|
2683
|
+
errSchemaPath: r
|
|
2684
|
+
}, h);
|
|
2685
|
+
e.mergeEvaluated(f), e.ok(h);
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
function ho(e, t) {
|
|
2690
|
+
const { gen: r } = e;
|
|
2691
|
+
return t.validate ? r.scopeValue("validate", { ref: t.validate }) : (0, te._)`${r.scopeValue("wrapper", { ref: t })}.validate`;
|
|
2692
|
+
}
|
|
2693
|
+
Fe.getValidate = ho;
|
|
2694
|
+
function Et(e, t, r, s) {
|
|
2695
|
+
const { gen: o, it: a } = e, { allErrors: i, schemaEnv: d, opts: u } = a, l = u.passContext ? Le.default.this : te.nil;
|
|
2696
|
+
s ? m() : y();
|
|
2697
|
+
function m() {
|
|
2698
|
+
if (!d.$async)
|
|
2699
|
+
throw new Error("async schema referenced by sync schema");
|
|
2700
|
+
const g = o.let("valid");
|
|
2701
|
+
o.try(() => {
|
|
2702
|
+
o.code((0, te._)`await ${(0, ls.callValidateCode)(e, t, l)}`), E(t), i || o.assign(g, !0);
|
|
2703
|
+
}, (v) => {
|
|
2704
|
+
o.if((0, te._)`!(${v} instanceof ${a.ValidationError})`, () => o.throw(v)), b(v), i || o.assign(g, !1);
|
|
2705
|
+
}), e.ok(g);
|
|
2706
|
+
}
|
|
2707
|
+
function y() {
|
|
2708
|
+
e.result((0, ls.callValidateCode)(e, t, l), () => E(t), () => b(t));
|
|
2709
|
+
}
|
|
2710
|
+
function b(g) {
|
|
2711
|
+
const v = (0, te._)`${g}.errors`;
|
|
2712
|
+
o.assign(Le.default.vErrors, (0, te._)`${Le.default.vErrors} === null ? ${v} : ${Le.default.vErrors}.concat(${v})`), o.assign(Le.default.errors, (0, te._)`${Le.default.vErrors}.length`);
|
|
2713
|
+
}
|
|
2714
|
+
function E(g) {
|
|
2715
|
+
var v;
|
|
2716
|
+
if (!a.opts.unevaluated)
|
|
2717
|
+
return;
|
|
2718
|
+
const h = (v = r == null ? void 0 : r.validate) === null || v === void 0 ? void 0 : v.evaluated;
|
|
2719
|
+
if (a.props !== !0)
|
|
2720
|
+
if (h && !h.dynamicProps)
|
|
2721
|
+
h.props !== void 0 && (a.props = vt.mergeEvaluated.props(o, h.props, a.props));
|
|
2722
|
+
else {
|
|
2723
|
+
const f = o.var("props", (0, te._)`${g}.evaluated.props`);
|
|
2724
|
+
a.props = vt.mergeEvaluated.props(o, f, a.props, te.Name);
|
|
2725
|
+
}
|
|
2726
|
+
if (a.items !== !0)
|
|
2727
|
+
if (h && !h.dynamicItems)
|
|
2728
|
+
h.items !== void 0 && (a.items = vt.mergeEvaluated.items(o, h.items, a.items));
|
|
2729
|
+
else {
|
|
2730
|
+
const f = o.var("items", (0, te._)`${g}.evaluated.items`);
|
|
2731
|
+
a.items = vt.mergeEvaluated.items(o, f, a.items, te.Name);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
Fe.callRef = Et;
|
|
2736
|
+
Fe.default = wi;
|
|
2737
|
+
Object.defineProperty(wr, "__esModule", { value: !0 });
|
|
2738
|
+
const bi = br, Ei = Fe, Si = [
|
|
2739
|
+
"$schema",
|
|
2740
|
+
"$id",
|
|
2741
|
+
"$defs",
|
|
2742
|
+
"$vocabulary",
|
|
2743
|
+
{ keyword: "$comment" },
|
|
2744
|
+
"definitions",
|
|
2745
|
+
bi.default,
|
|
2746
|
+
Ei.default
|
|
2747
|
+
];
|
|
2748
|
+
wr.default = Si;
|
|
2749
|
+
var Er = {}, Sr = {};
|
|
2750
|
+
Object.defineProperty(Sr, "__esModule", { value: !0 });
|
|
2751
|
+
const Nt = q, Pe = Nt.operators, Ct = {
|
|
2752
|
+
maximum: { okStr: "<=", ok: Pe.LTE, fail: Pe.GT },
|
|
2753
|
+
minimum: { okStr: ">=", ok: Pe.GTE, fail: Pe.LT },
|
|
2754
|
+
exclusiveMaximum: { okStr: "<", ok: Pe.LT, fail: Pe.GTE },
|
|
2755
|
+
exclusiveMinimum: { okStr: ">", ok: Pe.GT, fail: Pe.LTE }
|
|
2756
|
+
}, Pi = {
|
|
2757
|
+
message: ({ keyword: e, schemaCode: t }) => (0, Nt.str)`must be ${Ct[e].okStr} ${t}`,
|
|
2758
|
+
params: ({ keyword: e, schemaCode: t }) => (0, Nt._)`{comparison: ${Ct[e].okStr}, limit: ${t}}`
|
|
2759
|
+
}, ki = {
|
|
2760
|
+
keyword: Object.keys(Ct),
|
|
2761
|
+
type: "number",
|
|
2762
|
+
schemaType: "number",
|
|
2763
|
+
$data: !0,
|
|
2764
|
+
error: Pi,
|
|
2765
|
+
code(e) {
|
|
2766
|
+
const { keyword: t, data: r, schemaCode: s } = e;
|
|
2767
|
+
e.fail$data((0, Nt._)`${r} ${Ct[t].fail} ${s} || isNaN(${r})`);
|
|
2768
|
+
}
|
|
2769
|
+
};
|
|
2770
|
+
Sr.default = ki;
|
|
2771
|
+
var Pr = {};
|
|
2772
|
+
Object.defineProperty(Pr, "__esModule", { value: !0 });
|
|
2773
|
+
const at = q, Ni = {
|
|
2774
|
+
message: ({ schemaCode: e }) => (0, at.str)`must be multiple of ${e}`,
|
|
2775
|
+
params: ({ schemaCode: e }) => (0, at._)`{multipleOf: ${e}}`
|
|
2776
|
+
}, Ci = {
|
|
2777
|
+
keyword: "multipleOf",
|
|
2778
|
+
type: "number",
|
|
2779
|
+
schemaType: "number",
|
|
2780
|
+
$data: !0,
|
|
2781
|
+
error: Ni,
|
|
2782
|
+
code(e) {
|
|
2783
|
+
const { gen: t, data: r, schemaCode: s, it: o } = e, a = o.opts.multipleOfPrecision, i = t.let("res"), d = a ? (0, at._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${a}` : (0, at._)`${i} !== parseInt(${i})`;
|
|
2784
|
+
e.fail$data((0, at._)`(${s} === 0 || (${i} = ${r}/${s}, ${d}))`);
|
|
2785
|
+
}
|
|
2786
|
+
};
|
|
2787
|
+
Pr.default = Ci;
|
|
2788
|
+
var kr = {}, Nr = {};
|
|
2789
|
+
Object.defineProperty(Nr, "__esModule", { value: !0 });
|
|
2790
|
+
function po(e) {
|
|
2791
|
+
const t = e.length;
|
|
2792
|
+
let r = 0, s = 0, o;
|
|
2793
|
+
for (; s < t; )
|
|
2794
|
+
r++, o = e.charCodeAt(s++), o >= 55296 && o <= 56319 && s < t && (o = e.charCodeAt(s), (o & 64512) === 56320 && s++);
|
|
2795
|
+
return r;
|
|
2796
|
+
}
|
|
2797
|
+
Nr.default = po;
|
|
2798
|
+
po.code = 'require("ajv/dist/runtime/ucs2length").default';
|
|
2799
|
+
Object.defineProperty(kr, "__esModule", { value: !0 });
|
|
2800
|
+
const Ie = q, ji = N, Ri = Nr, Oi = {
|
|
2801
|
+
message({ keyword: e, schemaCode: t }) {
|
|
2802
|
+
const r = e === "maxLength" ? "more" : "fewer";
|
|
2803
|
+
return (0, Ie.str)`must NOT have ${r} than ${t} characters`;
|
|
2804
|
+
},
|
|
2805
|
+
params: ({ schemaCode: e }) => (0, Ie._)`{limit: ${e}}`
|
|
2806
|
+
}, Ti = {
|
|
2807
|
+
keyword: ["maxLength", "minLength"],
|
|
2808
|
+
type: "string",
|
|
2809
|
+
schemaType: "number",
|
|
2810
|
+
$data: !0,
|
|
2811
|
+
error: Oi,
|
|
2812
|
+
code(e) {
|
|
2813
|
+
const { keyword: t, data: r, schemaCode: s, it: o } = e, a = t === "maxLength" ? Ie.operators.GT : Ie.operators.LT, i = o.opts.unicode === !1 ? (0, Ie._)`${r}.length` : (0, Ie._)`${(0, ji.useFunc)(e.gen, Ri.default)}(${r})`;
|
|
2814
|
+
e.fail$data((0, Ie._)`${i} ${a} ${s}`);
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
kr.default = Ti;
|
|
2818
|
+
var Cr = {};
|
|
2819
|
+
Object.defineProperty(Cr, "__esModule", { value: !0 });
|
|
2820
|
+
const Ii = K, Mi = N, Je = q, Vi = {
|
|
2821
|
+
message: ({ schemaCode: e }) => (0, Je.str)`must match pattern "${e}"`,
|
|
2822
|
+
params: ({ schemaCode: e }) => (0, Je._)`{pattern: ${e}}`
|
|
2823
|
+
}, Fi = {
|
|
2824
|
+
keyword: "pattern",
|
|
2825
|
+
type: "string",
|
|
2826
|
+
schemaType: "string",
|
|
2827
|
+
$data: !0,
|
|
2828
|
+
error: Vi,
|
|
2829
|
+
code(e) {
|
|
2830
|
+
const { gen: t, data: r, $data: s, schema: o, schemaCode: a, it: i } = e, d = i.opts.unicodeRegExp ? "u" : "";
|
|
2831
|
+
if (s) {
|
|
2832
|
+
const { regExp: u } = i.opts.code, l = u.code === "new RegExp" ? (0, Je._)`new RegExp` : (0, Mi.useFunc)(t, u), m = t.let("valid");
|
|
2833
|
+
t.try(() => t.assign(m, (0, Je._)`${l}(${a}, ${d}).test(${r})`), () => t.assign(m, !1)), e.fail$data((0, Je._)`!${m}`);
|
|
2834
|
+
} else {
|
|
2835
|
+
const u = (0, Ii.usePattern)(e, o);
|
|
2836
|
+
e.fail$data((0, Je._)`!${u}.test(${r})`);
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
};
|
|
2840
|
+
Cr.default = Fi;
|
|
2841
|
+
var jr = {};
|
|
2842
|
+
Object.defineProperty(jr, "__esModule", { value: !0 });
|
|
2843
|
+
const it = q, Ki = {
|
|
2844
|
+
message({ keyword: e, schemaCode: t }) {
|
|
2845
|
+
const r = e === "maxProperties" ? "more" : "fewer";
|
|
2846
|
+
return (0, it.str)`must NOT have ${r} than ${t} properties`;
|
|
2847
|
+
},
|
|
2848
|
+
params: ({ schemaCode: e }) => (0, it._)`{limit: ${e}}`
|
|
2849
|
+
}, qi = {
|
|
2850
|
+
keyword: ["maxProperties", "minProperties"],
|
|
2851
|
+
type: "object",
|
|
2852
|
+
schemaType: "number",
|
|
2853
|
+
$data: !0,
|
|
2854
|
+
error: Ki,
|
|
2855
|
+
code(e) {
|
|
2856
|
+
const { keyword: t, data: r, schemaCode: s } = e, o = t === "maxProperties" ? it.operators.GT : it.operators.LT;
|
|
2857
|
+
e.fail$data((0, it._)`Object.keys(${r}).length ${o} ${s}`);
|
|
2858
|
+
}
|
|
2859
|
+
};
|
|
2860
|
+
jr.default = qi;
|
|
2861
|
+
var Rr = {};
|
|
2862
|
+
Object.defineProperty(Rr, "__esModule", { value: !0 });
|
|
2863
|
+
const rt = K, ct = q, Ui = N, zi = {
|
|
2864
|
+
message: ({ params: { missingProperty: e } }) => (0, ct.str)`must have required property '${e}'`,
|
|
2865
|
+
params: ({ params: { missingProperty: e } }) => (0, ct._)`{missingProperty: ${e}}`
|
|
2866
|
+
}, Ai = {
|
|
2867
|
+
keyword: "required",
|
|
2868
|
+
type: "object",
|
|
2869
|
+
schemaType: "array",
|
|
2870
|
+
$data: !0,
|
|
2871
|
+
error: zi,
|
|
2872
|
+
code(e) {
|
|
2873
|
+
const { gen: t, schema: r, schemaCode: s, data: o, $data: a, it: i } = e, { opts: d } = i;
|
|
2874
|
+
if (!a && r.length === 0)
|
|
2875
|
+
return;
|
|
2876
|
+
const u = r.length >= d.loopRequired;
|
|
2877
|
+
if (i.allErrors ? l() : m(), d.strictRequired) {
|
|
2878
|
+
const E = e.parentSchema.properties, { definedProperties: g } = e.it;
|
|
2879
|
+
for (const v of r)
|
|
2880
|
+
if ((E == null ? void 0 : E[v]) === void 0 && !g.has(v)) {
|
|
2881
|
+
const h = i.schemaEnv.baseId + i.errSchemaPath, f = `required property "${v}" is not defined at "${h}" (strictRequired)`;
|
|
2882
|
+
(0, Ui.checkStrictMode)(i, f, i.opts.strictRequired);
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
function l() {
|
|
2886
|
+
if (u || a)
|
|
2887
|
+
e.block$data(ct.nil, y);
|
|
2888
|
+
else
|
|
2889
|
+
for (const E of r)
|
|
2890
|
+
(0, rt.checkReportMissingProp)(e, E);
|
|
2891
|
+
}
|
|
2892
|
+
function m() {
|
|
2893
|
+
const E = t.let("missing");
|
|
2894
|
+
if (u || a) {
|
|
2895
|
+
const g = t.let("valid", !0);
|
|
2896
|
+
e.block$data(g, () => b(E, g)), e.ok(g);
|
|
2897
|
+
} else
|
|
2898
|
+
t.if((0, rt.checkMissingProp)(e, r, E)), (0, rt.reportMissingProp)(e, E), t.else();
|
|
2899
|
+
}
|
|
2900
|
+
function y() {
|
|
2901
|
+
t.forOf("prop", s, (E) => {
|
|
2902
|
+
e.setParams({ missingProperty: E }), t.if((0, rt.noPropertyInData)(t, o, E, d.ownProperties), () => e.error());
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
function b(E, g) {
|
|
2906
|
+
e.setParams({ missingProperty: E }), t.forOf(E, s, () => {
|
|
2907
|
+
t.assign(g, (0, rt.propertyInData)(t, o, E, d.ownProperties)), t.if((0, ct.not)(g), () => {
|
|
2908
|
+
e.error(), t.break();
|
|
2909
|
+
});
|
|
2910
|
+
}, ct.nil);
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
};
|
|
2914
|
+
Rr.default = Ai;
|
|
2915
|
+
var Or = {};
|
|
2916
|
+
Object.defineProperty(Or, "__esModule", { value: !0 });
|
|
2917
|
+
const lt = q, Li = {
|
|
2918
|
+
message({ keyword: e, schemaCode: t }) {
|
|
2919
|
+
const r = e === "maxItems" ? "more" : "fewer";
|
|
2920
|
+
return (0, lt.str)`must NOT have ${r} than ${t} items`;
|
|
2921
|
+
},
|
|
2922
|
+
params: ({ schemaCode: e }) => (0, lt._)`{limit: ${e}}`
|
|
2923
|
+
}, Gi = {
|
|
2924
|
+
keyword: ["maxItems", "minItems"],
|
|
2925
|
+
type: "array",
|
|
2926
|
+
schemaType: "number",
|
|
2927
|
+
$data: !0,
|
|
2928
|
+
error: Li,
|
|
2929
|
+
code(e) {
|
|
2930
|
+
const { keyword: t, data: r, schemaCode: s } = e, o = t === "maxItems" ? lt.operators.GT : lt.operators.LT;
|
|
2931
|
+
e.fail$data((0, lt._)`${r}.length ${o} ${s}`);
|
|
2932
|
+
}
|
|
2933
|
+
};
|
|
2934
|
+
Or.default = Gi;
|
|
2935
|
+
var Tr = {}, pt = {};
|
|
2936
|
+
Object.defineProperty(pt, "__esModule", { value: !0 });
|
|
2937
|
+
const yo = Ps;
|
|
2938
|
+
yo.code = 'require("ajv/dist/runtime/equal").default';
|
|
2939
|
+
pt.default = yo;
|
|
2940
|
+
Object.defineProperty(Tr, "__esModule", { value: !0 });
|
|
2941
|
+
const Yt = X, Y = q, Ji = N, Hi = pt, Bi = {
|
|
2942
|
+
message: ({ params: { i: e, j: t } }) => (0, Y.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
|
|
2943
|
+
params: ({ params: { i: e, j: t } }) => (0, Y._)`{i: ${e}, j: ${t}}`
|
|
2944
|
+
}, Qi = {
|
|
2945
|
+
keyword: "uniqueItems",
|
|
2946
|
+
type: "array",
|
|
2947
|
+
schemaType: "boolean",
|
|
2948
|
+
$data: !0,
|
|
2949
|
+
error: Bi,
|
|
2950
|
+
code(e) {
|
|
2951
|
+
const { gen: t, data: r, $data: s, schema: o, parentSchema: a, schemaCode: i, it: d } = e;
|
|
2952
|
+
if (!s && !o)
|
|
2953
|
+
return;
|
|
2954
|
+
const u = t.let("valid"), l = a.items ? (0, Yt.getSchemaTypes)(a.items) : [];
|
|
2955
|
+
e.block$data(u, m, (0, Y._)`${i} === false`), e.ok(u);
|
|
2956
|
+
function m() {
|
|
2957
|
+
const g = t.let("i", (0, Y._)`${r}.length`), v = t.let("j");
|
|
2958
|
+
e.setParams({ i: g, j: v }), t.assign(u, !0), t.if((0, Y._)`${g} > 1`, () => (y() ? b : E)(g, v));
|
|
2959
|
+
}
|
|
2960
|
+
function y() {
|
|
2961
|
+
return l.length > 0 && !l.some((g) => g === "object" || g === "array");
|
|
2962
|
+
}
|
|
2963
|
+
function b(g, v) {
|
|
2964
|
+
const h = t.name("item"), f = (0, Yt.checkDataTypes)(l, h, d.opts.strictNumbers, Yt.DataType.Wrong), $ = t.const("indices", (0, Y._)`{}`);
|
|
2965
|
+
t.for((0, Y._)`;${g}--;`, () => {
|
|
2966
|
+
t.let(h, (0, Y._)`${r}[${g}]`), t.if(f, (0, Y._)`continue`), l.length > 1 && t.if((0, Y._)`typeof ${h} == "string"`, (0, Y._)`${h} += "_"`), t.if((0, Y._)`typeof ${$}[${h}] == "number"`, () => {
|
|
2967
|
+
t.assign(v, (0, Y._)`${$}[${h}]`), e.error(), t.assign(u, !1).break();
|
|
2968
|
+
}).code((0, Y._)`${$}[${h}] = ${g}`);
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
function E(g, v) {
|
|
2972
|
+
const h = (0, Ji.useFunc)(t, Hi.default), f = t.name("outer");
|
|
2973
|
+
t.label(f).for((0, Y._)`;${g}--;`, () => t.for((0, Y._)`${v} = ${g}; ${v}--;`, () => t.if((0, Y._)`${h}(${r}[${g}], ${r}[${v}])`, () => {
|
|
2974
|
+
e.error(), t.assign(u, !1).break(f);
|
|
2975
|
+
})));
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
Tr.default = Qi;
|
|
2980
|
+
var Ir = {};
|
|
2981
|
+
Object.defineProperty(Ir, "__esModule", { value: !0 });
|
|
2982
|
+
const ar = q, Xi = N, Yi = pt, Zi = {
|
|
2983
|
+
message: "must be equal to constant",
|
|
2984
|
+
params: ({ schemaCode: e }) => (0, ar._)`{allowedValue: ${e}}`
|
|
2985
|
+
}, Di = {
|
|
2986
|
+
keyword: "const",
|
|
2987
|
+
$data: !0,
|
|
2988
|
+
error: Zi,
|
|
2989
|
+
code(e) {
|
|
2990
|
+
const { gen: t, data: r, $data: s, schemaCode: o, schema: a } = e;
|
|
2991
|
+
s || a && typeof a == "object" ? e.fail$data((0, ar._)`!${(0, Xi.useFunc)(t, Yi.default)}(${r}, ${o})`) : e.fail((0, ar._)`${a} !== ${r}`);
|
|
2992
|
+
}
|
|
2993
|
+
};
|
|
2994
|
+
Ir.default = Di;
|
|
2995
|
+
var Mr = {};
|
|
2996
|
+
Object.defineProperty(Mr, "__esModule", { value: !0 });
|
|
2997
|
+
const st = q, Wi = N, xi = pt, ec = {
|
|
2998
|
+
message: "must be equal to one of the allowed values",
|
|
2999
|
+
params: ({ schemaCode: e }) => (0, st._)`{allowedValues: ${e}}`
|
|
3000
|
+
}, tc = {
|
|
3001
|
+
keyword: "enum",
|
|
3002
|
+
schemaType: "array",
|
|
3003
|
+
$data: !0,
|
|
3004
|
+
error: ec,
|
|
3005
|
+
code(e) {
|
|
3006
|
+
const { gen: t, data: r, $data: s, schema: o, schemaCode: a, it: i } = e;
|
|
3007
|
+
if (!s && o.length === 0)
|
|
3008
|
+
throw new Error("enum must have non-empty array");
|
|
3009
|
+
const d = o.length >= i.opts.loopEnum;
|
|
3010
|
+
let u;
|
|
3011
|
+
const l = () => u ?? (u = (0, Wi.useFunc)(t, xi.default));
|
|
3012
|
+
let m;
|
|
3013
|
+
if (d || s)
|
|
3014
|
+
m = t.let("valid"), e.block$data(m, y);
|
|
3015
|
+
else {
|
|
3016
|
+
if (!Array.isArray(o))
|
|
3017
|
+
throw new Error("ajv implementation error");
|
|
3018
|
+
const E = t.const("vSchema", a);
|
|
3019
|
+
m = (0, st.or)(...o.map((g, v) => b(E, v)));
|
|
3020
|
+
}
|
|
3021
|
+
e.pass(m);
|
|
3022
|
+
function y() {
|
|
3023
|
+
t.assign(m, !1), t.forOf("v", a, (E) => t.if((0, st._)`${l()}(${r}, ${E})`, () => t.assign(m, !0).break()));
|
|
3024
|
+
}
|
|
3025
|
+
function b(E, g) {
|
|
3026
|
+
const v = o[g];
|
|
3027
|
+
return typeof v == "object" && v !== null ? (0, st._)`${l()}(${r}, ${E}[${g}])` : (0, st._)`${r} === ${v}`;
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
Mr.default = tc;
|
|
3032
|
+
Object.defineProperty(Er, "__esModule", { value: !0 });
|
|
3033
|
+
const rc = Sr, sc = Pr, oc = kr, nc = Cr, ac = jr, ic = Rr, cc = Or, lc = Tr, dc = Ir, uc = Mr, fc = [
|
|
3034
|
+
// number
|
|
3035
|
+
rc.default,
|
|
3036
|
+
sc.default,
|
|
3037
|
+
// string
|
|
3038
|
+
oc.default,
|
|
3039
|
+
nc.default,
|
|
3040
|
+
// object
|
|
3041
|
+
ac.default,
|
|
3042
|
+
ic.default,
|
|
3043
|
+
// array
|
|
3044
|
+
cc.default,
|
|
3045
|
+
lc.default,
|
|
3046
|
+
// any
|
|
3047
|
+
{ keyword: "type", schemaType: ["string", "array"] },
|
|
3048
|
+
{ keyword: "nullable", schemaType: "boolean" },
|
|
3049
|
+
dc.default,
|
|
3050
|
+
uc.default
|
|
3051
|
+
];
|
|
3052
|
+
Er.default = fc;
|
|
3053
|
+
var Vr = {}, Ze = {};
|
|
3054
|
+
Object.defineProperty(Ze, "__esModule", { value: !0 });
|
|
3055
|
+
Ze.validateAdditionalItems = void 0;
|
|
3056
|
+
const Me = q, ir = N, mc = {
|
|
3057
|
+
message: ({ params: { len: e } }) => (0, Me.str)`must NOT have more than ${e} items`,
|
|
3058
|
+
params: ({ params: { len: e } }) => (0, Me._)`{limit: ${e}}`
|
|
3059
|
+
}, hc = {
|
|
3060
|
+
keyword: "additionalItems",
|
|
3061
|
+
type: "array",
|
|
3062
|
+
schemaType: ["boolean", "object"],
|
|
3063
|
+
before: "uniqueItems",
|
|
3064
|
+
error: mc,
|
|
3065
|
+
code(e) {
|
|
3066
|
+
const { parentSchema: t, it: r } = e, { items: s } = t;
|
|
3067
|
+
if (!Array.isArray(s)) {
|
|
3068
|
+
(0, ir.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas');
|
|
3069
|
+
return;
|
|
3070
|
+
}
|
|
3071
|
+
_o(e, s);
|
|
3072
|
+
}
|
|
3073
|
+
};
|
|
3074
|
+
function _o(e, t) {
|
|
3075
|
+
const { gen: r, schema: s, data: o, keyword: a, it: i } = e;
|
|
3076
|
+
i.items = !0;
|
|
3077
|
+
const d = r.const("len", (0, Me._)`${o}.length`);
|
|
3078
|
+
if (s === !1)
|
|
3079
|
+
e.setParams({ len: t.length }), e.pass((0, Me._)`${d} <= ${t.length}`);
|
|
3080
|
+
else if (typeof s == "object" && !(0, ir.alwaysValidSchema)(i, s)) {
|
|
3081
|
+
const l = r.var("valid", (0, Me._)`${d} <= ${t.length}`);
|
|
3082
|
+
r.if((0, Me.not)(l), () => u(l)), e.ok(l);
|
|
3083
|
+
}
|
|
3084
|
+
function u(l) {
|
|
3085
|
+
r.forRange("i", t.length, d, (m) => {
|
|
3086
|
+
e.subschema({ keyword: a, dataProp: m, dataPropType: ir.Type.Num }, l), i.allErrors || r.if((0, Me.not)(l), () => r.break());
|
|
3087
|
+
});
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
Ze.validateAdditionalItems = _o;
|
|
3091
|
+
Ze.default = hc;
|
|
3092
|
+
var Fr = {}, De = {};
|
|
3093
|
+
Object.defineProperty(De, "__esModule", { value: !0 });
|
|
3094
|
+
De.validateTuple = void 0;
|
|
3095
|
+
const us = q, St = N, pc = K, yc = {
|
|
3096
|
+
keyword: "items",
|
|
3097
|
+
type: "array",
|
|
3098
|
+
schemaType: ["object", "array", "boolean"],
|
|
3099
|
+
before: "uniqueItems",
|
|
3100
|
+
code(e) {
|
|
3101
|
+
const { schema: t, it: r } = e;
|
|
3102
|
+
if (Array.isArray(t))
|
|
3103
|
+
return vo(e, "additionalItems", t);
|
|
3104
|
+
r.items = !0, !(0, St.alwaysValidSchema)(r, t) && e.ok((0, pc.validateArray)(e));
|
|
3105
|
+
}
|
|
3106
|
+
};
|
|
3107
|
+
function vo(e, t, r = e.schema) {
|
|
3108
|
+
const { gen: s, parentSchema: o, data: a, keyword: i, it: d } = e;
|
|
3109
|
+
m(o), d.opts.unevaluated && r.length && d.items !== !0 && (d.items = St.mergeEvaluated.items(s, r.length, d.items));
|
|
3110
|
+
const u = s.name("valid"), l = s.const("len", (0, us._)`${a}.length`);
|
|
3111
|
+
r.forEach((y, b) => {
|
|
3112
|
+
(0, St.alwaysValidSchema)(d, y) || (s.if((0, us._)`${l} > ${b}`, () => e.subschema({
|
|
3113
|
+
keyword: i,
|
|
3114
|
+
schemaProp: b,
|
|
3115
|
+
dataProp: b
|
|
3116
|
+
}, u)), e.ok(u));
|
|
3117
|
+
});
|
|
3118
|
+
function m(y) {
|
|
3119
|
+
const { opts: b, errSchemaPath: E } = d, g = r.length, v = g === y.minItems && (g === y.maxItems || y[t] === !1);
|
|
3120
|
+
if (b.strictTuples && !v) {
|
|
3121
|
+
const h = `"${i}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${E}"`;
|
|
3122
|
+
(0, St.checkStrictMode)(d, h, b.strictTuples);
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
De.validateTuple = vo;
|
|
3127
|
+
De.default = yc;
|
|
3128
|
+
Object.defineProperty(Fr, "__esModule", { value: !0 });
|
|
3129
|
+
const _c = De, vc = {
|
|
3130
|
+
keyword: "prefixItems",
|
|
3131
|
+
type: "array",
|
|
3132
|
+
schemaType: ["array"],
|
|
3133
|
+
before: "uniqueItems",
|
|
3134
|
+
code: (e) => (0, _c.validateTuple)(e, "items")
|
|
3135
|
+
};
|
|
3136
|
+
Fr.default = vc;
|
|
3137
|
+
var Kr = {};
|
|
3138
|
+
Object.defineProperty(Kr, "__esModule", { value: !0 });
|
|
3139
|
+
const fs = q, $c = N, gc = K, wc = Ze, bc = {
|
|
3140
|
+
message: ({ params: { len: e } }) => (0, fs.str)`must NOT have more than ${e} items`,
|
|
3141
|
+
params: ({ params: { len: e } }) => (0, fs._)`{limit: ${e}}`
|
|
3142
|
+
}, Ec = {
|
|
3143
|
+
keyword: "items",
|
|
3144
|
+
type: "array",
|
|
3145
|
+
schemaType: ["object", "boolean"],
|
|
3146
|
+
before: "uniqueItems",
|
|
3147
|
+
error: bc,
|
|
3148
|
+
code(e) {
|
|
3149
|
+
const { schema: t, parentSchema: r, it: s } = e, { prefixItems: o } = r;
|
|
3150
|
+
s.items = !0, !(0, $c.alwaysValidSchema)(s, t) && (o ? (0, wc.validateAdditionalItems)(e, o) : e.ok((0, gc.validateArray)(e)));
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
Kr.default = Ec;
|
|
3154
|
+
var qr = {};
|
|
3155
|
+
Object.defineProperty(qr, "__esModule", { value: !0 });
|
|
3156
|
+
const ne = q, $t = N, Sc = {
|
|
3157
|
+
message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, ne.str)`must contain at least ${e} valid item(s)` : (0, ne.str)`must contain at least ${e} and no more than ${t} valid item(s)`,
|
|
3158
|
+
params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, ne._)`{minContains: ${e}}` : (0, ne._)`{minContains: ${e}, maxContains: ${t}}`
|
|
3159
|
+
}, Pc = {
|
|
3160
|
+
keyword: "contains",
|
|
3161
|
+
type: "array",
|
|
3162
|
+
schemaType: ["object", "boolean"],
|
|
3163
|
+
before: "uniqueItems",
|
|
3164
|
+
trackErrors: !0,
|
|
3165
|
+
error: Sc,
|
|
3166
|
+
code(e) {
|
|
3167
|
+
const { gen: t, schema: r, parentSchema: s, data: o, it: a } = e;
|
|
3168
|
+
let i, d;
|
|
3169
|
+
const { minContains: u, maxContains: l } = s;
|
|
3170
|
+
a.opts.next ? (i = u === void 0 ? 1 : u, d = l) : i = 1;
|
|
3171
|
+
const m = t.const("len", (0, ne._)`${o}.length`);
|
|
3172
|
+
if (e.setParams({ min: i, max: d }), d === void 0 && i === 0) {
|
|
3173
|
+
(0, $t.checkStrictMode)(a, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
if (d !== void 0 && i > d) {
|
|
3177
|
+
(0, $t.checkStrictMode)(a, '"minContains" > "maxContains" is always invalid'), e.fail();
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3180
|
+
if ((0, $t.alwaysValidSchema)(a, r)) {
|
|
3181
|
+
let v = (0, ne._)`${m} >= ${i}`;
|
|
3182
|
+
d !== void 0 && (v = (0, ne._)`${v} && ${m} <= ${d}`), e.pass(v);
|
|
3183
|
+
return;
|
|
3184
|
+
}
|
|
3185
|
+
a.items = !0;
|
|
3186
|
+
const y = t.name("valid");
|
|
3187
|
+
d === void 0 && i === 1 ? E(y, () => t.if(y, () => t.break())) : i === 0 ? (t.let(y, !0), d !== void 0 && t.if((0, ne._)`${o}.length > 0`, b)) : (t.let(y, !1), b()), e.result(y, () => e.reset());
|
|
3188
|
+
function b() {
|
|
3189
|
+
const v = t.name("_valid"), h = t.let("count", 0);
|
|
3190
|
+
E(v, () => t.if(v, () => g(h)));
|
|
3191
|
+
}
|
|
3192
|
+
function E(v, h) {
|
|
3193
|
+
t.forRange("i", 0, m, (f) => {
|
|
3194
|
+
e.subschema({
|
|
3195
|
+
keyword: "contains",
|
|
3196
|
+
dataProp: f,
|
|
3197
|
+
dataPropType: $t.Type.Num,
|
|
3198
|
+
compositeRule: !0
|
|
3199
|
+
}, v), h();
|
|
3200
|
+
});
|
|
3201
|
+
}
|
|
3202
|
+
function g(v) {
|
|
3203
|
+
t.code((0, ne._)`${v}++`), d === void 0 ? t.if((0, ne._)`${v} >= ${i}`, () => t.assign(y, !0).break()) : (t.if((0, ne._)`${v} > ${d}`, () => t.assign(y, !1).break()), i === 1 ? t.assign(y, !0) : t.if((0, ne._)`${v} >= ${i}`, () => t.assign(y, !0)));
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
};
|
|
3207
|
+
qr.default = Pc;
|
|
3208
|
+
var $o = {};
|
|
3209
|
+
(function(e) {
|
|
3210
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
|
|
3211
|
+
const t = q, r = N, s = K;
|
|
3212
|
+
e.error = {
|
|
3213
|
+
message: ({ params: { property: u, depsCount: l, deps: m } }) => {
|
|
3214
|
+
const y = l === 1 ? "property" : "properties";
|
|
3215
|
+
return (0, t.str)`must have ${y} ${m} when property ${u} is present`;
|
|
3216
|
+
},
|
|
3217
|
+
params: ({ params: { property: u, depsCount: l, deps: m, missingProperty: y } }) => (0, t._)`{property: ${u},
|
|
3218
|
+
missingProperty: ${y},
|
|
3219
|
+
depsCount: ${l},
|
|
3220
|
+
deps: ${m}}`
|
|
3221
|
+
// TODO change to reference
|
|
3222
|
+
};
|
|
3223
|
+
const o = {
|
|
3224
|
+
keyword: "dependencies",
|
|
3225
|
+
type: "object",
|
|
3226
|
+
schemaType: "object",
|
|
3227
|
+
error: e.error,
|
|
3228
|
+
code(u) {
|
|
3229
|
+
const [l, m] = a(u);
|
|
3230
|
+
i(u, l), d(u, m);
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
function a({ schema: u }) {
|
|
3234
|
+
const l = {}, m = {};
|
|
3235
|
+
for (const y in u) {
|
|
3236
|
+
if (y === "__proto__")
|
|
3237
|
+
continue;
|
|
3238
|
+
const b = Array.isArray(u[y]) ? l : m;
|
|
3239
|
+
b[y] = u[y];
|
|
3240
|
+
}
|
|
3241
|
+
return [l, m];
|
|
3242
|
+
}
|
|
3243
|
+
function i(u, l = u.schema) {
|
|
3244
|
+
const { gen: m, data: y, it: b } = u;
|
|
3245
|
+
if (Object.keys(l).length === 0)
|
|
3246
|
+
return;
|
|
3247
|
+
const E = m.let("missing");
|
|
3248
|
+
for (const g in l) {
|
|
3249
|
+
const v = l[g];
|
|
3250
|
+
if (v.length === 0)
|
|
3251
|
+
continue;
|
|
3252
|
+
const h = (0, s.propertyInData)(m, y, g, b.opts.ownProperties);
|
|
3253
|
+
u.setParams({
|
|
3254
|
+
property: g,
|
|
3255
|
+
depsCount: v.length,
|
|
3256
|
+
deps: v.join(", ")
|
|
3257
|
+
}), b.allErrors ? m.if(h, () => {
|
|
3258
|
+
for (const f of v)
|
|
3259
|
+
(0, s.checkReportMissingProp)(u, f);
|
|
3260
|
+
}) : (m.if((0, t._)`${h} && (${(0, s.checkMissingProp)(u, v, E)})`), (0, s.reportMissingProp)(u, E), m.else());
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
e.validatePropertyDeps = i;
|
|
3264
|
+
function d(u, l = u.schema) {
|
|
3265
|
+
const { gen: m, data: y, keyword: b, it: E } = u, g = m.name("valid");
|
|
3266
|
+
for (const v in l)
|
|
3267
|
+
(0, r.alwaysValidSchema)(E, l[v]) || (m.if(
|
|
3268
|
+
(0, s.propertyInData)(m, y, v, E.opts.ownProperties),
|
|
3269
|
+
() => {
|
|
3270
|
+
const h = u.subschema({ keyword: b, schemaProp: v }, g);
|
|
3271
|
+
u.mergeValidEvaluated(h, g);
|
|
3272
|
+
},
|
|
3273
|
+
() => m.var(g, !0)
|
|
3274
|
+
// TODO var
|
|
3275
|
+
), u.ok(g));
|
|
3276
|
+
}
|
|
3277
|
+
e.validateSchemaDeps = d, e.default = o;
|
|
3278
|
+
})($o);
|
|
3279
|
+
var Ur = {};
|
|
3280
|
+
Object.defineProperty(Ur, "__esModule", { value: !0 });
|
|
3281
|
+
const go = q, kc = N, Nc = {
|
|
3282
|
+
message: "property name must be valid",
|
|
3283
|
+
params: ({ params: e }) => (0, go._)`{propertyName: ${e.propertyName}}`
|
|
3284
|
+
}, Cc = {
|
|
3285
|
+
keyword: "propertyNames",
|
|
3286
|
+
type: "object",
|
|
3287
|
+
schemaType: ["object", "boolean"],
|
|
3288
|
+
error: Nc,
|
|
3289
|
+
code(e) {
|
|
3290
|
+
const { gen: t, schema: r, data: s, it: o } = e;
|
|
3291
|
+
if ((0, kc.alwaysValidSchema)(o, r))
|
|
3292
|
+
return;
|
|
3293
|
+
const a = t.name("valid");
|
|
3294
|
+
t.forIn("key", s, (i) => {
|
|
3295
|
+
e.setParams({ propertyName: i }), e.subschema({
|
|
3296
|
+
keyword: "propertyNames",
|
|
3297
|
+
data: i,
|
|
3298
|
+
dataTypes: ["string"],
|
|
3299
|
+
propertyName: i,
|
|
3300
|
+
compositeRule: !0
|
|
3301
|
+
}, a), t.if((0, go.not)(a), () => {
|
|
3302
|
+
e.error(!0), o.allErrors || t.break();
|
|
3303
|
+
});
|
|
3304
|
+
}), e.ok(a);
|
|
3305
|
+
}
|
|
3306
|
+
};
|
|
3307
|
+
Ur.default = Cc;
|
|
3308
|
+
var It = {};
|
|
3309
|
+
Object.defineProperty(It, "__esModule", { value: !0 });
|
|
3310
|
+
const gt = K, le = q, jc = ve, wt = N, Rc = {
|
|
3311
|
+
message: "must NOT have additional properties",
|
|
3312
|
+
params: ({ params: e }) => (0, le._)`{additionalProperty: ${e.additionalProperty}}`
|
|
3313
|
+
}, Oc = {
|
|
3314
|
+
keyword: "additionalProperties",
|
|
3315
|
+
type: ["object"],
|
|
3316
|
+
schemaType: ["boolean", "object"],
|
|
3317
|
+
allowUndefined: !0,
|
|
3318
|
+
trackErrors: !0,
|
|
3319
|
+
error: Rc,
|
|
3320
|
+
code(e) {
|
|
3321
|
+
const { gen: t, schema: r, parentSchema: s, data: o, errsCount: a, it: i } = e;
|
|
3322
|
+
if (!a)
|
|
3323
|
+
throw new Error("ajv implementation error");
|
|
3324
|
+
const { allErrors: d, opts: u } = i;
|
|
3325
|
+
if (i.props = !0, u.removeAdditional !== "all" && (0, wt.alwaysValidSchema)(i, r))
|
|
3326
|
+
return;
|
|
3327
|
+
const l = (0, gt.allSchemaProperties)(s.properties), m = (0, gt.allSchemaProperties)(s.patternProperties);
|
|
3328
|
+
y(), e.ok((0, le._)`${a} === ${jc.default.errors}`);
|
|
3329
|
+
function y() {
|
|
3330
|
+
t.forIn("key", o, (h) => {
|
|
3331
|
+
!l.length && !m.length ? g(h) : t.if(b(h), () => g(h));
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
function b(h) {
|
|
3335
|
+
let f;
|
|
3336
|
+
if (l.length > 8) {
|
|
3337
|
+
const $ = (0, wt.schemaRefOrVal)(i, s.properties, "properties");
|
|
3338
|
+
f = (0, gt.isOwnProperty)(t, $, h);
|
|
3339
|
+
} else l.length ? f = (0, le.or)(...l.map(($) => (0, le._)`${h} === ${$}`)) : f = le.nil;
|
|
3340
|
+
return m.length && (f = (0, le.or)(f, ...m.map(($) => (0, le._)`${(0, gt.usePattern)(e, $)}.test(${h})`))), (0, le.not)(f);
|
|
3341
|
+
}
|
|
3342
|
+
function E(h) {
|
|
3343
|
+
t.code((0, le._)`delete ${o}[${h}]`);
|
|
3344
|
+
}
|
|
3345
|
+
function g(h) {
|
|
3346
|
+
if (u.removeAdditional === "all" || u.removeAdditional && r === !1) {
|
|
3347
|
+
E(h);
|
|
3348
|
+
return;
|
|
3349
|
+
}
|
|
3350
|
+
if (r === !1) {
|
|
3351
|
+
e.setParams({ additionalProperty: h }), e.error(), d || t.break();
|
|
3352
|
+
return;
|
|
3353
|
+
}
|
|
3354
|
+
if (typeof r == "object" && !(0, wt.alwaysValidSchema)(i, r)) {
|
|
3355
|
+
const f = t.name("valid");
|
|
3356
|
+
u.removeAdditional === "failing" ? (v(h, f, !1), t.if((0, le.not)(f), () => {
|
|
3357
|
+
e.reset(), E(h);
|
|
3358
|
+
})) : (v(h, f), d || t.if((0, le.not)(f), () => t.break()));
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
function v(h, f, $) {
|
|
3362
|
+
const P = {
|
|
3363
|
+
keyword: "additionalProperties",
|
|
3364
|
+
dataProp: h,
|
|
3365
|
+
dataPropType: wt.Type.Str
|
|
3366
|
+
};
|
|
3367
|
+
$ === !1 && Object.assign(P, {
|
|
3368
|
+
compositeRule: !0,
|
|
3369
|
+
createErrors: !1,
|
|
3370
|
+
allErrors: !1
|
|
3371
|
+
}), e.subschema(P, f);
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
};
|
|
3375
|
+
It.default = Oc;
|
|
3376
|
+
var zr = {};
|
|
3377
|
+
Object.defineProperty(zr, "__esModule", { value: !0 });
|
|
3378
|
+
const Tc = fe, ms = K, Zt = N, hs = It, Ic = {
|
|
3379
|
+
keyword: "properties",
|
|
3380
|
+
type: "object",
|
|
3381
|
+
schemaType: "object",
|
|
3382
|
+
code(e) {
|
|
3383
|
+
const { gen: t, schema: r, parentSchema: s, data: o, it: a } = e;
|
|
3384
|
+
a.opts.removeAdditional === "all" && s.additionalProperties === void 0 && hs.default.code(new Tc.KeywordCxt(a, hs.default, "additionalProperties"));
|
|
3385
|
+
const i = (0, ms.allSchemaProperties)(r);
|
|
3386
|
+
for (const y of i)
|
|
3387
|
+
a.definedProperties.add(y);
|
|
3388
|
+
a.opts.unevaluated && i.length && a.props !== !0 && (a.props = Zt.mergeEvaluated.props(t, (0, Zt.toHash)(i), a.props));
|
|
3389
|
+
const d = i.filter((y) => !(0, Zt.alwaysValidSchema)(a, r[y]));
|
|
3390
|
+
if (d.length === 0)
|
|
3391
|
+
return;
|
|
3392
|
+
const u = t.name("valid");
|
|
3393
|
+
for (const y of d)
|
|
3394
|
+
l(y) ? m(y) : (t.if((0, ms.propertyInData)(t, o, y, a.opts.ownProperties)), m(y), a.allErrors || t.else().var(u, !0), t.endIf()), e.it.definedProperties.add(y), e.ok(u);
|
|
3395
|
+
function l(y) {
|
|
3396
|
+
return a.opts.useDefaults && !a.compositeRule && r[y].default !== void 0;
|
|
3397
|
+
}
|
|
3398
|
+
function m(y) {
|
|
3399
|
+
e.subschema({
|
|
3400
|
+
keyword: "properties",
|
|
3401
|
+
schemaProp: y,
|
|
3402
|
+
dataProp: y
|
|
3403
|
+
}, u);
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
};
|
|
3407
|
+
zr.default = Ic;
|
|
3408
|
+
var Ar = {};
|
|
3409
|
+
Object.defineProperty(Ar, "__esModule", { value: !0 });
|
|
3410
|
+
const ps = K, bt = q, ys = N, _s = N, Mc = {
|
|
3411
|
+
keyword: "patternProperties",
|
|
3412
|
+
type: "object",
|
|
3413
|
+
schemaType: "object",
|
|
3414
|
+
code(e) {
|
|
3415
|
+
const { gen: t, schema: r, data: s, parentSchema: o, it: a } = e, { opts: i } = a, d = (0, ps.allSchemaProperties)(r), u = d.filter((v) => (0, ys.alwaysValidSchema)(a, r[v]));
|
|
3416
|
+
if (d.length === 0 || u.length === d.length && (!a.opts.unevaluated || a.props === !0))
|
|
3417
|
+
return;
|
|
3418
|
+
const l = i.strictSchema && !i.allowMatchingProperties && o.properties, m = t.name("valid");
|
|
3419
|
+
a.props !== !0 && !(a.props instanceof bt.Name) && (a.props = (0, _s.evaluatedPropsToName)(t, a.props));
|
|
3420
|
+
const { props: y } = a;
|
|
3421
|
+
b();
|
|
3422
|
+
function b() {
|
|
3423
|
+
for (const v of d)
|
|
3424
|
+
l && E(v), a.allErrors ? g(v) : (t.var(m, !0), g(v), t.if(m));
|
|
3425
|
+
}
|
|
3426
|
+
function E(v) {
|
|
3427
|
+
for (const h in l)
|
|
3428
|
+
new RegExp(v).test(h) && (0, ys.checkStrictMode)(a, `property ${h} matches pattern ${v} (use allowMatchingProperties)`);
|
|
3429
|
+
}
|
|
3430
|
+
function g(v) {
|
|
3431
|
+
t.forIn("key", s, (h) => {
|
|
3432
|
+
t.if((0, bt._)`${(0, ps.usePattern)(e, v)}.test(${h})`, () => {
|
|
3433
|
+
const f = u.includes(v);
|
|
3434
|
+
f || e.subschema({
|
|
3435
|
+
keyword: "patternProperties",
|
|
3436
|
+
schemaProp: v,
|
|
3437
|
+
dataProp: h,
|
|
3438
|
+
dataPropType: _s.Type.Str
|
|
3439
|
+
}, m), a.opts.unevaluated && y !== !0 ? t.assign((0, bt._)`${y}[${h}]`, !0) : !f && !a.allErrors && t.if((0, bt.not)(m), () => t.break());
|
|
3440
|
+
});
|
|
3441
|
+
});
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
Ar.default = Mc;
|
|
3446
|
+
var Lr = {};
|
|
3447
|
+
Object.defineProperty(Lr, "__esModule", { value: !0 });
|
|
3448
|
+
const Vc = N, Fc = {
|
|
3449
|
+
keyword: "not",
|
|
3450
|
+
schemaType: ["object", "boolean"],
|
|
3451
|
+
trackErrors: !0,
|
|
3452
|
+
code(e) {
|
|
3453
|
+
const { gen: t, schema: r, it: s } = e;
|
|
3454
|
+
if ((0, Vc.alwaysValidSchema)(s, r)) {
|
|
3455
|
+
e.fail();
|
|
3456
|
+
return;
|
|
3457
|
+
}
|
|
3458
|
+
const o = t.name("valid");
|
|
3459
|
+
e.subschema({
|
|
3460
|
+
keyword: "not",
|
|
3461
|
+
compositeRule: !0,
|
|
3462
|
+
createErrors: !1,
|
|
3463
|
+
allErrors: !1
|
|
3464
|
+
}, o), e.failResult(o, () => e.reset(), () => e.error());
|
|
3465
|
+
},
|
|
3466
|
+
error: { message: "must NOT be valid" }
|
|
3467
|
+
};
|
|
3468
|
+
Lr.default = Fc;
|
|
3469
|
+
var Gr = {};
|
|
3470
|
+
Object.defineProperty(Gr, "__esModule", { value: !0 });
|
|
3471
|
+
const Kc = K, qc = {
|
|
3472
|
+
keyword: "anyOf",
|
|
3473
|
+
schemaType: "array",
|
|
3474
|
+
trackErrors: !0,
|
|
3475
|
+
code: Kc.validateUnion,
|
|
3476
|
+
error: { message: "must match a schema in anyOf" }
|
|
3477
|
+
};
|
|
3478
|
+
Gr.default = qc;
|
|
3479
|
+
var Jr = {};
|
|
3480
|
+
Object.defineProperty(Jr, "__esModule", { value: !0 });
|
|
3481
|
+
const Pt = q, Uc = N, zc = {
|
|
3482
|
+
message: "must match exactly one schema in oneOf",
|
|
3483
|
+
params: ({ params: e }) => (0, Pt._)`{passingSchemas: ${e.passing}}`
|
|
3484
|
+
}, Ac = {
|
|
3485
|
+
keyword: "oneOf",
|
|
3486
|
+
schemaType: "array",
|
|
3487
|
+
trackErrors: !0,
|
|
3488
|
+
error: zc,
|
|
3489
|
+
code(e) {
|
|
3490
|
+
const { gen: t, schema: r, parentSchema: s, it: o } = e;
|
|
3491
|
+
if (!Array.isArray(r))
|
|
3492
|
+
throw new Error("ajv implementation error");
|
|
3493
|
+
if (o.opts.discriminator && s.discriminator)
|
|
3494
|
+
return;
|
|
3495
|
+
const a = r, i = t.let("valid", !1), d = t.let("passing", null), u = t.name("_valid");
|
|
3496
|
+
e.setParams({ passing: d }), t.block(l), e.result(i, () => e.reset(), () => e.error(!0));
|
|
3497
|
+
function l() {
|
|
3498
|
+
a.forEach((m, y) => {
|
|
3499
|
+
let b;
|
|
3500
|
+
(0, Uc.alwaysValidSchema)(o, m) ? t.var(u, !0) : b = e.subschema({
|
|
3501
|
+
keyword: "oneOf",
|
|
3502
|
+
schemaProp: y,
|
|
3503
|
+
compositeRule: !0
|
|
3504
|
+
}, u), y > 0 && t.if((0, Pt._)`${u} && ${i}`).assign(i, !1).assign(d, (0, Pt._)`[${d}, ${y}]`).else(), t.if(u, () => {
|
|
3505
|
+
t.assign(i, !0), t.assign(d, y), b && e.mergeEvaluated(b, Pt.Name);
|
|
3506
|
+
});
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
};
|
|
3511
|
+
Jr.default = Ac;
|
|
3512
|
+
var Hr = {};
|
|
3513
|
+
Object.defineProperty(Hr, "__esModule", { value: !0 });
|
|
3514
|
+
const Lc = N, Gc = {
|
|
3515
|
+
keyword: "allOf",
|
|
3516
|
+
schemaType: "array",
|
|
3517
|
+
code(e) {
|
|
3518
|
+
const { gen: t, schema: r, it: s } = e;
|
|
3519
|
+
if (!Array.isArray(r))
|
|
3520
|
+
throw new Error("ajv implementation error");
|
|
3521
|
+
const o = t.name("valid");
|
|
3522
|
+
r.forEach((a, i) => {
|
|
3523
|
+
if ((0, Lc.alwaysValidSchema)(s, a))
|
|
3524
|
+
return;
|
|
3525
|
+
const d = e.subschema({ keyword: "allOf", schemaProp: i }, o);
|
|
3526
|
+
e.ok(o), e.mergeEvaluated(d);
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3529
|
+
};
|
|
3530
|
+
Hr.default = Gc;
|
|
3531
|
+
var Br = {};
|
|
3532
|
+
Object.defineProperty(Br, "__esModule", { value: !0 });
|
|
3533
|
+
const jt = q, wo = N, Jc = {
|
|
3534
|
+
message: ({ params: e }) => (0, jt.str)`must match "${e.ifClause}" schema`,
|
|
3535
|
+
params: ({ params: e }) => (0, jt._)`{failingKeyword: ${e.ifClause}}`
|
|
3536
|
+
}, Hc = {
|
|
3537
|
+
keyword: "if",
|
|
3538
|
+
schemaType: ["object", "boolean"],
|
|
3539
|
+
trackErrors: !0,
|
|
3540
|
+
error: Jc,
|
|
3541
|
+
code(e) {
|
|
3542
|
+
const { gen: t, parentSchema: r, it: s } = e;
|
|
3543
|
+
r.then === void 0 && r.else === void 0 && (0, wo.checkStrictMode)(s, '"if" without "then" and "else" is ignored');
|
|
3544
|
+
const o = vs(s, "then"), a = vs(s, "else");
|
|
3545
|
+
if (!o && !a)
|
|
3546
|
+
return;
|
|
3547
|
+
const i = t.let("valid", !0), d = t.name("_valid");
|
|
3548
|
+
if (u(), e.reset(), o && a) {
|
|
3549
|
+
const m = t.let("ifClause");
|
|
3550
|
+
e.setParams({ ifClause: m }), t.if(d, l("then", m), l("else", m));
|
|
3551
|
+
} else o ? t.if(d, l("then")) : t.if((0, jt.not)(d), l("else"));
|
|
3552
|
+
e.pass(i, () => e.error(!0));
|
|
3553
|
+
function u() {
|
|
3554
|
+
const m = e.subschema({
|
|
3555
|
+
keyword: "if",
|
|
3556
|
+
compositeRule: !0,
|
|
3557
|
+
createErrors: !1,
|
|
3558
|
+
allErrors: !1
|
|
3559
|
+
}, d);
|
|
3560
|
+
e.mergeEvaluated(m);
|
|
3561
|
+
}
|
|
3562
|
+
function l(m, y) {
|
|
3563
|
+
return () => {
|
|
3564
|
+
const b = e.subschema({ keyword: m }, d);
|
|
3565
|
+
t.assign(i, d), e.mergeValidEvaluated(b, i), y ? t.assign(y, (0, jt._)`${m}`) : e.setParams({ ifClause: m });
|
|
3566
|
+
};
|
|
3567
|
+
}
|
|
3568
|
+
}
|
|
3569
|
+
};
|
|
3570
|
+
function vs(e, t) {
|
|
3571
|
+
const r = e.schema[t];
|
|
3572
|
+
return r !== void 0 && !(0, wo.alwaysValidSchema)(e, r);
|
|
3573
|
+
}
|
|
3574
|
+
Br.default = Hc;
|
|
3575
|
+
var Qr = {};
|
|
3576
|
+
Object.defineProperty(Qr, "__esModule", { value: !0 });
|
|
3577
|
+
const Bc = N, Qc = {
|
|
3578
|
+
keyword: ["then", "else"],
|
|
3579
|
+
schemaType: ["object", "boolean"],
|
|
3580
|
+
code({ keyword: e, parentSchema: t, it: r }) {
|
|
3581
|
+
t.if === void 0 && (0, Bc.checkStrictMode)(r, `"${e}" without "if" is ignored`);
|
|
3582
|
+
}
|
|
3583
|
+
};
|
|
3584
|
+
Qr.default = Qc;
|
|
3585
|
+
Object.defineProperty(Vr, "__esModule", { value: !0 });
|
|
3586
|
+
const Xc = Ze, Yc = Fr, Zc = De, Dc = Kr, Wc = qr, xc = $o, el = Ur, tl = It, rl = zr, sl = Ar, ol = Lr, nl = Gr, al = Jr, il = Hr, cl = Br, ll = Qr;
|
|
3587
|
+
function dl(e = !1) {
|
|
3588
|
+
const t = [
|
|
3589
|
+
// any
|
|
3590
|
+
ol.default,
|
|
3591
|
+
nl.default,
|
|
3592
|
+
al.default,
|
|
3593
|
+
il.default,
|
|
3594
|
+
cl.default,
|
|
3595
|
+
ll.default,
|
|
3596
|
+
// object
|
|
3597
|
+
el.default,
|
|
3598
|
+
tl.default,
|
|
3599
|
+
xc.default,
|
|
3600
|
+
rl.default,
|
|
3601
|
+
sl.default
|
|
3602
|
+
];
|
|
3603
|
+
return e ? t.push(Yc.default, Dc.default) : t.push(Xc.default, Zc.default), t.push(Wc.default), t;
|
|
3604
|
+
}
|
|
3605
|
+
Vr.default = dl;
|
|
3606
|
+
var Xr = {}, Yr = {};
|
|
3607
|
+
Object.defineProperty(Yr, "__esModule", { value: !0 });
|
|
3608
|
+
const Q = q, ul = {
|
|
3609
|
+
message: ({ schemaCode: e }) => (0, Q.str)`must match format "${e}"`,
|
|
3610
|
+
params: ({ schemaCode: e }) => (0, Q._)`{format: ${e}}`
|
|
3611
|
+
}, fl = {
|
|
3612
|
+
keyword: "format",
|
|
3613
|
+
type: ["number", "string"],
|
|
3614
|
+
schemaType: "string",
|
|
3615
|
+
$data: !0,
|
|
3616
|
+
error: ul,
|
|
3617
|
+
code(e, t) {
|
|
3618
|
+
const { gen: r, data: s, $data: o, schema: a, schemaCode: i, it: d } = e, { opts: u, errSchemaPath: l, schemaEnv: m, self: y } = d;
|
|
3619
|
+
if (!u.validateFormats)
|
|
3620
|
+
return;
|
|
3621
|
+
o ? b() : E();
|
|
3622
|
+
function b() {
|
|
3623
|
+
const g = r.scopeValue("formats", {
|
|
3624
|
+
ref: y.formats,
|
|
3625
|
+
code: u.code.formats
|
|
3626
|
+
}), v = r.const("fDef", (0, Q._)`${g}[${i}]`), h = r.let("fType"), f = r.let("format");
|
|
3627
|
+
r.if((0, Q._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`, () => r.assign(h, (0, Q._)`${v}.type || "string"`).assign(f, (0, Q._)`${v}.validate`), () => r.assign(h, (0, Q._)`"string"`).assign(f, v)), e.fail$data((0, Q.or)($(), P()));
|
|
3628
|
+
function $() {
|
|
3629
|
+
return u.strictSchema === !1 ? Q.nil : (0, Q._)`${i} && !${f}`;
|
|
3630
|
+
}
|
|
3631
|
+
function P() {
|
|
3632
|
+
const R = m.$async ? (0, Q._)`(${v}.async ? await ${f}(${s}) : ${f}(${s}))` : (0, Q._)`${f}(${s})`, C = (0, Q._)`(typeof ${f} == "function" ? ${R} : ${f}.test(${s}))`;
|
|
3633
|
+
return (0, Q._)`${f} && ${f} !== true && ${h} === ${t} && !${C}`;
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
function E() {
|
|
3637
|
+
const g = y.formats[a];
|
|
3638
|
+
if (!g) {
|
|
3639
|
+
$();
|
|
3640
|
+
return;
|
|
3641
|
+
}
|
|
3642
|
+
if (g === !0)
|
|
3643
|
+
return;
|
|
3644
|
+
const [v, h, f] = P(g);
|
|
3645
|
+
v === t && e.pass(R());
|
|
3646
|
+
function $() {
|
|
3647
|
+
if (u.strictSchema === !1) {
|
|
3648
|
+
y.logger.warn(C());
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
throw new Error(C());
|
|
3652
|
+
function C() {
|
|
3653
|
+
return `unknown format "${a}" ignored in schema at path "${l}"`;
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
function P(C) {
|
|
3657
|
+
const L = C instanceof RegExp ? (0, Q.regexpCode)(C) : u.code.formats ? (0, Q._)`${u.code.formats}${(0, Q.getProperty)(a)}` : void 0, H = r.scopeValue("formats", { key: a, ref: C, code: L });
|
|
3658
|
+
return typeof C == "object" && !(C instanceof RegExp) ? [C.type || "string", C.validate, (0, Q._)`${H}.validate`] : ["string", C, H];
|
|
3659
|
+
}
|
|
3660
|
+
function R() {
|
|
3661
|
+
if (typeof g == "object" && !(g instanceof RegExp) && g.async) {
|
|
3662
|
+
if (!m.$async)
|
|
3663
|
+
throw new Error("async format in sync schema");
|
|
3664
|
+
return (0, Q._)`await ${f}(${s})`;
|
|
3665
|
+
}
|
|
3666
|
+
return typeof h == "function" ? (0, Q._)`${f}(${s})` : (0, Q._)`${f}.test(${s})`;
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
};
|
|
3671
|
+
Yr.default = fl;
|
|
3672
|
+
Object.defineProperty(Xr, "__esModule", { value: !0 });
|
|
3673
|
+
const ml = Yr, hl = [ml.default];
|
|
3674
|
+
Xr.default = hl;
|
|
3675
|
+
var Xe = {};
|
|
3676
|
+
Object.defineProperty(Xe, "__esModule", { value: !0 });
|
|
3677
|
+
Xe.contentVocabulary = Xe.metadataVocabulary = void 0;
|
|
3678
|
+
Xe.metadataVocabulary = [
|
|
3679
|
+
"title",
|
|
3680
|
+
"description",
|
|
3681
|
+
"default",
|
|
3682
|
+
"deprecated",
|
|
3683
|
+
"readOnly",
|
|
3684
|
+
"writeOnly",
|
|
3685
|
+
"examples"
|
|
3686
|
+
];
|
|
3687
|
+
Xe.contentVocabulary = [
|
|
3688
|
+
"contentMediaType",
|
|
3689
|
+
"contentEncoding",
|
|
3690
|
+
"contentSchema"
|
|
3691
|
+
];
|
|
3692
|
+
Object.defineProperty(gr, "__esModule", { value: !0 });
|
|
3693
|
+
const pl = wr, yl = Er, _l = Vr, vl = Xr, $s = Xe, $l = [
|
|
3694
|
+
pl.default,
|
|
3695
|
+
yl.default,
|
|
3696
|
+
(0, _l.default)(),
|
|
3697
|
+
vl.default,
|
|
3698
|
+
$s.metadataVocabulary,
|
|
3699
|
+
$s.contentVocabulary
|
|
3700
|
+
];
|
|
3701
|
+
gr.default = $l;
|
|
3702
|
+
var Zr = {}, Mt = {};
|
|
3703
|
+
Object.defineProperty(Mt, "__esModule", { value: !0 });
|
|
3704
|
+
Mt.DiscrError = void 0;
|
|
3705
|
+
var gs;
|
|
3706
|
+
(function(e) {
|
|
3707
|
+
e.Tag = "tag", e.Mapping = "mapping";
|
|
3708
|
+
})(gs || (Mt.DiscrError = gs = {}));
|
|
3709
|
+
Object.defineProperty(Zr, "__esModule", { value: !0 });
|
|
3710
|
+
const Ge = q, cr = Mt, ws = re, gl = Ye, wl = N, bl = {
|
|
3711
|
+
message: ({ params: { discrError: e, tagName: t } }) => e === cr.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
|
|
3712
|
+
params: ({ params: { discrError: e, tag: t, tagName: r } }) => (0, Ge._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`
|
|
3713
|
+
}, El = {
|
|
3714
|
+
keyword: "discriminator",
|
|
3715
|
+
type: "object",
|
|
3716
|
+
schemaType: "object",
|
|
3717
|
+
error: bl,
|
|
3718
|
+
code(e) {
|
|
3719
|
+
const { gen: t, data: r, schema: s, parentSchema: o, it: a } = e, { oneOf: i } = o;
|
|
3720
|
+
if (!a.opts.discriminator)
|
|
3721
|
+
throw new Error("discriminator: requires discriminator option");
|
|
3722
|
+
const d = s.propertyName;
|
|
3723
|
+
if (typeof d != "string")
|
|
3724
|
+
throw new Error("discriminator: requires propertyName");
|
|
3725
|
+
if (s.mapping)
|
|
3726
|
+
throw new Error("discriminator: mapping is not supported");
|
|
3727
|
+
if (!i)
|
|
3728
|
+
throw new Error("discriminator: requires oneOf keyword");
|
|
3729
|
+
const u = t.let("valid", !1), l = t.const("tag", (0, Ge._)`${r}${(0, Ge.getProperty)(d)}`);
|
|
3730
|
+
t.if((0, Ge._)`typeof ${l} == "string"`, () => m(), () => e.error(!1, { discrError: cr.DiscrError.Tag, tag: l, tagName: d })), e.ok(u);
|
|
3731
|
+
function m() {
|
|
3732
|
+
const E = b();
|
|
3733
|
+
t.if(!1);
|
|
3734
|
+
for (const g in E)
|
|
3735
|
+
t.elseIf((0, Ge._)`${l} === ${g}`), t.assign(u, y(E[g]));
|
|
3736
|
+
t.else(), e.error(!1, { discrError: cr.DiscrError.Mapping, tag: l, tagName: d }), t.endIf();
|
|
3737
|
+
}
|
|
3738
|
+
function y(E) {
|
|
3739
|
+
const g = t.name("valid"), v = e.subschema({ keyword: "oneOf", schemaProp: E }, g);
|
|
3740
|
+
return e.mergeEvaluated(v, Ge.Name), g;
|
|
3741
|
+
}
|
|
3742
|
+
function b() {
|
|
3743
|
+
var E;
|
|
3744
|
+
const g = {}, v = f(o);
|
|
3745
|
+
let h = !0;
|
|
3746
|
+
for (let R = 0; R < i.length; R++) {
|
|
3747
|
+
let C = i[R];
|
|
3748
|
+
if (C != null && C.$ref && !(0, wl.schemaHasRulesButRef)(C, a.self.RULES)) {
|
|
3749
|
+
const H = C.$ref;
|
|
3750
|
+
if (C = ws.resolveRef.call(a.self, a.schemaEnv.root, a.baseId, H), C instanceof ws.SchemaEnv && (C = C.schema), C === void 0)
|
|
3751
|
+
throw new gl.default(a.opts.uriResolver, a.baseId, H);
|
|
3752
|
+
}
|
|
3753
|
+
const L = (E = C == null ? void 0 : C.properties) === null || E === void 0 ? void 0 : E[d];
|
|
3754
|
+
if (typeof L != "object")
|
|
3755
|
+
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);
|
|
3756
|
+
h = h && (v || f(C)), $(L, R);
|
|
3757
|
+
}
|
|
3758
|
+
if (!h)
|
|
3759
|
+
throw new Error(`discriminator: "${d}" must be required`);
|
|
3760
|
+
return g;
|
|
3761
|
+
function f({ required: R }) {
|
|
3762
|
+
return Array.isArray(R) && R.includes(d);
|
|
3763
|
+
}
|
|
3764
|
+
function $(R, C) {
|
|
3765
|
+
if (R.const)
|
|
3766
|
+
P(R.const, C);
|
|
3767
|
+
else if (R.enum)
|
|
3768
|
+
for (const L of R.enum)
|
|
3769
|
+
P(L, C);
|
|
3770
|
+
else
|
|
3771
|
+
throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);
|
|
3772
|
+
}
|
|
3773
|
+
function P(R, C) {
|
|
3774
|
+
if (typeof R != "string" || R in g)
|
|
3775
|
+
throw new Error(`discriminator: "${d}" values must be unique strings`);
|
|
3776
|
+
g[R] = C;
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
}
|
|
3780
|
+
};
|
|
3781
|
+
Zr.default = El;
|
|
3782
|
+
const Sl = "http://json-schema.org/draft-07/schema#", Pl = "http://json-schema.org/draft-07/schema#", kl = "Core schema meta-schema", Nl = {
|
|
3783
|
+
schemaArray: {
|
|
3784
|
+
type: "array",
|
|
3785
|
+
minItems: 1,
|
|
3786
|
+
items: {
|
|
3787
|
+
$ref: "#"
|
|
3788
|
+
}
|
|
3789
|
+
},
|
|
3790
|
+
nonNegativeInteger: {
|
|
3791
|
+
type: "integer",
|
|
3792
|
+
minimum: 0
|
|
3793
|
+
},
|
|
3794
|
+
nonNegativeIntegerDefault0: {
|
|
3795
|
+
allOf: [
|
|
3796
|
+
{
|
|
3797
|
+
$ref: "#/definitions/nonNegativeInteger"
|
|
3798
|
+
},
|
|
3799
|
+
{
|
|
3800
|
+
default: 0
|
|
3801
|
+
}
|
|
3802
|
+
]
|
|
3803
|
+
},
|
|
3804
|
+
simpleTypes: {
|
|
3805
|
+
enum: [
|
|
3806
|
+
"array",
|
|
3807
|
+
"boolean",
|
|
3808
|
+
"integer",
|
|
3809
|
+
"null",
|
|
3810
|
+
"number",
|
|
3811
|
+
"object",
|
|
3812
|
+
"string"
|
|
3813
|
+
]
|
|
3814
|
+
},
|
|
3815
|
+
stringArray: {
|
|
3816
|
+
type: "array",
|
|
3817
|
+
items: {
|
|
3818
|
+
type: "string"
|
|
3819
|
+
},
|
|
3820
|
+
uniqueItems: !0,
|
|
3821
|
+
default: []
|
|
3822
|
+
}
|
|
3823
|
+
}, Cl = [
|
|
3824
|
+
"object",
|
|
3825
|
+
"boolean"
|
|
3826
|
+
], jl = {
|
|
3827
|
+
$id: {
|
|
3828
|
+
type: "string",
|
|
3829
|
+
format: "uri-reference"
|
|
3830
|
+
},
|
|
3831
|
+
$schema: {
|
|
3832
|
+
type: "string",
|
|
3833
|
+
format: "uri"
|
|
3834
|
+
},
|
|
3835
|
+
$ref: {
|
|
3836
|
+
type: "string",
|
|
3837
|
+
format: "uri-reference"
|
|
3838
|
+
},
|
|
3839
|
+
$comment: {
|
|
3840
|
+
type: "string"
|
|
3841
|
+
},
|
|
3842
|
+
title: {
|
|
3843
|
+
type: "string"
|
|
3844
|
+
},
|
|
3845
|
+
description: {
|
|
3846
|
+
type: "string"
|
|
3847
|
+
},
|
|
3848
|
+
default: !0,
|
|
3849
|
+
readOnly: {
|
|
3850
|
+
type: "boolean",
|
|
3851
|
+
default: !1
|
|
3852
|
+
},
|
|
3853
|
+
examples: {
|
|
3854
|
+
type: "array",
|
|
3855
|
+
items: !0
|
|
3856
|
+
},
|
|
3857
|
+
multipleOf: {
|
|
3858
|
+
type: "number",
|
|
3859
|
+
exclusiveMinimum: 0
|
|
3860
|
+
},
|
|
3861
|
+
maximum: {
|
|
3862
|
+
type: "number"
|
|
3863
|
+
},
|
|
3864
|
+
exclusiveMaximum: {
|
|
3865
|
+
type: "number"
|
|
3866
|
+
},
|
|
3867
|
+
minimum: {
|
|
3868
|
+
type: "number"
|
|
3869
|
+
},
|
|
3870
|
+
exclusiveMinimum: {
|
|
3871
|
+
type: "number"
|
|
3872
|
+
},
|
|
3873
|
+
maxLength: {
|
|
3874
|
+
$ref: "#/definitions/nonNegativeInteger"
|
|
3875
|
+
},
|
|
3876
|
+
minLength: {
|
|
3877
|
+
$ref: "#/definitions/nonNegativeIntegerDefault0"
|
|
3878
|
+
},
|
|
3879
|
+
pattern: {
|
|
3880
|
+
type: "string",
|
|
3881
|
+
format: "regex"
|
|
3882
|
+
},
|
|
3883
|
+
additionalItems: {
|
|
3884
|
+
$ref: "#"
|
|
3885
|
+
},
|
|
3886
|
+
items: {
|
|
3887
|
+
anyOf: [
|
|
3888
|
+
{
|
|
3889
|
+
$ref: "#"
|
|
3890
|
+
},
|
|
3891
|
+
{
|
|
3892
|
+
$ref: "#/definitions/schemaArray"
|
|
3893
|
+
}
|
|
3894
|
+
],
|
|
3895
|
+
default: !0
|
|
3896
|
+
},
|
|
3897
|
+
maxItems: {
|
|
3898
|
+
$ref: "#/definitions/nonNegativeInteger"
|
|
3899
|
+
},
|
|
3900
|
+
minItems: {
|
|
3901
|
+
$ref: "#/definitions/nonNegativeIntegerDefault0"
|
|
3902
|
+
},
|
|
3903
|
+
uniqueItems: {
|
|
3904
|
+
type: "boolean",
|
|
3905
|
+
default: !1
|
|
3906
|
+
},
|
|
3907
|
+
contains: {
|
|
3908
|
+
$ref: "#"
|
|
3909
|
+
},
|
|
3910
|
+
maxProperties: {
|
|
3911
|
+
$ref: "#/definitions/nonNegativeInteger"
|
|
3912
|
+
},
|
|
3913
|
+
minProperties: {
|
|
3914
|
+
$ref: "#/definitions/nonNegativeIntegerDefault0"
|
|
3915
|
+
},
|
|
3916
|
+
required: {
|
|
3917
|
+
$ref: "#/definitions/stringArray"
|
|
3918
|
+
},
|
|
3919
|
+
additionalProperties: {
|
|
3920
|
+
$ref: "#"
|
|
3921
|
+
},
|
|
3922
|
+
definitions: {
|
|
3923
|
+
type: "object",
|
|
3924
|
+
additionalProperties: {
|
|
3925
|
+
$ref: "#"
|
|
3926
|
+
},
|
|
3927
|
+
default: {}
|
|
3928
|
+
},
|
|
3929
|
+
properties: {
|
|
3930
|
+
type: "object",
|
|
3931
|
+
additionalProperties: {
|
|
3932
|
+
$ref: "#"
|
|
3933
|
+
},
|
|
3934
|
+
default: {}
|
|
3935
|
+
},
|
|
3936
|
+
patternProperties: {
|
|
3937
|
+
type: "object",
|
|
3938
|
+
additionalProperties: {
|
|
3939
|
+
$ref: "#"
|
|
3940
|
+
},
|
|
3941
|
+
propertyNames: {
|
|
3942
|
+
format: "regex"
|
|
3943
|
+
},
|
|
3944
|
+
default: {}
|
|
3945
|
+
},
|
|
3946
|
+
dependencies: {
|
|
3947
|
+
type: "object",
|
|
3948
|
+
additionalProperties: {
|
|
3949
|
+
anyOf: [
|
|
3950
|
+
{
|
|
3951
|
+
$ref: "#"
|
|
3952
|
+
},
|
|
3953
|
+
{
|
|
3954
|
+
$ref: "#/definitions/stringArray"
|
|
3955
|
+
}
|
|
3956
|
+
]
|
|
3957
|
+
}
|
|
3958
|
+
},
|
|
3959
|
+
propertyNames: {
|
|
3960
|
+
$ref: "#"
|
|
3961
|
+
},
|
|
3962
|
+
const: !0,
|
|
3963
|
+
enum: {
|
|
3964
|
+
type: "array",
|
|
3965
|
+
items: !0,
|
|
3966
|
+
minItems: 1,
|
|
3967
|
+
uniqueItems: !0
|
|
3968
|
+
},
|
|
3969
|
+
type: {
|
|
3970
|
+
anyOf: [
|
|
3971
|
+
{
|
|
3972
|
+
$ref: "#/definitions/simpleTypes"
|
|
3973
|
+
},
|
|
3974
|
+
{
|
|
3975
|
+
type: "array",
|
|
3976
|
+
items: {
|
|
3977
|
+
$ref: "#/definitions/simpleTypes"
|
|
3978
|
+
},
|
|
3979
|
+
minItems: 1,
|
|
3980
|
+
uniqueItems: !0
|
|
3981
|
+
}
|
|
3982
|
+
]
|
|
3983
|
+
},
|
|
3984
|
+
format: {
|
|
3985
|
+
type: "string"
|
|
3986
|
+
},
|
|
3987
|
+
contentMediaType: {
|
|
3988
|
+
type: "string"
|
|
3989
|
+
},
|
|
3990
|
+
contentEncoding: {
|
|
3991
|
+
type: "string"
|
|
3992
|
+
},
|
|
3993
|
+
if: {
|
|
3994
|
+
$ref: "#"
|
|
3995
|
+
},
|
|
3996
|
+
then: {
|
|
3997
|
+
$ref: "#"
|
|
3998
|
+
},
|
|
3999
|
+
else: {
|
|
4000
|
+
$ref: "#"
|
|
4001
|
+
},
|
|
4002
|
+
allOf: {
|
|
4003
|
+
$ref: "#/definitions/schemaArray"
|
|
4004
|
+
},
|
|
4005
|
+
anyOf: {
|
|
4006
|
+
$ref: "#/definitions/schemaArray"
|
|
4007
|
+
},
|
|
4008
|
+
oneOf: {
|
|
4009
|
+
$ref: "#/definitions/schemaArray"
|
|
4010
|
+
},
|
|
4011
|
+
not: {
|
|
4012
|
+
$ref: "#"
|
|
4013
|
+
}
|
|
4014
|
+
}, Rl = {
|
|
4015
|
+
$schema: Sl,
|
|
4016
|
+
$id: Pl,
|
|
4017
|
+
title: kl,
|
|
4018
|
+
definitions: Nl,
|
|
4019
|
+
type: Cl,
|
|
4020
|
+
properties: jl,
|
|
4021
|
+
default: !0
|
|
4022
|
+
};
|
|
4023
|
+
(function(e, t) {
|
|
4024
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv = void 0;
|
|
4025
|
+
const r = Vs, s = gr, o = Zr, a = Rl, i = ["/properties"], d = "http://json-schema.org/draft-07/schema";
|
|
4026
|
+
class u extends r.default {
|
|
4027
|
+
_addVocabularies() {
|
|
4028
|
+
super._addVocabularies(), s.default.forEach((g) => this.addVocabulary(g)), this.opts.discriminator && this.addKeyword(o.default);
|
|
4029
|
+
}
|
|
4030
|
+
_addDefaultMetaSchema() {
|
|
4031
|
+
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
4032
|
+
return;
|
|
4033
|
+
const g = this.opts.$data ? this.$dataMetaSchema(a, i) : a;
|
|
4034
|
+
this.addMetaSchema(g, d, !1), this.refs["http://json-schema.org/schema"] = d;
|
|
4035
|
+
}
|
|
4036
|
+
defaultMeta() {
|
|
4037
|
+
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(d) ? d : void 0);
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
t.Ajv = u, e.exports = t = u, e.exports.Ajv = u, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = u;
|
|
4041
|
+
var l = fe;
|
|
4042
|
+
Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
|
|
4043
|
+
return l.KeywordCxt;
|
|
4044
|
+
} });
|
|
4045
|
+
var m = q;
|
|
4046
|
+
Object.defineProperty(t, "_", { enumerable: !0, get: function() {
|
|
4047
|
+
return m._;
|
|
4048
|
+
} }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
|
|
4049
|
+
return m.str;
|
|
4050
|
+
} }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
|
|
4051
|
+
return m.stringify;
|
|
4052
|
+
} }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
|
|
4053
|
+
return m.nil;
|
|
4054
|
+
} }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
|
|
4055
|
+
return m.Name;
|
|
4056
|
+
} }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
|
|
4057
|
+
return m.CodeGen;
|
|
4058
|
+
} });
|
|
4059
|
+
var y = ht;
|
|
4060
|
+
Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
|
|
4061
|
+
return y.default;
|
|
4062
|
+
} });
|
|
4063
|
+
var b = Ye;
|
|
4064
|
+
Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
|
|
4065
|
+
return b.default;
|
|
4066
|
+
} });
|
|
4067
|
+
})(tr, tr.exports);
|
|
4068
|
+
var Ol = tr.exports;
|
|
4069
|
+
const Tl = /* @__PURE__ */ Oo(Ol), pd = (e) => je(Lo, e), Il = (e) => je(Dr, e), yd = (e) => je(Ao, e), _d = (e) => je(ft, e), Ml = (e, t = 2e3) => {
|
|
4070
|
+
const [r, s] = de(e), o = Fo(null), { t: a } = je(ft, (l) => l.i18next), i = Il((l) => l.getActionStatus), d = Ne(() => e == null ? void 0 : e.task_id, [e == null ? void 0 : e.task_id]), u = Ne(() => e == null ? void 0 : e.actionId, [e == null ? void 0 : e.actionId]);
|
|
4071
|
+
return Wt(() => {
|
|
4072
|
+
if ((e == null ? void 0 : e.outcome) !== "pending" || !d)
|
|
4073
|
+
return;
|
|
4074
|
+
let l = !1;
|
|
4075
|
+
const m = async () => {
|
|
4076
|
+
var E, g;
|
|
4077
|
+
const y = await i(u, d);
|
|
4078
|
+
if (l)
|
|
4079
|
+
return;
|
|
4080
|
+
let b;
|
|
4081
|
+
y ? y.outcome === "success" || y.outcome === "failure" ? b = { ...y, done: !0 } : b = y : b = { outcome: "failure", summary: a("error.unexpected"), done: !0 }, s(b), (E = e == null ? void 0 : e.onUpdate) == null || E.call(e, { ...e, ...b }), b.done ? (g = e == null ? void 0 : e.onComplete) == null || g.call(e, { ...e, ...b }) : o.current = setTimeout(m, t);
|
|
4082
|
+
};
|
|
4083
|
+
return m(), () => {
|
|
4084
|
+
l = !0, o.current && clearTimeout(o.current);
|
|
4085
|
+
};
|
|
4086
|
+
}, [u, i, t, e, e == null ? void 0 : e.outcome, a, d]), Wt(() => {
|
|
4087
|
+
s(e);
|
|
4088
|
+
}, [e]), Ne(
|
|
4089
|
+
() => e || r ? { ...e, ...r } : void 0,
|
|
4090
|
+
[e, r]
|
|
4091
|
+
);
|
|
4092
|
+
}, Vl = ({ result: e, onClose: t, show: r = !1 }) => {
|
|
4093
|
+
var i, d;
|
|
4094
|
+
const { t: s } = je(ft, (u) => u.i18next), o = Ml(e), a = Ne(
|
|
4095
|
+
() => (o == null ? void 0 : o.outcome) === "success" || (o == null ? void 0 : o.outcome) === "failure" || (o == null ? void 0 : o.done),
|
|
4096
|
+
[o == null ? void 0 : o.done, o == null ? void 0 : o.outcome]
|
|
4097
|
+
);
|
|
4098
|
+
return o ? /* @__PURE__ */ M(bs, { open: r, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: t, children: /* @__PURE__ */ M(Es, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ M(dt, { children: /* @__PURE__ */ W(se, { spacing: 1, height: "100%", children: [
|
|
4099
|
+
/* @__PURE__ */ W(se, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
4100
|
+
o.action.action_icon && /* @__PURE__ */ M(zo, { height: "1.5rem", icon: o.action.action_icon }),
|
|
4101
|
+
/* @__PURE__ */ M(ke, { variant: "h5", children: o.action.name }),
|
|
4102
|
+
o.action.supported_types && /* @__PURE__ */ M(ke, { variant: "caption", color: "text.secondary", children: o.action.supported_types.map((u) => u.toUpperCase()).join(", ") }),
|
|
4103
|
+
/* @__PURE__ */ M("div", { style: { flex: 1 } }),
|
|
4104
|
+
/* @__PURE__ */ M(Go, { size: "small", classification: o.action.classification })
|
|
4105
|
+
] }),
|
|
4106
|
+
/* @__PURE__ */ M(ke, { variant: "body1", children: o.action.summary }),
|
|
4107
|
+
/* @__PURE__ */ M(Dt, { flexItem: !0 }),
|
|
4108
|
+
a ? /* @__PURE__ */ M(dt, { children: /* @__PURE__ */ M(Jo, { result: o }) }) : /* @__PURE__ */ W(se, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
4109
|
+
o.summary && /* @__PURE__ */ M(ke, { variant: "caption", children: o.summary }),
|
|
4110
|
+
/* @__PURE__ */ M(
|
|
4111
|
+
ko,
|
|
4112
|
+
{
|
|
4113
|
+
variant: (i = o.output) != null && i.progress ? "determinate" : "indeterminate",
|
|
4114
|
+
value: ((d = o.output) == null ? void 0 : d.progress) * 100,
|
|
4115
|
+
sx: { maxWidth: 500, width: "100%", borderRadius: (u) => u.shape.borderRadius }
|
|
4116
|
+
}
|
|
4117
|
+
)
|
|
4118
|
+
] }),
|
|
4119
|
+
/* @__PURE__ */ M("div", { style: { flex: 1 } }),
|
|
4120
|
+
/* @__PURE__ */ W(se, { direction: "row", spacing: 1, children: [
|
|
4121
|
+
/* @__PURE__ */ M("div", { style: { flex: 1 } }),
|
|
4122
|
+
o.link && /* @__PURE__ */ M(ot, { variant: "outlined", component: "a", target: "_blank", href: o.link, children: s("details.open") }),
|
|
4123
|
+
/* @__PURE__ */ M(ot, { variant: "outlined", color: "error", onClick: t, children: s("close") })
|
|
4124
|
+
] })
|
|
4125
|
+
] }) }) }) }) : null;
|
|
4126
|
+
}, Fl = Ns(Vl), Kl = new Tl({ removeAdditional: !0, coerceTypes: !0, strict: !1 }), Dr = Ko(null), vd = ({
|
|
4127
|
+
baseURL: e,
|
|
4128
|
+
children: t,
|
|
4129
|
+
classification: r,
|
|
4130
|
+
includeContext: s,
|
|
4131
|
+
getToken: o,
|
|
4132
|
+
onNetworkCall: a
|
|
4133
|
+
}) => {
|
|
4134
|
+
const { t: i, i18n: d } = je(ft, (z) => z.i18next), { ready: u } = Bo(), [l, m] = de(null), [y, b] = de({}), [E, g] = de(!1), [v, h] = de(null), [f, $] = de(!1), [P, R] = de({}), C = Ne(() => {
|
|
4135
|
+
const z = {}, B = o == null ? void 0 : o();
|
|
4136
|
+
return B && (z.Authorization = `Bearer ${B}`), a ? a({ baseURL: e, headers: z }) : { baseURL: e, headers: z };
|
|
4137
|
+
}, [e, o, a]), L = Oe(async () => {
|
|
4138
|
+
if (!u)
|
|
4139
|
+
return;
|
|
4140
|
+
const z = await Ht.actions.get(C);
|
|
4141
|
+
return z && R(z), z;
|
|
4142
|
+
}, [u, C]);
|
|
4143
|
+
Wt(() => {
|
|
4144
|
+
L();
|
|
4145
|
+
}, [e, u]);
|
|
4146
|
+
const H = Oe(
|
|
4147
|
+
(z, B, ee) => JSON.stringify({ type: z, value: B, classification: ee ?? r }),
|
|
4148
|
+
[r]
|
|
4149
|
+
), oe = Oe(
|
|
4150
|
+
async (z, B, ee, Ke) => {
|
|
4151
|
+
const {
|
|
4152
|
+
forceMenu: qe,
|
|
4153
|
+
onComplete: $e,
|
|
4154
|
+
onUpdate: he,
|
|
4155
|
+
onCancel: k,
|
|
4156
|
+
skipMenu: p,
|
|
4157
|
+
skipResultModal: S,
|
|
4158
|
+
timeout: _,
|
|
4159
|
+
includeContext: n,
|
|
4160
|
+
extraContext: c
|
|
4161
|
+
} = {
|
|
4162
|
+
forceMenu: !1,
|
|
4163
|
+
skipResultModal: !1,
|
|
4164
|
+
skipMenu: !1,
|
|
4165
|
+
onComplete: null,
|
|
4166
|
+
onUpdate: null,
|
|
4167
|
+
onCancel: null,
|
|
4168
|
+
timeout: null,
|
|
4169
|
+
includeContext: s ?? !1,
|
|
4170
|
+
extraContext: null,
|
|
4171
|
+
...Ke
|
|
4172
|
+
};
|
|
4173
|
+
if (!Object.keys(P).includes(z))
|
|
4174
|
+
throw new Error("Invalid action id");
|
|
4175
|
+
const w = B.map(
|
|
4176
|
+
(V) => V.type === "telemetry" ? { ...V, value: JSON.stringify(V.value) } : V
|
|
4177
|
+
), j = P[z], O = Kl.compile(j.params), A = { selectors: w, ...ee };
|
|
4178
|
+
let U = null;
|
|
4179
|
+
if (n && (U = {
|
|
4180
|
+
timestamp: Ho().toISOString(),
|
|
4181
|
+
url: window.location,
|
|
4182
|
+
language: (d == null ? void 0 : d.language) ?? "en"
|
|
4183
|
+
}), Qo(c) || (U = {
|
|
4184
|
+
...U ?? {},
|
|
4185
|
+
...c
|
|
4186
|
+
}), $(!0), !O(A) || qe) {
|
|
4187
|
+
if (p && !qe)
|
|
4188
|
+
throw console.error(`Form is not valid (${O.errors.length} errors)`), new Error("Form is not completed");
|
|
4189
|
+
(l == null ? void 0 : l.id) === z && (console.error(`Form is not valid (${O.errors.length} errors)`), _t(
|
|
4190
|
+
new CustomEvent(yt, {
|
|
4191
|
+
detail: {
|
|
4192
|
+
message: i("action.error.validation"),
|
|
4193
|
+
level: "error"
|
|
4194
|
+
}
|
|
4195
|
+
})
|
|
4196
|
+
)), m({
|
|
4197
|
+
id: z,
|
|
4198
|
+
action: j,
|
|
4199
|
+
selectors: B,
|
|
4200
|
+
params: A ?? {},
|
|
4201
|
+
skipResultModal: S,
|
|
4202
|
+
context: U,
|
|
4203
|
+
onComplete: $e,
|
|
4204
|
+
onUpdate: he,
|
|
4205
|
+
onCancel: k,
|
|
4206
|
+
timeout: _
|
|
4207
|
+
});
|
|
4208
|
+
return;
|
|
4209
|
+
}
|
|
4210
|
+
try {
|
|
4211
|
+
const V = await Ht.actions.post(
|
|
4212
|
+
z,
|
|
4213
|
+
w,
|
|
4214
|
+
A ?? {},
|
|
4215
|
+
U,
|
|
4216
|
+
{ timeout: _ },
|
|
4217
|
+
C
|
|
4218
|
+
), pe = { ...V, actionId: z, action: j, params: A };
|
|
4219
|
+
he == null || he(pe), V.outcome !== "pending" && ($e == null || $e(pe)), b((Ue) => {
|
|
4220
|
+
const We = B.map((ge) => H(ge.type, ge.value, ge.classification));
|
|
4221
|
+
return {
|
|
4222
|
+
...Ue,
|
|
4223
|
+
...We.reduce(
|
|
4224
|
+
(ge, ze) => ({
|
|
4225
|
+
...ge,
|
|
4226
|
+
[ze]: [...Ue[ze] ?? [], pe]
|
|
4227
|
+
}),
|
|
4228
|
+
{}
|
|
4229
|
+
)
|
|
4230
|
+
};
|
|
4231
|
+
}), _t(
|
|
4232
|
+
new CustomEvent(yt, {
|
|
4233
|
+
detail: {
|
|
4234
|
+
message: /* @__PURE__ */ W(se, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
|
|
4235
|
+
/* @__PURE__ */ M(ke, { children: V.summary }),
|
|
4236
|
+
V.link && /* @__PURE__ */ M(No, { component: "a", href: V.link, size: "small", target: "_blank", children: /* @__PURE__ */ M(Ss, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
4237
|
+
] }),
|
|
4238
|
+
timeout: V.link ? null : 5e3,
|
|
4239
|
+
level: V.outcome === "success" ? "success" : V.outcome === "pending" ? "info" : "error",
|
|
4240
|
+
options: {
|
|
4241
|
+
style: {
|
|
4242
|
+
minWidth: 0
|
|
4243
|
+
},
|
|
4244
|
+
SnackbarProps: {
|
|
4245
|
+
style: {
|
|
4246
|
+
minWidth: 0
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
})
|
|
4252
|
+
), V.outcome === "success" && m(null), V.outcome === "pending" && (h({ ...V, actionId: z, action: j, onComplete: $e, onUpdate: he }), S || g(!0), m(null)), V.format && (h({ ...V, actionId: z, action: j }), V.format !== "pivot" && !S ? g(!0) : window.open(V.output, "_blank", "noreferrer"));
|
|
4253
|
+
} catch (V) {
|
|
4254
|
+
_t(
|
|
4255
|
+
new CustomEvent(yt, {
|
|
4256
|
+
detail: {
|
|
4257
|
+
message: V.toString(),
|
|
4258
|
+
level: "error"
|
|
4259
|
+
}
|
|
4260
|
+
})
|
|
4261
|
+
);
|
|
4262
|
+
} finally {
|
|
4263
|
+
$(!1);
|
|
4264
|
+
}
|
|
4265
|
+
},
|
|
4266
|
+
[P, s, H, d == null ? void 0 : d.language, C, l == null ? void 0 : l.id, i]
|
|
4267
|
+
), ae = Oe(
|
|
4268
|
+
async (z, B) => {
|
|
4269
|
+
try {
|
|
4270
|
+
return await Ht.actions.status.get(z, B, {}, C);
|
|
4271
|
+
} catch (ee) {
|
|
4272
|
+
_t(
|
|
4273
|
+
new CustomEvent(yt, {
|
|
4274
|
+
detail: {
|
|
4275
|
+
message: ee.toString(),
|
|
4276
|
+
level: "error"
|
|
4277
|
+
}
|
|
4278
|
+
})
|
|
4279
|
+
);
|
|
4280
|
+
}
|
|
4281
|
+
},
|
|
4282
|
+
[C]
|
|
4283
|
+
), me = Oe(() => {
|
|
4284
|
+
var z;
|
|
4285
|
+
(z = l == null ? void 0 : l.onCancel) == null || z.call(l), m(null), $(!1);
|
|
4286
|
+
}, [l]), Ee = Oe(
|
|
4287
|
+
(z, B, ee) => y[H(z, B, ee)] ?? [],
|
|
4288
|
+
[y, H]
|
|
4289
|
+
), ie = Ne(
|
|
4290
|
+
() => ({
|
|
4291
|
+
availableActions: P,
|
|
4292
|
+
executeAction: oe,
|
|
4293
|
+
cancelAction: me,
|
|
4294
|
+
getActionStatus: ae,
|
|
4295
|
+
getActionResults: Ee,
|
|
4296
|
+
loading: f,
|
|
4297
|
+
refreshActions: L
|
|
4298
|
+
}),
|
|
4299
|
+
[P, me, oe, Ee, ae, f, L]
|
|
4300
|
+
);
|
|
4301
|
+
return /* @__PURE__ */ W(Dr.Provider, { value: ie, children: [
|
|
4302
|
+
t,
|
|
4303
|
+
/* @__PURE__ */ W(dt, { children: [
|
|
4304
|
+
l && /* @__PURE__ */ M(Al, { runningActionData: l }),
|
|
4305
|
+
/* @__PURE__ */ M(
|
|
4306
|
+
Fl,
|
|
4307
|
+
{
|
|
4308
|
+
show: E && !!v,
|
|
4309
|
+
result: v,
|
|
4310
|
+
onClose: () => g(!1)
|
|
4311
|
+
}
|
|
4312
|
+
)
|
|
4313
|
+
] })
|
|
4314
|
+
] });
|
|
4315
|
+
}, ql = () => qo(Dr), Ul = Eo.map((e) => ({
|
|
4316
|
+
...e,
|
|
4317
|
+
renderer: ({ ...t }) => /* @__PURE__ */ M(dt, { children: /* @__PURE__ */ M(e.renderer, { ...t }) })
|
|
4318
|
+
})), zl = ({ runningActionData: e }) => {
|
|
4319
|
+
const { executeAction: t, cancelAction: r } = ql(), { t: s } = je(ft, (v) => v.i18next), [o, a] = de(!1), [i, d] = de(null), [u, l] = de(e == null ? void 0 : e.params), [m, y] = de(!1), b = Ne(
|
|
4320
|
+
() => e != null && e.action ? { ...Uo(e.action.params), ...e.action.extra_schema ?? {} } : null,
|
|
4321
|
+
[e == null ? void 0 : e.action]
|
|
4322
|
+
), E = Ne(
|
|
4323
|
+
() => ({
|
|
4324
|
+
type: "VerticalLayout",
|
|
4325
|
+
elements: Object.entries((b == null ? void 0 : b.properties) ?? {}).sort(([v, h], [f, $]) => h.order || $.order ? h.order - $.order : +(b == null ? void 0 : b.required.includes(v)) - +(b == null ? void 0 : b.required.includes(f))).map(([v, h]) => {
|
|
4326
|
+
var f;
|
|
4327
|
+
return {
|
|
4328
|
+
type: "Control",
|
|
4329
|
+
scope: `#/properties/${v}`,
|
|
4330
|
+
options: {
|
|
4331
|
+
autocomplete: !!h.enum || ((f = h.options) == null ? void 0 : f.autocomplete),
|
|
4332
|
+
showUnfocusedDescription: !0,
|
|
4333
|
+
...h.options
|
|
4334
|
+
},
|
|
4335
|
+
rule: h.rule
|
|
4336
|
+
};
|
|
4337
|
+
})
|
|
4338
|
+
}),
|
|
4339
|
+
[b == null ? void 0 : b.properties, b == null ? void 0 : b.required]
|
|
4340
|
+
), g = Oe(async () => {
|
|
4341
|
+
try {
|
|
4342
|
+
a(!0);
|
|
4343
|
+
const v = {};
|
|
4344
|
+
e != null && e.onComplete && (v.onComplete = e == null ? void 0 : e.onComplete), e != null && e.onUpdate && (v.onUpdate = e == null ? void 0 : e.onUpdate), e != null && e.timeout && (v.timeout = e == null ? void 0 : e.timeout), e != null && e.skipResultModal && (v.skipResultModal = e == null ? void 0 : e.skipResultModal), await t(e == null ? void 0 : e.id, e == null ? void 0 : e.selectors, u, v);
|
|
4345
|
+
} catch (v) {
|
|
4346
|
+
console.error(v);
|
|
4347
|
+
} finally {
|
|
4348
|
+
a(!1);
|
|
4349
|
+
}
|
|
4350
|
+
}, [
|
|
4351
|
+
t,
|
|
4352
|
+
e == null ? void 0 : e.id,
|
|
4353
|
+
e == null ? void 0 : e.selectors,
|
|
4354
|
+
e == null ? void 0 : e.onComplete,
|
|
4355
|
+
e == null ? void 0 : e.timeout,
|
|
4356
|
+
e == null ? void 0 : e.skipResultModal,
|
|
4357
|
+
u
|
|
4358
|
+
]);
|
|
4359
|
+
if (e != null && e.action)
|
|
4360
|
+
try {
|
|
4361
|
+
return /* @__PURE__ */ M(bs, { open: !0, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose: r, children: /* @__PURE__ */ M(
|
|
4362
|
+
Es,
|
|
4363
|
+
{
|
|
4364
|
+
sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", px: 2, pt: 2, minWidth: "750px", overflow: "auto" },
|
|
4365
|
+
children: /* @__PURE__ */ W(
|
|
4366
|
+
se,
|
|
4367
|
+
{
|
|
4368
|
+
spacing: 1,
|
|
4369
|
+
height: "100%",
|
|
4370
|
+
sx: {
|
|
4371
|
+
".MuiFormHelperText-root": {
|
|
4372
|
+
marginLeft: "0 !important",
|
|
4373
|
+
"&:last-of-type": { mb: 3 }
|
|
4374
|
+
}
|
|
4375
|
+
},
|
|
4376
|
+
children: [
|
|
4377
|
+
/* @__PURE__ */ W(se, { direction: "row", spacing: 1, children: [
|
|
4378
|
+
/* @__PURE__ */ W(se, { direction: "column", spacing: 1, children: [
|
|
4379
|
+
/* @__PURE__ */ W(ke, { variant: "h5", children: [
|
|
4380
|
+
s("actions.executing"),
|
|
4381
|
+
" ",
|
|
4382
|
+
e == null ? void 0 : e.action.id.replace(/_/g, " ").split(" ").map(wn).join(" ")
|
|
4383
|
+
] }),
|
|
4384
|
+
(e == null ? void 0 : e.action.summary) && /* @__PURE__ */ M(ke, { variant: "body1", color: "text.secondary", sx: { pb: 1.5 }, children: e == null ? void 0 : e.action.summary })
|
|
4385
|
+
] }),
|
|
4386
|
+
/* @__PURE__ */ M(et, { flex: 1 }),
|
|
4387
|
+
/* @__PURE__ */ M(et, { alignContent: "end", children: /* @__PURE__ */ M(
|
|
4388
|
+
ot,
|
|
4389
|
+
{
|
|
4390
|
+
variant: "outlined",
|
|
4391
|
+
onClick: () => y((v) => !v),
|
|
4392
|
+
startIcon: /* @__PURE__ */ M(
|
|
4393
|
+
et,
|
|
4394
|
+
{
|
|
4395
|
+
component: "span",
|
|
4396
|
+
sx: (v) => ({
|
|
4397
|
+
transition: v.transitions.create("transform"),
|
|
4398
|
+
transform: m ? "rotate(180deg)" : "rotate(0deg)"
|
|
4399
|
+
}),
|
|
4400
|
+
children: /* @__PURE__ */ M(Ss, { icon: "ic:baseline-keyboard-double-arrow-right" })
|
|
4401
|
+
}
|
|
4402
|
+
),
|
|
4403
|
+
children: s(m ? "actions.json.hide" : "actions.json.show")
|
|
4404
|
+
}
|
|
4405
|
+
) })
|
|
4406
|
+
] }),
|
|
4407
|
+
/* @__PURE__ */ M(Dt, { orientation: "horizontal", variant: "middle" }),
|
|
4408
|
+
/* @__PURE__ */ M(et, { pt: 1.5 }),
|
|
4409
|
+
/* @__PURE__ */ W(se, { flexGrow: 1, direction: "row", spacing: 1, children: [
|
|
4410
|
+
/* @__PURE__ */ W(se, { direction: "column", flexGrow: 1, children: [
|
|
4411
|
+
/* @__PURE__ */ M(dt, { children: /* @__PURE__ */ M(
|
|
4412
|
+
Po,
|
|
4413
|
+
{
|
|
4414
|
+
schema: b,
|
|
4415
|
+
uischema: E,
|
|
4416
|
+
renderers: Ul,
|
|
4417
|
+
cells: So,
|
|
4418
|
+
data: u,
|
|
4419
|
+
onChange: ({ data: v, errors: h }) => {
|
|
4420
|
+
Vo(v, u) || l(v), d(h);
|
|
4421
|
+
},
|
|
4422
|
+
config: {}
|
|
4423
|
+
}
|
|
4424
|
+
) }),
|
|
4425
|
+
/* @__PURE__ */ W(se, { direction: "row", spacing: 1, pb: 1, children: [
|
|
4426
|
+
/* @__PURE__ */ M("div", { style: { flex: 1 } }),
|
|
4427
|
+
/* @__PURE__ */ M(ot, { color: "error", variant: "outlined", onClick: r, children: s("cancel") }),
|
|
4428
|
+
/* @__PURE__ */ M(
|
|
4429
|
+
ot,
|
|
4430
|
+
{
|
|
4431
|
+
color: "success",
|
|
4432
|
+
variant: "outlined",
|
|
4433
|
+
disabled: o || (i == null ? void 0 : i.length) > 0,
|
|
4434
|
+
onClick: g,
|
|
4435
|
+
endIcon: o && /* @__PURE__ */ M(Co, { color: "inherit", size: 18 }),
|
|
4436
|
+
children: s("actions.execute")
|
|
4437
|
+
}
|
|
4438
|
+
)
|
|
4439
|
+
] })
|
|
4440
|
+
] }),
|
|
4441
|
+
/* @__PURE__ */ M(jo, { orientation: "horizontal", in: m, unmountOnExit: !0, mountOnEnter: !0, children: /* @__PURE__ */ W(se, { direction: "row", height: "100%", spacing: 1, children: [
|
|
4442
|
+
/* @__PURE__ */ M(Dt, { orientation: "vertical" }),
|
|
4443
|
+
/* @__PURE__ */ W(se, { children: [
|
|
4444
|
+
/* @__PURE__ */ M(ke, { variant: "h5", children: s("action.data") }),
|
|
4445
|
+
/* @__PURE__ */ M(et, { width: 600, height: "100%", children: /* @__PURE__ */ M(Ro, { data: u, slotProps: { stack: { height: "100%" }, json: { name: !1 } } }) })
|
|
4446
|
+
] })
|
|
4447
|
+
] }) })
|
|
4448
|
+
] })
|
|
4449
|
+
]
|
|
4450
|
+
}
|
|
4451
|
+
)
|
|
4452
|
+
}
|
|
4453
|
+
) });
|
|
4454
|
+
} catch (v) {
|
|
4455
|
+
return console.warn(v), null;
|
|
4456
|
+
}
|
|
4457
|
+
}, Al = Ns(zl);
|
|
4458
|
+
export {
|
|
4459
|
+
Al as A,
|
|
4460
|
+
vd as C,
|
|
4461
|
+
Fl as R,
|
|
4462
|
+
Il as a,
|
|
4463
|
+
yd as b,
|
|
4464
|
+
pd as c,
|
|
4465
|
+
_d as d,
|
|
4466
|
+
wn as e,
|
|
4467
|
+
Ml as f,
|
|
4468
|
+
Dr as g,
|
|
4469
|
+
ql as u
|
|
4470
|
+
};
|