@cccsaurora/clue-ui 1.3.0-dev.404 → 1.3.0

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