@wp-playground/client 0.6.13 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +16 -16
- package/index.d.ts +27 -11
- package/index.js +830 -810
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -777,8 +777,8 @@ const enableMultisite = async (e) => {
|
|
|
777
777
|
});
|
|
778
778
|
const t = new URL(await e.absoluteUrl);
|
|
779
779
|
if (t.port !== "") {
|
|
780
|
-
let
|
|
781
|
-
throw t.hostname === "localhost" && (
|
|
780
|
+
let C = `The current host is ${t.host}, but WordPress multisites do not support custom ports.`;
|
|
781
|
+
throw t.hostname === "localhost" && (C += " For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."), new Error(C);
|
|
782
782
|
}
|
|
783
783
|
const r = t.pathname.replace(/\/$/, "") + "/", n = `${t.protocol}//${t.hostname}${r}`;
|
|
784
784
|
await setSiteOptions(e, {
|
|
@@ -858,23 +858,23 @@ echo json_encode($deactivated_plugins);
|
|
|
858
858
|
PATH_CURRENT_SITE: r
|
|
859
859
|
}
|
|
860
860
|
});
|
|
861
|
-
const p = new URL(await e.absoluteUrl),
|
|
861
|
+
const p = new URL(await e.absoluteUrl), _ = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
|
|
862
862
|
await e.writeFile(
|
|
863
863
|
joinPaths(s, "/wp-content/sunrise.php"),
|
|
864
864
|
`<?php
|
|
865
865
|
if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
|
|
866
866
|
define( 'BLOG_ID_CURRENT_SITE', 1 );
|
|
867
867
|
}
|
|
868
|
-
$folder = ${phpVar(
|
|
868
|
+
$folder = ${phpVar(_)};
|
|
869
869
|
if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
|
|
870
870
|
$_SERVER['HTTP_HOST'] = ${phpVar(p.hostname)};
|
|
871
871
|
$_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
|
|
872
872
|
}
|
|
873
873
|
`
|
|
874
874
|
), await login(e, {});
|
|
875
|
-
for (const
|
|
875
|
+
for (const C of o)
|
|
876
876
|
await activatePlugin(e, {
|
|
877
|
-
pluginPath:
|
|
877
|
+
pluginPath: C
|
|
878
878
|
});
|
|
879
879
|
};
|
|
880
880
|
function jsonToUrlEncoded(e) {
|
|
@@ -1050,13 +1050,13 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
|
|
|
1050
1050
|
}), s = joinPaths(s, r);
|
|
1051
1051
|
const i = joinPaths(s, "wp-content"), o = joinPaths(n, "wp-content");
|
|
1052
1052
|
for (const p of wpContentFilesExcludedFromExport) {
|
|
1053
|
-
const
|
|
1053
|
+
const _ = joinPaths(
|
|
1054
1054
|
i,
|
|
1055
1055
|
p
|
|
1056
1056
|
);
|
|
1057
|
-
await removePath(e,
|
|
1057
|
+
await removePath(e, _);
|
|
1058
1058
|
const T = joinPaths(o, p);
|
|
1059
|
-
await e.fileExists(T) && (await e.mkdir(dirname(
|
|
1059
|
+
await e.fileExists(T) && (await e.mkdir(dirname(_)), await e.mv(T, _));
|
|
1060
1060
|
}
|
|
1061
1061
|
const c = joinPaths(
|
|
1062
1062
|
s,
|
|
@@ -1095,30 +1095,54 @@ async function exportWXR(e) {
|
|
|
1095
1095
|
});
|
|
1096
1096
|
return new File([t.bytes], "export.xml");
|
|
1097
1097
|
}
|
|
1098
|
-
async function installAsset(e, {
|
|
1099
|
-
|
|
1100
|
-
|
|
1098
|
+
async function installAsset(e, {
|
|
1099
|
+
targetPath: t,
|
|
1100
|
+
zipFile: r,
|
|
1101
|
+
ifAlreadyInstalled: n = "overwrite"
|
|
1102
|
+
}) {
|
|
1103
|
+
const i = r.name.replace(/\.zip$/, ""), o = joinPaths(await e.documentRoot, "wp-content"), c = joinPaths(o, randomString()), d = joinPaths(c, "assets", i);
|
|
1104
|
+
await e.fileExists(d) && await e.rmdir(c, {
|
|
1101
1105
|
recursive: !0
|
|
1102
|
-
}), await e.mkdir(
|
|
1106
|
+
}), await e.mkdir(c);
|
|
1103
1107
|
try {
|
|
1104
1108
|
await unzip(e, {
|
|
1105
1109
|
zipFile: r,
|
|
1106
|
-
extractToPath:
|
|
1110
|
+
extractToPath: d
|
|
1107
1111
|
});
|
|
1108
|
-
let
|
|
1112
|
+
let u = await e.listFiles(d, {
|
|
1109
1113
|
prependPath: !0
|
|
1110
1114
|
});
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
let
|
|
1114
|
-
|
|
1115
|
-
const
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1115
|
+
u = u.filter((S) => !S.endsWith("/__MACOSX"));
|
|
1116
|
+
const p = u.length === 1 && await e.isDir(u[0]);
|
|
1117
|
+
let _, T = "";
|
|
1118
|
+
p ? (T = u[0], _ = u[0].split("/").pop()) : (T = d, _ = i);
|
|
1119
|
+
const C = `${t}/${_}`;
|
|
1120
|
+
if (await e.fileExists(C)) {
|
|
1121
|
+
if (!await e.isDir(C))
|
|
1122
|
+
throw new Error(
|
|
1123
|
+
`Cannot install asset ${_} to ${C} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`
|
|
1124
|
+
);
|
|
1125
|
+
if (n === "overwrite")
|
|
1126
|
+
await e.rmdir(C, {
|
|
1127
|
+
recursive: !0
|
|
1128
|
+
});
|
|
1129
|
+
else {
|
|
1130
|
+
if (n === "skip")
|
|
1131
|
+
return {
|
|
1132
|
+
assetFolderPath: C,
|
|
1133
|
+
assetFolderName: _
|
|
1134
|
+
};
|
|
1135
|
+
throw new Error(
|
|
1136
|
+
`Cannot install asset ${_} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return await e.mv(T, C), {
|
|
1141
|
+
assetFolderPath: C,
|
|
1142
|
+
assetFolderName: _
|
|
1119
1143
|
};
|
|
1120
1144
|
} finally {
|
|
1121
|
-
await e.rmdir(
|
|
1145
|
+
await e.rmdir(c, {
|
|
1122
1146
|
recursive: !0
|
|
1123
1147
|
});
|
|
1124
1148
|
}
|
|
@@ -1127,34 +1151,36 @@ function zipNameToHumanName(e) {
|
|
|
1127
1151
|
const t = e.split(".").shift().replace(/-/g, " ");
|
|
1128
1152
|
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
1129
1153
|
}
|
|
1130
|
-
const installPlugin = async (e, { pluginZipFile: t,
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
const { assetFolderPath:
|
|
1154
|
+
const installPlugin = async (e, { pluginZipFile: t, ifAlreadyInstalled: r, options: n = {} }, s) => {
|
|
1155
|
+
const i = t.name.split("/").pop() || "plugin.zip", o = zipNameToHumanName(i);
|
|
1156
|
+
s == null || s.tracker.setCaption(`Installing the ${o} plugin`);
|
|
1157
|
+
const { assetFolderPath: c } = await installAsset(e, {
|
|
1158
|
+
ifAlreadyInstalled: r,
|
|
1134
1159
|
zipFile: t,
|
|
1135
1160
|
targetPath: `${await e.documentRoot}/wp-content/plugins`
|
|
1136
1161
|
});
|
|
1137
|
-
("activate" in
|
|
1162
|
+
("activate" in n ? n.activate : !0) && await activatePlugin(
|
|
1138
1163
|
e,
|
|
1139
1164
|
{
|
|
1140
|
-
pluginPath:
|
|
1141
|
-
pluginName:
|
|
1165
|
+
pluginPath: c,
|
|
1166
|
+
pluginName: o
|
|
1142
1167
|
},
|
|
1143
|
-
|
|
1168
|
+
s
|
|
1144
1169
|
);
|
|
1145
|
-
}, installTheme = async (e, { themeZipFile: t,
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
const { assetFolderName:
|
|
1170
|
+
}, installTheme = async (e, { themeZipFile: t, ifAlreadyInstalled: r, options: n = {} }, s) => {
|
|
1171
|
+
const i = zipNameToHumanName(t.name);
|
|
1172
|
+
s == null || s.tracker.setCaption(`Installing the ${i} theme`);
|
|
1173
|
+
const { assetFolderName: o } = await installAsset(e, {
|
|
1174
|
+
ifAlreadyInstalled: r,
|
|
1149
1175
|
zipFile: t,
|
|
1150
1176
|
targetPath: `${await e.documentRoot}/wp-content/themes`
|
|
1151
1177
|
});
|
|
1152
|
-
("activate" in
|
|
1178
|
+
("activate" in n ? n.activate : !0) && await activateTheme(
|
|
1153
1179
|
e,
|
|
1154
1180
|
{
|
|
1155
|
-
themeFolderName:
|
|
1181
|
+
themeFolderName: o
|
|
1156
1182
|
},
|
|
1157
|
-
|
|
1183
|
+
s
|
|
1158
1184
|
);
|
|
1159
1185
|
}, runWpInstallationWizard = async (e, { options: t }) => {
|
|
1160
1186
|
await e.request({
|
|
@@ -1918,9 +1944,12 @@ class PHPRequestHandler {
|
|
|
1918
1944
|
t.url.split("#")[0],
|
|
1919
1945
|
r ? void 0 : DEFAULT_BASE_URL
|
|
1920
1946
|
), s = applyRewriteRules(
|
|
1921
|
-
removePathPrefix(
|
|
1947
|
+
removePathPrefix(
|
|
1948
|
+
decodeURIComponent(n.pathname),
|
|
1949
|
+
H(this, ve)
|
|
1950
|
+
),
|
|
1922
1951
|
this.rewriteRules
|
|
1923
|
-
), i =
|
|
1952
|
+
), i = joinPaths(H(this, Pe), s);
|
|
1924
1953
|
return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, zt).call(this, i);
|
|
1925
1954
|
}
|
|
1926
1955
|
}
|
|
@@ -1978,7 +2007,7 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
|
|
|
1978
2007
|
}
|
|
1979
2008
|
let d;
|
|
1980
2009
|
try {
|
|
1981
|
-
d = ce(this, gt, Bt).call(this, r.pathname);
|
|
2010
|
+
d = ce(this, gt, Bt).call(this, decodeURIComponent(r.pathname));
|
|
1982
2011
|
} catch {
|
|
1983
2012
|
return new PHPResponse(
|
|
1984
2013
|
404,
|
|
@@ -2156,8 +2185,8 @@ function rethrowFileSystemError(e = "") {
|
|
|
2156
2185
|
} catch (c) {
|
|
2157
2186
|
const d = typeof c == "object" ? c == null ? void 0 : c.errno : null;
|
|
2158
2187
|
if (d in FileErrorCodes) {
|
|
2159
|
-
const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null,
|
|
2160
|
-
throw new Error(`${
|
|
2188
|
+
const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, _ = p !== null ? e.replaceAll("{path}", p) : e;
|
|
2189
|
+
throw new Error(`${_}: ${u}`, {
|
|
2161
2190
|
cause: c
|
|
2162
2191
|
});
|
|
2163
2192
|
}
|
|
@@ -2180,7 +2209,7 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
|
|
|
2180
2209
|
return n && s && __defProp(t, r, s), s;
|
|
2181
2210
|
};
|
|
2182
2211
|
const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
|
|
2183
|
-
var Me, Ze, Ye,
|
|
2212
|
+
var Me, Ze, Ye, Ee, Re, Te, be, Xe, yt, Gt, $t, Kt, vt, Jt, wt, Qt, Pt, Zt, Et, Yt, bt, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ct, sr;
|
|
2184
2213
|
class BasePHP {
|
|
2185
2214
|
/**
|
|
2186
2215
|
* Initializes a PHP runtime.
|
|
@@ -2195,8 +2224,8 @@ class BasePHP {
|
|
|
2195
2224
|
Q(this, vt);
|
|
2196
2225
|
Q(this, wt);
|
|
2197
2226
|
Q(this, Pt);
|
|
2198
|
-
Q(this, bt);
|
|
2199
2227
|
Q(this, Et);
|
|
2228
|
+
Q(this, bt);
|
|
2200
2229
|
Q(this, St);
|
|
2201
2230
|
Q(this, Rt);
|
|
2202
2231
|
Q(this, Tt);
|
|
@@ -2205,24 +2234,24 @@ class BasePHP {
|
|
|
2205
2234
|
Q(this, Me, void 0);
|
|
2206
2235
|
Q(this, Ze, void 0);
|
|
2207
2236
|
Q(this, Ye, void 0);
|
|
2208
|
-
Q(this,
|
|
2237
|
+
Q(this, Ee, void 0);
|
|
2209
2238
|
Q(this, Re, void 0);
|
|
2210
2239
|
Q(this, Te, void 0);
|
|
2211
|
-
Q(this,
|
|
2240
|
+
Q(this, be, void 0);
|
|
2212
2241
|
Q(this, Xe, void 0);
|
|
2213
|
-
te(this, Me, []), te(this,
|
|
2242
|
+
te(this, Me, []), te(this, Ee, !1), te(this, Re, null), te(this, Te, {}), te(this, be, /* @__PURE__ */ new Map()), te(this, Xe, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPBrowser(
|
|
2214
2243
|
new PHPRequestHandler(this, t)
|
|
2215
2244
|
));
|
|
2216
2245
|
}
|
|
2217
2246
|
addEventListener(e, t) {
|
|
2218
|
-
H(this,
|
|
2247
|
+
H(this, be).has(e) || H(this, be).set(e, /* @__PURE__ */ new Set()), H(this, be).get(e).add(t);
|
|
2219
2248
|
}
|
|
2220
2249
|
removeEventListener(e, t) {
|
|
2221
2250
|
var r;
|
|
2222
|
-
(r = H(this,
|
|
2251
|
+
(r = H(this, be).get(e)) == null || r.delete(t);
|
|
2223
2252
|
}
|
|
2224
2253
|
dispatchEvent(e) {
|
|
2225
|
-
const t = H(this,
|
|
2254
|
+
const t = H(this, be).get(e.type);
|
|
2226
2255
|
if (t)
|
|
2227
2256
|
for (const r of t)
|
|
2228
2257
|
r(e);
|
|
@@ -2285,7 +2314,7 @@ class BasePHP {
|
|
|
2285
2314
|
}
|
|
2286
2315
|
/** @inheritDoc */
|
|
2287
2316
|
setPhpIniPath(e) {
|
|
2288
|
-
if (H(this,
|
|
2317
|
+
if (H(this, Ee))
|
|
2289
2318
|
throw new Error("Cannot set PHP ini path after calling run().");
|
|
2290
2319
|
te(this, Ze, e), this[__private__dont__use].ccall(
|
|
2291
2320
|
"wasm_set_phpini_path",
|
|
@@ -2296,7 +2325,7 @@ class BasePHP {
|
|
|
2296
2325
|
}
|
|
2297
2326
|
/** @inheritDoc */
|
|
2298
2327
|
setPhpIniEntry(e, t) {
|
|
2299
|
-
if (H(this,
|
|
2328
|
+
if (H(this, Ee))
|
|
2300
2329
|
throw new Error("Cannot set PHP ini entries after calling run().");
|
|
2301
2330
|
H(this, Me).push([e, t]);
|
|
2302
2331
|
}
|
|
@@ -2315,27 +2344,23 @@ class BasePHP {
|
|
|
2315
2344
|
const t = await this.semaphore.acquire();
|
|
2316
2345
|
let r;
|
|
2317
2346
|
try {
|
|
2318
|
-
if (H(this,
|
|
2347
|
+
if (H(this, Ee) || (ce(this, yt, Gt).call(this), te(this, Ee, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
|
|
2319
2348
|
throw new Error(
|
|
2320
2349
|
`The script path "${e.scriptPath}" does not exist.`
|
|
2321
2350
|
);
|
|
2322
2351
|
ce(this, St, er).call(this, e.scriptPath || ""), ce(this, vt, Jt).call(this, e.relativeUri || ""), ce(this, Pt, Zt).call(this, e.method || "GET");
|
|
2323
2352
|
const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443";
|
|
2324
|
-
ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this,
|
|
2353
|
+
ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, Et, Yt).call(this, n), e.body && (r = ce(this, bt, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this, Rt, tr).call(this);
|
|
2325
2354
|
const i = e.env || {};
|
|
2326
2355
|
for (const c in i)
|
|
2327
2356
|
ce(this, Tt, rr).call(this, c, i[c]);
|
|
2328
2357
|
const o = await ce(this, Ct, sr).call(this);
|
|
2329
2358
|
if (o.exitCode !== 0) {
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
stderr: o.errors
|
|
2333
|
-
};
|
|
2334
|
-
console.warn("PHP.run() output was:", c);
|
|
2335
|
-
const d = new Error(
|
|
2359
|
+
console.warn("PHP.run() output was:", o.text);
|
|
2360
|
+
const c = new Error(
|
|
2336
2361
|
`PHP.run() failed with exit code ${o.exitCode} and the following output: ` + o.errors
|
|
2337
2362
|
);
|
|
2338
|
-
throw
|
|
2363
|
+
throw c.response = o, c.source = "request", console.error(c), c;
|
|
2339
2364
|
}
|
|
2340
2365
|
return o;
|
|
2341
2366
|
} catch (n) {
|
|
@@ -2465,10 +2490,10 @@ class BasePHP {
|
|
|
2465
2490
|
this[__private__dont__use]._exit(e);
|
|
2466
2491
|
} catch {
|
|
2467
2492
|
}
|
|
2468
|
-
te(this,
|
|
2493
|
+
te(this, Ee, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
|
|
2469
2494
|
}
|
|
2470
2495
|
}
|
|
2471
|
-
Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(),
|
|
2496
|
+
Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), Ee = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), be = new WeakMap(), Xe = new WeakMap(), yt = new WeakSet(), Gt = function() {
|
|
2472
2497
|
if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
|
|
2473
2498
|
"/internal/consts.php",
|
|
2474
2499
|
`<?php
|
|
@@ -2550,7 +2575,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2550
2575
|
[STRING],
|
|
2551
2576
|
[e]
|
|
2552
2577
|
);
|
|
2553
|
-
},
|
|
2578
|
+
}, Et = new WeakSet(), Yt = function(e) {
|
|
2554
2579
|
e.cookie && this[__private__dont__use].ccall(
|
|
2555
2580
|
"wasm_set_cookies",
|
|
2556
2581
|
null,
|
|
@@ -2574,7 +2599,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
|
|
|
2574
2599
|
e[t]
|
|
2575
2600
|
);
|
|
2576
2601
|
}
|
|
2577
|
-
},
|
|
2602
|
+
}, bt = new WeakSet(), Xt = function(e) {
|
|
2578
2603
|
let t, r;
|
|
2579
2604
|
typeof e == "string" ? (console.warn(
|
|
2580
2605
|
"Passing a string as the request body is deprecated. Please use a Uint8Array instead. See https://github.com/WordPress/wordpress-playground/issues/997 for more details"
|
|
@@ -2998,78 +3023,78 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
|
|
|
2998
3023
|
}
|
|
2999
3024
|
}
|
|
3000
3025
|
e._Code = n, e.nil = new n("");
|
|
3001
|
-
function s(
|
|
3002
|
-
const P = [
|
|
3026
|
+
function s(g, ...y) {
|
|
3027
|
+
const P = [g[0]];
|
|
3003
3028
|
let I = 0;
|
|
3004
3029
|
for (; I < y.length; )
|
|
3005
|
-
c(P, y[I]), P.push(
|
|
3030
|
+
c(P, y[I]), P.push(g[++I]);
|
|
3006
3031
|
return new n(P);
|
|
3007
3032
|
}
|
|
3008
3033
|
e._ = s;
|
|
3009
3034
|
const i = new n("+");
|
|
3010
|
-
function o(
|
|
3011
|
-
const P = [
|
|
3035
|
+
function o(g, ...y) {
|
|
3036
|
+
const P = [C(g[0])];
|
|
3012
3037
|
let I = 0;
|
|
3013
3038
|
for (; I < y.length; )
|
|
3014
|
-
P.push(i), c(P, y[I]), P.push(i,
|
|
3039
|
+
P.push(i), c(P, y[I]), P.push(i, C(g[++I]));
|
|
3015
3040
|
return d(P), new n(P);
|
|
3016
3041
|
}
|
|
3017
3042
|
e.str = o;
|
|
3018
|
-
function c(
|
|
3019
|
-
y instanceof n ?
|
|
3043
|
+
function c(g, y) {
|
|
3044
|
+
y instanceof n ? g.push(...y._items) : y instanceof r ? g.push(y) : g.push(_(y));
|
|
3020
3045
|
}
|
|
3021
3046
|
e.addCodeArg = c;
|
|
3022
|
-
function d(
|
|
3047
|
+
function d(g) {
|
|
3023
3048
|
let y = 1;
|
|
3024
|
-
for (; y <
|
|
3025
|
-
if (
|
|
3026
|
-
const P = u(
|
|
3049
|
+
for (; y < g.length - 1; ) {
|
|
3050
|
+
if (g[y] === i) {
|
|
3051
|
+
const P = u(g[y - 1], g[y + 1]);
|
|
3027
3052
|
if (P !== void 0) {
|
|
3028
|
-
|
|
3053
|
+
g.splice(y - 1, 3, P);
|
|
3029
3054
|
continue;
|
|
3030
3055
|
}
|
|
3031
|
-
|
|
3056
|
+
g[y++] = "+";
|
|
3032
3057
|
}
|
|
3033
3058
|
y++;
|
|
3034
3059
|
}
|
|
3035
3060
|
}
|
|
3036
|
-
function u(
|
|
3061
|
+
function u(g, y) {
|
|
3037
3062
|
if (y === '""')
|
|
3038
|
-
return
|
|
3039
|
-
if (
|
|
3063
|
+
return g;
|
|
3064
|
+
if (g === '""')
|
|
3040
3065
|
return y;
|
|
3041
|
-
if (typeof
|
|
3042
|
-
return y instanceof r ||
|
|
3043
|
-
if (typeof y == "string" && y[0] === '"' && !(
|
|
3044
|
-
return `"${
|
|
3066
|
+
if (typeof g == "string")
|
|
3067
|
+
return y instanceof r || g[g.length - 1] !== '"' ? void 0 : typeof y != "string" ? `${g.slice(0, -1)}${y}"` : y[0] === '"' ? g.slice(0, -1) + y.slice(1) : void 0;
|
|
3068
|
+
if (typeof y == "string" && y[0] === '"' && !(g instanceof r))
|
|
3069
|
+
return `"${g}${y.slice(1)}`;
|
|
3045
3070
|
}
|
|
3046
|
-
function p(
|
|
3047
|
-
return y.emptyStr() ?
|
|
3071
|
+
function p(g, y) {
|
|
3072
|
+
return y.emptyStr() ? g : g.emptyStr() ? y : o`${g}${y}`;
|
|
3048
3073
|
}
|
|
3049
3074
|
e.strConcat = p;
|
|
3050
|
-
function g
|
|
3051
|
-
return typeof
|
|
3075
|
+
function _(g) {
|
|
3076
|
+
return typeof g == "number" || typeof g == "boolean" || g === null ? g : C(Array.isArray(g) ? g.join(",") : g);
|
|
3052
3077
|
}
|
|
3053
|
-
function T(
|
|
3054
|
-
return new n(
|
|
3078
|
+
function T(g) {
|
|
3079
|
+
return new n(C(g));
|
|
3055
3080
|
}
|
|
3056
3081
|
e.stringify = T;
|
|
3057
|
-
function
|
|
3058
|
-
return JSON.stringify(
|
|
3082
|
+
function C(g) {
|
|
3083
|
+
return JSON.stringify(g).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3059
3084
|
}
|
|
3060
|
-
e.safeStringify =
|
|
3061
|
-
function
|
|
3062
|
-
return typeof
|
|
3085
|
+
e.safeStringify = C;
|
|
3086
|
+
function S(g) {
|
|
3087
|
+
return typeof g == "string" && e.IDENTIFIER.test(g) ? new n(`.${g}`) : s`[${g}]`;
|
|
3063
3088
|
}
|
|
3064
|
-
e.getProperty =
|
|
3065
|
-
function k(
|
|
3066
|
-
if (typeof
|
|
3067
|
-
return new n(`${
|
|
3068
|
-
throw new Error(`CodeGen: invalid export name: ${
|
|
3089
|
+
e.getProperty = S;
|
|
3090
|
+
function k(g) {
|
|
3091
|
+
if (typeof g == "string" && e.IDENTIFIER.test(g))
|
|
3092
|
+
return new n(`${g}`);
|
|
3093
|
+
throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`);
|
|
3069
3094
|
}
|
|
3070
3095
|
e.getEsmExportName = k;
|
|
3071
|
-
function $(
|
|
3072
|
-
return new n(
|
|
3096
|
+
function $(g) {
|
|
3097
|
+
return new n(g.toString());
|
|
3073
3098
|
}
|
|
3074
3099
|
e.regexpCode = $;
|
|
3075
3100
|
})(code$1);
|
|
@@ -3105,8 +3130,8 @@ var scope = {};
|
|
|
3105
3130
|
return `${u}${p.index++}`;
|
|
3106
3131
|
}
|
|
3107
3132
|
_nameGroup(u) {
|
|
3108
|
-
var p,
|
|
3109
|
-
if (!((
|
|
3133
|
+
var p, _;
|
|
3134
|
+
if (!((_ = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || _ === void 0) && _.has(u) || this._prefixes && !this._prefixes.has(u))
|
|
3110
3135
|
throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);
|
|
3111
3136
|
return this._names[u] = { prefix: u, index: 0 };
|
|
3112
3137
|
}
|
|
@@ -3116,8 +3141,8 @@ var scope = {};
|
|
|
3116
3141
|
constructor(u, p) {
|
|
3117
3142
|
super(p), this.prefix = u;
|
|
3118
3143
|
}
|
|
3119
|
-
setValue(u, { property: p, itemIndex:
|
|
3120
|
-
this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${
|
|
3144
|
+
setValue(u, { property: p, itemIndex: _ }) {
|
|
3145
|
+
this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${_}]`;
|
|
3121
3146
|
}
|
|
3122
3147
|
}
|
|
3123
3148
|
e.ValueScopeName = i;
|
|
@@ -3133,63 +3158,63 @@ var scope = {};
|
|
|
3133
3158
|
return new i(u, this._newName(u));
|
|
3134
3159
|
}
|
|
3135
3160
|
value(u, p) {
|
|
3136
|
-
var
|
|
3161
|
+
var _;
|
|
3137
3162
|
if (p.ref === void 0)
|
|
3138
3163
|
throw new Error("CodeGen: ref must be passed in value");
|
|
3139
|
-
const T = this.toName(u), { prefix:
|
|
3140
|
-
let k = this._values[
|
|
3164
|
+
const T = this.toName(u), { prefix: C } = T, S = (_ = p.key) !== null && _ !== void 0 ? _ : p.ref;
|
|
3165
|
+
let k = this._values[C];
|
|
3141
3166
|
if (k) {
|
|
3142
|
-
const y = k.get(
|
|
3167
|
+
const y = k.get(S);
|
|
3143
3168
|
if (y)
|
|
3144
3169
|
return y;
|
|
3145
3170
|
} else
|
|
3146
|
-
k = this._values[
|
|
3147
|
-
k.set(
|
|
3148
|
-
const $ = this._scope[
|
|
3149
|
-
return $[
|
|
3171
|
+
k = this._values[C] = /* @__PURE__ */ new Map();
|
|
3172
|
+
k.set(S, T);
|
|
3173
|
+
const $ = this._scope[C] || (this._scope[C] = []), g = $.length;
|
|
3174
|
+
return $[g] = p.ref, T.setValue(p, { property: C, itemIndex: g }), T;
|
|
3150
3175
|
}
|
|
3151
3176
|
getValue(u, p) {
|
|
3152
|
-
const
|
|
3153
|
-
if (
|
|
3154
|
-
return
|
|
3177
|
+
const _ = this._values[u];
|
|
3178
|
+
if (_)
|
|
3179
|
+
return _.get(p);
|
|
3155
3180
|
}
|
|
3156
3181
|
scopeRefs(u, p = this._values) {
|
|
3157
|
-
return this._reduceValues(p, (
|
|
3158
|
-
if (
|
|
3159
|
-
throw new Error(`CodeGen: name "${
|
|
3160
|
-
return (0, t._)`${u}${
|
|
3182
|
+
return this._reduceValues(p, (_) => {
|
|
3183
|
+
if (_.scopePath === void 0)
|
|
3184
|
+
throw new Error(`CodeGen: name "${_}" has no value`);
|
|
3185
|
+
return (0, t._)`${u}${_.scopePath}`;
|
|
3161
3186
|
});
|
|
3162
3187
|
}
|
|
3163
|
-
scopeCode(u = this._values, p,
|
|
3188
|
+
scopeCode(u = this._values, p, _) {
|
|
3164
3189
|
return this._reduceValues(u, (T) => {
|
|
3165
3190
|
if (T.value === void 0)
|
|
3166
3191
|
throw new Error(`CodeGen: name "${T}" has no value`);
|
|
3167
3192
|
return T.value.code;
|
|
3168
|
-
}, p,
|
|
3193
|
+
}, p, _);
|
|
3169
3194
|
}
|
|
3170
|
-
_reduceValues(u, p,
|
|
3171
|
-
let
|
|
3172
|
-
for (const
|
|
3173
|
-
const k = u[
|
|
3195
|
+
_reduceValues(u, p, _ = {}, T) {
|
|
3196
|
+
let C = t.nil;
|
|
3197
|
+
for (const S in u) {
|
|
3198
|
+
const k = u[S];
|
|
3174
3199
|
if (!k)
|
|
3175
3200
|
continue;
|
|
3176
|
-
const $ =
|
|
3177
|
-
k.forEach((
|
|
3178
|
-
if ($.has(
|
|
3201
|
+
const $ = _[S] = _[S] || /* @__PURE__ */ new Map();
|
|
3202
|
+
k.forEach((g) => {
|
|
3203
|
+
if ($.has(g))
|
|
3179
3204
|
return;
|
|
3180
|
-
$.set(
|
|
3181
|
-
let y = p(
|
|
3205
|
+
$.set(g, n.Started);
|
|
3206
|
+
let y = p(g);
|
|
3182
3207
|
if (y) {
|
|
3183
3208
|
const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
|
|
3184
|
-
|
|
3185
|
-
} else if (y = T == null ? void 0 : T(
|
|
3186
|
-
|
|
3209
|
+
C = (0, t._)`${C}${P} ${g} = ${y};${this.opts._n}`;
|
|
3210
|
+
} else if (y = T == null ? void 0 : T(g))
|
|
3211
|
+
C = (0, t._)`${C}${y}${this.opts._n}`;
|
|
3187
3212
|
else
|
|
3188
|
-
throw new r(
|
|
3189
|
-
$.set(
|
|
3213
|
+
throw new r(g);
|
|
3214
|
+
$.set(g, n.Completed);
|
|
3190
3215
|
});
|
|
3191
3216
|
}
|
|
3192
|
-
return
|
|
3217
|
+
return C;
|
|
3193
3218
|
}
|
|
3194
3219
|
}
|
|
3195
3220
|
e.ValueScope = c;
|
|
@@ -3300,7 +3325,7 @@ var scope = {};
|
|
|
3300
3325
|
return `break${this.label ? ` ${this.label}` : ""};` + a;
|
|
3301
3326
|
}
|
|
3302
3327
|
}
|
|
3303
|
-
class
|
|
3328
|
+
class _ extends i {
|
|
3304
3329
|
constructor(a) {
|
|
3305
3330
|
super(), this.error = a;
|
|
3306
3331
|
}
|
|
@@ -3328,7 +3353,7 @@ var scope = {};
|
|
|
3328
3353
|
return this.code instanceof t._CodeOrName ? this.code.names : {};
|
|
3329
3354
|
}
|
|
3330
3355
|
}
|
|
3331
|
-
class
|
|
3356
|
+
class C extends i {
|
|
3332
3357
|
constructor(a = []) {
|
|
3333
3358
|
super(), this.nodes = a;
|
|
3334
3359
|
}
|
|
@@ -3357,17 +3382,17 @@ var scope = {};
|
|
|
3357
3382
|
return this.nodes.reduce((a, h) => K(a, h.names), {});
|
|
3358
3383
|
}
|
|
3359
3384
|
}
|
|
3360
|
-
class
|
|
3385
|
+
class S extends C {
|
|
3361
3386
|
render(a) {
|
|
3362
3387
|
return "{" + a._n + super.render(a) + "}" + a._n;
|
|
3363
3388
|
}
|
|
3364
3389
|
}
|
|
3365
|
-
class k extends
|
|
3390
|
+
class k extends C {
|
|
3366
3391
|
}
|
|
3367
|
-
class $ extends
|
|
3392
|
+
class $ extends S {
|
|
3368
3393
|
}
|
|
3369
3394
|
$.kind = "else";
|
|
3370
|
-
class
|
|
3395
|
+
class g extends S {
|
|
3371
3396
|
constructor(a, h) {
|
|
3372
3397
|
super(h), this.condition = a;
|
|
3373
3398
|
}
|
|
@@ -3386,7 +3411,7 @@ var scope = {};
|
|
|
3386
3411
|
h = this.else = Array.isArray(N) ? new $(N) : N;
|
|
3387
3412
|
}
|
|
3388
3413
|
if (h)
|
|
3389
|
-
return a === !1 ? h instanceof
|
|
3414
|
+
return a === !1 ? h instanceof g ? h : h.nodes : this.nodes.length ? this : new g(Ce(a), h instanceof g ? [h] : h.nodes);
|
|
3390
3415
|
if (!(a === !1 || !this.nodes.length))
|
|
3391
3416
|
return this;
|
|
3392
3417
|
}
|
|
@@ -3400,8 +3425,8 @@ var scope = {};
|
|
|
3400
3425
|
return ue(a, this.condition), this.else && K(a, this.else.names), a;
|
|
3401
3426
|
}
|
|
3402
3427
|
}
|
|
3403
|
-
|
|
3404
|
-
class y extends
|
|
3428
|
+
g.kind = "if";
|
|
3429
|
+
class y extends S {
|
|
3405
3430
|
}
|
|
3406
3431
|
y.kind = "for";
|
|
3407
3432
|
class P extends y {
|
|
@@ -3447,7 +3472,7 @@ var scope = {};
|
|
|
3447
3472
|
return K(super.names, this.iterable.names);
|
|
3448
3473
|
}
|
|
3449
3474
|
}
|
|
3450
|
-
class w extends
|
|
3475
|
+
class w extends S {
|
|
3451
3476
|
constructor(a, h, N) {
|
|
3452
3477
|
super(), this.name = a, this.args = h, this.async = N;
|
|
3453
3478
|
}
|
|
@@ -3456,13 +3481,13 @@ var scope = {};
|
|
|
3456
3481
|
}
|
|
3457
3482
|
}
|
|
3458
3483
|
w.kind = "func";
|
|
3459
|
-
class
|
|
3484
|
+
class O extends C {
|
|
3460
3485
|
render(a) {
|
|
3461
3486
|
return "return " + super.render(a);
|
|
3462
3487
|
}
|
|
3463
3488
|
}
|
|
3464
|
-
|
|
3465
|
-
class A extends
|
|
3489
|
+
O.kind = "return";
|
|
3490
|
+
class A extends S {
|
|
3466
3491
|
render(a) {
|
|
3467
3492
|
let h = "try" + super.render(a);
|
|
3468
3493
|
return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
|
|
@@ -3480,7 +3505,7 @@ var scope = {};
|
|
|
3480
3505
|
return this.catch && K(a, this.catch.names), this.finally && K(a, this.finally.names), a;
|
|
3481
3506
|
}
|
|
3482
3507
|
}
|
|
3483
|
-
class x extends
|
|
3508
|
+
class x extends S {
|
|
3484
3509
|
constructor(a) {
|
|
3485
3510
|
super(), this.error = a;
|
|
3486
3511
|
}
|
|
@@ -3489,7 +3514,7 @@ var scope = {};
|
|
|
3489
3514
|
}
|
|
3490
3515
|
}
|
|
3491
3516
|
x.kind = "catch";
|
|
3492
|
-
class z extends
|
|
3517
|
+
class z extends S {
|
|
3493
3518
|
render(a) {
|
|
3494
3519
|
return "finally" + super.render(a);
|
|
3495
3520
|
}
|
|
@@ -3564,7 +3589,7 @@ var scope = {};
|
|
|
3564
3589
|
}
|
|
3565
3590
|
// `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
|
|
3566
3591
|
if(a, h, N) {
|
|
3567
|
-
if (this._blockNode(new
|
|
3592
|
+
if (this._blockNode(new g(a)), h && N)
|
|
3568
3593
|
this.code(h).else().code(N).endIf();
|
|
3569
3594
|
else if (h)
|
|
3570
3595
|
this.code(h).endIf();
|
|
@@ -3574,7 +3599,7 @@ var scope = {};
|
|
|
3574
3599
|
}
|
|
3575
3600
|
// `else if` clause - invalid without `if` or after `else` clauses
|
|
3576
3601
|
elseIf(a) {
|
|
3577
|
-
return this._elseNode(new
|
|
3602
|
+
return this._elseNode(new g(a));
|
|
3578
3603
|
}
|
|
3579
3604
|
// `else` clause - only valid after `if` or `else if` clauses
|
|
3580
3605
|
else() {
|
|
@@ -3582,7 +3607,7 @@ var scope = {};
|
|
|
3582
3607
|
}
|
|
3583
3608
|
// end `if` statement (needed if gen.if was used only with condition)
|
|
3584
3609
|
endIf() {
|
|
3585
|
-
return this._endBlockNode(
|
|
3610
|
+
return this._endBlockNode(g, $);
|
|
3586
3611
|
}
|
|
3587
3612
|
_for(a, h) {
|
|
3588
3613
|
return this._blockNode(a), h && this.code(h).endFor(), this;
|
|
@@ -3629,10 +3654,10 @@ var scope = {};
|
|
|
3629
3654
|
}
|
|
3630
3655
|
// `return` statement
|
|
3631
3656
|
return(a) {
|
|
3632
|
-
const h = new
|
|
3657
|
+
const h = new O();
|
|
3633
3658
|
if (this._blockNode(h), this.code(a), h.nodes.length !== 1)
|
|
3634
3659
|
throw new Error('CodeGen: "return" should have one node');
|
|
3635
|
-
return this._endBlockNode(
|
|
3660
|
+
return this._endBlockNode(O);
|
|
3636
3661
|
}
|
|
3637
3662
|
// `try` statement
|
|
3638
3663
|
try(a, h, N) {
|
|
@@ -3647,7 +3672,7 @@ var scope = {};
|
|
|
3647
3672
|
}
|
|
3648
3673
|
// `throw` statement
|
|
3649
3674
|
throw(a) {
|
|
3650
|
-
return this._leafNode(new
|
|
3675
|
+
return this._leafNode(new _(a));
|
|
3651
3676
|
}
|
|
3652
3677
|
// start self-balancing block
|
|
3653
3678
|
block(a, h) {
|
|
@@ -3689,7 +3714,7 @@ var scope = {};
|
|
|
3689
3714
|
}
|
|
3690
3715
|
_elseNode(a) {
|
|
3691
3716
|
const h = this._currNode;
|
|
3692
|
-
if (!(h instanceof
|
|
3717
|
+
if (!(h instanceof g))
|
|
3693
3718
|
throw new Error('CodeGen: "else" without "if"');
|
|
3694
3719
|
return this._currNode = h.else = a, this;
|
|
3695
3720
|
}
|
|
@@ -3706,20 +3731,20 @@ var scope = {};
|
|
|
3706
3731
|
}
|
|
3707
3732
|
}
|
|
3708
3733
|
e.CodeGen = re;
|
|
3709
|
-
function K(
|
|
3734
|
+
function K(E, a) {
|
|
3710
3735
|
for (const h in a)
|
|
3711
|
-
|
|
3712
|
-
return
|
|
3713
|
-
}
|
|
3714
|
-
function ue(
|
|
3715
|
-
return a instanceof t._CodeOrName ? K(
|
|
3716
|
-
}
|
|
3717
|
-
function oe(
|
|
3718
|
-
if (
|
|
3719
|
-
return N(
|
|
3720
|
-
if (!M(
|
|
3721
|
-
return
|
|
3722
|
-
return new t._Code(
|
|
3736
|
+
E[h] = (E[h] || 0) + (a[h] || 0);
|
|
3737
|
+
return E;
|
|
3738
|
+
}
|
|
3739
|
+
function ue(E, a) {
|
|
3740
|
+
return a instanceof t._CodeOrName ? K(E, a.names) : E;
|
|
3741
|
+
}
|
|
3742
|
+
function oe(E, a, h) {
|
|
3743
|
+
if (E instanceof t.Name)
|
|
3744
|
+
return N(E);
|
|
3745
|
+
if (!M(E))
|
|
3746
|
+
return E;
|
|
3747
|
+
return new t._Code(E._items.reduce((L, W) => (W instanceof t.Name && (W = N(W)), W instanceof t._Code ? L.push(...W._items) : L.push(W), L), []));
|
|
3723
3748
|
function N(L) {
|
|
3724
3749
|
const W = h[L.str];
|
|
3725
3750
|
return W === void 0 || a[L.str] !== 1 ? L : (delete a[L.str], W);
|
|
@@ -3728,29 +3753,29 @@ var scope = {};
|
|
|
3728
3753
|
return L instanceof t._Code && L._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
|
|
3729
3754
|
}
|
|
3730
3755
|
}
|
|
3731
|
-
function ke(
|
|
3756
|
+
function ke(E, a) {
|
|
3732
3757
|
for (const h in a)
|
|
3733
|
-
|
|
3758
|
+
E[h] = (E[h] || 0) - (a[h] || 0);
|
|
3734
3759
|
}
|
|
3735
|
-
function Ce(
|
|
3736
|
-
return typeof
|
|
3760
|
+
function Ce(E) {
|
|
3761
|
+
return typeof E == "boolean" || typeof E == "number" || E === null ? !E : (0, t._)`!${j(E)}`;
|
|
3737
3762
|
}
|
|
3738
3763
|
e.not = Ce;
|
|
3739
3764
|
const Le = v(e.operators.AND);
|
|
3740
|
-
function et(...
|
|
3741
|
-
return
|
|
3765
|
+
function et(...E) {
|
|
3766
|
+
return E.reduce(Le);
|
|
3742
3767
|
}
|
|
3743
3768
|
e.and = et;
|
|
3744
3769
|
const qe = v(e.operators.OR);
|
|
3745
|
-
function F(...
|
|
3746
|
-
return
|
|
3770
|
+
function F(...E) {
|
|
3771
|
+
return E.reduce(qe);
|
|
3747
3772
|
}
|
|
3748
3773
|
e.or = F;
|
|
3749
|
-
function v(
|
|
3750
|
-
return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${
|
|
3774
|
+
function v(E) {
|
|
3775
|
+
return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${E} ${j(h)}`;
|
|
3751
3776
|
}
|
|
3752
|
-
function j(
|
|
3753
|
-
return
|
|
3777
|
+
function j(E) {
|
|
3778
|
+
return E instanceof t.Name ? E : (0, t._)`(${E})`;
|
|
3754
3779
|
}
|
|
3755
3780
|
})(codegen);
|
|
3756
3781
|
var util = {};
|
|
@@ -3758,51 +3783,51 @@ var util = {};
|
|
|
3758
3783
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0;
|
|
3759
3784
|
const t = codegen, r = code$1;
|
|
3760
3785
|
function n(w) {
|
|
3761
|
-
const
|
|
3786
|
+
const O = {};
|
|
3762
3787
|
for (const A of w)
|
|
3763
|
-
|
|
3764
|
-
return
|
|
3788
|
+
O[A] = !0;
|
|
3789
|
+
return O;
|
|
3765
3790
|
}
|
|
3766
3791
|
e.toHash = n;
|
|
3767
|
-
function s(w,
|
|
3768
|
-
return typeof
|
|
3792
|
+
function s(w, O) {
|
|
3793
|
+
return typeof O == "boolean" ? O : Object.keys(O).length === 0 ? !0 : (i(w, O), !o(O, w.self.RULES.all));
|
|
3769
3794
|
}
|
|
3770
3795
|
e.alwaysValidSchema = s;
|
|
3771
|
-
function i(w,
|
|
3796
|
+
function i(w, O = w.schema) {
|
|
3772
3797
|
const { opts: A, self: x } = w;
|
|
3773
|
-
if (!A.strictSchema || typeof
|
|
3798
|
+
if (!A.strictSchema || typeof O == "boolean")
|
|
3774
3799
|
return;
|
|
3775
3800
|
const z = x.RULES.keywords;
|
|
3776
|
-
for (const re in
|
|
3801
|
+
for (const re in O)
|
|
3777
3802
|
z[re] || D(w, `unknown keyword: "${re}"`);
|
|
3778
3803
|
}
|
|
3779
3804
|
e.checkUnknownRules = i;
|
|
3780
|
-
function o(w,
|
|
3805
|
+
function o(w, O) {
|
|
3781
3806
|
if (typeof w == "boolean")
|
|
3782
3807
|
return !w;
|
|
3783
3808
|
for (const A in w)
|
|
3784
|
-
if (
|
|
3809
|
+
if (O[A])
|
|
3785
3810
|
return !0;
|
|
3786
3811
|
return !1;
|
|
3787
3812
|
}
|
|
3788
3813
|
e.schemaHasRules = o;
|
|
3789
|
-
function c(w,
|
|
3814
|
+
function c(w, O) {
|
|
3790
3815
|
if (typeof w == "boolean")
|
|
3791
3816
|
return !w;
|
|
3792
3817
|
for (const A in w)
|
|
3793
|
-
if (A !== "$ref" &&
|
|
3818
|
+
if (A !== "$ref" && O.all[A])
|
|
3794
3819
|
return !0;
|
|
3795
3820
|
return !1;
|
|
3796
3821
|
}
|
|
3797
3822
|
e.schemaHasRulesButRef = c;
|
|
3798
|
-
function d({ topSchemaRef: w, schemaPath:
|
|
3823
|
+
function d({ topSchemaRef: w, schemaPath: O }, A, x, z) {
|
|
3799
3824
|
if (!z) {
|
|
3800
3825
|
if (typeof A == "number" || typeof A == "boolean")
|
|
3801
3826
|
return A;
|
|
3802
3827
|
if (typeof A == "string")
|
|
3803
3828
|
return (0, t._)`${A}`;
|
|
3804
3829
|
}
|
|
3805
|
-
return (0, t._)`${w}${
|
|
3830
|
+
return (0, t._)`${w}${O}${(0, t.getProperty)(x)}`;
|
|
3806
3831
|
}
|
|
3807
3832
|
e.schemaRefOrVal = d;
|
|
3808
3833
|
function u(w) {
|
|
@@ -3810,65 +3835,65 @@ var util = {};
|
|
|
3810
3835
|
}
|
|
3811
3836
|
e.unescapeFragment = u;
|
|
3812
3837
|
function p(w) {
|
|
3813
|
-
return encodeURIComponent(
|
|
3838
|
+
return encodeURIComponent(_(w));
|
|
3814
3839
|
}
|
|
3815
3840
|
e.escapeFragment = p;
|
|
3816
|
-
function
|
|
3841
|
+
function _(w) {
|
|
3817
3842
|
return typeof w == "number" ? `${w}` : w.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3818
3843
|
}
|
|
3819
|
-
e.escapeJsonPointer =
|
|
3844
|
+
e.escapeJsonPointer = _;
|
|
3820
3845
|
function T(w) {
|
|
3821
3846
|
return w.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
3822
3847
|
}
|
|
3823
3848
|
e.unescapeJsonPointer = T;
|
|
3824
|
-
function
|
|
3849
|
+
function C(w, O) {
|
|
3825
3850
|
if (Array.isArray(w))
|
|
3826
3851
|
for (const A of w)
|
|
3827
|
-
|
|
3852
|
+
O(A);
|
|
3828
3853
|
else
|
|
3829
|
-
|
|
3854
|
+
O(w);
|
|
3830
3855
|
}
|
|
3831
|
-
e.eachItem =
|
|
3832
|
-
function
|
|
3856
|
+
e.eachItem = C;
|
|
3857
|
+
function S({ mergeNames: w, mergeToName: O, mergeValues: A, resultToName: x }) {
|
|
3833
3858
|
return (z, re, K, ue) => {
|
|
3834
|
-
const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(z, re, K) :
|
|
3859
|
+
const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(z, re, K) : O(z, re, K), K) : re instanceof t.Name ? (O(z, K, re), re) : A(re, K);
|
|
3835
3860
|
return ue === t.Name && !(oe instanceof t.Name) ? x(z, oe) : oe;
|
|
3836
3861
|
};
|
|
3837
3862
|
}
|
|
3838
3863
|
e.mergeEvaluated = {
|
|
3839
|
-
props:
|
|
3840
|
-
mergeNames: (w,
|
|
3841
|
-
w.if((0, t._)`${
|
|
3864
|
+
props: S({
|
|
3865
|
+
mergeNames: (w, O, A) => w.if((0, t._)`${A} !== true && ${O} !== undefined`, () => {
|
|
3866
|
+
w.if((0, t._)`${O} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${O})`));
|
|
3842
3867
|
}),
|
|
3843
|
-
mergeToName: (w,
|
|
3844
|
-
|
|
3868
|
+
mergeToName: (w, O, A) => w.if((0, t._)`${A} !== true`, () => {
|
|
3869
|
+
O === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), $(w, A, O));
|
|
3845
3870
|
}),
|
|
3846
|
-
mergeValues: (w,
|
|
3871
|
+
mergeValues: (w, O) => w === !0 ? !0 : { ...w, ...O },
|
|
3847
3872
|
resultToName: k
|
|
3848
3873
|
}),
|
|
3849
|
-
items:
|
|
3850
|
-
mergeNames: (w,
|
|
3851
|
-
mergeToName: (w,
|
|
3852
|
-
mergeValues: (w,
|
|
3853
|
-
resultToName: (w,
|
|
3874
|
+
items: S({
|
|
3875
|
+
mergeNames: (w, O, A) => w.if((0, t._)`${A} !== true && ${O} !== undefined`, () => w.assign(A, (0, t._)`${O} === true ? true : ${A} > ${O} ? ${A} : ${O}`)),
|
|
3876
|
+
mergeToName: (w, O, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, O === !0 ? !0 : (0, t._)`${A} > ${O} ? ${A} : ${O}`)),
|
|
3877
|
+
mergeValues: (w, O) => w === !0 ? !0 : Math.max(w, O),
|
|
3878
|
+
resultToName: (w, O) => w.var("items", O)
|
|
3854
3879
|
})
|
|
3855
3880
|
};
|
|
3856
|
-
function k(w,
|
|
3857
|
-
if (
|
|
3881
|
+
function k(w, O) {
|
|
3882
|
+
if (O === !0)
|
|
3858
3883
|
return w.var("props", !0);
|
|
3859
3884
|
const A = w.var("props", (0, t._)`{}`);
|
|
3860
|
-
return
|
|
3885
|
+
return O !== void 0 && $(w, A, O), A;
|
|
3861
3886
|
}
|
|
3862
3887
|
e.evaluatedPropsToName = k;
|
|
3863
|
-
function $(w,
|
|
3864
|
-
Object.keys(A).forEach((x) => w.assign((0, t._)`${
|
|
3888
|
+
function $(w, O, A) {
|
|
3889
|
+
Object.keys(A).forEach((x) => w.assign((0, t._)`${O}${(0, t.getProperty)(x)}`, !0));
|
|
3865
3890
|
}
|
|
3866
3891
|
e.setEvaluated = $;
|
|
3867
|
-
const
|
|
3868
|
-
function y(w,
|
|
3892
|
+
const g = {};
|
|
3893
|
+
function y(w, O) {
|
|
3869
3894
|
return w.scopeValue("func", {
|
|
3870
|
-
ref:
|
|
3871
|
-
code:
|
|
3895
|
+
ref: O,
|
|
3896
|
+
code: g[O.code] || (g[O.code] = new r._Code(O.code))
|
|
3872
3897
|
});
|
|
3873
3898
|
}
|
|
3874
3899
|
e.useFunc = y;
|
|
@@ -3876,19 +3901,19 @@ var util = {};
|
|
|
3876
3901
|
(function(w) {
|
|
3877
3902
|
w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
|
|
3878
3903
|
})(P = e.Type || (e.Type = {}));
|
|
3879
|
-
function I(w,
|
|
3904
|
+
function I(w, O, A) {
|
|
3880
3905
|
if (w instanceof t.Name) {
|
|
3881
|
-
const x =
|
|
3906
|
+
const x = O === P.Num;
|
|
3882
3907
|
return A ? x ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : x ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
|
|
3883
3908
|
}
|
|
3884
|
-
return A ? (0, t.getProperty)(w).toString() : "/" +
|
|
3909
|
+
return A ? (0, t.getProperty)(w).toString() : "/" + _(w);
|
|
3885
3910
|
}
|
|
3886
3911
|
e.getErrorPath = I;
|
|
3887
|
-
function D(w,
|
|
3912
|
+
function D(w, O, A = w.opts.strictSchema) {
|
|
3888
3913
|
if (A) {
|
|
3889
|
-
if (
|
|
3890
|
-
throw new Error(
|
|
3891
|
-
w.self.logger.warn(
|
|
3914
|
+
if (O = `strict mode: ${O}`, A === !0)
|
|
3915
|
+
throw new Error(O);
|
|
3916
|
+
w.self.logger.warn(O);
|
|
3892
3917
|
}
|
|
3893
3918
|
}
|
|
3894
3919
|
e.checkStrictMode = D;
|
|
@@ -3925,38 +3950,38 @@ names$1.default = names;
|
|
|
3925
3950
|
e.keywordError = {
|
|
3926
3951
|
message: ({ keyword: $ }) => (0, t.str)`must pass "${$}" keyword validation`
|
|
3927
3952
|
}, e.keyword$DataError = {
|
|
3928
|
-
message: ({ keyword: $, schemaType:
|
|
3953
|
+
message: ({ keyword: $, schemaType: g }) => g ? (0, t.str)`"${$}" keyword must be ${g} ($data)` : (0, t.str)`"${$}" keyword is invalid ($data)`
|
|
3929
3954
|
};
|
|
3930
|
-
function s($,
|
|
3931
|
-
const { it: I } = $, { gen: D, compositeRule: w, allErrors:
|
|
3932
|
-
P ?? (w ||
|
|
3955
|
+
function s($, g = e.keywordError, y, P) {
|
|
3956
|
+
const { it: I } = $, { gen: D, compositeRule: w, allErrors: O } = I, A = _($, g, y);
|
|
3957
|
+
P ?? (w || O) ? d(D, A) : u(I, (0, t._)`[${A}]`);
|
|
3933
3958
|
}
|
|
3934
3959
|
e.reportError = s;
|
|
3935
|
-
function i($,
|
|
3936
|
-
const { it: P } = $, { gen: I, compositeRule: D, allErrors: w } = P,
|
|
3937
|
-
d(I,
|
|
3960
|
+
function i($, g = e.keywordError, y) {
|
|
3961
|
+
const { it: P } = $, { gen: I, compositeRule: D, allErrors: w } = P, O = _($, g, y);
|
|
3962
|
+
d(I, O), D || w || u(P, n.default.vErrors);
|
|
3938
3963
|
}
|
|
3939
3964
|
e.reportExtraError = i;
|
|
3940
|
-
function o($,
|
|
3941
|
-
$.assign(n.default.errors,
|
|
3965
|
+
function o($, g) {
|
|
3966
|
+
$.assign(n.default.errors, g), $.if((0, t._)`${n.default.vErrors} !== null`, () => $.if(g, () => $.assign((0, t._)`${n.default.vErrors}.length`, g), () => $.assign(n.default.vErrors, null)));
|
|
3942
3967
|
}
|
|
3943
3968
|
e.resetErrorsCount = o;
|
|
3944
|
-
function c({ gen: $, keyword:
|
|
3969
|
+
function c({ gen: $, keyword: g, schemaValue: y, data: P, errsCount: I, it: D }) {
|
|
3945
3970
|
if (I === void 0)
|
|
3946
3971
|
throw new Error("ajv implementation error");
|
|
3947
3972
|
const w = $.name("err");
|
|
3948
|
-
$.forRange("i", I, n.default.errors, (
|
|
3949
|
-
$.const(w, (0, t._)`${n.default.vErrors}[${
|
|
3973
|
+
$.forRange("i", I, n.default.errors, (O) => {
|
|
3974
|
+
$.const(w, (0, t._)`${n.default.vErrors}[${O}]`), $.if((0, t._)`${w}.instancePath === undefined`, () => $.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), $.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${g}`), D.opts.verbose && ($.assign((0, t._)`${w}.schema`, y), $.assign((0, t._)`${w}.data`, P));
|
|
3950
3975
|
});
|
|
3951
3976
|
}
|
|
3952
3977
|
e.extendErrors = c;
|
|
3953
|
-
function d($,
|
|
3954
|
-
const y = $.const("err",
|
|
3978
|
+
function d($, g) {
|
|
3979
|
+
const y = $.const("err", g);
|
|
3955
3980
|
$.if((0, t._)`${n.default.vErrors} === null`, () => $.assign(n.default.vErrors, (0, t._)`[${y}]`), (0, t._)`${n.default.vErrors}.push(${y})`), $.code((0, t._)`${n.default.errors}++`);
|
|
3956
3981
|
}
|
|
3957
|
-
function u($,
|
|
3982
|
+
function u($, g) {
|
|
3958
3983
|
const { gen: y, validateName: P, schemaEnv: I } = $;
|
|
3959
|
-
I.$async ? y.throw((0, t._)`new ${$.ValidationError}(${
|
|
3984
|
+
I.$async ? y.throw((0, t._)`new ${$.ValidationError}(${g})`) : (y.assign((0, t._)`${P}.errors`, g), y.return(!1));
|
|
3960
3985
|
}
|
|
3961
3986
|
const p = {
|
|
3962
3987
|
keyword: new t.Name("keyword"),
|
|
@@ -3967,28 +3992,28 @@ names$1.default = names;
|
|
|
3967
3992
|
schema: new t.Name("schema"),
|
|
3968
3993
|
parentSchema: new t.Name("parentSchema")
|
|
3969
3994
|
};
|
|
3970
|
-
function
|
|
3995
|
+
function _($, g, y) {
|
|
3971
3996
|
const { createErrors: P } = $.it;
|
|
3972
|
-
return P === !1 ? (0, t._)`{}` : T($,
|
|
3997
|
+
return P === !1 ? (0, t._)`{}` : T($, g, y);
|
|
3973
3998
|
}
|
|
3974
|
-
function T($,
|
|
3999
|
+
function T($, g, y = {}) {
|
|
3975
4000
|
const { gen: P, it: I } = $, D = [
|
|
3976
|
-
|
|
3977
|
-
|
|
4001
|
+
C(I, y),
|
|
4002
|
+
S($, y)
|
|
3978
4003
|
];
|
|
3979
|
-
return k($,
|
|
4004
|
+
return k($, g, D), P.object(...D);
|
|
3980
4005
|
}
|
|
3981
|
-
function
|
|
3982
|
-
const y =
|
|
4006
|
+
function C({ errorPath: $ }, { instancePath: g }) {
|
|
4007
|
+
const y = g ? (0, t.str)`${$}${(0, r.getErrorPath)(g, r.Type.Str)}` : $;
|
|
3983
4008
|
return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, y)];
|
|
3984
4009
|
}
|
|
3985
|
-
function
|
|
3986
|
-
let I = P ?
|
|
4010
|
+
function S({ keyword: $, it: { errSchemaPath: g } }, { schemaPath: y, parentSchema: P }) {
|
|
4011
|
+
let I = P ? g : (0, t.str)`${g}/${$}`;
|
|
3987
4012
|
return y && (I = (0, t.str)`${I}${(0, r.getErrorPath)(y, r.Type.Str)}`), [p.schemaPath, I];
|
|
3988
4013
|
}
|
|
3989
|
-
function k($, { params:
|
|
3990
|
-
const { keyword: I, data: D, schemaValue: w, it:
|
|
3991
|
-
P.push([p.keyword, I], [p.params, typeof
|
|
4014
|
+
function k($, { params: g, message: y }, P) {
|
|
4015
|
+
const { keyword: I, data: D, schemaValue: w, it: O } = $, { opts: A, propertyName: x, topSchemaRef: z, schemaPath: re } = O;
|
|
4016
|
+
P.push([p.keyword, I], [p.params, typeof g == "function" ? g($) : g || (0, t._)`{}`]), A.messages && P.push([p.message, typeof y == "function" ? y($) : y]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${z}${re}`], [n.default.data, D]), x && P.push([p.propertyName, x]);
|
|
3992
4017
|
}
|
|
3993
4018
|
})(errors);
|
|
3994
4019
|
Object.defineProperty(boolSchema, "__esModule", { value: !0 });
|
|
@@ -4088,62 +4113,62 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4088
4113
|
}
|
|
4089
4114
|
e.getJSONTypes = d;
|
|
4090
4115
|
function u(P, I) {
|
|
4091
|
-
const { gen: D, data: w, opts:
|
|
4116
|
+
const { gen: D, data: w, opts: O } = P, A = _(I, O.coerceTypes), x = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
|
|
4092
4117
|
if (x) {
|
|
4093
|
-
const z = k(I, w,
|
|
4118
|
+
const z = k(I, w, O.strictNumbers, o.Wrong);
|
|
4094
4119
|
D.if(z, () => {
|
|
4095
|
-
A.length ? T(P, I, A) :
|
|
4120
|
+
A.length ? T(P, I, A) : g(P);
|
|
4096
4121
|
});
|
|
4097
4122
|
}
|
|
4098
4123
|
return x;
|
|
4099
4124
|
}
|
|
4100
4125
|
e.coerceAndCheckDataType = u;
|
|
4101
4126
|
const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
|
|
4102
|
-
function
|
|
4127
|
+
function _(P, I) {
|
|
4103
4128
|
return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
|
|
4104
4129
|
}
|
|
4105
4130
|
function T(P, I, D) {
|
|
4106
|
-
const { gen: w, data:
|
|
4107
|
-
A.coerceTypes === "array" && w.if((0, s._)`${x} == 'object' && Array.isArray(${
|
|
4131
|
+
const { gen: w, data: O, opts: A } = P, x = w.let("dataType", (0, s._)`typeof ${O}`), z = w.let("coerced", (0, s._)`undefined`);
|
|
4132
|
+
A.coerceTypes === "array" && w.if((0, s._)`${x} == 'object' && Array.isArray(${O}) && ${O}.length == 1`, () => w.assign(O, (0, s._)`${O}[0]`).assign(x, (0, s._)`typeof ${O}`).if(k(I, O, A.strictNumbers), () => w.assign(z, O))), w.if((0, s._)`${z} !== undefined`);
|
|
4108
4133
|
for (const K of D)
|
|
4109
4134
|
(p.has(K) || K === "array" && A.coerceTypes === "array") && re(K);
|
|
4110
|
-
w.else(),
|
|
4111
|
-
w.assign(
|
|
4135
|
+
w.else(), g(P), w.endIf(), w.if((0, s._)`${z} !== undefined`, () => {
|
|
4136
|
+
w.assign(O, z), C(P, z);
|
|
4112
4137
|
});
|
|
4113
4138
|
function re(K) {
|
|
4114
4139
|
switch (K) {
|
|
4115
4140
|
case "string":
|
|
4116
|
-
w.elseIf((0, s._)`${x} == "number" || ${x} == "boolean"`).assign(z, (0, s._)`"" + ${
|
|
4141
|
+
w.elseIf((0, s._)`${x} == "number" || ${x} == "boolean"`).assign(z, (0, s._)`"" + ${O}`).elseIf((0, s._)`${O} === null`).assign(z, (0, s._)`""`);
|
|
4117
4142
|
return;
|
|
4118
4143
|
case "number":
|
|
4119
|
-
w.elseIf((0, s._)`${x} == "boolean" || ${
|
|
4120
|
-
|| (${x} == "string" && ${
|
|
4144
|
+
w.elseIf((0, s._)`${x} == "boolean" || ${O} === null
|
|
4145
|
+
|| (${x} == "string" && ${O} && ${O} == +${O})`).assign(z, (0, s._)`+${O}`);
|
|
4121
4146
|
return;
|
|
4122
4147
|
case "integer":
|
|
4123
|
-
w.elseIf((0, s._)`${x} === "boolean" || ${
|
|
4124
|
-
|| (${x} === "string" && ${
|
|
4148
|
+
w.elseIf((0, s._)`${x} === "boolean" || ${O} === null
|
|
4149
|
+
|| (${x} === "string" && ${O} && ${O} == +${O} && !(${O} % 1))`).assign(z, (0, s._)`+${O}`);
|
|
4125
4150
|
return;
|
|
4126
4151
|
case "boolean":
|
|
4127
|
-
w.elseIf((0, s._)`${
|
|
4152
|
+
w.elseIf((0, s._)`${O} === "false" || ${O} === 0 || ${O} === null`).assign(z, !1).elseIf((0, s._)`${O} === "true" || ${O} === 1`).assign(z, !0);
|
|
4128
4153
|
return;
|
|
4129
4154
|
case "null":
|
|
4130
|
-
w.elseIf((0, s._)`${
|
|
4155
|
+
w.elseIf((0, s._)`${O} === "" || ${O} === 0 || ${O} === false`), w.assign(z, null);
|
|
4131
4156
|
return;
|
|
4132
4157
|
case "array":
|
|
4133
4158
|
w.elseIf((0, s._)`${x} === "string" || ${x} === "number"
|
|
4134
|
-
|| ${x} === "boolean" || ${
|
|
4159
|
+
|| ${x} === "boolean" || ${O} === null`).assign(z, (0, s._)`[${O}]`);
|
|
4135
4160
|
}
|
|
4136
4161
|
}
|
|
4137
4162
|
}
|
|
4138
|
-
function
|
|
4163
|
+
function C({ gen: P, parentData: I, parentDataProperty: D }, w) {
|
|
4139
4164
|
P.if((0, s._)`${I} !== undefined`, () => P.assign((0, s._)`${I}[${D}]`, w));
|
|
4140
4165
|
}
|
|
4141
|
-
function
|
|
4142
|
-
const
|
|
4166
|
+
function S(P, I, D, w = o.Correct) {
|
|
4167
|
+
const O = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
|
|
4143
4168
|
let A;
|
|
4144
4169
|
switch (P) {
|
|
4145
4170
|
case "null":
|
|
4146
|
-
return (0, s._)`${I} ${
|
|
4171
|
+
return (0, s._)`${I} ${O} null`;
|
|
4147
4172
|
case "array":
|
|
4148
4173
|
A = (0, s._)`Array.isArray(${I})`;
|
|
4149
4174
|
break;
|
|
@@ -4157,48 +4182,48 @@ applicability.shouldUseRule = shouldUseRule;
|
|
|
4157
4182
|
A = x();
|
|
4158
4183
|
break;
|
|
4159
4184
|
default:
|
|
4160
|
-
return (0, s._)`typeof ${I} ${
|
|
4185
|
+
return (0, s._)`typeof ${I} ${O} ${P}`;
|
|
4161
4186
|
}
|
|
4162
4187
|
return w === o.Correct ? A : (0, s.not)(A);
|
|
4163
4188
|
function x(z = s.nil) {
|
|
4164
4189
|
return (0, s.and)((0, s._)`typeof ${I} == "number"`, z, D ? (0, s._)`isFinite(${I})` : s.nil);
|
|
4165
4190
|
}
|
|
4166
4191
|
}
|
|
4167
|
-
e.checkDataType =
|
|
4192
|
+
e.checkDataType = S;
|
|
4168
4193
|
function k(P, I, D, w) {
|
|
4169
4194
|
if (P.length === 1)
|
|
4170
|
-
return
|
|
4171
|
-
let
|
|
4195
|
+
return S(P[0], I, D, w);
|
|
4196
|
+
let O;
|
|
4172
4197
|
const A = (0, i.toHash)(P);
|
|
4173
4198
|
if (A.array && A.object) {
|
|
4174
4199
|
const x = (0, s._)`typeof ${I} != "object"`;
|
|
4175
|
-
|
|
4200
|
+
O = A.null ? x : (0, s._)`!${I} || ${x}`, delete A.null, delete A.array, delete A.object;
|
|
4176
4201
|
} else
|
|
4177
|
-
|
|
4202
|
+
O = s.nil;
|
|
4178
4203
|
A.number && delete A.integer;
|
|
4179
4204
|
for (const x in A)
|
|
4180
|
-
|
|
4181
|
-
return
|
|
4205
|
+
O = (0, s.and)(O, S(x, I, D, w));
|
|
4206
|
+
return O;
|
|
4182
4207
|
}
|
|
4183
4208
|
e.checkDataTypes = k;
|
|
4184
4209
|
const $ = {
|
|
4185
4210
|
message: ({ schema: P }) => `must be ${P}`,
|
|
4186
4211
|
params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
|
|
4187
4212
|
};
|
|
4188
|
-
function
|
|
4213
|
+
function g(P) {
|
|
4189
4214
|
const I = y(P);
|
|
4190
4215
|
(0, n.reportError)(I, $);
|
|
4191
4216
|
}
|
|
4192
|
-
e.reportTypeError =
|
|
4217
|
+
e.reportTypeError = g;
|
|
4193
4218
|
function y(P) {
|
|
4194
|
-
const { gen: I, data: D, schema: w } = P,
|
|
4219
|
+
const { gen: I, data: D, schema: w } = P, O = (0, i.schemaRefOrVal)(P, w, "type");
|
|
4195
4220
|
return {
|
|
4196
4221
|
gen: I,
|
|
4197
4222
|
keyword: "type",
|
|
4198
4223
|
data: D,
|
|
4199
4224
|
schema: w.type,
|
|
4200
|
-
schemaCode:
|
|
4201
|
-
schemaValue:
|
|
4225
|
+
schemaCode: O,
|
|
4226
|
+
schemaValue: O,
|
|
4202
4227
|
parentSchema: w,
|
|
4203
4228
|
params: {},
|
|
4204
4229
|
it: P
|
|
@@ -4280,14 +4305,14 @@ function schemaProperties(e, t) {
|
|
|
4280
4305
|
}
|
|
4281
4306
|
code.schemaProperties = schemaProperties;
|
|
4282
4307
|
function callValidateCode({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, c, d, u) {
|
|
4283
|
-
const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t,
|
|
4308
|
+
const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, _ = [
|
|
4284
4309
|
[names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, i)],
|
|
4285
4310
|
[names_1$5.default.parentData, o.parentData],
|
|
4286
4311
|
[names_1$5.default.parentDataProperty, o.parentDataProperty],
|
|
4287
4312
|
[names_1$5.default.rootData, names_1$5.default.rootData]
|
|
4288
4313
|
];
|
|
4289
|
-
o.opts.dynamicRef &&
|
|
4290
|
-
const T = (0, codegen_1$q._)`${p}, ${r.object(...
|
|
4314
|
+
o.opts.dynamicRef && _.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
|
|
4315
|
+
const T = (0, codegen_1$q._)`${p}, ${r.object(..._)}`;
|
|
4291
4316
|
return d !== codegen_1$q.nil ? (0, codegen_1$q._)`${c}.call(${d}, ${T})` : (0, codegen_1$q._)`${c}(${T})`;
|
|
4292
4317
|
}
|
|
4293
4318
|
code.callValidateCode = callValidateCode;
|
|
@@ -4357,31 +4382,31 @@ function funcKeywordCode(e, t) {
|
|
|
4357
4382
|
var r;
|
|
4358
4383
|
const { gen: n, keyword: s, schema: i, parentSchema: o, $data: c, it: d } = e;
|
|
4359
4384
|
checkAsyncKeyword(d, t);
|
|
4360
|
-
const u = !c && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u),
|
|
4361
|
-
e.block$data(
|
|
4385
|
+
const u = !c && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), _ = n.let("valid");
|
|
4386
|
+
e.block$data(_, T), e.ok((r = t.valid) !== null && r !== void 0 ? r : _);
|
|
4362
4387
|
function T() {
|
|
4363
4388
|
if (t.errors === !1)
|
|
4364
4389
|
k(), t.modifying && modifyData(e), $(() => e.error());
|
|
4365
4390
|
else {
|
|
4366
|
-
const
|
|
4367
|
-
t.modifying && modifyData(e), $(() => addErrs(e,
|
|
4391
|
+
const g = t.async ? C() : S();
|
|
4392
|
+
t.modifying && modifyData(e), $(() => addErrs(e, g));
|
|
4368
4393
|
}
|
|
4369
4394
|
}
|
|
4370
|
-
function
|
|
4371
|
-
const
|
|
4372
|
-
return n.try(() => k((0, codegen_1$p._)`await `), (y) => n.assign(
|
|
4395
|
+
function C() {
|
|
4396
|
+
const g = n.let("ruleErrs", null);
|
|
4397
|
+
return n.try(() => k((0, codegen_1$p._)`await `), (y) => n.assign(_, !1).if((0, codegen_1$p._)`${y} instanceof ${d.ValidationError}`, () => n.assign(g, (0, codegen_1$p._)`${y}.errors`), () => n.throw(y))), g;
|
|
4373
4398
|
}
|
|
4374
|
-
function
|
|
4375
|
-
const
|
|
4376
|
-
return n.assign(
|
|
4399
|
+
function S() {
|
|
4400
|
+
const g = (0, codegen_1$p._)`${p}.errors`;
|
|
4401
|
+
return n.assign(g, null), k(codegen_1$p.nil), g;
|
|
4377
4402
|
}
|
|
4378
|
-
function k(
|
|
4403
|
+
function k(g = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
|
|
4379
4404
|
const y = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !c || t.schema === !1);
|
|
4380
|
-
n.assign(
|
|
4405
|
+
n.assign(_, (0, codegen_1$p._)`${g}${(0, code_1$9.callValidateCode)(e, p, y, P)}`, t.modifying);
|
|
4381
4406
|
}
|
|
4382
|
-
function $(
|
|
4407
|
+
function $(g) {
|
|
4383
4408
|
var y;
|
|
4384
|
-
n.if((0, codegen_1$p.not)((y = t.valid) !== null && y !== void 0 ? y :
|
|
4409
|
+
n.if((0, codegen_1$p.not)((y = t.valid) !== null && y !== void 0 ? y : _), g);
|
|
4385
4410
|
}
|
|
4386
4411
|
}
|
|
4387
4412
|
keyword.funcKeywordCode = funcKeywordCode;
|
|
@@ -4460,8 +4485,8 @@ function extendSubschemaData(e, t, { dataProp: r, dataPropType: n, data: s, data
|
|
|
4460
4485
|
throw new Error('both "data" and "dataProp" passed, only one allowed');
|
|
4461
4486
|
const { gen: c } = t;
|
|
4462
4487
|
if (r !== void 0) {
|
|
4463
|
-
const { errorPath: u, dataPathArr: p, opts:
|
|
4464
|
-
d(T), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n,
|
|
4488
|
+
const { errorPath: u, dataPathArr: p, opts: _ } = t, T = c.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
|
|
4489
|
+
d(T), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, _.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
|
|
4465
4490
|
}
|
|
4466
4491
|
if (s !== void 0) {
|
|
4467
4492
|
const u = s instanceof codegen_1$o.Name ? s : c.let("data", s, !0);
|
|
@@ -4566,17 +4591,17 @@ function _traverse(e, t, r, n, s, i, o, c, d, u) {
|
|
|
4566
4591
|
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
4567
4592
|
t(n, s, i, o, c, d, u);
|
|
4568
4593
|
for (var p in n) {
|
|
4569
|
-
var
|
|
4570
|
-
if (Array.isArray(
|
|
4594
|
+
var _ = n[p];
|
|
4595
|
+
if (Array.isArray(_)) {
|
|
4571
4596
|
if (p in traverse$1.arrayKeywords)
|
|
4572
|
-
for (var T = 0; T <
|
|
4573
|
-
_traverse(e, t, r,
|
|
4597
|
+
for (var T = 0; T < _.length; T++)
|
|
4598
|
+
_traverse(e, t, r, _[T], s + "/" + p + "/" + T, i, s, p, n, T);
|
|
4574
4599
|
} else if (p in traverse$1.propsKeywords) {
|
|
4575
|
-
if (
|
|
4576
|
-
for (var
|
|
4577
|
-
_traverse(e, t, r,
|
|
4600
|
+
if (_ && typeof _ == "object")
|
|
4601
|
+
for (var C in _)
|
|
4602
|
+
_traverse(e, t, r, _[C], s + "/" + p + "/" + escapeJsonPtr(C), i, s, p, n, C);
|
|
4578
4603
|
} else
|
|
4579
|
-
(p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r,
|
|
4604
|
+
(p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, _, s + "/" + p, i, s, p, n);
|
|
4580
4605
|
}
|
|
4581
4606
|
r(n, s, i, o, c, d, u);
|
|
4582
4607
|
}
|
|
@@ -4660,34 +4685,34 @@ function getSchemaRefs(e, t) {
|
|
|
4660
4685
|
if (typeof e == "boolean")
|
|
4661
4686
|
return {};
|
|
4662
4687
|
const { schemaId: r, uriResolver: n } = this.opts, s = normalizeId(e[r] || t), i = { "": s }, o = getFullPath(n, s, !1), c = {}, d = /* @__PURE__ */ new Set();
|
|
4663
|
-
return traverse(e, { allKeys: !0 }, (
|
|
4664
|
-
if (
|
|
4688
|
+
return traverse(e, { allKeys: !0 }, (_, T, C, S) => {
|
|
4689
|
+
if (S === void 0)
|
|
4665
4690
|
return;
|
|
4666
4691
|
const k = o + T;
|
|
4667
|
-
let $ = i[
|
|
4668
|
-
typeof
|
|
4669
|
-
function
|
|
4692
|
+
let $ = i[S];
|
|
4693
|
+
typeof _[r] == "string" && ($ = g.call(this, _[r])), y.call(this, _.$anchor), y.call(this, _.$dynamicAnchor), i[T] = $;
|
|
4694
|
+
function g(P) {
|
|
4670
4695
|
const I = this.opts.uriResolver.resolve;
|
|
4671
4696
|
if (P = normalizeId($ ? I($, P) : P), d.has(P))
|
|
4672
4697
|
throw p(P);
|
|
4673
4698
|
d.add(P);
|
|
4674
4699
|
let D = this.refs[P];
|
|
4675
|
-
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(
|
|
4700
|
+
return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(_, D.schema, P) : P !== normalizeId(k) && (P[0] === "#" ? (u(_, c[P], P), c[P] = _) : this.refs[P] = k), P;
|
|
4676
4701
|
}
|
|
4677
4702
|
function y(P) {
|
|
4678
4703
|
if (typeof P == "string") {
|
|
4679
4704
|
if (!ANCHOR.test(P))
|
|
4680
4705
|
throw new Error(`invalid anchor "${P}"`);
|
|
4681
|
-
|
|
4706
|
+
g.call(this, `#${P}`);
|
|
4682
4707
|
}
|
|
4683
4708
|
}
|
|
4684
4709
|
}), c;
|
|
4685
|
-
function u(
|
|
4686
|
-
if (T !== void 0 && !equal$2(
|
|
4687
|
-
throw p(
|
|
4710
|
+
function u(_, T, C) {
|
|
4711
|
+
if (T !== void 0 && !equal$2(_, T))
|
|
4712
|
+
throw p(C);
|
|
4688
4713
|
}
|
|
4689
|
-
function p(
|
|
4690
|
-
return new Error(`reference "${
|
|
4714
|
+
function p(_) {
|
|
4715
|
+
return new Error(`reference "${_}" resolves to more than one schema`);
|
|
4691
4716
|
}
|
|
4692
4717
|
}
|
|
4693
4718
|
resolve$1.getSchemaRefs = getSchemaRefs;
|
|
@@ -4804,10 +4829,10 @@ function schemaKeywords(e, t, r, n) {
|
|
|
4804
4829
|
}
|
|
4805
4830
|
d.jtd || checkStrictTypes(e, t), s.block(() => {
|
|
4806
4831
|
for (const T of p.rules)
|
|
4807
|
-
|
|
4808
|
-
|
|
4832
|
+
_(T);
|
|
4833
|
+
_(p.post);
|
|
4809
4834
|
});
|
|
4810
|
-
function
|
|
4835
|
+
function _(T) {
|
|
4811
4836
|
(0, applicability_1.shouldUseGroup)(i, T) && (T.type ? (s.if((0, dataType_2.checkDataType)(T.type, o, d.strictNumbers)), iterateKeywords(e, T), t.length === 1 && t[0] === T.type && r && (s.else(), (0, dataType_2.reportTypeError)(e)), s.endIf()) : iterateKeywords(e, T), c || s.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${n || 0}`));
|
|
4812
4837
|
}
|
|
4813
4838
|
}
|
|
@@ -5070,21 +5095,21 @@ function compileSchema(e) {
|
|
|
5070
5095
|
let p;
|
|
5071
5096
|
try {
|
|
5072
5097
|
this._compilations.add(e), (0, validate_1$1.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
|
|
5073
|
-
const
|
|
5074
|
-
p = `${o.scopeRefs(names_1$2.default.scope)}return ${
|
|
5075
|
-
const
|
|
5076
|
-
if (this.scope.value(d, { ref:
|
|
5077
|
-
const { props:
|
|
5078
|
-
|
|
5079
|
-
props:
|
|
5098
|
+
const _ = o.toString();
|
|
5099
|
+
p = `${o.scopeRefs(names_1$2.default.scope)}return ${_}`, this.opts.code.process && (p = this.opts.code.process(p, e));
|
|
5100
|
+
const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
|
|
5101
|
+
if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode: _, scopeValues: o._values }), this.opts.unevaluated) {
|
|
5102
|
+
const { props: S, items: k } = u;
|
|
5103
|
+
C.evaluated = {
|
|
5104
|
+
props: S instanceof codegen_1$m.Name ? void 0 : S,
|
|
5080
5105
|
items: k instanceof codegen_1$m.Name ? void 0 : k,
|
|
5081
|
-
dynamicProps:
|
|
5106
|
+
dynamicProps: S instanceof codegen_1$m.Name,
|
|
5082
5107
|
dynamicItems: k instanceof codegen_1$m.Name
|
|
5083
|
-
},
|
|
5108
|
+
}, C.source && (C.source.evaluated = (0, codegen_1$m.stringify)(C.evaluated));
|
|
5084
5109
|
}
|
|
5085
|
-
return e.validate =
|
|
5086
|
-
} catch (
|
|
5087
|
-
throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p),
|
|
5110
|
+
return e.validate = C, e;
|
|
5111
|
+
} catch (_) {
|
|
5112
|
+
throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), _;
|
|
5088
5113
|
} finally {
|
|
5089
5114
|
this._compilations.delete(e);
|
|
5090
5115
|
}
|
|
@@ -5205,9 +5230,9 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5205
5230
|
l[m] = arguments[m];
|
|
5206
5231
|
if (l.length > 1) {
|
|
5207
5232
|
l[0] = l[0].slice(0, -1);
|
|
5208
|
-
for (var
|
|
5209
|
-
l[
|
|
5210
|
-
return l[
|
|
5233
|
+
for (var R = l.length - 1, b = 1; b < R; ++b)
|
|
5234
|
+
l[b] = l[b].slice(1, -1);
|
|
5235
|
+
return l[R] = l[R].slice(1), l.join("");
|
|
5211
5236
|
} else
|
|
5212
5237
|
return l[0];
|
|
5213
5238
|
}
|
|
@@ -5226,17 +5251,17 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5226
5251
|
function d(f, l) {
|
|
5227
5252
|
var m = f;
|
|
5228
5253
|
if (l)
|
|
5229
|
-
for (var
|
|
5230
|
-
m[
|
|
5254
|
+
for (var R in l)
|
|
5255
|
+
m[R] = l[R];
|
|
5231
5256
|
return m;
|
|
5232
5257
|
}
|
|
5233
5258
|
function u(f) {
|
|
5234
|
-
var l = "[A-Za-z]", m = "[0-9]",
|
|
5235
|
-
s(l + n(l, m, "[\\+\\-\\.]") + "*"), s(s(
|
|
5236
|
-
var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), V = s(
|
|
5237
|
-
s("[vV]" +
|
|
5238
|
-
var ct = s(
|
|
5239
|
-
return s(s(
|
|
5259
|
+
var l = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), b = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), q = "[\\:\\/\\?\\#\\[\\]\\@]", U = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(q, U), Y = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(l, m, "[\\-\\.\\_\\~]", Y);
|
|
5260
|
+
s(l + n(l, m, "[\\+\\-\\.]") + "*"), s(s(b + "|" + n(B, U, "[\\:]")) + "*");
|
|
5261
|
+
var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), V = s(R + "{1,4}"), X = s(s(V + "\\:" + V) + "|" + ie), ae = s(s(V + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(V + "\\:") + "{5}" + X), Se = s(s(V) + "?\\:\\:" + s(V + "\\:") + "{4}" + X), ge = s(s(s(V + "\\:") + "{0,1}" + V) + "?\\:\\:" + s(V + "\\:") + "{3}" + X), ye = s(s(s(V + "\\:") + "{0,2}" + V) + "?\\:\\:" + s(V + "\\:") + "{2}" + X), Be = s(s(s(V + "\\:") + "{0,3}" + V) + "?\\:\\:" + V + "\\:" + X), Ie = s(s(s(V + "\\:") + "{0,4}" + V) + "?\\:\\:" + X), fe = s(s(s(V + "\\:") + "{0,5}" + V) + "?\\:\\:" + V), $e = s(s(s(V + "\\:") + "{0,6}" + V) + "?\\:\\:"), je = s([ae, ee, Se, ge, ye, Be, Ie, fe, $e].join("|")), we = s(s(B + "|" + b) + "+");
|
|
5262
|
+
s("[vV]" + R + "+\\." + n(B, U, "[\\:]") + "+"), s(s(b + "|" + n(B, U)) + "*");
|
|
5263
|
+
var ct = s(b + "|" + n(B, U, "[\\:\\@]"));
|
|
5264
|
+
return s(s(b + "|" + n(B, U, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
|
|
5240
5265
|
NOT_SCHEME: new RegExp(n("[^]", l, m, "[\\+\\-\\.]"), "g"),
|
|
5241
5266
|
NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, U), "g"),
|
|
5242
5267
|
NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, U), "g"),
|
|
@@ -5247,29 +5272,29 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5247
5272
|
ESCAPE: new RegExp(n("[^]", B, U), "g"),
|
|
5248
5273
|
UNRESERVED: new RegExp(B, "g"),
|
|
5249
5274
|
OTHER_CHARS: new RegExp(n("[^\\%]", B, J), "g"),
|
|
5250
|
-
PCT_ENCODED: new RegExp(
|
|
5275
|
+
PCT_ENCODED: new RegExp(b, "g"),
|
|
5251
5276
|
IPV4ADDRESS: new RegExp("^(" + ie + ")$"),
|
|
5252
|
-
IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" +
|
|
5277
|
+
IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
|
|
5253
5278
|
//RFC 6874, with relaxed parsing rules
|
|
5254
5279
|
};
|
|
5255
5280
|
}
|
|
5256
|
-
var p = u(!1),
|
|
5281
|
+
var p = u(!1), _ = u(!0), T = function() {
|
|
5257
5282
|
function f(l, m) {
|
|
5258
|
-
var
|
|
5283
|
+
var R = [], b = !0, q = !1, U = void 0;
|
|
5259
5284
|
try {
|
|
5260
|
-
for (var J = l[Symbol.iterator](), Y; !(
|
|
5285
|
+
for (var J = l[Symbol.iterator](), Y; !(b = (Y = J.next()).done) && (R.push(Y.value), !(m && R.length === m)); b = !0)
|
|
5261
5286
|
;
|
|
5262
5287
|
} catch (se) {
|
|
5263
5288
|
q = !0, U = se;
|
|
5264
5289
|
} finally {
|
|
5265
5290
|
try {
|
|
5266
|
-
!
|
|
5291
|
+
!b && J.return && J.return();
|
|
5267
5292
|
} finally {
|
|
5268
5293
|
if (q)
|
|
5269
5294
|
throw U;
|
|
5270
5295
|
}
|
|
5271
5296
|
}
|
|
5272
|
-
return
|
|
5297
|
+
return R;
|
|
5273
5298
|
}
|
|
5274
5299
|
return function(l, m) {
|
|
5275
5300
|
if (Array.isArray(l))
|
|
@@ -5278,14 +5303,14 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5278
5303
|
return f(l, m);
|
|
5279
5304
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
5280
5305
|
};
|
|
5281
|
-
}(),
|
|
5306
|
+
}(), C = function(f) {
|
|
5282
5307
|
if (Array.isArray(f)) {
|
|
5283
5308
|
for (var l = 0, m = Array(f.length); l < f.length; l++)
|
|
5284
5309
|
m[l] = f[l];
|
|
5285
5310
|
return m;
|
|
5286
5311
|
} else
|
|
5287
5312
|
return Array.from(f);
|
|
5288
|
-
},
|
|
5313
|
+
}, S = 2147483647, k = 36, $ = 1, g = 26, y = 38, P = 700, I = 72, D = 128, w = "-", O = /^xn--/, A = /[^\0-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, z = {
|
|
5289
5314
|
overflow: "Overflow: input needs wider integers to process",
|
|
5290
5315
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
5291
5316
|
"invalid-input": "Invalid input"
|
|
@@ -5294,72 +5319,72 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5294
5319
|
throw new RangeError(z[f]);
|
|
5295
5320
|
}
|
|
5296
5321
|
function ke(f, l) {
|
|
5297
|
-
for (var m = [],
|
|
5298
|
-
m[
|
|
5322
|
+
for (var m = [], R = f.length; R--; )
|
|
5323
|
+
m[R] = l(f[R]);
|
|
5299
5324
|
return m;
|
|
5300
5325
|
}
|
|
5301
5326
|
function Ce(f, l) {
|
|
5302
|
-
var m = f.split("@"),
|
|
5303
|
-
m.length > 1 && (
|
|
5304
|
-
var
|
|
5305
|
-
return
|
|
5327
|
+
var m = f.split("@"), R = "";
|
|
5328
|
+
m.length > 1 && (R = m[0] + "@", f = m[1]), f = f.replace(x, ".");
|
|
5329
|
+
var b = f.split("."), q = ke(b, l).join(".");
|
|
5330
|
+
return R + q;
|
|
5306
5331
|
}
|
|
5307
5332
|
function Le(f) {
|
|
5308
|
-
for (var l = [], m = 0,
|
|
5309
|
-
var
|
|
5310
|
-
if (
|
|
5333
|
+
for (var l = [], m = 0, R = f.length; m < R; ) {
|
|
5334
|
+
var b = f.charCodeAt(m++);
|
|
5335
|
+
if (b >= 55296 && b <= 56319 && m < R) {
|
|
5311
5336
|
var q = f.charCodeAt(m++);
|
|
5312
|
-
(q & 64512) == 56320 ? l.push(((
|
|
5337
|
+
(q & 64512) == 56320 ? l.push(((b & 1023) << 10) + (q & 1023) + 65536) : (l.push(b), m--);
|
|
5313
5338
|
} else
|
|
5314
|
-
l.push(
|
|
5339
|
+
l.push(b);
|
|
5315
5340
|
}
|
|
5316
5341
|
return l;
|
|
5317
5342
|
}
|
|
5318
5343
|
var et = function(l) {
|
|
5319
|
-
return String.fromCodePoint.apply(String,
|
|
5344
|
+
return String.fromCodePoint.apply(String, C(l));
|
|
5320
5345
|
}, qe = function(l) {
|
|
5321
5346
|
return l - 48 < 10 ? l - 22 : l - 65 < 26 ? l - 65 : l - 97 < 26 ? l - 97 : k;
|
|
5322
5347
|
}, F = function(l, m) {
|
|
5323
5348
|
return l + 22 + 75 * (l < 26) - ((m != 0) << 5);
|
|
5324
|
-
}, v = function(l, m,
|
|
5325
|
-
var
|
|
5349
|
+
}, v = function(l, m, R) {
|
|
5350
|
+
var b = 0;
|
|
5326
5351
|
for (
|
|
5327
|
-
l =
|
|
5352
|
+
l = R ? K(l / P) : l >> 1, l += K(l / m);
|
|
5328
5353
|
/* no initialization */
|
|
5329
|
-
l > re *
|
|
5330
|
-
|
|
5354
|
+
l > re * g >> 1;
|
|
5355
|
+
b += k
|
|
5331
5356
|
)
|
|
5332
5357
|
l = K(l / re);
|
|
5333
|
-
return K(
|
|
5358
|
+
return K(b + (re + 1) * l / (l + y));
|
|
5334
5359
|
}, j = function(l) {
|
|
5335
|
-
var m = [],
|
|
5360
|
+
var m = [], R = l.length, b = 0, q = D, U = I, J = l.lastIndexOf(w);
|
|
5336
5361
|
J < 0 && (J = 0);
|
|
5337
5362
|
for (var Y = 0; Y < J; ++Y)
|
|
5338
5363
|
l.charCodeAt(Y) >= 128 && oe("not-basic"), m.push(l.charCodeAt(Y));
|
|
5339
|
-
for (var se = J > 0 ? J + 1 : 0; se <
|
|
5364
|
+
for (var se = J > 0 ? J + 1 : 0; se < R; ) {
|
|
5340
5365
|
for (
|
|
5341
|
-
var B =
|
|
5366
|
+
var B = b, Z = 1, ie = k;
|
|
5342
5367
|
;
|
|
5343
5368
|
/* no condition */
|
|
5344
5369
|
ie += k
|
|
5345
5370
|
) {
|
|
5346
|
-
se >=
|
|
5371
|
+
se >= R && oe("invalid-input");
|
|
5347
5372
|
var V = qe(l.charCodeAt(se++));
|
|
5348
|
-
(V >= k || V > K((
|
|
5349
|
-
var X = ie <= U ? $ : ie >= U +
|
|
5373
|
+
(V >= k || V > K((S - b) / Z)) && oe("overflow"), b += V * Z;
|
|
5374
|
+
var X = ie <= U ? $ : ie >= U + g ? g : ie - U;
|
|
5350
5375
|
if (V < X)
|
|
5351
5376
|
break;
|
|
5352
5377
|
var ae = k - X;
|
|
5353
|
-
Z > K(
|
|
5378
|
+
Z > K(S / ae) && oe("overflow"), Z *= ae;
|
|
5354
5379
|
}
|
|
5355
5380
|
var ee = m.length + 1;
|
|
5356
|
-
U = v(
|
|
5381
|
+
U = v(b - B, ee, B == 0), K(b / ee) > S - q && oe("overflow"), q += K(b / ee), b %= ee, m.splice(b++, 0, q);
|
|
5357
5382
|
}
|
|
5358
5383
|
return String.fromCodePoint.apply(String, m);
|
|
5359
|
-
},
|
|
5384
|
+
}, E = function(l) {
|
|
5360
5385
|
var m = [];
|
|
5361
5386
|
l = Le(l);
|
|
5362
|
-
var
|
|
5387
|
+
var R = l.length, b = D, q = 0, U = I, J = !0, Y = !1, se = void 0;
|
|
5363
5388
|
try {
|
|
5364
5389
|
for (var B = l[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
|
|
5365
5390
|
var ie = Z.value;
|
|
@@ -5376,12 +5401,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5376
5401
|
}
|
|
5377
5402
|
}
|
|
5378
5403
|
var V = m.length, X = V;
|
|
5379
|
-
for (V && m.push(w); X <
|
|
5380
|
-
var ae =
|
|
5404
|
+
for (V && m.push(w); X < R; ) {
|
|
5405
|
+
var ae = S, ee = !0, Se = !1, ge = void 0;
|
|
5381
5406
|
try {
|
|
5382
5407
|
for (var ye = l[Symbol.iterator](), Be; !(ee = (Be = ye.next()).done); ee = !0) {
|
|
5383
5408
|
var Ie = Be.value;
|
|
5384
|
-
Ie >=
|
|
5409
|
+
Ie >= b && Ie < ae && (ae = Ie);
|
|
5385
5410
|
}
|
|
5386
5411
|
} catch (lt) {
|
|
5387
5412
|
Se = !0, ge = lt;
|
|
@@ -5394,19 +5419,19 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5394
5419
|
}
|
|
5395
5420
|
}
|
|
5396
5421
|
var fe = X + 1;
|
|
5397
|
-
ae -
|
|
5422
|
+
ae - b > K((S - q) / fe) && oe("overflow"), q += (ae - b) * fe, b = ae;
|
|
5398
5423
|
var $e = !0, je = !1, we = void 0;
|
|
5399
5424
|
try {
|
|
5400
5425
|
for (var ct = l[Symbol.iterator](), Ut; !($e = (Ut = ct.next()).done); $e = !0) {
|
|
5401
5426
|
var Ht = Ut.value;
|
|
5402
|
-
if (Ht <
|
|
5427
|
+
if (Ht < b && ++q > S && oe("overflow"), Ht == b) {
|
|
5403
5428
|
for (
|
|
5404
5429
|
var pt = q, ft = k;
|
|
5405
5430
|
;
|
|
5406
5431
|
/* no condition */
|
|
5407
5432
|
ft += k
|
|
5408
5433
|
) {
|
|
5409
|
-
var ht = ft <= U ? $ : ft >= U +
|
|
5434
|
+
var ht = ft <= U ? $ : ft >= U + g ? g : ft - U;
|
|
5410
5435
|
if (pt < ht)
|
|
5411
5436
|
break;
|
|
5412
5437
|
var xt = pt - ht, Vt = k - ht;
|
|
@@ -5425,16 +5450,16 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5425
5450
|
throw we;
|
|
5426
5451
|
}
|
|
5427
5452
|
}
|
|
5428
|
-
++q, ++
|
|
5453
|
+
++q, ++b;
|
|
5429
5454
|
}
|
|
5430
5455
|
return m.join("");
|
|
5431
5456
|
}, a = function(l) {
|
|
5432
5457
|
return Ce(l, function(m) {
|
|
5433
|
-
return
|
|
5458
|
+
return O.test(m) ? j(m.slice(4).toLowerCase()) : m;
|
|
5434
5459
|
});
|
|
5435
5460
|
}, h = function(l) {
|
|
5436
5461
|
return Ce(l, function(m) {
|
|
5437
|
-
return A.test(m) ? "xn--" +
|
|
5462
|
+
return A.test(m) ? "xn--" + E(m) : m;
|
|
5438
5463
|
});
|
|
5439
5464
|
}, N = {
|
|
5440
5465
|
/**
|
|
@@ -5455,7 +5480,7 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5455
5480
|
encode: et
|
|
5456
5481
|
},
|
|
5457
5482
|
decode: j,
|
|
5458
|
-
encode:
|
|
5483
|
+
encode: E,
|
|
5459
5484
|
toASCII: h,
|
|
5460
5485
|
toUnicode: a
|
|
5461
5486
|
}, M = {};
|
|
@@ -5464,21 +5489,21 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5464
5489
|
return l < 16 ? m = "%0" + l.toString(16).toUpperCase() : l < 128 ? m = "%" + l.toString(16).toUpperCase() : l < 2048 ? m = "%" + (l >> 6 | 192).toString(16).toUpperCase() + "%" + (l & 63 | 128).toString(16).toUpperCase() : m = "%" + (l >> 12 | 224).toString(16).toUpperCase() + "%" + (l >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (l & 63 | 128).toString(16).toUpperCase(), m;
|
|
5465
5490
|
}
|
|
5466
5491
|
function W(f) {
|
|
5467
|
-
for (var l = "", m = 0,
|
|
5468
|
-
var
|
|
5469
|
-
if (
|
|
5470
|
-
l += String.fromCharCode(
|
|
5471
|
-
else if (
|
|
5472
|
-
if (
|
|
5492
|
+
for (var l = "", m = 0, R = f.length; m < R; ) {
|
|
5493
|
+
var b = parseInt(f.substr(m + 1, 2), 16);
|
|
5494
|
+
if (b < 128)
|
|
5495
|
+
l += String.fromCharCode(b), m += 3;
|
|
5496
|
+
else if (b >= 194 && b < 224) {
|
|
5497
|
+
if (R - m >= 6) {
|
|
5473
5498
|
var q = parseInt(f.substr(m + 4, 2), 16);
|
|
5474
|
-
l += String.fromCharCode((
|
|
5499
|
+
l += String.fromCharCode((b & 31) << 6 | q & 63);
|
|
5475
5500
|
} else
|
|
5476
5501
|
l += f.substr(m, 6);
|
|
5477
5502
|
m += 6;
|
|
5478
|
-
} else if (
|
|
5479
|
-
if (
|
|
5503
|
+
} else if (b >= 224) {
|
|
5504
|
+
if (R - m >= 9) {
|
|
5480
5505
|
var U = parseInt(f.substr(m + 4, 2), 16), J = parseInt(f.substr(m + 7, 2), 16);
|
|
5481
|
-
l += String.fromCharCode((
|
|
5506
|
+
l += String.fromCharCode((b & 15) << 12 | (U & 63) << 6 | J & 63);
|
|
5482
5507
|
} else
|
|
5483
5508
|
l += f.substr(m, 9);
|
|
5484
5509
|
m += 9;
|
|
@@ -5488,9 +5513,9 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5488
5513
|
return l;
|
|
5489
5514
|
}
|
|
5490
5515
|
function G(f, l) {
|
|
5491
|
-
function m(
|
|
5492
|
-
var
|
|
5493
|
-
return
|
|
5516
|
+
function m(R) {
|
|
5517
|
+
var b = W(R);
|
|
5518
|
+
return b.match(l.UNRESERVED) ? b : R;
|
|
5494
5519
|
}
|
|
5495
5520
|
return f.scheme && (f.scheme = String(f.scheme).replace(l.PCT_ENCODED, m).toLowerCase().replace(l.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(l.PCT_ENCODED, m).replace(l.NOT_USERINFO, L).replace(l.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(l.PCT_ENCODED, m).toLowerCase().replace(l.NOT_HOST, L).replace(l.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(l.PCT_ENCODED, m).replace(f.scheme ? l.NOT_PATH : l.NOT_PATH_NOSCHEME, L).replace(l.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(l.PCT_ENCODED, m).replace(l.NOT_QUERY, L).replace(l.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(l.PCT_ENCODED, m).replace(l.NOT_FRAGMENT, L).replace(l.PCT_ENCODED, o)), f;
|
|
5496
5521
|
}
|
|
@@ -5498,13 +5523,13 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5498
5523
|
return f.replace(/^0*(.*)/, "$1") || "0";
|
|
5499
5524
|
}
|
|
5500
5525
|
function he(f, l) {
|
|
5501
|
-
var m = f.match(l.IPV4ADDRESS) || [],
|
|
5502
|
-
return
|
|
5526
|
+
var m = f.match(l.IPV4ADDRESS) || [], R = T(m, 2), b = R[1];
|
|
5527
|
+
return b ? b.split(".").map(ne).join(".") : f;
|
|
5503
5528
|
}
|
|
5504
5529
|
function Ue(f, l) {
|
|
5505
|
-
var m = f.match(l.IPV6ADDRESS) || [],
|
|
5506
|
-
if (
|
|
5507
|
-
for (var U =
|
|
5530
|
+
var m = f.match(l.IPV6ADDRESS) || [], R = T(m, 3), b = R[1], q = R[2];
|
|
5531
|
+
if (b) {
|
|
5532
|
+
for (var U = b.toLowerCase().split("::").reverse(), J = T(U, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = l.IPV4ADDRESS.test(Z[Z.length - 1]), V = ie ? 7 : 8, X = Z.length - V, ae = Array(V), ee = 0; ee < V; ++ee)
|
|
5508
5533
|
ae[ee] = B[ee] || Z[X + ee] || "";
|
|
5509
5534
|
ie && (ae[V - 1] = he(ae[V - 1], l));
|
|
5510
5535
|
var Se = ae.reduce(function(fe, $e, je) {
|
|
@@ -5527,32 +5552,32 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5527
5552
|
}
|
|
5528
5553
|
var tt = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, rt = "".match(/(){0}/)[1] === void 0;
|
|
5529
5554
|
function de(f) {
|
|
5530
|
-
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {},
|
|
5555
|
+
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = l.iri !== !1 ? _ : p;
|
|
5531
5556
|
l.reference === "suffix" && (f = (l.scheme ? l.scheme + ":" : "") + "//" + f);
|
|
5532
|
-
var
|
|
5533
|
-
if (
|
|
5534
|
-
rt ? (m.scheme =
|
|
5557
|
+
var b = f.match(tt);
|
|
5558
|
+
if (b) {
|
|
5559
|
+
rt ? (m.scheme = b[1], m.userinfo = b[3], m.host = b[4], m.port = parseInt(b[5], 10), m.path = b[6] || "", m.query = b[7], m.fragment = b[8], isNaN(m.port) && (m.port = b[5])) : (m.scheme = b[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? b[3] : void 0, m.host = f.indexOf("//") !== -1 ? b[4] : void 0, m.port = parseInt(b[5], 10), m.path = b[6] || "", m.query = f.indexOf("?") !== -1 ? b[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? b[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? b[4] : void 0)), m.host && (m.host = Ue(he(m.host, R), R)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", l.reference && l.reference !== "suffix" && l.reference !== m.reference && (m.error = m.error || "URI is not a " + l.reference + " reference.");
|
|
5535
5560
|
var q = M[(l.scheme || m.scheme || "").toLowerCase()];
|
|
5536
5561
|
if (!l.unicodeSupport && (!q || !q.unicodeSupport)) {
|
|
5537
5562
|
if (m.host && (l.domainHost || q && q.domainHost))
|
|
5538
5563
|
try {
|
|
5539
|
-
m.host = N.toASCII(m.host.replace(
|
|
5564
|
+
m.host = N.toASCII(m.host.replace(R.PCT_ENCODED, W).toLowerCase());
|
|
5540
5565
|
} catch (U) {
|
|
5541
5566
|
m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + U;
|
|
5542
5567
|
}
|
|
5543
5568
|
G(m, p);
|
|
5544
5569
|
} else
|
|
5545
|
-
G(m,
|
|
5570
|
+
G(m, R);
|
|
5546
5571
|
q && q.parse && q.parse(m, l);
|
|
5547
5572
|
} else
|
|
5548
5573
|
m.error = m.error || "URI can not be parsed.";
|
|
5549
5574
|
return m;
|
|
5550
5575
|
}
|
|
5551
5576
|
function nt(f, l) {
|
|
5552
|
-
var m = l.iri !== !1 ?
|
|
5553
|
-
return f.userinfo !== void 0 && (
|
|
5577
|
+
var m = l.iri !== !1 ? _ : p, R = [];
|
|
5578
|
+
return f.userinfo !== void 0 && (R.push(f.userinfo), R.push("@")), f.host !== void 0 && R.push(Ue(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(b, q, U) {
|
|
5554
5579
|
return "[" + q + (U ? "%25" + U : "") + "]";
|
|
5555
|
-
})), (typeof f.port == "number" || typeof f.port == "string") && (
|
|
5580
|
+
})), (typeof f.port == "number" || typeof f.port == "string") && (R.push(":"), R.push(String(f.port))), R.length ? R.join("") : void 0;
|
|
5556
5581
|
}
|
|
5557
5582
|
var He = /^\.\.?\//, xe = /^\/\.(\/|$)/, Ve = /^\/\.\.(\/|$)/, st = /^\/?(?:.|\n)*?(?=\/|$)/;
|
|
5558
5583
|
function me(f) {
|
|
@@ -5568,38 +5593,38 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5568
5593
|
else {
|
|
5569
5594
|
var m = f.match(st);
|
|
5570
5595
|
if (m) {
|
|
5571
|
-
var
|
|
5572
|
-
f = f.slice(
|
|
5596
|
+
var R = m[0];
|
|
5597
|
+
f = f.slice(R.length), l.push(R);
|
|
5573
5598
|
} else
|
|
5574
5599
|
throw new Error("Unexpected dot segment condition");
|
|
5575
5600
|
}
|
|
5576
5601
|
return l.join("");
|
|
5577
5602
|
}
|
|
5578
5603
|
function le(f) {
|
|
5579
|
-
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.iri ?
|
|
5580
|
-
if (
|
|
5581
|
-
if (l.domainHost ||
|
|
5604
|
+
var l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.iri ? _ : p, R = [], b = M[(l.scheme || f.scheme || "").toLowerCase()];
|
|
5605
|
+
if (b && b.serialize && b.serialize(f, l), f.host && !m.IPV6ADDRESS.test(f.host)) {
|
|
5606
|
+
if (l.domainHost || b && b.domainHost)
|
|
5582
5607
|
try {
|
|
5583
5608
|
f.host = l.iri ? N.toUnicode(f.host) : N.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
|
|
5584
5609
|
} catch (J) {
|
|
5585
5610
|
f.error = f.error || "Host's domain name can not be converted to " + (l.iri ? "Unicode" : "ASCII") + " via punycode: " + J;
|
|
5586
5611
|
}
|
|
5587
5612
|
}
|
|
5588
|
-
G(f, m), l.reference !== "suffix" && f.scheme && (
|
|
5613
|
+
G(f, m), l.reference !== "suffix" && f.scheme && (R.push(f.scheme), R.push(":"));
|
|
5589
5614
|
var q = nt(f, l);
|
|
5590
|
-
if (q !== void 0 && (l.reference !== "suffix" &&
|
|
5615
|
+
if (q !== void 0 && (l.reference !== "suffix" && R.push("//"), R.push(q), f.path && f.path.charAt(0) !== "/" && R.push("/")), f.path !== void 0) {
|
|
5591
5616
|
var U = f.path;
|
|
5592
|
-
!l.absolutePath && (!
|
|
5617
|
+
!l.absolutePath && (!b || !b.absolutePath) && (U = me(U)), q === void 0 && (U = U.replace(/^\/\//, "/%2F")), R.push(U);
|
|
5593
5618
|
}
|
|
5594
|
-
return f.query !== void 0 && (
|
|
5619
|
+
return f.query !== void 0 && (R.push("?"), R.push(f.query)), f.fragment !== void 0 && (R.push("#"), R.push(f.fragment)), R.join("");
|
|
5595
5620
|
}
|
|
5596
5621
|
function ze(f, l) {
|
|
5597
|
-
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
5598
|
-
return
|
|
5622
|
+
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, R = arguments[3], b = {};
|
|
5623
|
+
return R || (f = de(le(f, m), m), l = de(le(l, m), m)), m = m || {}, !m.tolerant && l.scheme ? (b.scheme = l.scheme, b.userinfo = l.userinfo, b.host = l.host, b.port = l.port, b.path = me(l.path || ""), b.query = l.query) : (l.userinfo !== void 0 || l.host !== void 0 || l.port !== void 0 ? (b.userinfo = l.userinfo, b.host = l.host, b.port = l.port, b.path = me(l.path || ""), b.query = l.query) : (l.path ? (l.path.charAt(0) === "/" ? b.path = me(l.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? b.path = "/" + l.path : f.path ? b.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + l.path : b.path = l.path, b.path = me(b.path)), b.query = l.query) : (b.path = f.path, l.query !== void 0 ? b.query = l.query : b.query = f.query), b.userinfo = f.userinfo, b.host = f.host, b.port = f.port), b.scheme = f.scheme), b.fragment = l.fragment, b;
|
|
5599
5624
|
}
|
|
5600
5625
|
function it(f, l, m) {
|
|
5601
|
-
var
|
|
5602
|
-
return le(ze(de(f,
|
|
5626
|
+
var R = d({ scheme: "null" }, m);
|
|
5627
|
+
return le(ze(de(f, R), de(l, R), R, !0), R);
|
|
5603
5628
|
}
|
|
5604
5629
|
function Oe(f, l) {
|
|
5605
5630
|
return typeof f == "string" ? f = le(de(f, l), l) : i(f) === "object" && (f = de(le(f, l), l)), f;
|
|
@@ -5608,10 +5633,10 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5608
5633
|
return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof l == "string" ? l = le(de(l, m), m) : i(l) === "object" && (l = le(l, m)), f === l;
|
|
5609
5634
|
}
|
|
5610
5635
|
function ut(f, l) {
|
|
5611
|
-
return f && f.toString().replace(!l || !l.iri ? p.ESCAPE :
|
|
5636
|
+
return f && f.toString().replace(!l || !l.iri ? p.ESCAPE : _.ESCAPE, L);
|
|
5612
5637
|
}
|
|
5613
5638
|
function pe(f, l) {
|
|
5614
|
-
return f && f.toString().replace(!l || !l.iri ? p.PCT_ENCODED :
|
|
5639
|
+
return f && f.toString().replace(!l || !l.iri ? p.PCT_ENCODED : _.PCT_ENCODED, W);
|
|
5615
5640
|
}
|
|
5616
5641
|
var Ne = {
|
|
5617
5642
|
scheme: "http",
|
|
@@ -5620,8 +5645,8 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5620
5645
|
return l.host || (l.error = l.error || "HTTP URIs must have a host."), l;
|
|
5621
5646
|
},
|
|
5622
5647
|
serialize: function(l, m) {
|
|
5623
|
-
var
|
|
5624
|
-
return (l.port === (
|
|
5648
|
+
var R = String(l.scheme).toLowerCase() === "https";
|
|
5649
|
+
return (l.port === (R ? 443 : 80) || l.port === "") && (l.port = void 0), l.path || (l.path = "/"), l;
|
|
5625
5650
|
}
|
|
5626
5651
|
}, It = {
|
|
5627
5652
|
scheme: "https",
|
|
@@ -5636,12 +5661,12 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5636
5661
|
scheme: "ws",
|
|
5637
5662
|
domainHost: !0,
|
|
5638
5663
|
parse: function(l, m) {
|
|
5639
|
-
var
|
|
5640
|
-
return
|
|
5664
|
+
var R = l;
|
|
5665
|
+
return R.secure = jt(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
|
|
5641
5666
|
},
|
|
5642
5667
|
serialize: function(l, m) {
|
|
5643
5668
|
if ((l.port === (jt(l) ? 443 : 80) || l.port === "") && (l.port = void 0), typeof l.secure == "boolean" && (l.scheme = l.secure ? "wss" : "ws", l.secure = void 0), l.resourceName) {
|
|
5644
|
-
var
|
|
5669
|
+
var R = l.resourceName.split("?"), b = T(R, 2), q = b[0], U = b[1];
|
|
5645
5670
|
l.path = q && q !== "/" ? q : void 0, l.query = U, l.resourceName = void 0;
|
|
5646
5671
|
}
|
|
5647
5672
|
return l.fragment = void 0, l;
|
|
@@ -5659,90 +5684,90 @@ var uri$1 = {}, uri_all = { exports: {} };
|
|
|
5659
5684
|
var Mt = {
|
|
5660
5685
|
scheme: "mailto",
|
|
5661
5686
|
parse: function(l, m) {
|
|
5662
|
-
var
|
|
5663
|
-
if (
|
|
5664
|
-
for (var q = !1, U = {}, J =
|
|
5687
|
+
var R = l, b = R.to = R.path ? R.path.split(",") : [];
|
|
5688
|
+
if (R.path = void 0, R.query) {
|
|
5689
|
+
for (var q = !1, U = {}, J = R.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
|
|
5665
5690
|
var B = J[Y].split("=");
|
|
5666
5691
|
switch (B[0]) {
|
|
5667
5692
|
case "to":
|
|
5668
5693
|
for (var Z = B[1].split(","), ie = 0, V = Z.length; ie < V; ++ie)
|
|
5669
|
-
|
|
5694
|
+
b.push(Z[ie]);
|
|
5670
5695
|
break;
|
|
5671
5696
|
case "subject":
|
|
5672
|
-
|
|
5697
|
+
R.subject = pe(B[1], m);
|
|
5673
5698
|
break;
|
|
5674
5699
|
case "body":
|
|
5675
|
-
|
|
5700
|
+
R.body = pe(B[1], m);
|
|
5676
5701
|
break;
|
|
5677
5702
|
default:
|
|
5678
5703
|
q = !0, U[pe(B[0], m)] = pe(B[1], m);
|
|
5679
5704
|
break;
|
|
5680
5705
|
}
|
|
5681
5706
|
}
|
|
5682
|
-
q && (
|
|
5707
|
+
q && (R.headers = U);
|
|
5683
5708
|
}
|
|
5684
|
-
|
|
5685
|
-
for (var X = 0, ae =
|
|
5686
|
-
var ee =
|
|
5709
|
+
R.query = void 0;
|
|
5710
|
+
for (var X = 0, ae = b.length; X < ae; ++X) {
|
|
5711
|
+
var ee = b[X].split("@");
|
|
5687
5712
|
if (ee[0] = pe(ee[0]), m.unicodeSupport)
|
|
5688
5713
|
ee[1] = pe(ee[1], m).toLowerCase();
|
|
5689
5714
|
else
|
|
5690
5715
|
try {
|
|
5691
5716
|
ee[1] = N.toASCII(pe(ee[1], m).toLowerCase());
|
|
5692
5717
|
} catch (Se) {
|
|
5693
|
-
|
|
5718
|
+
R.error = R.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
|
|
5694
5719
|
}
|
|
5695
|
-
|
|
5720
|
+
b[X] = ee.join("@");
|
|
5696
5721
|
}
|
|
5697
|
-
return
|
|
5722
|
+
return R;
|
|
5698
5723
|
},
|
|
5699
5724
|
serialize: function(l, m) {
|
|
5700
|
-
var
|
|
5701
|
-
if (
|
|
5702
|
-
for (var q = 0, U =
|
|
5703
|
-
var J = String(
|
|
5725
|
+
var R = l, b = c(l.to);
|
|
5726
|
+
if (b) {
|
|
5727
|
+
for (var q = 0, U = b.length; q < U; ++q) {
|
|
5728
|
+
var J = String(b[q]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ot).replace(We, o).replace(pr, L), B = J.slice(Y + 1);
|
|
5704
5729
|
try {
|
|
5705
5730
|
B = m.iri ? N.toUnicode(B) : N.toASCII(pe(B, m).toLowerCase());
|
|
5706
5731
|
} catch (X) {
|
|
5707
|
-
|
|
5732
|
+
R.error = R.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
|
|
5708
5733
|
}
|
|
5709
|
-
|
|
5734
|
+
b[q] = se + "@" + B;
|
|
5710
5735
|
}
|
|
5711
|
-
|
|
5736
|
+
R.path = b.join(",");
|
|
5712
5737
|
}
|
|
5713
5738
|
var Z = l.headers = l.headers || {};
|
|
5714
5739
|
l.subject && (Z.subject = l.subject), l.body && (Z.body = l.body);
|
|
5715
5740
|
var ie = [];
|
|
5716
5741
|
for (var V in Z)
|
|
5717
5742
|
Z[V] !== ir[V] && ie.push(V.replace(We, Ot).replace(We, o).replace(Ft, L) + "=" + Z[V].replace(We, Ot).replace(We, o).replace(fr, L));
|
|
5718
|
-
return ie.length && (
|
|
5743
|
+
return ie.length && (R.query = ie.join("&")), R;
|
|
5719
5744
|
}
|
|
5720
5745
|
}, hr = /^([^\:]+)\:(.*)/, Lt = {
|
|
5721
5746
|
scheme: "urn",
|
|
5722
5747
|
parse: function(l, m) {
|
|
5723
|
-
var
|
|
5724
|
-
if (
|
|
5725
|
-
var q = m.scheme ||
|
|
5726
|
-
|
|
5748
|
+
var R = l.path && l.path.match(hr), b = l;
|
|
5749
|
+
if (R) {
|
|
5750
|
+
var q = m.scheme || b.scheme || "urn", U = R[1].toLowerCase(), J = R[2], Y = q + ":" + (m.nid || U), se = M[Y];
|
|
5751
|
+
b.nid = U, b.nss = J, b.path = void 0, se && (b = se.parse(b, m));
|
|
5727
5752
|
} else
|
|
5728
|
-
|
|
5729
|
-
return
|
|
5753
|
+
b.error = b.error || "URN can not be parsed.";
|
|
5754
|
+
return b;
|
|
5730
5755
|
},
|
|
5731
5756
|
serialize: function(l, m) {
|
|
5732
|
-
var
|
|
5757
|
+
var R = m.scheme || l.scheme || "urn", b = l.nid, q = R + ":" + (m.nid || b), U = M[q];
|
|
5733
5758
|
U && (l = U.serialize(l, m));
|
|
5734
5759
|
var J = l, Y = l.nss;
|
|
5735
|
-
return J.path = (
|
|
5760
|
+
return J.path = (b || m.nid) + ":" + Y, J;
|
|
5736
5761
|
}
|
|
5737
5762
|
}, mr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, qt = {
|
|
5738
5763
|
scheme: "urn:uuid",
|
|
5739
5764
|
parse: function(l, m) {
|
|
5740
|
-
var
|
|
5741
|
-
return
|
|
5765
|
+
var R = l;
|
|
5766
|
+
return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(mr)) && (R.error = R.error || "UUID is not valid."), R;
|
|
5742
5767
|
},
|
|
5743
5768
|
serialize: function(l, m) {
|
|
5744
|
-
var
|
|
5745
|
-
return
|
|
5769
|
+
var R = l;
|
|
5770
|
+
return R.nss = (l.uuid || "").toLowerCase(), R;
|
|
5746
5771
|
}
|
|
5747
5772
|
};
|
|
5748
5773
|
M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, M[Mt.scheme] = Mt, M[Lt.scheme] = Lt, M[qt.scheme] = qt, r.SCHEMES = M, r.pctEncChar = L, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = ze, r.resolve = it, r.normalize = Oe, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
|
|
@@ -5773,9 +5798,9 @@ uri$1.default = uri;
|
|
|
5773
5798
|
} }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
|
|
5774
5799
|
return r.CodeGen;
|
|
5775
5800
|
} });
|
|
5776
|
-
const n = validation_error, s = ref_error, i = rules, o = compile, c = codegen, d = resolve$1, u = dataType, p = util,
|
|
5777
|
-
|
|
5778
|
-
const
|
|
5801
|
+
const n = validation_error, s = ref_error, i = rules, o = compile, c = codegen, d = resolve$1, u = dataType, p = util, _ = require$$9, T = uri$1, C = (F, v) => new RegExp(F, v);
|
|
5802
|
+
C.code = "new RegExp";
|
|
5803
|
+
const S = ["removeAdditional", "useDefaults", "coerceTypes"], k = /* @__PURE__ */ new Set([
|
|
5779
5804
|
"validate",
|
|
5780
5805
|
"serialize",
|
|
5781
5806
|
"parse",
|
|
@@ -5805,14 +5830,14 @@ uri$1.default = uri;
|
|
|
5805
5830
|
cache: "Map is used as cache, schema object as key.",
|
|
5806
5831
|
serialize: "Map is used as cache, schema object as key.",
|
|
5807
5832
|
ajvErrors: "It is default now."
|
|
5808
|
-
},
|
|
5833
|
+
}, g = {
|
|
5809
5834
|
ignoreKeywordsWithRef: "",
|
|
5810
5835
|
jsPropertySyntax: "",
|
|
5811
5836
|
unicode: '"minLength"/"maxLength" account for unicode characters by default.'
|
|
5812
5837
|
}, y = 200;
|
|
5813
5838
|
function P(F) {
|
|
5814
|
-
var v, j,
|
|
5815
|
-
const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (
|
|
5839
|
+
var v, j, E, a, h, N, M, L, W, G, ne, he, Ue, tt, rt, de, nt, He, xe, Ve, st, me, le, ze, it;
|
|
5840
|
+
const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (E = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && E !== void 0 ? E : C, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : T.default;
|
|
5816
5841
|
return {
|
|
5817
5842
|
strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Oe) !== null && N !== void 0 ? N : !0,
|
|
5818
5843
|
strictNumbers: (L = (M = F.strictNumbers) !== null && M !== void 0 ? M : Oe) !== null && L !== void 0 ? L : !0,
|
|
@@ -5837,41 +5862,41 @@ uri$1.default = uri;
|
|
|
5837
5862
|
class I {
|
|
5838
5863
|
constructor(v = {}) {
|
|
5839
5864
|
this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
|
|
5840
|
-
const { es5: j, lines:
|
|
5841
|
-
this.scope = new c.ValueScope({ scope: {}, prefixes: k, es5: j, lines:
|
|
5865
|
+
const { es5: j, lines: E } = this.opts.code;
|
|
5866
|
+
this.scope = new c.ValueScope({ scope: {}, prefixes: k, es5: j, lines: E }), this.logger = K(v.logger);
|
|
5842
5867
|
const a = v.validateFormats;
|
|
5843
|
-
v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, $, v, "NOT SUPPORTED"), D.call(this,
|
|
5868
|
+
v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, $, v, "NOT SUPPORTED"), D.call(this, g, v, "DEPRECATED", "warn"), this._metaOpts = z.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && x.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), O.call(this), v.validateFormats = a;
|
|
5844
5869
|
}
|
|
5845
5870
|
_addVocabularies() {
|
|
5846
5871
|
this.addKeyword("$async");
|
|
5847
5872
|
}
|
|
5848
5873
|
_addDefaultMetaSchema() {
|
|
5849
|
-
const { $data: v, meta: j, schemaId:
|
|
5850
|
-
let a =
|
|
5851
|
-
|
|
5874
|
+
const { $data: v, meta: j, schemaId: E } = this.opts;
|
|
5875
|
+
let a = _;
|
|
5876
|
+
E === "id" && (a = { ..._ }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[E], !1);
|
|
5852
5877
|
}
|
|
5853
5878
|
defaultMeta() {
|
|
5854
5879
|
const { meta: v, schemaId: j } = this.opts;
|
|
5855
5880
|
return this.opts.defaultMeta = typeof v == "object" ? v[j] || v : void 0;
|
|
5856
5881
|
}
|
|
5857
5882
|
validate(v, j) {
|
|
5858
|
-
let
|
|
5883
|
+
let E;
|
|
5859
5884
|
if (typeof v == "string") {
|
|
5860
|
-
if (
|
|
5885
|
+
if (E = this.getSchema(v), !E)
|
|
5861
5886
|
throw new Error(`no schema with key or ref "${v}"`);
|
|
5862
5887
|
} else
|
|
5863
|
-
|
|
5864
|
-
const a =
|
|
5865
|
-
return "$async" in
|
|
5888
|
+
E = this.compile(v);
|
|
5889
|
+
const a = E(j);
|
|
5890
|
+
return "$async" in E || (this.errors = E.errors), a;
|
|
5866
5891
|
}
|
|
5867
5892
|
compile(v, j) {
|
|
5868
|
-
const
|
|
5869
|
-
return
|
|
5893
|
+
const E = this._addSchema(v, j);
|
|
5894
|
+
return E.validate || this._compileSchemaEnv(E);
|
|
5870
5895
|
}
|
|
5871
5896
|
compileAsync(v, j) {
|
|
5872
5897
|
if (typeof this.opts.loadSchema != "function")
|
|
5873
5898
|
throw new Error("options.loadSchema should be a function");
|
|
5874
|
-
const { loadSchema:
|
|
5899
|
+
const { loadSchema: E } = this.opts;
|
|
5875
5900
|
return a.call(this, v, j);
|
|
5876
5901
|
async function a(G, ne) {
|
|
5877
5902
|
await h.call(this, G.$schema);
|
|
@@ -5903,17 +5928,17 @@ uri$1.default = uri;
|
|
|
5903
5928
|
if (ne)
|
|
5904
5929
|
return ne;
|
|
5905
5930
|
try {
|
|
5906
|
-
return await (this._loading[G] =
|
|
5931
|
+
return await (this._loading[G] = E(G));
|
|
5907
5932
|
} finally {
|
|
5908
5933
|
delete this._loading[G];
|
|
5909
5934
|
}
|
|
5910
5935
|
}
|
|
5911
5936
|
}
|
|
5912
5937
|
// Adds schema to the instance
|
|
5913
|
-
addSchema(v, j,
|
|
5938
|
+
addSchema(v, j, E, a = this.opts.validateSchema) {
|
|
5914
5939
|
if (Array.isArray(v)) {
|
|
5915
5940
|
for (const N of v)
|
|
5916
|
-
this.addSchema(N, void 0,
|
|
5941
|
+
this.addSchema(N, void 0, E, a);
|
|
5917
5942
|
return this;
|
|
5918
5943
|
}
|
|
5919
5944
|
let h;
|
|
@@ -5922,23 +5947,23 @@ uri$1.default = uri;
|
|
|
5922
5947
|
if (h = v[N], h !== void 0 && typeof h != "string")
|
|
5923
5948
|
throw new Error(`schema ${N} must be string`);
|
|
5924
5949
|
}
|
|
5925
|
-
return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v,
|
|
5950
|
+
return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, E, j, a, !0), this;
|
|
5926
5951
|
}
|
|
5927
5952
|
// Add schema that will be used to validate other schemas
|
|
5928
5953
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
5929
|
-
addMetaSchema(v, j,
|
|
5930
|
-
return this.addSchema(v, j, !0,
|
|
5954
|
+
addMetaSchema(v, j, E = this.opts.validateSchema) {
|
|
5955
|
+
return this.addSchema(v, j, !0, E), this;
|
|
5931
5956
|
}
|
|
5932
5957
|
// Validate schema against its meta-schema
|
|
5933
5958
|
validateSchema(v, j) {
|
|
5934
5959
|
if (typeof v == "boolean")
|
|
5935
5960
|
return !0;
|
|
5936
|
-
let
|
|
5937
|
-
if (
|
|
5961
|
+
let E;
|
|
5962
|
+
if (E = v.$schema, E !== void 0 && typeof E != "string")
|
|
5938
5963
|
throw new Error("$schema must be a string");
|
|
5939
|
-
if (
|
|
5964
|
+
if (E = E || this.opts.defaultMeta || this.defaultMeta(), !E)
|
|
5940
5965
|
return this.logger.warn("meta-schema not available"), this.errors = null, !0;
|
|
5941
|
-
const a = this.validate(
|
|
5966
|
+
const a = this.validate(E, v);
|
|
5942
5967
|
if (!a && j) {
|
|
5943
5968
|
const h = "schema is invalid: " + this.errorsText();
|
|
5944
5969
|
if (this.opts.validateSchema === "log")
|
|
@@ -5955,7 +5980,7 @@ uri$1.default = uri;
|
|
|
5955
5980
|
for (; typeof (j = w.call(this, v)) == "string"; )
|
|
5956
5981
|
v = j;
|
|
5957
5982
|
if (j === void 0) {
|
|
5958
|
-
const { schemaId:
|
|
5983
|
+
const { schemaId: E } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: E });
|
|
5959
5984
|
if (j = o.resolveSchema.call(this, a, v), !j)
|
|
5960
5985
|
return;
|
|
5961
5986
|
this.refs[v] = j;
|
|
@@ -5979,8 +6004,8 @@ uri$1.default = uri;
|
|
|
5979
6004
|
case "object": {
|
|
5980
6005
|
const j = v;
|
|
5981
6006
|
this._cache.delete(j);
|
|
5982
|
-
let
|
|
5983
|
-
return
|
|
6007
|
+
let E = v[this.opts.schemaId];
|
|
6008
|
+
return E && (E = (0, d.normalizeId)(E), delete this.schemas[E], delete this.refs[E]), this;
|
|
5984
6009
|
}
|
|
5985
6010
|
default:
|
|
5986
6011
|
throw new Error("ajv.removeSchema: invalid parameter");
|
|
@@ -5993,23 +6018,23 @@ uri$1.default = uri;
|
|
|
5993
6018
|
return this;
|
|
5994
6019
|
}
|
|
5995
6020
|
addKeyword(v, j) {
|
|
5996
|
-
let
|
|
6021
|
+
let E;
|
|
5997
6022
|
if (typeof v == "string")
|
|
5998
|
-
|
|
6023
|
+
E = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = E);
|
|
5999
6024
|
else if (typeof v == "object" && j === void 0) {
|
|
6000
|
-
if (j = v,
|
|
6025
|
+
if (j = v, E = j.keyword, Array.isArray(E) && !E.length)
|
|
6001
6026
|
throw new Error("addKeywords: keyword must be string or non-empty array");
|
|
6002
6027
|
} else
|
|
6003
6028
|
throw new Error("invalid addKeywords parameters");
|
|
6004
|
-
if (oe.call(this,
|
|
6005
|
-
return (0, p.eachItem)(
|
|
6029
|
+
if (oe.call(this, E, j), !j)
|
|
6030
|
+
return (0, p.eachItem)(E, (h) => ke.call(this, h)), this;
|
|
6006
6031
|
Le.call(this, j);
|
|
6007
6032
|
const a = {
|
|
6008
6033
|
...j,
|
|
6009
6034
|
type: (0, u.getJSONTypes)(j.type),
|
|
6010
6035
|
schemaType: (0, u.getJSONTypes)(j.schemaType)
|
|
6011
6036
|
};
|
|
6012
|
-
return (0, p.eachItem)(
|
|
6037
|
+
return (0, p.eachItem)(E, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((N) => ke.call(this, h, a, N))), this;
|
|
6013
6038
|
}
|
|
6014
6039
|
getKeyword(v) {
|
|
6015
6040
|
const j = this.RULES.all[v];
|
|
@@ -6019,9 +6044,9 @@ uri$1.default = uri;
|
|
|
6019
6044
|
removeKeyword(v) {
|
|
6020
6045
|
const { RULES: j } = this;
|
|
6021
6046
|
delete j.keywords[v], delete j.all[v];
|
|
6022
|
-
for (const
|
|
6023
|
-
const a =
|
|
6024
|
-
a >= 0 &&
|
|
6047
|
+
for (const E of j.rules) {
|
|
6048
|
+
const a = E.rules.findIndex((h) => h.keyword === v);
|
|
6049
|
+
a >= 0 && E.rules.splice(a, 1);
|
|
6025
6050
|
}
|
|
6026
6051
|
return this;
|
|
6027
6052
|
}
|
|
@@ -6029,19 +6054,19 @@ uri$1.default = uri;
|
|
|
6029
6054
|
addFormat(v, j) {
|
|
6030
6055
|
return typeof j == "string" && (j = new RegExp(j)), this.formats[v] = j, this;
|
|
6031
6056
|
}
|
|
6032
|
-
errorsText(v = this.errors, { separator: j = ", ", dataVar:
|
|
6033
|
-
return !v || v.length === 0 ? "No errors" : v.map((a) => `${
|
|
6057
|
+
errorsText(v = this.errors, { separator: j = ", ", dataVar: E = "data" } = {}) {
|
|
6058
|
+
return !v || v.length === 0 ? "No errors" : v.map((a) => `${E}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
|
|
6034
6059
|
}
|
|
6035
6060
|
$dataMetaSchema(v, j) {
|
|
6036
|
-
const
|
|
6061
|
+
const E = this.RULES.all;
|
|
6037
6062
|
v = JSON.parse(JSON.stringify(v));
|
|
6038
6063
|
for (const a of j) {
|
|
6039
6064
|
const h = a.split("/").slice(1);
|
|
6040
6065
|
let N = v;
|
|
6041
6066
|
for (const M of h)
|
|
6042
6067
|
N = N[M];
|
|
6043
|
-
for (const M in
|
|
6044
|
-
const L =
|
|
6068
|
+
for (const M in E) {
|
|
6069
|
+
const L = E[M];
|
|
6045
6070
|
if (typeof L != "object")
|
|
6046
6071
|
continue;
|
|
6047
6072
|
const { $data: W } = L.definition, G = N[M];
|
|
@@ -6051,12 +6076,12 @@ uri$1.default = uri;
|
|
|
6051
6076
|
return v;
|
|
6052
6077
|
}
|
|
6053
6078
|
_removeAllSchemas(v, j) {
|
|
6054
|
-
for (const
|
|
6055
|
-
const a = v[
|
|
6056
|
-
(!j || j.test(
|
|
6079
|
+
for (const E in v) {
|
|
6080
|
+
const a = v[E];
|
|
6081
|
+
(!j || j.test(E)) && (typeof a == "string" ? delete v[E] : a && !a.meta && (this._cache.delete(a.schema), delete v[E]));
|
|
6057
6082
|
}
|
|
6058
6083
|
}
|
|
6059
|
-
_addSchema(v, j,
|
|
6084
|
+
_addSchema(v, j, E, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
|
|
6060
6085
|
let N;
|
|
6061
6086
|
const { schemaId: M } = this.opts;
|
|
6062
6087
|
if (typeof v == "object")
|
|
@@ -6070,9 +6095,9 @@ uri$1.default = uri;
|
|
|
6070
6095
|
let L = this._cache.get(v);
|
|
6071
6096
|
if (L !== void 0)
|
|
6072
6097
|
return L;
|
|
6073
|
-
|
|
6074
|
-
const W = d.getSchemaRefs.call(this, v,
|
|
6075
|
-
return L = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId:
|
|
6098
|
+
E = (0, d.normalizeId)(N || E);
|
|
6099
|
+
const W = d.getSchemaRefs.call(this, v, E);
|
|
6100
|
+
return L = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: E, localRefs: W }), this._cache.set(L.schema, L), h && !E.startsWith("#") && (E && this._checkUnique(E), this.refs[E] = L), a && this.validateSchema(v, !0), L;
|
|
6076
6101
|
}
|
|
6077
6102
|
_checkUnique(v) {
|
|
6078
6103
|
if (this.schemas[v] || this.refs[v])
|
|
@@ -6094,16 +6119,16 @@ uri$1.default = uri;
|
|
|
6094
6119
|
}
|
|
6095
6120
|
}
|
|
6096
6121
|
e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
|
|
6097
|
-
function D(F, v, j,
|
|
6122
|
+
function D(F, v, j, E = "error") {
|
|
6098
6123
|
for (const a in F) {
|
|
6099
6124
|
const h = a;
|
|
6100
|
-
h in v && this.logger[
|
|
6125
|
+
h in v && this.logger[E](`${j}: option ${a}. ${F[h]}`);
|
|
6101
6126
|
}
|
|
6102
6127
|
}
|
|
6103
6128
|
function w(F) {
|
|
6104
6129
|
return F = (0, d.normalizeId)(F), this.schemas[F] || this.refs[F];
|
|
6105
6130
|
}
|
|
6106
|
-
function
|
|
6131
|
+
function O() {
|
|
6107
6132
|
const F = this.opts.schemas;
|
|
6108
6133
|
if (F)
|
|
6109
6134
|
if (Array.isArray(F))
|
|
@@ -6131,7 +6156,7 @@ uri$1.default = uri;
|
|
|
6131
6156
|
}
|
|
6132
6157
|
function z() {
|
|
6133
6158
|
const F = { ...this.opts };
|
|
6134
|
-
for (const v of
|
|
6159
|
+
for (const v of S)
|
|
6135
6160
|
delete F[v];
|
|
6136
6161
|
return F;
|
|
6137
6162
|
}
|
|
@@ -6151,16 +6176,16 @@ uri$1.default = uri;
|
|
|
6151
6176
|
const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
6152
6177
|
function oe(F, v) {
|
|
6153
6178
|
const { RULES: j } = this;
|
|
6154
|
-
if ((0, p.eachItem)(F, (
|
|
6155
|
-
if (j.keywords[
|
|
6156
|
-
throw new Error(`Keyword ${
|
|
6157
|
-
if (!ue.test(
|
|
6158
|
-
throw new Error(`Keyword ${
|
|
6179
|
+
if ((0, p.eachItem)(F, (E) => {
|
|
6180
|
+
if (j.keywords[E])
|
|
6181
|
+
throw new Error(`Keyword ${E} is already defined`);
|
|
6182
|
+
if (!ue.test(E))
|
|
6183
|
+
throw new Error(`Keyword ${E} has invalid name`);
|
|
6159
6184
|
}), !!v && v.$data && !("code" in v || "validate" in v))
|
|
6160
6185
|
throw new Error('$data keyword must have "code" or "validate" function');
|
|
6161
6186
|
}
|
|
6162
6187
|
function ke(F, v, j) {
|
|
6163
|
-
var
|
|
6188
|
+
var E;
|
|
6164
6189
|
const a = v == null ? void 0 : v.post;
|
|
6165
6190
|
if (j && a)
|
|
6166
6191
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
@@ -6176,11 +6201,11 @@ uri$1.default = uri;
|
|
|
6176
6201
|
schemaType: (0, u.getJSONTypes)(v.schemaType)
|
|
6177
6202
|
}
|
|
6178
6203
|
};
|
|
6179
|
-
v.before ? Ce.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (
|
|
6204
|
+
v.before ? Ce.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (E = v.implements) === null || E === void 0 || E.forEach((L) => this.addKeyword(L));
|
|
6180
6205
|
}
|
|
6181
6206
|
function Ce(F, v, j) {
|
|
6182
|
-
const
|
|
6183
|
-
|
|
6207
|
+
const E = F.rules.findIndex((a) => a.keyword === j);
|
|
6208
|
+
E >= 0 ? F.rules.splice(E, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
|
|
6184
6209
|
}
|
|
6185
6210
|
function Le(F) {
|
|
6186
6211
|
let { metaSchema: v } = F;
|
|
@@ -6211,32 +6236,32 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
|
|
|
6211
6236
|
code(e) {
|
|
6212
6237
|
const { gen: t, schema: r, it: n } = e, { baseId: s, schemaEnv: i, validateName: o, opts: c, self: d } = n, { root: u } = i;
|
|
6213
6238
|
if ((r === "#" || r === "#/") && s === u.baseId)
|
|
6214
|
-
return
|
|
6239
|
+
return _();
|
|
6215
6240
|
const p = compile_1$1.resolveRef.call(d, u, s, r);
|
|
6216
6241
|
if (p === void 0)
|
|
6217
6242
|
throw new ref_error_1.default(n.opts.uriResolver, s, r);
|
|
6218
6243
|
if (p instanceof compile_1$1.SchemaEnv)
|
|
6219
6244
|
return T(p);
|
|
6220
|
-
return
|
|
6221
|
-
function
|
|
6245
|
+
return C(p);
|
|
6246
|
+
function _() {
|
|
6222
6247
|
if (i === u)
|
|
6223
6248
|
return callRef(e, o, i, i.$async);
|
|
6224
|
-
const
|
|
6225
|
-
return callRef(e, (0, codegen_1$l._)`${
|
|
6249
|
+
const S = t.scopeValue("root", { ref: u });
|
|
6250
|
+
return callRef(e, (0, codegen_1$l._)`${S}.validate`, u, u.$async);
|
|
6226
6251
|
}
|
|
6227
|
-
function T(
|
|
6228
|
-
const k = getValidate(e,
|
|
6229
|
-
callRef(e, k,
|
|
6252
|
+
function T(S) {
|
|
6253
|
+
const k = getValidate(e, S);
|
|
6254
|
+
callRef(e, k, S, S.$async);
|
|
6230
6255
|
}
|
|
6231
|
-
function
|
|
6232
|
-
const k = t.scopeValue("schema", c.code.source === !0 ? { ref:
|
|
6233
|
-
schema:
|
|
6256
|
+
function C(S) {
|
|
6257
|
+
const k = t.scopeValue("schema", c.code.source === !0 ? { ref: S, code: (0, codegen_1$l.stringify)(S) } : { ref: S }), $ = t.name("valid"), g = e.subschema({
|
|
6258
|
+
schema: S,
|
|
6234
6259
|
dataTypes: [],
|
|
6235
6260
|
schemaPath: codegen_1$l.nil,
|
|
6236
6261
|
topSchemaRef: k,
|
|
6237
6262
|
errSchemaPath: r
|
|
6238
6263
|
}, $);
|
|
6239
|
-
e.mergeEvaluated(
|
|
6264
|
+
e.mergeEvaluated(g), e.ok($);
|
|
6240
6265
|
}
|
|
6241
6266
|
}
|
|
6242
6267
|
};
|
|
@@ -6247,25 +6272,25 @@ function getValidate(e, t) {
|
|
|
6247
6272
|
ref.getValidate = getValidate;
|
|
6248
6273
|
function callRef(e, t, r, n) {
|
|
6249
6274
|
const { gen: s, it: i } = e, { allErrors: o, schemaEnv: c, opts: d } = i, u = d.passContext ? names_1$1.default.this : codegen_1$l.nil;
|
|
6250
|
-
n ? p() :
|
|
6275
|
+
n ? p() : _();
|
|
6251
6276
|
function p() {
|
|
6252
6277
|
if (!c.$async)
|
|
6253
6278
|
throw new Error("async schema referenced by sync schema");
|
|
6254
|
-
const
|
|
6279
|
+
const S = s.let("valid");
|
|
6255
6280
|
s.try(() => {
|
|
6256
|
-
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`),
|
|
6281
|
+
s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), C(t), o || s.assign(S, !0);
|
|
6257
6282
|
}, (k) => {
|
|
6258
|
-
s.if((0, codegen_1$l._)`!(${k} instanceof ${i.ValidationError})`, () => s.throw(k)), T(k), o || s.assign(
|
|
6259
|
-
}), e.ok(
|
|
6283
|
+
s.if((0, codegen_1$l._)`!(${k} instanceof ${i.ValidationError})`, () => s.throw(k)), T(k), o || s.assign(S, !1);
|
|
6284
|
+
}), e.ok(S);
|
|
6260
6285
|
}
|
|
6261
|
-
function
|
|
6262
|
-
e.result((0, code_1$8.callValidateCode)(e, t, u), () =>
|
|
6286
|
+
function _() {
|
|
6287
|
+
e.result((0, code_1$8.callValidateCode)(e, t, u), () => C(t), () => T(t));
|
|
6263
6288
|
}
|
|
6264
|
-
function T(
|
|
6265
|
-
const k = (0, codegen_1$l._)`${
|
|
6289
|
+
function T(S) {
|
|
6290
|
+
const k = (0, codegen_1$l._)`${S}.errors`;
|
|
6266
6291
|
s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${k} : ${names_1$1.default.vErrors}.concat(${k})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
|
|
6267
6292
|
}
|
|
6268
|
-
function
|
|
6293
|
+
function C(S) {
|
|
6269
6294
|
var k;
|
|
6270
6295
|
if (!i.opts.unevaluated)
|
|
6271
6296
|
return;
|
|
@@ -6274,15 +6299,15 @@ function callRef(e, t, r, n) {
|
|
|
6274
6299
|
if ($ && !$.dynamicProps)
|
|
6275
6300
|
$.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, $.props, i.props));
|
|
6276
6301
|
else {
|
|
6277
|
-
const
|
|
6278
|
-
i.props = util_1$j.mergeEvaluated.props(s,
|
|
6302
|
+
const g = s.var("props", (0, codegen_1$l._)`${S}.evaluated.props`);
|
|
6303
|
+
i.props = util_1$j.mergeEvaluated.props(s, g, i.props, codegen_1$l.Name);
|
|
6279
6304
|
}
|
|
6280
6305
|
if (i.items !== !0)
|
|
6281
6306
|
if ($ && !$.dynamicItems)
|
|
6282
6307
|
$.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, $.items, i.items));
|
|
6283
6308
|
else {
|
|
6284
|
-
const
|
|
6285
|
-
i.items = util_1$j.mergeEvaluated.items(s,
|
|
6309
|
+
const g = s.var("items", (0, codegen_1$l._)`${S}.evaluated.items`);
|
|
6310
|
+
i.items = util_1$j.mergeEvaluated.items(s, g, i.items, codegen_1$l.Name);
|
|
6286
6311
|
}
|
|
6287
6312
|
}
|
|
6288
6313
|
}
|
|
@@ -6423,36 +6448,36 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
|
|
|
6423
6448
|
return;
|
|
6424
6449
|
const d = r.length >= c.loopRequired;
|
|
6425
6450
|
if (o.allErrors ? u() : p(), c.strictRequired) {
|
|
6426
|
-
const
|
|
6451
|
+
const C = e.parentSchema.properties, { definedProperties: S } = e.it;
|
|
6427
6452
|
for (const k of r)
|
|
6428
|
-
if ((
|
|
6429
|
-
const $ = o.schemaEnv.baseId + o.errSchemaPath,
|
|
6430
|
-
(0, util_1$h.checkStrictMode)(o,
|
|
6453
|
+
if ((C == null ? void 0 : C[k]) === void 0 && !S.has(k)) {
|
|
6454
|
+
const $ = o.schemaEnv.baseId + o.errSchemaPath, g = `required property "${k}" is not defined at "${$}" (strictRequired)`;
|
|
6455
|
+
(0, util_1$h.checkStrictMode)(o, g, o.opts.strictRequired);
|
|
6431
6456
|
}
|
|
6432
6457
|
}
|
|
6433
6458
|
function u() {
|
|
6434
6459
|
if (d || i)
|
|
6435
|
-
e.block$data(codegen_1$f.nil,
|
|
6460
|
+
e.block$data(codegen_1$f.nil, _);
|
|
6436
6461
|
else
|
|
6437
|
-
for (const
|
|
6438
|
-
(0, code_1$6.checkReportMissingProp)(e,
|
|
6462
|
+
for (const C of r)
|
|
6463
|
+
(0, code_1$6.checkReportMissingProp)(e, C);
|
|
6439
6464
|
}
|
|
6440
6465
|
function p() {
|
|
6441
|
-
const
|
|
6466
|
+
const C = t.let("missing");
|
|
6442
6467
|
if (d || i) {
|
|
6443
|
-
const
|
|
6444
|
-
e.block$data(
|
|
6468
|
+
const S = t.let("valid", !0);
|
|
6469
|
+
e.block$data(S, () => T(C, S)), e.ok(S);
|
|
6445
6470
|
} else
|
|
6446
|
-
t.if((0, code_1$6.checkMissingProp)(e, r,
|
|
6471
|
+
t.if((0, code_1$6.checkMissingProp)(e, r, C)), (0, code_1$6.reportMissingProp)(e, C), t.else();
|
|
6447
6472
|
}
|
|
6448
|
-
function
|
|
6449
|
-
t.forOf("prop", n, (
|
|
6450
|
-
e.setParams({ missingProperty:
|
|
6473
|
+
function _() {
|
|
6474
|
+
t.forOf("prop", n, (C) => {
|
|
6475
|
+
e.setParams({ missingProperty: C }), t.if((0, code_1$6.noPropertyInData)(t, s, C, c.ownProperties), () => e.error());
|
|
6451
6476
|
});
|
|
6452
6477
|
}
|
|
6453
|
-
function T(
|
|
6454
|
-
e.setParams({ missingProperty:
|
|
6455
|
-
t.assign(
|
|
6478
|
+
function T(C, S) {
|
|
6479
|
+
e.setParams({ missingProperty: C }), t.forOf(C, n, () => {
|
|
6480
|
+
t.assign(S, (0, code_1$6.propertyInData)(t, s, C, c.ownProperties)), t.if((0, codegen_1$f.not)(S), () => {
|
|
6456
6481
|
e.error(), t.break();
|
|
6457
6482
|
});
|
|
6458
6483
|
}, codegen_1$f.nil);
|
|
@@ -6502,24 +6527,24 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
|
|
|
6502
6527
|
const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
|
|
6503
6528
|
e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
|
|
6504
6529
|
function p() {
|
|
6505
|
-
const
|
|
6506
|
-
e.setParams({ i:
|
|
6530
|
+
const S = t.let("i", (0, codegen_1$d._)`${r}.length`), k = t.let("j");
|
|
6531
|
+
e.setParams({ i: S, j: k }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (_() ? T : C)(S, k));
|
|
6507
6532
|
}
|
|
6508
|
-
function
|
|
6509
|
-
return u.length > 0 && !u.some((
|
|
6533
|
+
function _() {
|
|
6534
|
+
return u.length > 0 && !u.some((S) => S === "object" || S === "array");
|
|
6510
6535
|
}
|
|
6511
|
-
function T(
|
|
6512
|
-
const $ = t.name("item"),
|
|
6513
|
-
t.for((0, codegen_1$d._)`;${
|
|
6514
|
-
t.let($, (0, codegen_1$d._)`${r}[${
|
|
6536
|
+
function T(S, k) {
|
|
6537
|
+
const $ = t.name("item"), g = (0, dataType_1.checkDataTypes)(u, $, c.opts.strictNumbers, dataType_1.DataType.Wrong), y = t.const("indices", (0, codegen_1$d._)`{}`);
|
|
6538
|
+
t.for((0, codegen_1$d._)`;${S}--;`, () => {
|
|
6539
|
+
t.let($, (0, codegen_1$d._)`${r}[${S}]`), t.if(g, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${$} == "string"`, (0, codegen_1$d._)`${$} += "_"`), t.if((0, codegen_1$d._)`typeof ${y}[${$}] == "number"`, () => {
|
|
6515
6540
|
t.assign(k, (0, codegen_1$d._)`${y}[${$}]`), e.error(), t.assign(d, !1).break();
|
|
6516
|
-
}).code((0, codegen_1$d._)`${y}[${$}] = ${
|
|
6541
|
+
}).code((0, codegen_1$d._)`${y}[${$}] = ${S}`);
|
|
6517
6542
|
});
|
|
6518
6543
|
}
|
|
6519
|
-
function
|
|
6520
|
-
const $ = (0, util_1$g.useFunc)(t, equal_1$2.default),
|
|
6521
|
-
t.label(
|
|
6522
|
-
e.error(), t.assign(d, !1).break(
|
|
6544
|
+
function C(S, k) {
|
|
6545
|
+
const $ = (0, util_1$g.useFunc)(t, equal_1$2.default), g = t.name("outer");
|
|
6546
|
+
t.label(g).for((0, codegen_1$d._)`;${S}--;`, () => t.for((0, codegen_1$d._)`${k} = ${S}; ${k}--;`, () => t.if((0, codegen_1$d._)`${$}(${r}[${S}], ${r}[${k}])`, () => {
|
|
6547
|
+
e.error(), t.assign(d, !1).break(g);
|
|
6523
6548
|
})));
|
|
6524
6549
|
}
|
|
6525
6550
|
}
|
|
@@ -6559,20 +6584,20 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
|
|
|
6559
6584
|
const u = () => d ?? (d = (0, util_1$e.useFunc)(t, equal_1.default));
|
|
6560
6585
|
let p;
|
|
6561
6586
|
if (c || n)
|
|
6562
|
-
p = t.let("valid"), e.block$data(p,
|
|
6587
|
+
p = t.let("valid"), e.block$data(p, _);
|
|
6563
6588
|
else {
|
|
6564
6589
|
if (!Array.isArray(s))
|
|
6565
6590
|
throw new Error("ajv implementation error");
|
|
6566
|
-
const
|
|
6567
|
-
p = (0, codegen_1$b.or)(...s.map((
|
|
6591
|
+
const C = t.const("vSchema", i);
|
|
6592
|
+
p = (0, codegen_1$b.or)(...s.map((S, k) => T(C, k)));
|
|
6568
6593
|
}
|
|
6569
6594
|
e.pass(p);
|
|
6570
|
-
function
|
|
6571
|
-
t.assign(p, !1), t.forOf("v", i, (
|
|
6595
|
+
function _() {
|
|
6596
|
+
t.assign(p, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(p, !0).break()));
|
|
6572
6597
|
}
|
|
6573
|
-
function T(
|
|
6574
|
-
const k = s[
|
|
6575
|
-
return typeof k == "object" && k !== null ? (0, codegen_1$b._)`${u()}(${r}, ${
|
|
6598
|
+
function T(C, S) {
|
|
6599
|
+
const k = s[S];
|
|
6600
|
+
return typeof k == "object" && k !== null ? (0, codegen_1$b._)`${u()}(${r}, ${C}[${S}])` : (0, codegen_1$b._)`${r} === ${k}`;
|
|
6576
6601
|
}
|
|
6577
6602
|
}
|
|
6578
6603
|
};
|
|
@@ -6656,17 +6681,17 @@ function validateTuple(e, t, r = e.schema) {
|
|
|
6656
6681
|
const { gen: n, parentSchema: s, data: i, keyword: o, it: c } = e;
|
|
6657
6682
|
p(s), c.opts.unevaluated && r.length && c.items !== !0 && (c.items = util_1$c.mergeEvaluated.items(n, r.length, c.items));
|
|
6658
6683
|
const d = n.name("valid"), u = n.const("len", (0, codegen_1$9._)`${i}.length`);
|
|
6659
|
-
r.forEach((
|
|
6660
|
-
(0, util_1$c.alwaysValidSchema)(c,
|
|
6684
|
+
r.forEach((_, T) => {
|
|
6685
|
+
(0, util_1$c.alwaysValidSchema)(c, _) || (n.if((0, codegen_1$9._)`${u} > ${T}`, () => e.subschema({
|
|
6661
6686
|
keyword: o,
|
|
6662
6687
|
schemaProp: T,
|
|
6663
6688
|
dataProp: T
|
|
6664
6689
|
}, d)), e.ok(d));
|
|
6665
6690
|
});
|
|
6666
|
-
function p(
|
|
6667
|
-
const { opts: T, errSchemaPath:
|
|
6691
|
+
function p(_) {
|
|
6692
|
+
const { opts: T, errSchemaPath: C } = c, S = r.length, k = S === _.minItems && (S === _.maxItems || _[t] === !1);
|
|
6668
6693
|
if (T.strictTuples && !k) {
|
|
6669
|
-
const $ = `"${o}" is ${
|
|
6694
|
+
const $ = `"${o}" is ${S}-tuple, but minItems or maxItems/${t} are not specified or different at path "${C}"`;
|
|
6670
6695
|
(0, util_1$c.checkStrictMode)(c, $, T.strictTuples);
|
|
6671
6696
|
}
|
|
6672
6697
|
}
|
|
@@ -6731,24 +6756,24 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
|
|
|
6731
6756
|
return;
|
|
6732
6757
|
}
|
|
6733
6758
|
i.items = !0;
|
|
6734
|
-
const
|
|
6735
|
-
c === void 0 && o === 1 ?
|
|
6759
|
+
const _ = t.name("valid");
|
|
6760
|
+
c === void 0 && o === 1 ? C(_, () => t.if(_, () => t.break())) : o === 0 ? (t.let(_, !0), c !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, T)) : (t.let(_, !1), T()), e.result(_, () => e.reset());
|
|
6736
6761
|
function T() {
|
|
6737
6762
|
const k = t.name("_valid"), $ = t.let("count", 0);
|
|
6738
|
-
|
|
6763
|
+
C(k, () => t.if(k, () => S($)));
|
|
6739
6764
|
}
|
|
6740
|
-
function
|
|
6741
|
-
t.forRange("i", 0, p, (
|
|
6765
|
+
function C(k, $) {
|
|
6766
|
+
t.forRange("i", 0, p, (g) => {
|
|
6742
6767
|
e.subschema({
|
|
6743
6768
|
keyword: "contains",
|
|
6744
|
-
dataProp:
|
|
6769
|
+
dataProp: g,
|
|
6745
6770
|
dataPropType: util_1$a.Type.Num,
|
|
6746
6771
|
compositeRule: !0
|
|
6747
6772
|
}, k), $();
|
|
6748
6773
|
});
|
|
6749
6774
|
}
|
|
6750
|
-
function
|
|
6751
|
-
t.code((0, codegen_1$7._)`${k}++`), c === void 0 ? t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(
|
|
6775
|
+
function S(k) {
|
|
6776
|
+
t.code((0, codegen_1$7._)`${k}++`), c === void 0 ? t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(_, !0).break()) : (t.if((0, codegen_1$7._)`${k} > ${c}`, () => t.assign(_, !1).break()), o === 1 ? t.assign(_, !0) : t.if((0, codegen_1$7._)`${k} >= ${o}`, () => t.assign(_, !0)));
|
|
6752
6777
|
}
|
|
6753
6778
|
}
|
|
6754
6779
|
};
|
|
@@ -6759,11 +6784,11 @@ var dependencies = {};
|
|
|
6759
6784
|
const t = codegen, r = util, n = code;
|
|
6760
6785
|
e.error = {
|
|
6761
6786
|
message: ({ params: { property: d, depsCount: u, deps: p } }) => {
|
|
6762
|
-
const
|
|
6763
|
-
return (0, t.str)`must have ${
|
|
6787
|
+
const _ = u === 1 ? "property" : "properties";
|
|
6788
|
+
return (0, t.str)`must have ${_} ${p} when property ${d} is present`;
|
|
6764
6789
|
},
|
|
6765
|
-
params: ({ params: { property: d, depsCount: u, deps: p, missingProperty:
|
|
6766
|
-
missingProperty: ${
|
|
6790
|
+
params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: _ } }) => (0, t._)`{property: ${d},
|
|
6791
|
+
missingProperty: ${_},
|
|
6767
6792
|
depsCount: ${u},
|
|
6768
6793
|
deps: ${p}}`
|
|
6769
6794
|
// TODO change to reference
|
|
@@ -6780,47 +6805,47 @@ var dependencies = {};
|
|
|
6780
6805
|
};
|
|
6781
6806
|
function i({ schema: d }) {
|
|
6782
6807
|
const u = {}, p = {};
|
|
6783
|
-
for (const
|
|
6784
|
-
if (
|
|
6808
|
+
for (const _ in d) {
|
|
6809
|
+
if (_ === "__proto__")
|
|
6785
6810
|
continue;
|
|
6786
|
-
const T = Array.isArray(d[
|
|
6787
|
-
T[
|
|
6811
|
+
const T = Array.isArray(d[_]) ? u : p;
|
|
6812
|
+
T[_] = d[_];
|
|
6788
6813
|
}
|
|
6789
6814
|
return [u, p];
|
|
6790
6815
|
}
|
|
6791
6816
|
function o(d, u = d.schema) {
|
|
6792
|
-
const { gen: p, data:
|
|
6817
|
+
const { gen: p, data: _, it: T } = d;
|
|
6793
6818
|
if (Object.keys(u).length === 0)
|
|
6794
6819
|
return;
|
|
6795
|
-
const
|
|
6796
|
-
for (const
|
|
6797
|
-
const k = u[
|
|
6820
|
+
const C = p.let("missing");
|
|
6821
|
+
for (const S in u) {
|
|
6822
|
+
const k = u[S];
|
|
6798
6823
|
if (k.length === 0)
|
|
6799
6824
|
continue;
|
|
6800
|
-
const $ = (0, n.propertyInData)(p,
|
|
6825
|
+
const $ = (0, n.propertyInData)(p, _, S, T.opts.ownProperties);
|
|
6801
6826
|
d.setParams({
|
|
6802
|
-
property:
|
|
6827
|
+
property: S,
|
|
6803
6828
|
depsCount: k.length,
|
|
6804
6829
|
deps: k.join(", ")
|
|
6805
6830
|
}), T.allErrors ? p.if($, () => {
|
|
6806
|
-
for (const
|
|
6807
|
-
(0, n.checkReportMissingProp)(d,
|
|
6808
|
-
}) : (p.if((0, t._)`${$} && (${(0, n.checkMissingProp)(d, k,
|
|
6831
|
+
for (const g of k)
|
|
6832
|
+
(0, n.checkReportMissingProp)(d, g);
|
|
6833
|
+
}) : (p.if((0, t._)`${$} && (${(0, n.checkMissingProp)(d, k, C)})`), (0, n.reportMissingProp)(d, C), p.else());
|
|
6809
6834
|
}
|
|
6810
6835
|
}
|
|
6811
6836
|
e.validatePropertyDeps = o;
|
|
6812
6837
|
function c(d, u = d.schema) {
|
|
6813
|
-
const { gen: p, data:
|
|
6838
|
+
const { gen: p, data: _, keyword: T, it: C } = d, S = p.name("valid");
|
|
6814
6839
|
for (const k in u)
|
|
6815
|
-
(0, r.alwaysValidSchema)(
|
|
6816
|
-
(0, n.propertyInData)(p,
|
|
6840
|
+
(0, r.alwaysValidSchema)(C, u[k]) || (p.if(
|
|
6841
|
+
(0, n.propertyInData)(p, _, k, C.opts.ownProperties),
|
|
6817
6842
|
() => {
|
|
6818
|
-
const $ = d.subschema({ keyword: T, schemaProp: k },
|
|
6819
|
-
d.mergeValidEvaluated($,
|
|
6843
|
+
const $ = d.subschema({ keyword: T, schemaProp: k }, S);
|
|
6844
|
+
d.mergeValidEvaluated($, S);
|
|
6820
6845
|
},
|
|
6821
|
-
() => p.var(
|
|
6846
|
+
() => p.var(S, !0)
|
|
6822
6847
|
// TODO var
|
|
6823
|
-
), d.ok(
|
|
6848
|
+
), d.ok(S));
|
|
6824
6849
|
}
|
|
6825
6850
|
e.validateSchemaDeps = c, e.default = s;
|
|
6826
6851
|
})(dependencies);
|
|
@@ -6873,27 +6898,27 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6873
6898
|
if (o.props = !0, d.removeAdditional !== "all" && (0, util_1$8.alwaysValidSchema)(o, r))
|
|
6874
6899
|
return;
|
|
6875
6900
|
const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
|
|
6876
|
-
|
|
6877
|
-
function
|
|
6901
|
+
_(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
|
|
6902
|
+
function _() {
|
|
6878
6903
|
t.forIn("key", s, ($) => {
|
|
6879
|
-
!u.length && !p.length ?
|
|
6904
|
+
!u.length && !p.length ? S($) : t.if(T($), () => S($));
|
|
6880
6905
|
});
|
|
6881
6906
|
}
|
|
6882
6907
|
function T($) {
|
|
6883
|
-
let
|
|
6908
|
+
let g;
|
|
6884
6909
|
if (u.length > 8) {
|
|
6885
6910
|
const y = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
|
|
6886
|
-
|
|
6911
|
+
g = (0, code_1$3.isOwnProperty)(t, y, $);
|
|
6887
6912
|
} else
|
|
6888
|
-
u.length ?
|
|
6889
|
-
return p.length && (
|
|
6913
|
+
u.length ? g = (0, codegen_1$5.or)(...u.map((y) => (0, codegen_1$5._)`${$} === ${y}`)) : g = codegen_1$5.nil;
|
|
6914
|
+
return p.length && (g = (0, codegen_1$5.or)(g, ...p.map((y) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, y)}.test(${$})`))), (0, codegen_1$5.not)(g);
|
|
6890
6915
|
}
|
|
6891
|
-
function
|
|
6916
|
+
function C($) {
|
|
6892
6917
|
t.code((0, codegen_1$5._)`delete ${s}[${$}]`);
|
|
6893
6918
|
}
|
|
6894
|
-
function
|
|
6919
|
+
function S($) {
|
|
6895
6920
|
if (d.removeAdditional === "all" || d.removeAdditional && r === !1) {
|
|
6896
|
-
|
|
6921
|
+
C($);
|
|
6897
6922
|
return;
|
|
6898
6923
|
}
|
|
6899
6924
|
if (r === !1) {
|
|
@@ -6901,13 +6926,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6901
6926
|
return;
|
|
6902
6927
|
}
|
|
6903
6928
|
if (typeof r == "object" && !(0, util_1$8.alwaysValidSchema)(o, r)) {
|
|
6904
|
-
const
|
|
6905
|
-
d.removeAdditional === "failing" ? (k($,
|
|
6906
|
-
e.reset(),
|
|
6907
|
-
})) : (k($,
|
|
6929
|
+
const g = t.name("valid");
|
|
6930
|
+
d.removeAdditional === "failing" ? (k($, g, !1), t.if((0, codegen_1$5.not)(g), () => {
|
|
6931
|
+
e.reset(), C($);
|
|
6932
|
+
})) : (k($, g), c || t.if((0, codegen_1$5.not)(g), () => t.break()));
|
|
6908
6933
|
}
|
|
6909
6934
|
}
|
|
6910
|
-
function k($,
|
|
6935
|
+
function k($, g, y) {
|
|
6911
6936
|
const P = {
|
|
6912
6937
|
keyword: "additionalProperties",
|
|
6913
6938
|
dataProp: $,
|
|
@@ -6917,7 +6942,7 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
|
|
|
6917
6942
|
compositeRule: !0,
|
|
6918
6943
|
createErrors: !1,
|
|
6919
6944
|
allErrors: !1
|
|
6920
|
-
}), e.subschema(P,
|
|
6945
|
+
}), e.subschema(P, g);
|
|
6921
6946
|
}
|
|
6922
6947
|
}
|
|
6923
6948
|
};
|
|
@@ -6932,23 +6957,23 @@ const validate_1 = validate, code_1$2 = code, util_1$7 = util, additionalPropert
|
|
|
6932
6957
|
const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
|
|
6933
6958
|
i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && additionalProperties_1$1.default.code(new validate_1.KeywordCxt(i, additionalProperties_1$1.default, "additionalProperties"));
|
|
6934
6959
|
const o = (0, code_1$2.allSchemaProperties)(r);
|
|
6935
|
-
for (const
|
|
6936
|
-
i.definedProperties.add(
|
|
6960
|
+
for (const _ of o)
|
|
6961
|
+
i.definedProperties.add(_);
|
|
6937
6962
|
i.opts.unevaluated && o.length && i.props !== !0 && (i.props = util_1$7.mergeEvaluated.props(t, (0, util_1$7.toHash)(o), i.props));
|
|
6938
|
-
const c = o.filter((
|
|
6963
|
+
const c = o.filter((_) => !(0, util_1$7.alwaysValidSchema)(i, r[_]));
|
|
6939
6964
|
if (c.length === 0)
|
|
6940
6965
|
return;
|
|
6941
6966
|
const d = t.name("valid");
|
|
6942
|
-
for (const
|
|
6943
|
-
u(
|
|
6944
|
-
function u(
|
|
6945
|
-
return i.opts.useDefaults && !i.compositeRule && r[
|
|
6967
|
+
for (const _ of c)
|
|
6968
|
+
u(_) ? p(_) : (t.if((0, code_1$2.propertyInData)(t, s, _, i.opts.ownProperties)), p(_), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(_), e.ok(d);
|
|
6969
|
+
function u(_) {
|
|
6970
|
+
return i.opts.useDefaults && !i.compositeRule && r[_].default !== void 0;
|
|
6946
6971
|
}
|
|
6947
|
-
function p(
|
|
6972
|
+
function p(_) {
|
|
6948
6973
|
e.subschema({
|
|
6949
6974
|
keyword: "properties",
|
|
6950
|
-
schemaProp:
|
|
6951
|
-
dataProp:
|
|
6975
|
+
schemaProp: _,
|
|
6976
|
+
dataProp: _
|
|
6952
6977
|
}, d);
|
|
6953
6978
|
}
|
|
6954
6979
|
}
|
|
@@ -6966,26 +6991,26 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
|
|
|
6966
6991
|
return;
|
|
6967
6992
|
const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
|
|
6968
6993
|
i.props !== !0 && !(i.props instanceof codegen_1$4.Name) && (i.props = (0, util_2.evaluatedPropsToName)(t, i.props));
|
|
6969
|
-
const { props:
|
|
6994
|
+
const { props: _ } = i;
|
|
6970
6995
|
T();
|
|
6971
6996
|
function T() {
|
|
6972
6997
|
for (const k of c)
|
|
6973
|
-
u &&
|
|
6998
|
+
u && C(k), i.allErrors ? S(k) : (t.var(p, !0), S(k), t.if(p));
|
|
6974
6999
|
}
|
|
6975
|
-
function
|
|
7000
|
+
function C(k) {
|
|
6976
7001
|
for (const $ in u)
|
|
6977
7002
|
new RegExp(k).test($) && (0, util_1$6.checkStrictMode)(i, `property ${$} matches pattern ${k} (use allowMatchingProperties)`);
|
|
6978
7003
|
}
|
|
6979
|
-
function
|
|
7004
|
+
function S(k) {
|
|
6980
7005
|
t.forIn("key", n, ($) => {
|
|
6981
7006
|
t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, k)}.test(${$})`, () => {
|
|
6982
|
-
const
|
|
6983
|
-
|
|
7007
|
+
const g = d.includes(k);
|
|
7008
|
+
g || e.subschema({
|
|
6984
7009
|
keyword: "patternProperties",
|
|
6985
7010
|
schemaProp: k,
|
|
6986
7011
|
dataProp: $,
|
|
6987
7012
|
dataPropType: util_2.Type.Str
|
|
6988
|
-
}, p), i.opts.unevaluated &&
|
|
7013
|
+
}, p), i.opts.unevaluated && _ !== !0 ? t.assign((0, codegen_1$4._)`${_}[${$}]`, !0) : !g && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
|
|
6989
7014
|
});
|
|
6990
7015
|
});
|
|
6991
7016
|
}
|
|
@@ -7044,14 +7069,14 @@ const codegen_1$3 = codegen, util_1$4 = util, error$3 = {
|
|
|
7044
7069
|
const i = r, o = t.let("valid", !1), c = t.let("passing", null), d = t.name("_valid");
|
|
7045
7070
|
e.setParams({ passing: c }), t.block(u), e.result(o, () => e.reset(), () => e.error(!0));
|
|
7046
7071
|
function u() {
|
|
7047
|
-
i.forEach((p,
|
|
7072
|
+
i.forEach((p, _) => {
|
|
7048
7073
|
let T;
|
|
7049
7074
|
(0, util_1$4.alwaysValidSchema)(s, p) ? t.var(d, !0) : T = e.subschema({
|
|
7050
7075
|
keyword: "oneOf",
|
|
7051
|
-
schemaProp:
|
|
7076
|
+
schemaProp: _,
|
|
7052
7077
|
compositeRule: !0
|
|
7053
|
-
}, d),
|
|
7054
|
-
t.assign(o, !0), t.assign(c,
|
|
7078
|
+
}, d), _ > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(c, (0, codegen_1$3._)`[${c}, ${_}]`).else(), t.if(d, () => {
|
|
7079
|
+
t.assign(o, !0), t.assign(c, _), T && e.mergeEvaluated(T, codegen_1$3.Name);
|
|
7055
7080
|
});
|
|
7056
7081
|
});
|
|
7057
7082
|
}
|
|
@@ -7109,10 +7134,10 @@ const codegen_1$2 = codegen, util_1$2 = util, error$2 = {
|
|
|
7109
7134
|
}, c);
|
|
7110
7135
|
e.mergeEvaluated(p);
|
|
7111
7136
|
}
|
|
7112
|
-
function u(p,
|
|
7137
|
+
function u(p, _) {
|
|
7113
7138
|
return () => {
|
|
7114
7139
|
const T = e.subschema({ keyword: p }, c);
|
|
7115
|
-
t.assign(o, c), e.mergeValidEvaluated(T, o),
|
|
7140
|
+
t.assign(o, c), e.mergeValidEvaluated(T, o), _ ? t.assign(_, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
|
|
7116
7141
|
};
|
|
7117
7142
|
}
|
|
7118
7143
|
}
|
|
@@ -7165,37 +7190,37 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7165
7190
|
$data: !0,
|
|
7166
7191
|
error: error$1,
|
|
7167
7192
|
code(e, t) {
|
|
7168
|
-
const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: c } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self:
|
|
7193
|
+
const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: c } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: _ } = c;
|
|
7169
7194
|
if (!d.validateFormats)
|
|
7170
7195
|
return;
|
|
7171
|
-
s ? T() :
|
|
7196
|
+
s ? T() : C();
|
|
7172
7197
|
function T() {
|
|
7173
|
-
const
|
|
7174
|
-
ref:
|
|
7198
|
+
const S = r.scopeValue("formats", {
|
|
7199
|
+
ref: _.formats,
|
|
7175
7200
|
code: d.code.formats
|
|
7176
|
-
}), k = r.const("fDef", (0, codegen_1$1._)`${
|
|
7177
|
-
r.if((0, codegen_1$1._)`typeof ${k} == "object" && !(${k} instanceof RegExp)`, () => r.assign($, (0, codegen_1$1._)`${k}.type || "string"`).assign(
|
|
7201
|
+
}), k = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), $ = r.let("fType"), g = r.let("format");
|
|
7202
|
+
r.if((0, codegen_1$1._)`typeof ${k} == "object" && !(${k} instanceof RegExp)`, () => r.assign($, (0, codegen_1$1._)`${k}.type || "string"`).assign(g, (0, codegen_1$1._)`${k}.validate`), () => r.assign($, (0, codegen_1$1._)`"string"`).assign(g, k)), e.fail$data((0, codegen_1$1.or)(y(), P()));
|
|
7178
7203
|
function y() {
|
|
7179
|
-
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${
|
|
7204
|
+
return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${g}`;
|
|
7180
7205
|
}
|
|
7181
7206
|
function P() {
|
|
7182
|
-
const I = p.$async ? (0, codegen_1$1._)`(${k}.async ? await ${
|
|
7183
|
-
return (0, codegen_1$1._)`${
|
|
7207
|
+
const I = p.$async ? (0, codegen_1$1._)`(${k}.async ? await ${g}(${n}) : ${g}(${n}))` : (0, codegen_1$1._)`${g}(${n})`, D = (0, codegen_1$1._)`(typeof ${g} == "function" ? ${I} : ${g}.test(${n}))`;
|
|
7208
|
+
return (0, codegen_1$1._)`${g} && ${g} !== true && ${$} === ${t} && !${D}`;
|
|
7184
7209
|
}
|
|
7185
7210
|
}
|
|
7186
|
-
function
|
|
7187
|
-
const
|
|
7188
|
-
if (!
|
|
7211
|
+
function C() {
|
|
7212
|
+
const S = _.formats[i];
|
|
7213
|
+
if (!S) {
|
|
7189
7214
|
y();
|
|
7190
7215
|
return;
|
|
7191
7216
|
}
|
|
7192
|
-
if (
|
|
7217
|
+
if (S === !0)
|
|
7193
7218
|
return;
|
|
7194
|
-
const [k, $,
|
|
7219
|
+
const [k, $, g] = P(S);
|
|
7195
7220
|
k === t && e.pass(I());
|
|
7196
7221
|
function y() {
|
|
7197
7222
|
if (d.strictSchema === !1) {
|
|
7198
|
-
|
|
7223
|
+
_.logger.warn(D());
|
|
7199
7224
|
return;
|
|
7200
7225
|
}
|
|
7201
7226
|
throw new Error(D());
|
|
@@ -7204,16 +7229,16 @@ const codegen_1$1 = codegen, error$1 = {
|
|
|
7204
7229
|
}
|
|
7205
7230
|
}
|
|
7206
7231
|
function P(D) {
|
|
7207
|
-
const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0,
|
|
7208
|
-
return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${
|
|
7232
|
+
const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, O = r.scopeValue("formats", { key: i, ref: D, code: w });
|
|
7233
|
+
return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${O}.validate`] : ["string", D, O];
|
|
7209
7234
|
}
|
|
7210
7235
|
function I() {
|
|
7211
|
-
if (typeof
|
|
7236
|
+
if (typeof S == "object" && !(S instanceof RegExp) && S.async) {
|
|
7212
7237
|
if (!p.$async)
|
|
7213
7238
|
throw new Error("async format in sync schema");
|
|
7214
|
-
return (0, codegen_1$1._)`await ${
|
|
7239
|
+
return (0, codegen_1$1._)`await ${g}(${n})`;
|
|
7215
7240
|
}
|
|
7216
|
-
return typeof $ == "function" ? (0, codegen_1$1._)`${
|
|
7241
|
+
return typeof $ == "function" ? (0, codegen_1$1._)`${g}(${n})` : (0, codegen_1$1._)`${g}.test(${n})`;
|
|
7217
7242
|
}
|
|
7218
7243
|
}
|
|
7219
7244
|
}
|
|
@@ -7278,32 +7303,32 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7278
7303
|
const d = t.let("valid", !1), u = t.const("tag", (0, codegen_1._)`${r}${(0, codegen_1.getProperty)(c)}`);
|
|
7279
7304
|
t.if((0, codegen_1._)`typeof ${u} == "string"`, () => p(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: c })), e.ok(d);
|
|
7280
7305
|
function p() {
|
|
7281
|
-
const
|
|
7306
|
+
const C = T();
|
|
7282
7307
|
t.if(!1);
|
|
7283
|
-
for (const
|
|
7284
|
-
t.elseIf((0, codegen_1._)`${u} === ${
|
|
7308
|
+
for (const S in C)
|
|
7309
|
+
t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d, _(C[S]));
|
|
7285
7310
|
t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: c }), t.endIf();
|
|
7286
7311
|
}
|
|
7287
|
-
function
|
|
7288
|
-
const
|
|
7289
|
-
return e.mergeEvaluated(k, codegen_1.Name),
|
|
7312
|
+
function _(C) {
|
|
7313
|
+
const S = t.name("valid"), k = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
|
|
7314
|
+
return e.mergeEvaluated(k, codegen_1.Name), S;
|
|
7290
7315
|
}
|
|
7291
7316
|
function T() {
|
|
7292
|
-
var
|
|
7293
|
-
const
|
|
7317
|
+
var C;
|
|
7318
|
+
const S = {}, k = g(s);
|
|
7294
7319
|
let $ = !0;
|
|
7295
7320
|
for (let I = 0; I < o.length; I++) {
|
|
7296
7321
|
let D = o[I];
|
|
7297
7322
|
D != null && D.$ref && !(0, util_1.schemaHasRulesButRef)(D, i.self.RULES) && (D = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D == null ? void 0 : D.$ref), D instanceof compile_1.SchemaEnv && (D = D.schema));
|
|
7298
|
-
const w = (
|
|
7323
|
+
const w = (C = D == null ? void 0 : D.properties) === null || C === void 0 ? void 0 : C[c];
|
|
7299
7324
|
if (typeof w != "object")
|
|
7300
7325
|
throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);
|
|
7301
|
-
$ = $ && (k ||
|
|
7326
|
+
$ = $ && (k || g(D)), y(w, I);
|
|
7302
7327
|
}
|
|
7303
7328
|
if (!$)
|
|
7304
7329
|
throw new Error(`discriminator: "${c}" must be required`);
|
|
7305
|
-
return
|
|
7306
|
-
function
|
|
7330
|
+
return S;
|
|
7331
|
+
function g({ required: I }) {
|
|
7307
7332
|
return Array.isArray(I) && I.includes(c);
|
|
7308
7333
|
}
|
|
7309
7334
|
function y(I, D) {
|
|
@@ -7316,9 +7341,9 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
|
|
|
7316
7341
|
throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`);
|
|
7317
7342
|
}
|
|
7318
7343
|
function P(I, D) {
|
|
7319
|
-
if (typeof I != "string" || I in
|
|
7344
|
+
if (typeof I != "string" || I in S)
|
|
7320
7345
|
throw new Error(`discriminator: "${c}" values must be unique strings`);
|
|
7321
|
-
|
|
7346
|
+
S[I] = D;
|
|
7322
7347
|
}
|
|
7323
7348
|
}
|
|
7324
7349
|
}
|
|
@@ -7570,13 +7595,13 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
|
|
|
7570
7595
|
const r = core$2, n = draft7, s = discriminator, i = require$$3, o = ["/properties"], c = "http://json-schema.org/draft-07/schema";
|
|
7571
7596
|
class d extends r.default {
|
|
7572
7597
|
_addVocabularies() {
|
|
7573
|
-
super._addVocabularies(), n.default.forEach((
|
|
7598
|
+
super._addVocabularies(), n.default.forEach((S) => this.addVocabulary(S)), this.opts.discriminator && this.addKeyword(s.default);
|
|
7574
7599
|
}
|
|
7575
7600
|
_addDefaultMetaSchema() {
|
|
7576
7601
|
if (super._addDefaultMetaSchema(), !this.opts.meta)
|
|
7577
7602
|
return;
|
|
7578
|
-
const
|
|
7579
|
-
this.addMetaSchema(
|
|
7603
|
+
const S = this.opts.$data ? this.$dataMetaSchema(i, o) : i;
|
|
7604
|
+
this.addMetaSchema(S, c, !1), this.refs["http://json-schema.org/schema"] = c;
|
|
7580
7605
|
}
|
|
7581
7606
|
defaultMeta() {
|
|
7582
7607
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(c) ? c : void 0);
|
|
@@ -7601,9 +7626,9 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
|
|
|
7601
7626
|
} }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
|
|
7602
7627
|
return p.CodeGen;
|
|
7603
7628
|
} });
|
|
7604
|
-
var
|
|
7629
|
+
var _ = validation_error;
|
|
7605
7630
|
Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
|
|
7606
|
-
return
|
|
7631
|
+
return _.default;
|
|
7607
7632
|
} });
|
|
7608
7633
|
var T = ref_error;
|
|
7609
7634
|
Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
|
|
@@ -8217,36 +8242,6 @@ for existing apps using this option.`
|
|
|
8217
8242
|
"step"
|
|
8218
8243
|
]
|
|
8219
8244
|
},
|
|
8220
|
-
{
|
|
8221
|
-
type: "object",
|
|
8222
|
-
additionalProperties: !1,
|
|
8223
|
-
properties: {
|
|
8224
|
-
progress: {
|
|
8225
|
-
type: "object",
|
|
8226
|
-
properties: {
|
|
8227
|
-
weight: {
|
|
8228
|
-
type: "number"
|
|
8229
|
-
},
|
|
8230
|
-
caption: {
|
|
8231
|
-
type: "string"
|
|
8232
|
-
}
|
|
8233
|
-
},
|
|
8234
|
-
additionalProperties: !1
|
|
8235
|
-
},
|
|
8236
|
-
step: {
|
|
8237
|
-
type: "string",
|
|
8238
|
-
const: "importFile"
|
|
8239
|
-
},
|
|
8240
|
-
file: {
|
|
8241
|
-
$ref: "#/definitions/FileReference",
|
|
8242
|
-
description: "The file to import"
|
|
8243
|
-
}
|
|
8244
|
-
},
|
|
8245
|
-
required: [
|
|
8246
|
-
"file",
|
|
8247
|
-
"step"
|
|
8248
|
-
]
|
|
8249
|
-
},
|
|
8250
8245
|
{
|
|
8251
8246
|
type: "object",
|
|
8252
8247
|
additionalProperties: !1,
|
|
@@ -8297,6 +8292,15 @@ for existing apps using this option.`
|
|
|
8297
8292
|
},
|
|
8298
8293
|
additionalProperties: !1
|
|
8299
8294
|
},
|
|
8295
|
+
ifAlreadyInstalled: {
|
|
8296
|
+
type: "string",
|
|
8297
|
+
enum: [
|
|
8298
|
+
"overwrite",
|
|
8299
|
+
"skip",
|
|
8300
|
+
"error"
|
|
8301
|
+
],
|
|
8302
|
+
description: "What to do if the asset already exists."
|
|
8303
|
+
},
|
|
8300
8304
|
step: {
|
|
8301
8305
|
type: "string",
|
|
8302
8306
|
const: "installPlugin",
|
|
@@ -8332,6 +8336,15 @@ for existing apps using this option.`
|
|
|
8332
8336
|
},
|
|
8333
8337
|
additionalProperties: !1
|
|
8334
8338
|
},
|
|
8339
|
+
ifAlreadyInstalled: {
|
|
8340
|
+
type: "string",
|
|
8341
|
+
enum: [
|
|
8342
|
+
"overwrite",
|
|
8343
|
+
"skip",
|
|
8344
|
+
"error"
|
|
8345
|
+
],
|
|
8346
|
+
description: "What to do if the asset already exists."
|
|
8347
|
+
},
|
|
8335
8348
|
step: {
|
|
8336
8349
|
type: "string",
|
|
8337
8350
|
const: "installTheme",
|
|
@@ -9221,7 +9234,7 @@ function compileBlueprint(e, {
|
|
|
9221
9234
|
onStepCompleted: n = () => {
|
|
9222
9235
|
}
|
|
9223
9236
|
} = {}) {
|
|
9224
|
-
var
|
|
9237
|
+
var _, T, C, S, k, $, g;
|
|
9225
9238
|
e = {
|
|
9226
9239
|
...e,
|
|
9227
9240
|
steps: (e.steps || []).filter(isStepDefinition)
|
|
@@ -9253,7 +9266,7 @@ function compileBlueprint(e, {
|
|
|
9253
9266
|
step: "login",
|
|
9254
9267
|
...e.login === !0 ? { username: "admin", password: "password" } : e.login
|
|
9255
9268
|
}), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.length === 0 && e.phpExtensionBundles.push("kitchen-sink");
|
|
9256
|
-
const s = (
|
|
9269
|
+
const s = (_ = e.steps) == null ? void 0 : _.findIndex(
|
|
9257
9270
|
(y) => typeof y == "object" && (y == null ? void 0 : y.step) === "wp-cli"
|
|
9258
9271
|
);
|
|
9259
9272
|
s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
|
|
@@ -9278,14 +9291,14 @@ function compileBlueprint(e, {
|
|
|
9278
9291
|
},
|
|
9279
9292
|
path: "/tmp/wp-cli.phar"
|
|
9280
9293
|
}));
|
|
9281
|
-
const i = (
|
|
9294
|
+
const i = (C = e.steps) == null ? void 0 : C.findIndex(
|
|
9282
9295
|
(y) => typeof y == "object" && (y == null ? void 0 : y.step) === "importWxr"
|
|
9283
9296
|
);
|
|
9284
9297
|
i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
|
|
9285
9298
|
(y) => y !== "light"
|
|
9286
9299
|
), console.warn(
|
|
9287
9300
|
"The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
|
|
9288
|
-
)), (
|
|
9301
|
+
)), (S = e.steps) == null || S.splice(i, 0, {
|
|
9289
9302
|
step: "installPlugin",
|
|
9290
9303
|
pluginZipFile: {
|
|
9291
9304
|
resource: "url",
|
|
@@ -9328,7 +9341,7 @@ function compileBlueprint(e, {
|
|
|
9328
9341
|
),
|
|
9329
9342
|
features: {
|
|
9330
9343
|
// Disable networking by default
|
|
9331
|
-
networking: ((
|
|
9344
|
+
networking: ((g = e.features) == null ? void 0 : g.networking) ?? !1
|
|
9332
9345
|
},
|
|
9333
9346
|
run: async (y) => {
|
|
9334
9347
|
try {
|
|
@@ -9401,17 +9414,17 @@ function compileStep(e, {
|
|
|
9401
9414
|
const s = r.stage(
|
|
9402
9415
|
(((p = e.progress) == null ? void 0 : p.weight) || 1) / n
|
|
9403
9416
|
), i = {};
|
|
9404
|
-
for (const
|
|
9405
|
-
let T = e[
|
|
9417
|
+
for (const _ of Object.keys(e)) {
|
|
9418
|
+
let T = e[_];
|
|
9406
9419
|
isFileReference(T) && (T = Resource.create(T, {
|
|
9407
9420
|
semaphore: t
|
|
9408
|
-
})), i[
|
|
9421
|
+
})), i[_] = T;
|
|
9409
9422
|
}
|
|
9410
|
-
const o = async (
|
|
9423
|
+
const o = async (_) => {
|
|
9411
9424
|
var T;
|
|
9412
9425
|
try {
|
|
9413
9426
|
return s.fillSlowly(), await keyedStepHandlers[e.step](
|
|
9414
|
-
|
|
9427
|
+
_,
|
|
9415
9428
|
await resolveArguments(i),
|
|
9416
9429
|
{
|
|
9417
9430
|
tracker: s,
|
|
@@ -9422,10 +9435,10 @@ function compileStep(e, {
|
|
|
9422
9435
|
s.finish();
|
|
9423
9436
|
}
|
|
9424
9437
|
}, c = getResources(i), d = getResources(i).filter(
|
|
9425
|
-
(
|
|
9438
|
+
(_) => _.isAsync
|
|
9426
9439
|
), u = 1 / (d.length + 1);
|
|
9427
|
-
for (const
|
|
9428
|
-
|
|
9440
|
+
for (const _ of d)
|
|
9441
|
+
_.progress = s.stage(u);
|
|
9429
9442
|
return { run: o, step: e, resources: c };
|
|
9430
9443
|
}
|
|
9431
9444
|
function getResources(e) {
|
|
@@ -9500,27 +9513,27 @@ function expose(e, t = globalThis, r = ["*"]) {
|
|
|
9500
9513
|
const { id: i, type: o, path: c } = Object.assign({ path: [] }, s.data), d = (s.data.argumentList || []).map(fromWireValue);
|
|
9501
9514
|
let u;
|
|
9502
9515
|
try {
|
|
9503
|
-
const p = c.slice(0, -1).reduce((T,
|
|
9516
|
+
const p = c.slice(0, -1).reduce((T, C) => T[C], e), _ = c.reduce((T, C) => T[C], e);
|
|
9504
9517
|
switch (o) {
|
|
9505
9518
|
case "GET":
|
|
9506
|
-
u =
|
|
9519
|
+
u = _;
|
|
9507
9520
|
break;
|
|
9508
9521
|
case "SET":
|
|
9509
9522
|
p[c.slice(-1)[0]] = fromWireValue(s.data.value), u = !0;
|
|
9510
9523
|
break;
|
|
9511
9524
|
case "APPLY":
|
|
9512
|
-
u =
|
|
9525
|
+
u = _.apply(p, d);
|
|
9513
9526
|
break;
|
|
9514
9527
|
case "CONSTRUCT":
|
|
9515
9528
|
{
|
|
9516
|
-
const T = new
|
|
9529
|
+
const T = new _(...d);
|
|
9517
9530
|
u = proxy(T);
|
|
9518
9531
|
}
|
|
9519
9532
|
break;
|
|
9520
9533
|
case "ENDPOINT":
|
|
9521
9534
|
{
|
|
9522
|
-
const { port1: T, port2:
|
|
9523
|
-
expose(e,
|
|
9535
|
+
const { port1: T, port2: C } = new MessageChannel();
|
|
9536
|
+
expose(e, C), u = transfer(T, [T]);
|
|
9524
9537
|
}
|
|
9525
9538
|
break;
|
|
9526
9539
|
case "RELEASE":
|
|
@@ -9533,14 +9546,14 @@ function expose(e, t = globalThis, r = ["*"]) {
|
|
|
9533
9546
|
u = { value: p, [throwMarker]: 0 };
|
|
9534
9547
|
}
|
|
9535
9548
|
Promise.resolve(u).catch((p) => ({ value: p, [throwMarker]: 0 })).then((p) => {
|
|
9536
|
-
const [
|
|
9537
|
-
t.postMessage(Object.assign(Object.assign({},
|
|
9549
|
+
const [_, T] = toWireValue(p);
|
|
9550
|
+
t.postMessage(Object.assign(Object.assign({}, _), { id: i }), T), o === "RELEASE" && (t.removeEventListener("message", n), closeEndPoint(t), finalizer in e && typeof e[finalizer] == "function" && e[finalizer]());
|
|
9538
9551
|
}).catch((p) => {
|
|
9539
|
-
const [
|
|
9552
|
+
const [_, T] = toWireValue({
|
|
9540
9553
|
value: new TypeError("Unserializable return value"),
|
|
9541
9554
|
[throwMarker]: 0
|
|
9542
9555
|
});
|
|
9543
|
-
t.postMessage(Object.assign(Object.assign({},
|
|
9556
|
+
t.postMessage(Object.assign(Object.assign({}, _), { id: i }), T);
|
|
9544
9557
|
});
|
|
9545
9558
|
}), t.start && t.start();
|
|
9546
9559
|
}
|
|
@@ -9616,7 +9629,7 @@ function createProxy(e, t = [], r = function() {
|
|
|
9616
9629
|
const [u, p] = processArguments(c);
|
|
9617
9630
|
return requestResponseMessage(e, {
|
|
9618
9631
|
type: "APPLY",
|
|
9619
|
-
path: t.map((
|
|
9632
|
+
path: t.map((_) => _.toString()),
|
|
9620
9633
|
argumentList: u
|
|
9621
9634
|
}, p).then(fromWireValue);
|
|
9622
9635
|
},
|
|
@@ -9714,34 +9727,41 @@ async function runWithTimeout(e, t) {
|
|
|
9714
9727
|
}
|
|
9715
9728
|
let isTransferHandlersSetup = !1;
|
|
9716
9729
|
function setupTransferHandlers() {
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9730
|
+
if (isTransferHandlersSetup)
|
|
9731
|
+
return;
|
|
9732
|
+
isTransferHandlersSetup = !0, transferHandlers.set("EVENT", {
|
|
9733
|
+
canHandle: (r) => r instanceof CustomEvent,
|
|
9734
|
+
serialize: (r) => [
|
|
9720
9735
|
{
|
|
9721
|
-
detail:
|
|
9736
|
+
detail: r.detail
|
|
9722
9737
|
},
|
|
9723
9738
|
[]
|
|
9724
9739
|
],
|
|
9725
|
-
deserialize: (
|
|
9740
|
+
deserialize: (r) => r
|
|
9726
9741
|
}), transferHandlers.set("FUNCTION", {
|
|
9727
|
-
canHandle: (
|
|
9728
|
-
serialize(
|
|
9742
|
+
canHandle: (r) => typeof r == "function",
|
|
9743
|
+
serialize(r) {
|
|
9729
9744
|
console.debug("[Comlink][Performance] Proxying a function");
|
|
9730
|
-
const { port1:
|
|
9731
|
-
return expose(
|
|
9745
|
+
const { port1: n, port2: s } = new MessageChannel();
|
|
9746
|
+
return expose(r, n), [s, [s]];
|
|
9732
9747
|
},
|
|
9733
|
-
deserialize(
|
|
9734
|
-
return
|
|
9748
|
+
deserialize(r) {
|
|
9749
|
+
return r.start(), wrap(r);
|
|
9735
9750
|
}
|
|
9736
9751
|
}), transferHandlers.set("PHPResponse", {
|
|
9737
|
-
canHandle: (
|
|
9738
|
-
serialize(
|
|
9739
|
-
return [
|
|
9752
|
+
canHandle: (r) => typeof r == "object" && r !== null && "headers" in r && "bytes" in r && "errors" in r && "exitCode" in r && "httpStatusCode" in r,
|
|
9753
|
+
serialize(r) {
|
|
9754
|
+
return [r.toRawData(), []];
|
|
9740
9755
|
},
|
|
9741
|
-
deserialize(
|
|
9742
|
-
return PHPResponse.fromRawData(
|
|
9756
|
+
deserialize(r) {
|
|
9757
|
+
return PHPResponse.fromRawData(r);
|
|
9743
9758
|
}
|
|
9744
|
-
})
|
|
9759
|
+
});
|
|
9760
|
+
const e = transferHandlers.get("throw"), t = e == null ? void 0 : e.serialize;
|
|
9761
|
+
e.serialize = ({ value: r }) => {
|
|
9762
|
+
const n = t({ value: r });
|
|
9763
|
+
return r.response && (n[0].value.response = r.response), r.source && (n[0].value.source = r.source), n;
|
|
9764
|
+
};
|
|
9745
9765
|
}
|
|
9746
9766
|
function proxyClone(e) {
|
|
9747
9767
|
return new Proxy(e, {
|