@wp-playground/blueprints 0.7.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
- var It = (e, t, r) => {
1
+ var vt = (e, t, r) => {
2
2
  if (!t.has(e))
3
3
  throw TypeError("Cannot " + r);
4
4
  };
5
- var H = (e, t, r) => (It(e, t, "read from private field"), r ? r.call(e) : t.get(e)), K = (e, t, r) => {
5
+ var se = (e, t, r) => (vt(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ee = (e, t, r) => {
6
6
  if (t.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  t instanceof WeakSet ? t.add(e) : t.set(e, r);
9
- }, ie = (e, t, r, n) => (It(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
10
- var ce = (e, t, r) => (It(e, t, "access private method"), r);
9
+ }, fe = (e, t, r, n) => (vt(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
10
+ var ae = (e, t, r) => (vt(e, t, "access private method"), r);
11
11
  const currentJsRuntime = function() {
12
12
  var e;
13
13
  return typeof process < "u" && ((e = process.release) == null ? void 0 : e.name) === "node" ? "NODE" : typeof window < "u" ? "WEB" : (
@@ -200,7 +200,12 @@ function createSpawnHandler(e) {
200
200
  o = t;
201
201
  else
202
202
  throw new Error("Invalid command ", t);
203
- await e(o, i, n), s.emit("spawn", !0);
203
+ try {
204
+ await e(o, i, n);
205
+ } catch (l) {
206
+ s.emit("error", l), typeof l == "object" && l !== null && "message" in l && typeof l.message == "string" && i.stderr(l.message), i.exit(1);
207
+ }
208
+ s.emit("spawn", !0);
204
209
  }), s;
205
210
  };
206
211
  }
@@ -362,10 +367,177 @@ switch_theme( ${phpVar(t)} );
362
367
  `
363
368
  });
364
369
  return await rm(e, { path: n }), o;
370
+ }, logToConsole = (e, ...t) => {
371
+ switch (e.severity) {
372
+ case "Debug":
373
+ console.debug(e.message, ...t);
374
+ break;
375
+ case "Info":
376
+ console.info(e.message, ...t);
377
+ break;
378
+ case "Warn":
379
+ console.warn(e.message, ...t);
380
+ break;
381
+ case "Error":
382
+ console.error(e.message, ...t);
383
+ break;
384
+ case "Fatal":
385
+ console.error(e.message, ...t);
386
+ break;
387
+ default:
388
+ console.log(e.message, ...t);
389
+ }
390
+ }, prepareLogMessage = (e, ...t) => [
391
+ typeof e == "object" ? JSON.stringify(e) : e,
392
+ ...t.map((r) => JSON.stringify(r))
393
+ ].join(" "), logs = [], addToLogArray = (e) => {
394
+ logs.push(e);
395
+ }, logToMemory = (e) => {
396
+ if (e.raw === !0)
397
+ addToLogArray(e.message);
398
+ else {
399
+ const t = formatLogEntry(
400
+ typeof e.message == "object" ? prepareLogMessage(e.message) : e.message,
401
+ e.severity ?? "Info",
402
+ e.prefix ?? "JavaScript"
403
+ );
404
+ addToLogArray(t);
405
+ }
406
+ };
407
+ class Logger extends EventTarget {
408
+ // constructor
409
+ constructor(t = []) {
410
+ super(), this.handlers = t, this.fatalErrorEvent = "playground-fatal-error";
411
+ }
412
+ /**
413
+ * Get all logs.
414
+ * @returns string[]
415
+ */
416
+ getLogs() {
417
+ return this.handlers.includes(logToMemory) ? [...logs] : (this.error(`Logs aren't stored because the logToMemory handler isn't registered.
418
+ If you're using a custom logger instance, make sure to register logToMemory handler.
419
+ `), []);
420
+ }
421
+ /**
422
+ * Log message with severity.
423
+ *
424
+ * @param message any
425
+ * @param severity LogSeverity
426
+ * @param raw boolean
427
+ * @param args any
428
+ */
429
+ logMessage(t, ...r) {
430
+ for (const n of this.handlers)
431
+ n(t, ...r);
432
+ }
433
+ /**
434
+ * Log message
435
+ *
436
+ * @param message any
437
+ * @param args any
438
+ */
439
+ log(t, ...r) {
440
+ this.logMessage(
441
+ {
442
+ message: t,
443
+ severity: void 0,
444
+ prefix: "JavaScript",
445
+ raw: !1
446
+ },
447
+ ...r
448
+ );
449
+ }
450
+ /**
451
+ * Log debug message
452
+ *
453
+ * @param message any
454
+ * @param args any
455
+ */
456
+ debug(t, ...r) {
457
+ this.logMessage(
458
+ {
459
+ message: t,
460
+ severity: "Debug",
461
+ prefix: "JavaScript",
462
+ raw: !1
463
+ },
464
+ ...r
465
+ );
466
+ }
467
+ /**
468
+ * Log info message
469
+ *
470
+ * @param message any
471
+ * @param args any
472
+ */
473
+ info(t, ...r) {
474
+ this.logMessage(
475
+ {
476
+ message: t,
477
+ severity: "Info",
478
+ prefix: "JavaScript",
479
+ raw: !1
480
+ },
481
+ ...r
482
+ );
483
+ }
484
+ /**
485
+ * Log warning message
486
+ *
487
+ * @param message any
488
+ * @param args any
489
+ */
490
+ warn(t, ...r) {
491
+ this.logMessage(
492
+ {
493
+ message: t,
494
+ severity: "Warn",
495
+ prefix: "JavaScript",
496
+ raw: !1
497
+ },
498
+ ...r
499
+ );
500
+ }
501
+ /**
502
+ * Log error message
503
+ *
504
+ * @param message any
505
+ * @param args any
506
+ */
507
+ error(t, ...r) {
508
+ this.logMessage(
509
+ {
510
+ message: t,
511
+ severity: "Error",
512
+ prefix: "JavaScript",
513
+ raw: !1
514
+ },
515
+ ...r
516
+ );
517
+ }
518
+ }
519
+ const logger = new Logger([logToMemory, logToConsole]), formatLogEntry = (e, t, r) => {
520
+ const n = /* @__PURE__ */ new Date(), s = new Intl.DateTimeFormat("en-GB", {
521
+ year: "numeric",
522
+ month: "short",
523
+ day: "2-digit",
524
+ timeZone: "UTC"
525
+ }).format(n).replace(/ /g, "-"), i = new Intl.DateTimeFormat("en-GB", {
526
+ hour: "2-digit",
527
+ minute: "2-digit",
528
+ second: "2-digit",
529
+ hour12: !1,
530
+ timeZone: "UTC",
531
+ timeZoneName: "short"
532
+ }).format(n);
533
+ return `[${s + " " + i}] ${r} ${t}: ${e}`;
365
534
  }, request = async (e, { request: t }) => {
535
+ logger.warn(
536
+ 'Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.'
537
+ );
366
538
  const r = await e.request(t);
367
539
  if (r.httpStatusCode > 399 || r.httpStatusCode < 200)
368
- throw console.warn("WordPress response was", { response: r }), new Error(
540
+ throw logger.warn("WordPress response was", { response: r }), new Error(
369
541
  `Request failed with status ${r.httpStatusCode}`
370
542
  );
371
543
  return r;
@@ -751,7 +923,7 @@ const login = async (e, { username: t = "admin", password: r = "password" } = {}
751
923
  }
752
924
  });
753
925
  if (!((l = (o = (i = s.headers) == null ? void 0 : i.location) == null ? void 0 : o[0]) != null && l.includes("/wp-admin/")))
754
- throw console.warn("WordPress response was", {
926
+ throw logger.warn("WordPress response was", {
755
927
  response: s,
756
928
  text: s.text
757
929
  }), new Error(
@@ -859,7 +1031,7 @@ echo json_encode($deactivated_plugins);
859
1031
  }
860
1032
  });
861
1033
  if (u.httpStatusCode !== 200)
862
- throw console.warn("WordPress response was", {
1034
+ throw logger.warn("WordPress response was", {
863
1035
  response: u,
864
1036
  text: u.text,
865
1037
  headers: u.headers
@@ -877,7 +1049,7 @@ echo json_encode($deactivated_plugins);
877
1049
  PATH_CURRENT_SITE: r
878
1050
  }
879
1051
  });
880
- const p = new URL(await e.absoluteUrl), g = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
1052
+ const f = new URL(await e.absoluteUrl), g = isURLScoped(f) ? "scope:" + getURLScope(f) : null;
881
1053
  await e.writeFile(
882
1054
  joinPaths(s, "/wp-content/sunrise.php"),
883
1055
  `<?php
@@ -886,7 +1058,7 @@ echo json_encode($deactivated_plugins);
886
1058
  }
887
1059
  $folder = ${phpVar(g)};
888
1060
  if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
889
- $_SERVER['HTTP_HOST'] = ${phpVar(p.hostname)};
1061
+ $_SERVER['HTTP_HOST'] = ${phpVar(f.hostname)};
890
1062
  $_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
891
1063
  }
892
1064
  `
@@ -1042,7 +1214,7 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1042
1214
  await e.writeFile(
1043
1215
  tmpPath,
1044
1216
  await e.readFileAsBuffer(r)
1045
- ), console.warn(
1217
+ ), logger.warn(
1046
1218
  'The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.'
1047
1219
  );
1048
1220
  else if (t)
@@ -1068,13 +1240,13 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1068
1240
  extractToPath: s
1069
1241
  }), s = joinPaths(s, r);
1070
1242
  const i = joinPaths(s, "wp-content"), o = joinPaths(n, "wp-content");
1071
- for (const p of wpContentFilesExcludedFromExport) {
1243
+ for (const f of wpContentFilesExcludedFromExport) {
1072
1244
  const g = joinPaths(
1073
1245
  i,
1074
- p
1246
+ f
1075
1247
  );
1076
1248
  await removePath(e, g);
1077
- const O = joinPaths(o, p);
1249
+ const O = joinPaths(o, f);
1078
1250
  await e.fileExists(O) && (await e.mkdir(dirname(g)), await e.mv(O, g));
1079
1251
  }
1080
1252
  const l = joinPaths(
@@ -1087,10 +1259,10 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1087
1259
  l
1088
1260
  );
1089
1261
  const d = await e.listFiles(s);
1090
- for (const p of d)
1091
- await removePath(e, joinPaths(n, p)), await e.mv(
1092
- joinPaths(s, p),
1093
- joinPaths(n, p)
1262
+ for (const f of d)
1263
+ await removePath(e, joinPaths(n, f)), await e.mv(
1264
+ joinPaths(s, f),
1265
+ joinPaths(n, f)
1094
1266
  );
1095
1267
  await e.rmdir(s), await defineSiteUrl(e, {
1096
1268
  siteUrl: await e.absoluteUrl
@@ -1132,9 +1304,9 @@ async function installAsset(e, {
1132
1304
  prependPath: !0
1133
1305
  });
1134
1306
  u = u.filter((S) => !S.endsWith("/__MACOSX"));
1135
- const p = u.length === 1 && await e.isDir(u[0]);
1307
+ const f = u.length === 1 && await e.isDir(u[0]);
1136
1308
  let g, O = "";
1137
- p ? (O = u[0], g = u[0].split("/").pop()) : (O = d, g = i);
1309
+ f ? (O = u[0], g = u[0].split("/").pop()) : (O = d, g = i);
1138
1310
  const C = `${t}/${g}`;
1139
1311
  if (await e.fileExists(C)) {
1140
1312
  if (!await e.isDir(C))
@@ -1354,7 +1526,7 @@ function cloneResponseMonitorProgress(e, t) {
1354
1526
  } else
1355
1527
  s(l, n), i.enqueue(u);
1356
1528
  } catch (d) {
1357
- console.error({ e: d }), i.error(d);
1529
+ logger.error({ e: d }), i.error(d);
1358
1530
  break;
1359
1531
  }
1360
1532
  }
@@ -1656,13 +1828,13 @@ CLI option:
1656
1828
  let logged = !1;
1657
1829
  function showCriticalErrorBox(e) {
1658
1830
  if (!logged && (logged = !0, !(e != null && e.trim().startsWith("Program terminated with exit")))) {
1659
- console.log(`${redBg}
1831
+ logger.log(`${redBg}
1660
1832
  ${eol}
1661
1833
  ${bold} WASM ERROR${reset}${redBg}`);
1662
1834
  for (const t of e.split(`
1663
1835
  `))
1664
- console.log(`${eol} ${t} `);
1665
- console.log(`${reset}`);
1836
+ logger.log(`${eol} ${t} `);
1837
+ logger.log(`${reset}`);
1666
1838
  }
1667
1839
  }
1668
1840
  function extractPHPFunctionsFromStack(e) {
@@ -1696,10 +1868,34 @@ ReadableStream.prototype[Symbol.asyncIterator] || (ReadableStream.prototype[Symb
1696
1868
  }
1697
1869
  }, ReadableStream.prototype.iterate = // @ts-ignore
1698
1870
  ReadableStream.prototype[Symbol.asyncIterator]);
1871
+ const responseTexts = {
1872
+ 500: "Internal Server Error",
1873
+ 502: "Bad Gateway",
1874
+ 404: "Not Found",
1875
+ 403: "Forbidden",
1876
+ 401: "Unauthorized",
1877
+ 400: "Bad Request",
1878
+ 301: "Moved Permanently",
1879
+ 302: "Found",
1880
+ 307: "Temporary Redirect",
1881
+ 308: "Permanent Redirect",
1882
+ 204: "No Content",
1883
+ 201: "Created",
1884
+ 200: "OK"
1885
+ };
1699
1886
  class PHPResponse {
1700
1887
  constructor(t, r, n, s = "", i = 0) {
1701
1888
  this.httpStatusCode = t, this.headers = r, this.bytes = n, this.exitCode = i, this.errors = s;
1702
1889
  }
1890
+ static forHttpCode(t, r = "") {
1891
+ return new PHPResponse(
1892
+ t,
1893
+ {},
1894
+ new TextEncoder().encode(
1895
+ r || responseTexts[t] || ""
1896
+ )
1897
+ );
1898
+ }
1703
1899
  static fromRawData(t) {
1704
1900
  return new PHPResponse(
1705
1901
  t.httpStatusCode,
@@ -1749,411 +1945,7 @@ const SupportedPHPVersions = [
1749
1945
  ], SupportedPHPExtensionBundles = {
1750
1946
  "kitchen-sink": SupportedPHPExtensionsList,
1751
1947
  light: []
1752
- }, DEFAULT_BASE_URL = "http://example.com";
1753
- function toRelativeUrl(e) {
1754
- return e.toString().substring(e.origin.length);
1755
- }
1756
- function removePathPrefix(e, t) {
1757
- return !t || !e.startsWith(t) ? e : e.substring(t.length);
1758
- }
1759
- function ensurePathPrefix(e, t) {
1760
- return !t || e.startsWith(t) ? e : t + e;
1761
- }
1762
- async function encodeAsMultipart(e) {
1763
- const t = `----${Math.random().toString(36).slice(2)}`, r = `multipart/form-data; boundary=${t}`, n = new TextEncoder(), s = [];
1764
- for (const [d, u] of Object.entries(e))
1765
- s.push(`--${t}\r
1766
- `), s.push(`Content-Disposition: form-data; name="${d}"`), u instanceof File && s.push(`; filename="${u.name}"`), s.push(`\r
1767
- `), u instanceof File && (s.push("Content-Type: application/octet-stream"), s.push(`\r
1768
- `)), s.push(`\r
1769
- `), u instanceof File ? s.push(await fileToUint8Array(u)) : s.push(u), s.push(`\r
1770
- `);
1771
- s.push(`--${t}--\r
1772
- `);
1773
- const i = s.reduce((d, u) => d + u.length, 0), o = new Uint8Array(i);
1774
- let l = 0;
1775
- for (const d of s)
1776
- o.set(
1777
- typeof d == "string" ? n.encode(d) : d,
1778
- l
1779
- ), l += d.length;
1780
- return { bytes: o, contentType: r };
1781
- }
1782
- function fileToUint8Array(e) {
1783
- return new Promise((t) => {
1784
- const r = new FileReader();
1785
- r.onload = () => {
1786
- t(new Uint8Array(r.result));
1787
- }, r.readAsArrayBuffer(e);
1788
- });
1789
- }
1790
- class HttpCookieStore {
1791
- constructor() {
1792
- this.cookies = {};
1793
- }
1794
- rememberCookiesFromResponseHeaders(t) {
1795
- if (t != null && t["set-cookie"])
1796
- for (const r of t["set-cookie"])
1797
- try {
1798
- if (!r.includes("="))
1799
- continue;
1800
- const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
1801
- this.cookies[s] = i;
1802
- } catch (n) {
1803
- console.error(n);
1804
- }
1805
- }
1806
- getCookieRequestHeader() {
1807
- const t = [];
1808
- for (const r in this.cookies)
1809
- t.push(`${r}=${this.cookies[r]}`);
1810
- return t.join("; ");
1811
- }
1812
- }
1813
- var Pe, We, ct, je, Be, ve, Ge, Ae, Ke, ft, Wt, ht, Bt, mt, Gt;
1814
- class PHPRequestHandler {
1815
- /**
1816
- * @param php - The PHP instance.
1817
- * @param config - Request Handler configuration.
1818
- */
1819
- constructor(t, r = {}) {
1820
- /**
1821
- * Serves a static file from the PHP filesystem.
1822
- *
1823
- * @param fsPath - Absolute path of the static file to serve.
1824
- * @returns The response.
1825
- */
1826
- K(this, ft);
1827
- /**
1828
- * Runs the requested PHP file with all the request and $_SERVER
1829
- * superglobals populated.
1830
- *
1831
- * @param request - The request.
1832
- * @returns The response.
1833
- */
1834
- K(this, ht);
1835
- /**
1836
- * Resolve the requested path to the filesystem path of the requested PHP file.
1837
- *
1838
- * Fall back to index.php as if there was a url rewriting rule in place.
1839
- *
1840
- * @param requestedPath - The requested pathname.
1841
- * @throws {Error} If the requested path doesn't exist.
1842
- * @returns The resolved filesystem path.
1843
- */
1844
- K(this, mt);
1845
- K(this, Pe, void 0);
1846
- K(this, We, void 0);
1847
- K(this, ct, void 0);
1848
- K(this, je, void 0);
1849
- K(this, Be, void 0);
1850
- K(this, ve, void 0);
1851
- K(this, Ge, void 0);
1852
- K(this, Ae, void 0);
1853
- K(this, Ke, void 0);
1854
- ie(this, Ae, new Semaphore({ concurrency: 1 }));
1855
- const {
1856
- documentRoot: n = "/www/",
1857
- absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : "",
1858
- rewriteRules: i = []
1859
- } = r;
1860
- this.php = t, ie(this, Ke, new HttpCookieStore()), ie(this, Pe, n);
1861
- const o = new URL(s);
1862
- ie(this, ct, o.hostname), ie(this, je, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), ie(this, We, (o.protocol || "").replace(":", ""));
1863
- const l = H(this, je) !== 443 && H(this, je) !== 80;
1864
- ie(this, Be, [
1865
- H(this, ct),
1866
- l ? `:${H(this, je)}` : ""
1867
- ].join("")), ie(this, ve, o.pathname.replace(/\/+$/, "")), ie(this, Ge, [
1868
- `${H(this, We)}://`,
1869
- H(this, Be),
1870
- H(this, ve)
1871
- ].join("")), this.rewriteRules = i;
1872
- }
1873
- /**
1874
- * Converts a path to an absolute URL based at the PHPRequestHandler
1875
- * root.
1876
- *
1877
- * @param path The server path to convert to an absolute URL.
1878
- * @returns The absolute URL.
1879
- */
1880
- pathToInternalUrl(t) {
1881
- return `${this.absoluteUrl}${t}`;
1882
- }
1883
- /**
1884
- * Converts an absolute URL based at the PHPRequestHandler to a relative path
1885
- * without the server pathname and scope.
1886
- *
1887
- * @param internalUrl An absolute URL based at the PHPRequestHandler root.
1888
- * @returns The relative path.
1889
- */
1890
- internalUrlToPath(t) {
1891
- const r = new URL(t);
1892
- return r.pathname.startsWith(H(this, ve)) && (r.pathname = r.pathname.slice(H(this, ve).length)), toRelativeUrl(r);
1893
- }
1894
- get isRequestRunning() {
1895
- return H(this, Ae).running > 0;
1896
- }
1897
- /**
1898
- * The absolute URL of this PHPRequestHandler instance.
1899
- */
1900
- get absoluteUrl() {
1901
- return H(this, Ge);
1902
- }
1903
- /**
1904
- * The directory in the PHP filesystem where the server will look
1905
- * for the files to serve. Default: `/var/www`.
1906
- */
1907
- get documentRoot() {
1908
- return H(this, Pe);
1909
- }
1910
- /**
1911
- * Serves the request – either by serving a static file, or by
1912
- * dispatching it to the PHP runtime.
1913
- *
1914
- * The request() method mode behaves like a web server and only works if
1915
- * the PHP was initialized with a `requestHandler` option (which the online version
1916
- * of WordPress Playground does by default).
1917
- *
1918
- * In the request mode, you pass an object containing the request information
1919
- * (method, headers, body, etc.) and the path to the PHP file to run:
1920
- *
1921
- * ```ts
1922
- * const php = PHP.load('7.4', {
1923
- * requestHandler: {
1924
- * documentRoot: "/www"
1925
- * }
1926
- * })
1927
- * php.writeFile("/www/index.php", `<?php echo file_get_contents("php://input");`);
1928
- * const result = await php.request({
1929
- * method: "GET",
1930
- * headers: {
1931
- * "Content-Type": "text/plain"
1932
- * },
1933
- * body: "Hello world!",
1934
- * path: "/www/index.php"
1935
- * });
1936
- * // result.text === "Hello world!"
1937
- * ```
1938
- *
1939
- * The `request()` method cannot be used in conjunction with `cli()`.
1940
- *
1941
- * @example
1942
- * ```js
1943
- * const output = await php.request({
1944
- * method: 'GET',
1945
- * url: '/index.php',
1946
- * headers: {
1947
- * 'X-foo': 'bar',
1948
- * },
1949
- * body: {
1950
- * foo: 'bar',
1951
- * },
1952
- * });
1953
- * console.log(output.stdout); // "Hello world!"
1954
- * ```
1955
- *
1956
- * @param request - PHP Request data.
1957
- */
1958
- async request(t) {
1959
- const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
1960
- // Remove the hash part of the URL as it's not meant for the server.
1961
- t.url.split("#")[0],
1962
- r ? void 0 : DEFAULT_BASE_URL
1963
- ), s = applyRewriteRules(
1964
- removePathPrefix(
1965
- decodeURIComponent(n.pathname),
1966
- H(this, ve)
1967
- ),
1968
- this.rewriteRules
1969
- ), i = joinPaths(H(this, Pe), s);
1970
- return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, ht, Bt).call(this, t, n) : ce(this, ft, Wt).call(this, i);
1971
- }
1972
- }
1973
- Pe = new WeakMap(), We = new WeakMap(), ct = new WeakMap(), je = new WeakMap(), Be = new WeakMap(), ve = new WeakMap(), Ge = new WeakMap(), Ae = new WeakMap(), Ke = new WeakMap(), ft = new WeakSet(), Wt = function(t) {
1974
- if (!this.php.fileExists(t))
1975
- return new PHPResponse(
1976
- 404,
1977
- // Let the service worker know that no static file was found
1978
- // and that it's okay to issue a real fetch() to the server.
1979
- {
1980
- "x-file-type": ["static"]
1981
- },
1982
- new TextEncoder().encode("404 File not found")
1983
- );
1984
- const r = this.php.readFileAsBuffer(t);
1985
- return new PHPResponse(
1986
- 200,
1987
- {
1988
- "content-length": [`${r.byteLength}`],
1989
- // @TODO: Infer the content-type from the arrayBuffer instead of the file path.
1990
- // The code below won't return the correct mime-type if the extension
1991
- // was tampered with.
1992
- "content-type": [inferMimeType(t)],
1993
- "accept-ranges": ["bytes"],
1994
- "cache-control": ["public, max-age=0"]
1995
- },
1996
- r
1997
- );
1998
- }, ht = new WeakSet(), Bt = async function(t, r) {
1999
- var s;
2000
- if (H(this, Ae).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
2001
- return console.warn(
2002
- "Possible deadlock: Called request() before the previous request() have finished. PHP likely issued an HTTP call to itself. Normally this would lead to infinite waiting as Request 1 holds the lock that the Request 2 is waiting to acquire. That's not useful, so PHPRequestHandler will return error 502 instead."
2003
- ), new PHPResponse(
2004
- 502,
2005
- {},
2006
- new TextEncoder().encode("502 Bad Gateway")
2007
- );
2008
- const n = await H(this, Ae).acquire();
2009
- try {
2010
- let i = "GET";
2011
- const o = {
2012
- host: H(this, Be),
2013
- ...normalizeHeaders(t.headers || {}),
2014
- cookie: H(this, Ke).getCookieRequestHeader()
2015
- };
2016
- let l = t.body;
2017
- if (typeof l == "object" && !(l instanceof Uint8Array)) {
2018
- i = "POST";
2019
- const { bytes: u, contentType: p } = await encodeAsMultipart(l);
2020
- l = u, o["content-type"] = p;
2021
- }
2022
- let d;
2023
- try {
2024
- d = ce(this, mt, Gt).call(this, decodeURIComponent(r.pathname));
2025
- } catch {
2026
- return new PHPResponse(
2027
- 404,
2028
- {},
2029
- new TextEncoder().encode("404 File not found")
2030
- );
2031
- }
2032
- try {
2033
- const u = await this.php.run({
2034
- relativeUri: ensurePathPrefix(
2035
- toRelativeUrl(r),
2036
- H(this, ve)
2037
- ),
2038
- protocol: H(this, We),
2039
- method: t.method || i,
2040
- $_SERVER: {
2041
- REMOTE_ADDR: "127.0.0.1",
2042
- DOCUMENT_ROOT: H(this, Pe),
2043
- HTTPS: H(this, Ge).startsWith("https://") ? "on" : ""
2044
- },
2045
- body: l,
2046
- scriptPath: d,
2047
- headers: o
2048
- });
2049
- return H(this, Ke).rememberCookiesFromResponseHeaders(
2050
- u.headers
2051
- ), u;
2052
- } catch (u) {
2053
- const p = u;
2054
- if (p != null && p.response)
2055
- return p.response;
2056
- throw u;
2057
- }
2058
- } finally {
2059
- n();
2060
- }
2061
- }, mt = new WeakSet(), Gt = function(t) {
2062
- let r = removePathPrefix(t, H(this, ve));
2063
- r = applyRewriteRules(r, this.rewriteRules), r.includes(".php") ? r = r.split(".php")[0] + ".php" : this.php.isDir(`${H(this, Pe)}${r}`) ? (r.endsWith("/") || (r = `${r}/`), r = `${r}index.php`) : r = "/index.php";
2064
- const n = `${H(this, Pe)}${r}`;
2065
- if (this.php.fileExists(n))
2066
- return n;
2067
- throw new Error(`File not found: ${n}`);
2068
- };
2069
- function inferMimeType(e) {
2070
- switch (e.split(".").pop()) {
2071
- case "css":
2072
- return "text/css";
2073
- case "js":
2074
- return "application/javascript";
2075
- case "png":
2076
- return "image/png";
2077
- case "jpg":
2078
- case "jpeg":
2079
- return "image/jpeg";
2080
- case "gif":
2081
- return "image/gif";
2082
- case "svg":
2083
- return "image/svg+xml";
2084
- case "woff":
2085
- return "font/woff";
2086
- case "woff2":
2087
- return "font/woff2";
2088
- case "ttf":
2089
- return "font/ttf";
2090
- case "otf":
2091
- return "font/otf";
2092
- case "eot":
2093
- return "font/eot";
2094
- case "ico":
2095
- return "image/x-icon";
2096
- case "html":
2097
- return "text/html";
2098
- case "json":
2099
- return "application/json";
2100
- case "xml":
2101
- return "application/xml";
2102
- case "txt":
2103
- case "md":
2104
- return "text/plain";
2105
- case "pdf":
2106
- return "application/pdf";
2107
- case "webp":
2108
- return "image/webp";
2109
- case "mp3":
2110
- return "audio/mpeg";
2111
- case "mp4":
2112
- return "video/mp4";
2113
- case "csv":
2114
- return "text/csv";
2115
- case "xls":
2116
- return "application/vnd.ms-excel";
2117
- case "xlsx":
2118
- return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
2119
- case "doc":
2120
- return "application/msword";
2121
- case "docx":
2122
- return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
2123
- case "ppt":
2124
- return "application/vnd.ms-powerpoint";
2125
- case "pptx":
2126
- return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
2127
- case "zip":
2128
- return "application/zip";
2129
- case "rar":
2130
- return "application/x-rar-compressed";
2131
- case "tar":
2132
- return "application/x-tar";
2133
- case "gz":
2134
- return "application/gzip";
2135
- case "7z":
2136
- return "application/x-7z-compressed";
2137
- default:
2138
- return "application-octet-stream";
2139
- }
2140
- }
2141
- function seemsLikeAPHPRequestHandlerPath(e) {
2142
- return seemsLikeAPHPFile(e) || seemsLikeADirectoryRoot(e);
2143
- }
2144
- function seemsLikeAPHPFile(e) {
2145
- return e.endsWith(".php") || e.includes(".php/");
2146
- }
2147
- function seemsLikeADirectoryRoot(e) {
2148
- return !e.split("/").pop().includes(".");
2149
- }
2150
- function applyRewriteRules(e, t) {
2151
- for (const r of t)
2152
- if (new RegExp(r.match).test(e))
2153
- return e.replace(r.match, r.replacement);
2154
- return e;
2155
- }
2156
- const FileErrorCodes = {
1948
+ }, FileErrorCodes = {
2157
1949
  0: "No error occurred. System call completed successfully.",
2158
1950
  1: "Argument list too long.",
2159
1951
  2: "Permission denied.",
@@ -2246,7 +2038,7 @@ function rethrowFileSystemError(e = "") {
2246
2038
  } catch (l) {
2247
2039
  const d = typeof l == "object" ? l == null ? void 0 : l.errno : null;
2248
2040
  if (d in FileErrorCodes) {
2249
- const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, g = p !== null ? e.replaceAll("{path}", p) : e;
2041
+ const u = FileErrorCodes[d], f = typeof o[0] == "string" ? o[0] : null, g = f !== null ? e.replaceAll("{path}", f) : e;
2250
2042
  throw new Error(`${g}: ${u}`, {
2251
2043
  cause: l
2252
2044
  });
@@ -2275,16 +2067,16 @@ class PHPExecutionFailureError extends Error {
2275
2067
  super(t), this.response = r, this.source = n;
2276
2068
  }
2277
2069
  }
2278
- var De, Je, Qe, be, Re, Ee, Ye, _t, Kt, gt, Jt, $t, Qt, yt, Yt, vt, Zt, wt, Xt, Pt, er, bt, tr, Et, rr, St, nr, Rt, sr, Tt, ir, kt, or, Ct, ar, Ot, cr;
2070
+ var Ne, Ve, ze, ve, Ee, be, He, st, jt, it, Dt, ot, At, at, Ft, ct, Mt, lt, qt, dt, Lt, ut, Ut, pt, Vt, ft, zt, ht, Ht, mt, xt, _t, Bt, gt, Wt, $t, Gt;
2279
2071
  class BasePHP {
2280
2072
  /**
2281
2073
  * Initializes a PHP runtime.
2282
2074
  *
2283
2075
  * @internal
2284
2076
  * @param PHPRuntime - Optional. PHP Runtime ID as initialized by loadPHPRuntime.
2285
- * @param serverOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
2077
+ * @param requestHandlerOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
2286
2078
  */
2287
- constructor(e, t) {
2079
+ constructor(e) {
2288
2080
  /**
2289
2081
  * Prepares the $_SERVER entries for the PHP runtime.
2290
2082
  *
@@ -2294,46 +2086,46 @@ class BasePHP {
2294
2086
  * was provided.
2295
2087
  * @returns Computed $_SERVER entries.
2296
2088
  */
2297
- K(this, _t);
2298
- K(this, gt);
2299
- K(this, $t);
2300
- K(this, yt);
2301
- K(this, vt);
2302
- K(this, wt);
2303
- K(this, Pt);
2304
- K(this, bt);
2305
- K(this, Et);
2306
- K(this, St);
2307
- K(this, Rt);
2308
- K(this, Tt);
2309
- K(this, kt);
2310
- K(this, Ct);
2311
- K(this, Ot);
2312
- K(this, De, void 0);
2313
- K(this, Je, void 0);
2314
- K(this, Qe, void 0);
2315
- K(this, be, void 0);
2316
- K(this, Re, void 0);
2317
- K(this, Ee, void 0);
2318
- K(this, Ye, void 0);
2319
- ie(this, De, []), ie(this, be, !1), ie(this, Re, null), ie(this, Ee, /* @__PURE__ */ new Map()), ie(this, Ye, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPRequestHandler(this, t));
2089
+ ee(this, st);
2090
+ ee(this, it);
2091
+ ee(this, ot);
2092
+ ee(this, at);
2093
+ ee(this, ct);
2094
+ ee(this, lt);
2095
+ ee(this, dt);
2096
+ ee(this, ut);
2097
+ ee(this, pt);
2098
+ ee(this, ft);
2099
+ ee(this, ht);
2100
+ ee(this, mt);
2101
+ ee(this, _t);
2102
+ ee(this, gt);
2103
+ ee(this, $t);
2104
+ ee(this, Ne, void 0);
2105
+ ee(this, Ve, void 0);
2106
+ ee(this, ze, void 0);
2107
+ ee(this, ve, void 0);
2108
+ ee(this, Ee, void 0);
2109
+ ee(this, be, void 0);
2110
+ ee(this, He, void 0);
2111
+ fe(this, Ne, []), fe(this, ve, !1), fe(this, Ee, null), fe(this, be, /* @__PURE__ */ new Map()), fe(this, He, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e);
2320
2112
  }
2321
2113
  addEventListener(e, t) {
2322
- H(this, Ee).has(e) || H(this, Ee).set(e, /* @__PURE__ */ new Set()), H(this, Ee).get(e).add(t);
2114
+ se(this, be).has(e) || se(this, be).set(e, /* @__PURE__ */ new Set()), se(this, be).get(e).add(t);
2323
2115
  }
2324
2116
  removeEventListener(e, t) {
2325
2117
  var r;
2326
- (r = H(this, Ee).get(e)) == null || r.delete(t);
2118
+ (r = se(this, be).get(e)) == null || r.delete(t);
2327
2119
  }
2328
2120
  dispatchEvent(e) {
2329
- const t = H(this, Ee).get(e.type);
2121
+ const t = se(this, be).get(e.type);
2330
2122
  if (t)
2331
2123
  for (const r of t)
2332
2124
  r(e);
2333
2125
  }
2334
2126
  /** @inheritDoc */
2335
2127
  async onMessage(e) {
2336
- H(this, Ye).push(e);
2128
+ se(this, He).push(e);
2337
2129
  }
2338
2130
  /** @inheritDoc */
2339
2131
  async setSpawnHandler(handler) {
@@ -2362,13 +2154,13 @@ class BasePHP {
2362
2154
  if (!t)
2363
2155
  throw new Error("Invalid PHP runtime id.");
2364
2156
  this[__private__dont__use] = t, t.onMessage = async (r) => {
2365
- for (const n of H(this, Ye)) {
2157
+ for (const n of se(this, He)) {
2366
2158
  const s = await n(r);
2367
2159
  if (s)
2368
2160
  return s;
2369
2161
  }
2370
2162
  return "";
2371
- }, ie(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
2163
+ }, fe(this, Ee, improveWASMErrorReporting(t)), this.dispatchEvent({
2372
2164
  type: "runtime.initialized"
2373
2165
  });
2374
2166
  }
@@ -2383,13 +2175,13 @@ class BasePHP {
2383
2175
  throw new Error(
2384
2176
  "Could not set SAPI name. This can only be done before the PHP WASM module is initialized.Did you already dispatch any requests?"
2385
2177
  );
2386
- ie(this, Qe, e);
2178
+ fe(this, ze, e);
2387
2179
  }
2388
2180
  /** @inheritDoc */
2389
2181
  setPhpIniPath(e) {
2390
- if (H(this, be))
2182
+ if (se(this, ve))
2391
2183
  throw new Error("Cannot set PHP ini path after calling run().");
2392
- ie(this, Je, e), this[__private__dont__use].ccall(
2184
+ fe(this, Ve, e), this[__private__dont__use].ccall(
2393
2185
  "wasm_set_phpini_path",
2394
2186
  null,
2395
2187
  ["string"],
@@ -2398,17 +2190,22 @@ class BasePHP {
2398
2190
  }
2399
2191
  /** @inheritDoc */
2400
2192
  setPhpIniEntry(e, t) {
2401
- if (H(this, be))
2193
+ if (se(this, ve))
2402
2194
  throw new Error("Cannot set PHP ini entries after calling run().");
2403
- H(this, De).push([e, t]);
2195
+ se(this, Ne).push([e, t]);
2404
2196
  }
2405
2197
  /** @inheritDoc */
2406
2198
  chdir(e) {
2407
2199
  this[__private__dont__use].FS.chdir(e);
2408
2200
  }
2409
- /** @inheritDoc */
2201
+ /**
2202
+ * Do not use. Use new PHPRequestHandler() instead.
2203
+ * @deprecated
2204
+ */
2410
2205
  async request(e) {
2411
- if (!this.requestHandler)
2206
+ if (logger.warn(
2207
+ "PHP.request() is deprecated. Please use new PHPRequestHandler() instead."
2208
+ ), !this.requestHandler)
2412
2209
  throw new Error("No request handler available.");
2413
2210
  return this.requestHandler.request(e);
2414
2211
  }
@@ -2417,28 +2214,28 @@ class BasePHP {
2417
2214
  const t = await this.semaphore.acquire();
2418
2215
  let r;
2419
2216
  try {
2420
- if (H(this, be) || (ce(this, gt, Jt).call(this), ie(this, be, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2217
+ if (se(this, ve) || (ae(this, it, Dt).call(this), fe(this, ve, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2421
2218
  throw new Error(
2422
2219
  `The script path "${e.scriptPath}" does not exist.`
2423
2220
  );
2424
- ce(this, Rt, sr).call(this, e.scriptPath || ""), ce(this, yt, Yt).call(this, e.relativeUri || ""), ce(this, bt, tr).call(this, e.method || "GET");
2425
- const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443", i = ce(this, Pt, er).call(this, s, e.protocol || "http");
2426
- ce(this, vt, Zt).call(this, s), ce(this, wt, Xt).call(this, i), ce(this, Et, rr).call(this, n), e.body && (r = ce(this, St, nr).call(this, e.body)), typeof e.code == "string" && ce(this, Ct, ar).call(this, " ?>" + e.code);
2427
- const o = ce(this, _t, Kt).call(this, e.$_SERVER, n, i);
2221
+ ae(this, ht, Ht).call(this, e.scriptPath || ""), ae(this, at, Ft).call(this, e.relativeUri || ""), ae(this, ut, Ut).call(this, e.method || "GET");
2222
+ const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443", i = ae(this, dt, Lt).call(this, s, e.protocol || "http");
2223
+ ae(this, ct, Mt).call(this, s), ae(this, lt, qt).call(this, i), ae(this, pt, Vt).call(this, n), e.body && (r = ae(this, ft, zt).call(this, e.body)), typeof e.code == "string" && ae(this, gt, Wt).call(this, " ?>" + e.code);
2224
+ const o = ae(this, st, jt).call(this, e.$_SERVER, n, i);
2428
2225
  for (const u in o)
2429
- ce(this, Tt, ir).call(this, u, o[u]);
2226
+ ae(this, mt, xt).call(this, u, o[u]);
2430
2227
  const l = e.env || {};
2431
2228
  for (const u in l)
2432
- ce(this, kt, or).call(this, u, l[u]);
2433
- const d = await ce(this, Ot, cr).call(this);
2229
+ ae(this, _t, Bt).call(this, u, l[u]);
2230
+ const d = await ae(this, $t, Gt).call(this);
2434
2231
  if (d.exitCode !== 0) {
2435
- console.warn("PHP.run() output was:", d.text);
2232
+ logger.warn("PHP.run() output was:", d.text);
2436
2233
  const u = new PHPExecutionFailureError(
2437
2234
  `PHP.run() failed with exit code ${d.exitCode} and the following output: ` + d.errors,
2438
2235
  d,
2439
2236
  "request"
2440
2237
  );
2441
- throw console.error(u), u;
2238
+ throw logger.error(u), u;
2442
2239
  }
2443
2240
  return d;
2444
2241
  } catch (n) {
@@ -2525,7 +2322,7 @@ class BasePHP {
2525
2322
  }
2526
2323
  return r;
2527
2324
  } catch (r) {
2528
- return console.error(r, { path: e }), [];
2325
+ return logger.error(r, { path: e }), [];
2529
2326
  }
2530
2327
  }
2531
2328
  isDir(e) {
@@ -2556,7 +2353,7 @@ class BasePHP {
2556
2353
  this.exit();
2557
2354
  } catch {
2558
2355
  }
2559
- this.initializeRuntime(e), H(this, Je) && this.setPhpIniPath(H(this, Je)), H(this, Qe) && this.setSapiName(H(this, Qe)), t && copyFS(r, this[__private__dont__use].FS, t);
2356
+ this.initializeRuntime(e), se(this, Ve) && this.setPhpIniPath(se(this, Ve)), se(this, ze) && this.setSapiName(se(this, ze)), t && copyFS(r, this[__private__dont__use].FS, t);
2560
2357
  }
2561
2358
  exit(e = 0) {
2562
2359
  this.dispatchEvent({
@@ -2566,10 +2363,13 @@ class BasePHP {
2566
2363
  this[__private__dont__use]._exit(e);
2567
2364
  } catch {
2568
2365
  }
2569
- ie(this, be, !1), ie(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2366
+ fe(this, ve, !1), fe(this, Ee, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2367
+ }
2368
+ [Symbol.dispose]() {
2369
+ se(this, ve) && this.exit(0);
2570
2370
  }
2571
2371
  }
2572
- De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Ee = new WeakMap(), Ye = new WeakMap(), _t = new WeakSet(), Kt = function(e, t, r) {
2372
+ Ne = new WeakMap(), Ve = new WeakMap(), ze = new WeakMap(), ve = new WeakMap(), Ee = new WeakMap(), be = new WeakMap(), He = new WeakMap(), st = new WeakSet(), jt = function(e, t, r) {
2573
2373
  const n = {
2574
2374
  ...e || {}
2575
2375
  };
@@ -2579,7 +2379,7 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2579
2379
  ["content-type", "content-length"].includes(s.toLowerCase()) && (i = ""), n[`${i}${s.toUpperCase().replace(/-/g, "_")}`] = t[s];
2580
2380
  }
2581
2381
  return n;
2582
- }, gt = new WeakSet(), Jt = function() {
2382
+ }, it = new WeakSet(), Dt = function() {
2583
2383
  if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
2584
2384
  "/internal/consts.php",
2585
2385
  `<?php
@@ -2591,8 +2391,8 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2591
2391
  }
2592
2392
  }
2593
2393
  }`
2594
- ), H(this, De).length > 0) {
2595
- const e = H(this, De).map(([t, r]) => `${t}=${r}`).join(`
2394
+ ), se(this, Ne).length > 0) {
2395
+ const e = se(this, Ne).map(([t, r]) => `${t}=${r}`).join(`
2596
2396
  `) + `
2597
2397
 
2598
2398
  `;
@@ -2604,7 +2404,7 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2604
2404
  );
2605
2405
  }
2606
2406
  this[__private__dont__use].ccall("php_wasm_init", null, [], []);
2607
- }, $t = new WeakSet(), Qt = function() {
2407
+ }, ot = new WeakSet(), At = function() {
2608
2408
  const e = "/internal/headers.json";
2609
2409
  if (!this.fileExists(e))
2610
2410
  throw new Error(
@@ -2621,7 +2421,7 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2621
2421
  headers: r,
2622
2422
  httpStatusCode: t.status
2623
2423
  };
2624
- }, yt = new WeakSet(), Yt = function(e) {
2424
+ }, at = new WeakSet(), Ft = function(e) {
2625
2425
  if (this[__private__dont__use].ccall(
2626
2426
  "wasm_set_request_uri",
2627
2427
  null,
@@ -2636,35 +2436,35 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2636
2436
  [t]
2637
2437
  );
2638
2438
  }
2639
- }, vt = new WeakSet(), Zt = function(e) {
2439
+ }, ct = new WeakSet(), Mt = function(e) {
2640
2440
  this[__private__dont__use].ccall(
2641
2441
  "wasm_set_request_host",
2642
2442
  null,
2643
2443
  [STRING],
2644
2444
  [e]
2645
2445
  );
2646
- }, wt = new WeakSet(), Xt = function(e) {
2446
+ }, lt = new WeakSet(), qt = function(e) {
2647
2447
  this[__private__dont__use].ccall(
2648
2448
  "wasm_set_request_port",
2649
2449
  null,
2650
2450
  [NUMBER],
2651
2451
  [e]
2652
2452
  );
2653
- }, Pt = new WeakSet(), er = function(e, t) {
2453
+ }, dt = new WeakSet(), Lt = function(e, t) {
2654
2454
  let r;
2655
2455
  try {
2656
2456
  r = parseInt(new URL(e).port, 10);
2657
2457
  } catch {
2658
2458
  }
2659
2459
  return (!r || isNaN(r) || r === 80) && (r = t === "https" ? 443 : 80), r;
2660
- }, bt = new WeakSet(), tr = function(e) {
2460
+ }, ut = new WeakSet(), Ut = function(e) {
2661
2461
  this[__private__dont__use].ccall(
2662
2462
  "wasm_set_request_method",
2663
2463
  null,
2664
2464
  [STRING],
2665
2465
  [e]
2666
2466
  );
2667
- }, Et = new WeakSet(), rr = function(e) {
2467
+ }, pt = new WeakSet(), Vt = function(e) {
2668
2468
  e.cookie && this[__private__dont__use].ccall(
2669
2469
  "wasm_set_cookies",
2670
2470
  null,
@@ -2681,9 +2481,9 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2681
2481
  [NUMBER],
2682
2482
  [parseInt(e["content-length"], 10)]
2683
2483
  );
2684
- }, St = new WeakSet(), nr = function(e) {
2484
+ }, ft = new WeakSet(), zt = function(e) {
2685
2485
  let t, r;
2686
- typeof e == "string" ? (console.warn(
2486
+ typeof e == "string" ? (logger.warn(
2687
2487
  "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"
2688
2488
  ), r = this[__private__dont__use].lengthBytesUTF8(e), t = r + 1) : (r = e.byteLength, t = e.byteLength);
2689
2489
  const n = this[__private__dont__use].malloc(t);
@@ -2704,45 +2504,45 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2704
2504
  [NUMBER],
2705
2505
  [r]
2706
2506
  ), n;
2707
- }, Rt = new WeakSet(), sr = function(e) {
2507
+ }, ht = new WeakSet(), Ht = function(e) {
2708
2508
  this[__private__dont__use].ccall(
2709
2509
  "wasm_set_path_translated",
2710
2510
  null,
2711
2511
  [STRING],
2712
2512
  [e]
2713
2513
  );
2714
- }, Tt = new WeakSet(), ir = function(e, t) {
2514
+ }, mt = new WeakSet(), xt = function(e, t) {
2715
2515
  this[__private__dont__use].ccall(
2716
2516
  "wasm_add_SERVER_entry",
2717
2517
  null,
2718
2518
  [STRING, STRING],
2719
2519
  [e, t]
2720
2520
  );
2721
- }, kt = new WeakSet(), or = function(e, t) {
2521
+ }, _t = new WeakSet(), Bt = function(e, t) {
2722
2522
  this[__private__dont__use].ccall(
2723
2523
  "wasm_add_ENV_entry",
2724
2524
  null,
2725
2525
  [STRING, STRING],
2726
2526
  [e, t]
2727
2527
  );
2728
- }, Ct = new WeakSet(), ar = function(e) {
2528
+ }, gt = new WeakSet(), Wt = function(e) {
2729
2529
  this[__private__dont__use].ccall(
2730
2530
  "wasm_set_php_code",
2731
2531
  null,
2732
2532
  [STRING],
2733
2533
  [e]
2734
2534
  );
2735
- }, Ot = new WeakSet(), cr = async function() {
2535
+ }, $t = new WeakSet(), Gt = async function() {
2736
2536
  var s;
2737
2537
  let e, t;
2738
2538
  try {
2739
2539
  e = await new Promise((i, o) => {
2740
2540
  var d;
2741
2541
  t = (u) => {
2742
- console.error(u), console.error(u.error);
2743
- const p = new Error("Rethrown");
2744
- p.cause = u.error, p.betterMessage = u.message, o(p);
2745
- }, (d = H(this, Re)) == null || d.addEventListener(
2542
+ logger.error(u), logger.error(u.error);
2543
+ const f = new Error("Rethrown");
2544
+ f.cause = u.error, f.betterMessage = u.message, o(f);
2545
+ }, (d = se(this, Ee)) == null || d.addEventListener(
2746
2546
  "error",
2747
2547
  t
2748
2548
  );
@@ -2764,11 +2564,11 @@ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(),
2764
2564
  });
2765
2565
  this.functionsMaybeMissingFromAsyncify = getFunctionsMaybeMissingFromAsyncify();
2766
2566
  const o = i, l = "betterMessage" in o ? o.betterMessage : o.message, d = new Error(l);
2767
- throw d.cause = o, console.error(d), d;
2567
+ throw d.cause = o, logger.error(d), d;
2768
2568
  } finally {
2769
- (s = H(this, Re)) == null || s.removeEventListener("error", t);
2569
+ (s = se(this, Ee)) == null || s.removeEventListener("error", t);
2770
2570
  }
2771
- const { headers: r, httpStatusCode: n } = ce(this, $t, Qt).call(this);
2571
+ const { headers: r, httpStatusCode: n } = ae(this, ot, At).call(this);
2772
2572
  return new PHPResponse(
2773
2573
  e === 0 ? n : 500,
2774
2574
  r,
@@ -3132,29 +2932,29 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3132
2932
  }
3133
2933
  get str() {
3134
2934
  var $;
3135
- return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((P, I) => `${P}${I}`, "");
2935
+ return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((b, I) => `${b}${I}`, "");
3136
2936
  }
3137
2937
  get names() {
3138
2938
  var $;
3139
- return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((P, I) => (I instanceof r && (P[I.str] = (P[I.str] || 0) + 1), P), {});
2939
+ return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((b, I) => (I instanceof r && (b[I.str] = (b[I.str] || 0) + 1), b), {});
3140
2940
  }
3141
2941
  }
3142
2942
  e._Code = n, e.nil = new n("");
3143
2943
  function s(_, ...$) {
3144
- const P = [_[0]];
2944
+ const b = [_[0]];
3145
2945
  let I = 0;
3146
2946
  for (; I < $.length; )
3147
- l(P, $[I]), P.push(_[++I]);
3148
- return new n(P);
2947
+ l(b, $[I]), b.push(_[++I]);
2948
+ return new n(b);
3149
2949
  }
3150
2950
  e._ = s;
3151
2951
  const i = new n("+");
3152
2952
  function o(_, ...$) {
3153
- const P = [C(_[0])];
2953
+ const b = [C(_[0])];
3154
2954
  let I = 0;
3155
2955
  for (; I < $.length; )
3156
- P.push(i), l(P, $[I]), P.push(i, C(_[++I]));
3157
- return d(P), new n(P);
2956
+ b.push(i), l(b, $[I]), b.push(i, C(_[++I]));
2957
+ return d(b), new n(b);
3158
2958
  }
3159
2959
  e.str = o;
3160
2960
  function l(_, $) {
@@ -3165,9 +2965,9 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3165
2965
  let $ = 1;
3166
2966
  for (; $ < _.length - 1; ) {
3167
2967
  if (_[$] === i) {
3168
- const P = u(_[$ - 1], _[$ + 1]);
3169
- if (P !== void 0) {
3170
- _.splice($ - 1, 3, P);
2968
+ const b = u(_[$ - 1], _[$ + 1]);
2969
+ if (b !== void 0) {
2970
+ _.splice($ - 1, 3, b);
3171
2971
  continue;
3172
2972
  }
3173
2973
  _[$++] = "+";
@@ -3185,10 +2985,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3185
2985
  if (typeof $ == "string" && $[0] === '"' && !(_ instanceof r))
3186
2986
  return `"${_}${$.slice(1)}`;
3187
2987
  }
3188
- function p(_, $) {
2988
+ function f(_, $) {
3189
2989
  return $.emptyStr() ? _ : _.emptyStr() ? $ : o`${_}${$}`;
3190
2990
  }
3191
- e.strConcat = p;
2991
+ e.strConcat = f;
3192
2992
  function g(_) {
3193
2993
  return typeof _ == "number" || typeof _ == "boolean" || _ === null ? _ : C(Array.isArray(_) ? _.join(",") : _);
3194
2994
  }
@@ -3204,12 +3004,12 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3204
3004
  return typeof _ == "string" && e.IDENTIFIER.test(_) ? new n(`.${_}`) : s`[${_}]`;
3205
3005
  }
3206
3006
  e.getProperty = S;
3207
- function T(_) {
3007
+ function R(_) {
3208
3008
  if (typeof _ == "string" && e.IDENTIFIER.test(_))
3209
3009
  return new n(`${_}`);
3210
3010
  throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`);
3211
3011
  }
3212
- e.getEsmExportName = T;
3012
+ e.getEsmExportName = R;
3213
3013
  function y(_) {
3214
3014
  return new n(_.toString());
3215
3015
  }
@@ -3233,8 +3033,8 @@ var scope = {};
3233
3033
  var: new t.Name("var")
3234
3034
  };
3235
3035
  class s {
3236
- constructor({ prefixes: u, parent: p } = {}) {
3237
- this._names = {}, this._prefixes = u, this._parent = p;
3036
+ constructor({ prefixes: u, parent: f } = {}) {
3037
+ this._names = {}, this._prefixes = u, this._parent = f;
3238
3038
  }
3239
3039
  toName(u) {
3240
3040
  return u instanceof t.Name ? u : this.name(u);
@@ -3243,23 +3043,23 @@ var scope = {};
3243
3043
  return new t.Name(this._newName(u));
3244
3044
  }
3245
3045
  _newName(u) {
3246
- const p = this._names[u] || this._nameGroup(u);
3247
- return `${u}${p.index++}`;
3046
+ const f = this._names[u] || this._nameGroup(u);
3047
+ return `${u}${f.index++}`;
3248
3048
  }
3249
3049
  _nameGroup(u) {
3250
- var p, g;
3251
- if (!((g = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || g === void 0) && g.has(u) || this._prefixes && !this._prefixes.has(u))
3050
+ var f, g;
3051
+ if (!((g = (f = this._parent) === null || f === void 0 ? void 0 : f._prefixes) === null || g === void 0) && g.has(u) || this._prefixes && !this._prefixes.has(u))
3252
3052
  throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);
3253
3053
  return this._names[u] = { prefix: u, index: 0 };
3254
3054
  }
3255
3055
  }
3256
3056
  e.Scope = s;
3257
3057
  class i extends t.Name {
3258
- constructor(u, p) {
3259
- super(p), this.prefix = u;
3058
+ constructor(u, f) {
3059
+ super(f), this.prefix = u;
3260
3060
  }
3261
- setValue(u, { property: p, itemIndex: g }) {
3262
- this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${g}]`;
3061
+ setValue(u, { property: f, itemIndex: g }) {
3062
+ this.value = u, this.scopePath = (0, t._)`.${new t.Name(f)}[${g}]`;
3263
3063
  }
3264
3064
  }
3265
3065
  e.ValueScopeName = i;
@@ -3274,56 +3074,56 @@ var scope = {};
3274
3074
  name(u) {
3275
3075
  return new i(u, this._newName(u));
3276
3076
  }
3277
- value(u, p) {
3077
+ value(u, f) {
3278
3078
  var g;
3279
- if (p.ref === void 0)
3079
+ if (f.ref === void 0)
3280
3080
  throw new Error("CodeGen: ref must be passed in value");
3281
- const O = this.toName(u), { prefix: C } = O, S = (g = p.key) !== null && g !== void 0 ? g : p.ref;
3282
- let T = this._values[C];
3283
- if (T) {
3284
- const $ = T.get(S);
3081
+ const O = this.toName(u), { prefix: C } = O, S = (g = f.key) !== null && g !== void 0 ? g : f.ref;
3082
+ let R = this._values[C];
3083
+ if (R) {
3084
+ const $ = R.get(S);
3285
3085
  if ($)
3286
3086
  return $;
3287
3087
  } else
3288
- T = this._values[C] = /* @__PURE__ */ new Map();
3289
- T.set(S, O);
3088
+ R = this._values[C] = /* @__PURE__ */ new Map();
3089
+ R.set(S, O);
3290
3090
  const y = this._scope[C] || (this._scope[C] = []), _ = y.length;
3291
- return y[_] = p.ref, O.setValue(p, { property: C, itemIndex: _ }), O;
3091
+ return y[_] = f.ref, O.setValue(f, { property: C, itemIndex: _ }), O;
3292
3092
  }
3293
- getValue(u, p) {
3093
+ getValue(u, f) {
3294
3094
  const g = this._values[u];
3295
3095
  if (g)
3296
- return g.get(p);
3096
+ return g.get(f);
3297
3097
  }
3298
- scopeRefs(u, p = this._values) {
3299
- return this._reduceValues(p, (g) => {
3098
+ scopeRefs(u, f = this._values) {
3099
+ return this._reduceValues(f, (g) => {
3300
3100
  if (g.scopePath === void 0)
3301
3101
  throw new Error(`CodeGen: name "${g}" has no value`);
3302
3102
  return (0, t._)`${u}${g.scopePath}`;
3303
3103
  });
3304
3104
  }
3305
- scopeCode(u = this._values, p, g) {
3105
+ scopeCode(u = this._values, f, g) {
3306
3106
  return this._reduceValues(u, (O) => {
3307
3107
  if (O.value === void 0)
3308
3108
  throw new Error(`CodeGen: name "${O}" has no value`);
3309
3109
  return O.value.code;
3310
- }, p, g);
3110
+ }, f, g);
3311
3111
  }
3312
- _reduceValues(u, p, g = {}, O) {
3112
+ _reduceValues(u, f, g = {}, O) {
3313
3113
  let C = t.nil;
3314
3114
  for (const S in u) {
3315
- const T = u[S];
3316
- if (!T)
3115
+ const R = u[S];
3116
+ if (!R)
3317
3117
  continue;
3318
3118
  const y = g[S] = g[S] || /* @__PURE__ */ new Map();
3319
- T.forEach((_) => {
3119
+ R.forEach((_) => {
3320
3120
  if (y.has(_))
3321
3121
  return;
3322
3122
  y.set(_, n.Started);
3323
- let $ = p(_);
3123
+ let $ = f(_);
3324
3124
  if ($) {
3325
- const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3326
- C = (0, t._)`${C}${P} ${_} = ${$};${this.opts._n}`;
3125
+ const b = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3126
+ C = (0, t._)`${C}${b} ${_} = ${$};${this.opts._n}`;
3327
3127
  } else if ($ = O == null ? void 0 : O(_))
3328
3128
  C = (0, t._)`${C}${$}${this.opts._n}`;
3329
3129
  else
@@ -3396,7 +3196,7 @@ var scope = {};
3396
3196
  }
3397
3197
  optimizeNames(a, h) {
3398
3198
  if (a[this.name.str])
3399
- return this.rhs && (this.rhs = oe(this.rhs, a, h)), this;
3199
+ return this.rhs && (this.rhs = ie(this.rhs, a, h)), this;
3400
3200
  }
3401
3201
  get names() {
3402
3202
  return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
@@ -3411,11 +3211,11 @@ var scope = {};
3411
3211
  }
3412
3212
  optimizeNames(a, h) {
3413
3213
  if (!(this.lhs instanceof t.Name && !a[this.lhs.str] && !this.sideEffects))
3414
- return this.rhs = oe(this.rhs, a, h), this;
3214
+ return this.rhs = ie(this.rhs, a, h), this;
3415
3215
  }
3416
3216
  get names() {
3417
3217
  const a = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
3418
- return ue(a, this.rhs);
3218
+ return de(a, this.rhs);
3419
3219
  }
3420
3220
  }
3421
3221
  class d extends l {
@@ -3434,7 +3234,7 @@ var scope = {};
3434
3234
  return `${this.label}:` + a;
3435
3235
  }
3436
3236
  }
3437
- class p extends i {
3237
+ class f extends i {
3438
3238
  constructor(a) {
3439
3239
  super(), this.label = a, this.names = {};
3440
3240
  }
@@ -3464,7 +3264,7 @@ var scope = {};
3464
3264
  return `${this.code}` ? this : void 0;
3465
3265
  }
3466
3266
  optimizeNames(a, h) {
3467
- return this.code = oe(this.code, a, h), this;
3267
+ return this.code = ie(this.code, a, h), this;
3468
3268
  }
3469
3269
  get names() {
3470
3270
  return this.code instanceof t._CodeOrName ? this.code.names : {};
@@ -3491,12 +3291,12 @@ var scope = {};
3491
3291
  let M = N.length;
3492
3292
  for (; M--; ) {
3493
3293
  const q = N[M];
3494
- q.optimizeNames(a, h) || (Te(a, q.names), N.splice(M, 1));
3294
+ q.optimizeNames(a, h) || (Se(a, q.names), N.splice(M, 1));
3495
3295
  }
3496
3296
  return N.length > 0 ? this : void 0;
3497
3297
  }
3498
3298
  get names() {
3499
- return this.nodes.reduce((a, h) => J(a, h.names), {});
3299
+ return this.nodes.reduce((a, h) => G(a, h.names), {});
3500
3300
  }
3501
3301
  }
3502
3302
  class S extends C {
@@ -3504,7 +3304,7 @@ var scope = {};
3504
3304
  return "{" + a._n + super.render(a) + "}" + a._n;
3505
3305
  }
3506
3306
  }
3507
- class T extends C {
3307
+ class R extends C {
3508
3308
  }
3509
3309
  class y extends S {
3510
3310
  }
@@ -3528,25 +3328,25 @@ var scope = {};
3528
3328
  h = this.else = Array.isArray(N) ? new y(N) : N;
3529
3329
  }
3530
3330
  if (h)
3531
- return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(ke(a), h instanceof _ ? [h] : h.nodes);
3331
+ return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(Te(a), h instanceof _ ? [h] : h.nodes);
3532
3332
  if (!(a === !1 || !this.nodes.length))
3533
3333
  return this;
3534
3334
  }
3535
3335
  optimizeNames(a, h) {
3536
3336
  var N;
3537
3337
  if (this.else = (N = this.else) === null || N === void 0 ? void 0 : N.optimizeNames(a, h), !!(super.optimizeNames(a, h) || this.else))
3538
- return this.condition = oe(this.condition, a, h), this;
3338
+ return this.condition = ie(this.condition, a, h), this;
3539
3339
  }
3540
3340
  get names() {
3541
3341
  const a = super.names;
3542
- return ue(a, this.condition), this.else && J(a, this.else.names), a;
3342
+ return de(a, this.condition), this.else && G(a, this.else.names), a;
3543
3343
  }
3544
3344
  }
3545
3345
  _.kind = "if";
3546
3346
  class $ extends S {
3547
3347
  }
3548
3348
  $.kind = "for";
3549
- class P extends $ {
3349
+ class b extends $ {
3550
3350
  constructor(a) {
3551
3351
  super(), this.iteration = a;
3552
3352
  }
@@ -3555,10 +3355,10 @@ var scope = {};
3555
3355
  }
3556
3356
  optimizeNames(a, h) {
3557
3357
  if (super.optimizeNames(a, h))
3558
- return this.iteration = oe(this.iteration, a, h), this;
3358
+ return this.iteration = ie(this.iteration, a, h), this;
3559
3359
  }
3560
3360
  get names() {
3561
- return J(super.names, this.iteration.names);
3361
+ return G(super.names, this.iteration.names);
3562
3362
  }
3563
3363
  }
3564
3364
  class I extends $ {
@@ -3570,11 +3370,11 @@ var scope = {};
3570
3370
  return `for(${h} ${N}=${M}; ${N}<${q}; ${N}++)` + super.render(a);
3571
3371
  }
3572
3372
  get names() {
3573
- const a = ue(super.names, this.from);
3574
- return ue(a, this.to);
3373
+ const a = de(super.names, this.from);
3374
+ return de(a, this.to);
3575
3375
  }
3576
3376
  }
3577
- class D extends $ {
3377
+ class A extends $ {
3578
3378
  constructor(a, h, N, M) {
3579
3379
  super(), this.loop = a, this.varKind = h, this.name = N, this.iterable = M;
3580
3380
  }
@@ -3583,10 +3383,10 @@ var scope = {};
3583
3383
  }
3584
3384
  optimizeNames(a, h) {
3585
3385
  if (super.optimizeNames(a, h))
3586
- return this.iterable = oe(this.iterable, a, h), this;
3386
+ return this.iterable = ie(this.iterable, a, h), this;
3587
3387
  }
3588
3388
  get names() {
3589
- return J(super.names, this.iterable.names);
3389
+ return G(super.names, this.iterable.names);
3590
3390
  }
3591
3391
  }
3592
3392
  class w extends S {
@@ -3604,7 +3404,7 @@ var scope = {};
3604
3404
  }
3605
3405
  }
3606
3406
  k.kind = "return";
3607
- class A extends S {
3407
+ class D extends S {
3608
3408
  render(a) {
3609
3409
  let h = "try" + super.render(a);
3610
3410
  return this.catch && (h += this.catch.render(a)), this.finally && (h += this.finally.render(a)), h;
@@ -3619,7 +3419,7 @@ var scope = {};
3619
3419
  }
3620
3420
  get names() {
3621
3421
  const a = super.names;
3622
- return this.catch && J(a, this.catch.names), this.finally && J(a, this.finally.names), a;
3422
+ return this.catch && G(a, this.catch.names), this.finally && G(a, this.finally.names), a;
3623
3423
  }
3624
3424
  }
3625
3425
  class V extends S {
@@ -3631,16 +3431,16 @@ var scope = {};
3631
3431
  }
3632
3432
  }
3633
3433
  V.kind = "catch";
3634
- class x extends S {
3434
+ class H extends S {
3635
3435
  render(a) {
3636
3436
  return "finally" + super.render(a);
3637
3437
  }
3638
3438
  }
3639
- x.kind = "finally";
3640
- class te {
3439
+ H.kind = "finally";
3440
+ class X {
3641
3441
  constructor(a, h = {}) {
3642
3442
  this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...h, _n: h.lines ? `
3643
- ` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new T()];
3443
+ ` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new R()];
3644
3444
  }
3645
3445
  toString() {
3646
3446
  return this._root.render(this.opts);
@@ -3731,23 +3531,23 @@ var scope = {};
3731
3531
  }
3732
3532
  // a generic `for` clause (or statement if `forBody` is passed)
3733
3533
  for(a, h) {
3734
- return this._for(new P(a), h);
3534
+ return this._for(new b(a), h);
3735
3535
  }
3736
3536
  // `for` statement for a range of values
3737
3537
  forRange(a, h, N, M, q = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
3738
- const W = this._scope.toName(a);
3739
- return this._for(new I(q, W, h, N), () => M(W));
3538
+ const x = this._scope.toName(a);
3539
+ return this._for(new I(q, x, h, N), () => M(x));
3740
3540
  }
3741
3541
  // `for-of` statement (in es5 mode replace with a normal for loop)
3742
3542
  forOf(a, h, N, M = r.varKinds.const) {
3743
3543
  const q = this._scope.toName(a);
3744
3544
  if (this.opts.es5) {
3745
- const W = h instanceof t.Name ? h : this.var("_arr", h);
3746
- return this.forRange("_i", 0, (0, t._)`${W}.length`, (G) => {
3747
- this.var(q, (0, t._)`${W}[${G}]`), N(q);
3545
+ const x = h instanceof t.Name ? h : this.var("_arr", h);
3546
+ return this.forRange("_i", 0, (0, t._)`${x}.length`, (W) => {
3547
+ this.var(q, (0, t._)`${x}[${W}]`), N(q);
3748
3548
  });
3749
3549
  }
3750
- return this._for(new D("of", M, q, h), () => N(q));
3550
+ return this._for(new A("of", M, q, h), () => N(q));
3751
3551
  }
3752
3552
  // `for-in` statement.
3753
3553
  // With option `ownProperties` replaced with a `for-of` loop for object keys
@@ -3755,7 +3555,7 @@ var scope = {};
3755
3555
  if (this.opts.ownProperties)
3756
3556
  return this.forOf(a, (0, t._)`Object.keys(${h})`, N);
3757
3557
  const q = this._scope.toName(a);
3758
- return this._for(new D("in", M, q, h), () => N(q));
3558
+ return this._for(new A("in", M, q, h), () => N(q));
3759
3559
  }
3760
3560
  // end `for` loop
3761
3561
  endFor() {
@@ -3767,7 +3567,7 @@ var scope = {};
3767
3567
  }
3768
3568
  // `break` statement
3769
3569
  break(a) {
3770
- return this._leafNode(new p(a));
3570
+ return this._leafNode(new f(a));
3771
3571
  }
3772
3572
  // `return` statement
3773
3573
  return(a) {
@@ -3780,12 +3580,12 @@ var scope = {};
3780
3580
  try(a, h, N) {
3781
3581
  if (!h && !N)
3782
3582
  throw new Error('CodeGen: "try" without "catch" and "finally"');
3783
- const M = new A();
3583
+ const M = new D();
3784
3584
  if (this._blockNode(M), this.code(a), h) {
3785
3585
  const q = this.name("e");
3786
3586
  this._currNode = M.catch = new V(q), h(q);
3787
3587
  }
3788
- return N && (this._currNode = M.finally = new x(), this.code(N)), this._endBlockNode(V, x);
3588
+ return N && (this._currNode = M.finally = new H(), this.code(N)), this._endBlockNode(V, H);
3789
3589
  }
3790
3590
  // `throw` statement
3791
3591
  throw(a) {
@@ -3847,52 +3647,52 @@ var scope = {};
3847
3647
  h[h.length - 1] = a;
3848
3648
  }
3849
3649
  }
3850
- e.CodeGen = te;
3851
- function J(b, a) {
3650
+ e.CodeGen = X;
3651
+ function G(P, a) {
3852
3652
  for (const h in a)
3853
- b[h] = (b[h] || 0) + (a[h] || 0);
3854
- return b;
3855
- }
3856
- function ue(b, a) {
3857
- return a instanceof t._CodeOrName ? J(b, a.names) : b;
3858
- }
3859
- function oe(b, a, h) {
3860
- if (b instanceof t.Name)
3861
- return N(b);
3862
- if (!M(b))
3863
- return b;
3864
- return new t._Code(b._items.reduce((q, W) => (W instanceof t.Name && (W = N(W)), W instanceof t._Code ? q.push(...W._items) : q.push(W), q), []));
3653
+ P[h] = (P[h] || 0) + (a[h] || 0);
3654
+ return P;
3655
+ }
3656
+ function de(P, a) {
3657
+ return a instanceof t._CodeOrName ? G(P, a.names) : P;
3658
+ }
3659
+ function ie(P, a, h) {
3660
+ if (P instanceof t.Name)
3661
+ return N(P);
3662
+ if (!M(P))
3663
+ return P;
3664
+ return new t._Code(P._items.reduce((q, x) => (x instanceof t.Name && (x = N(x)), x instanceof t._Code ? q.push(...x._items) : q.push(x), q), []));
3865
3665
  function N(q) {
3866
- const W = h[q.str];
3867
- return W === void 0 || a[q.str] !== 1 ? q : (delete a[q.str], W);
3666
+ const x = h[q.str];
3667
+ return x === void 0 || a[q.str] !== 1 ? q : (delete a[q.str], x);
3868
3668
  }
3869
3669
  function M(q) {
3870
- return q instanceof t._Code && q._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
3670
+ return q instanceof t._Code && q._items.some((x) => x instanceof t.Name && a[x.str] === 1 && h[x.str] !== void 0);
3871
3671
  }
3872
3672
  }
3873
- function Te(b, a) {
3673
+ function Se(P, a) {
3874
3674
  for (const h in a)
3875
- b[h] = (b[h] || 0) - (a[h] || 0);
3675
+ P[h] = (P[h] || 0) - (a[h] || 0);
3876
3676
  }
3877
- function ke(b) {
3878
- return typeof b == "boolean" || typeof b == "number" || b === null ? !b : (0, t._)`!${j(b)}`;
3677
+ function Te(P) {
3678
+ return typeof P == "boolean" || typeof P == "number" || P === null ? !P : (0, t._)`!${j(P)}`;
3879
3679
  }
3880
- e.not = ke;
3881
- const Fe = v(e.operators.AND);
3882
- function Ze(...b) {
3883
- return b.reduce(Fe);
3680
+ e.not = Te;
3681
+ const Ie = v(e.operators.AND);
3682
+ function xe(...P) {
3683
+ return P.reduce(Ie);
3884
3684
  }
3885
- e.and = Ze;
3886
- const Me = v(e.operators.OR);
3887
- function F(...b) {
3888
- return b.reduce(Me);
3685
+ e.and = xe;
3686
+ const je = v(e.operators.OR);
3687
+ function F(...P) {
3688
+ return P.reduce(je);
3889
3689
  }
3890
3690
  e.or = F;
3891
- function v(b) {
3892
- return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${b} ${j(h)}`;
3691
+ function v(P) {
3692
+ return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${P} ${j(h)}`;
3893
3693
  }
3894
- function j(b) {
3895
- return b instanceof t.Name ? b : (0, t._)`(${b})`;
3694
+ function j(P) {
3695
+ return P instanceof t.Name ? P : (0, t._)`(${P})`;
3896
3696
  }
3897
3697
  })(codegen);
3898
3698
  var util = {};
@@ -3901,8 +3701,8 @@ var util = {};
3901
3701
  const t = codegen, r = code$1;
3902
3702
  function n(w) {
3903
3703
  const k = {};
3904
- for (const A of w)
3905
- k[A] = !0;
3704
+ for (const D of w)
3705
+ k[D] = !0;
3906
3706
  return k;
3907
3707
  }
3908
3708
  e.toHash = n;
@@ -3911,19 +3711,19 @@ var util = {};
3911
3711
  }
3912
3712
  e.alwaysValidSchema = s;
3913
3713
  function i(w, k = w.schema) {
3914
- const { opts: A, self: V } = w;
3915
- if (!A.strictSchema || typeof k == "boolean")
3714
+ const { opts: D, self: V } = w;
3715
+ if (!D.strictSchema || typeof k == "boolean")
3916
3716
  return;
3917
- const x = V.RULES.keywords;
3918
- for (const te in k)
3919
- x[te] || D(w, `unknown keyword: "${te}"`);
3717
+ const H = V.RULES.keywords;
3718
+ for (const X in k)
3719
+ H[X] || A(w, `unknown keyword: "${X}"`);
3920
3720
  }
3921
3721
  e.checkUnknownRules = i;
3922
3722
  function o(w, k) {
3923
3723
  if (typeof w == "boolean")
3924
3724
  return !w;
3925
- for (const A in w)
3926
- if (k[A])
3725
+ for (const D in w)
3726
+ if (k[D])
3927
3727
  return !0;
3928
3728
  return !1;
3929
3729
  }
@@ -3931,18 +3731,18 @@ var util = {};
3931
3731
  function l(w, k) {
3932
3732
  if (typeof w == "boolean")
3933
3733
  return !w;
3934
- for (const A in w)
3935
- if (A !== "$ref" && k.all[A])
3734
+ for (const D in w)
3735
+ if (D !== "$ref" && k.all[D])
3936
3736
  return !0;
3937
3737
  return !1;
3938
3738
  }
3939
3739
  e.schemaHasRulesButRef = l;
3940
- function d({ topSchemaRef: w, schemaPath: k }, A, V, x) {
3941
- if (!x) {
3942
- if (typeof A == "number" || typeof A == "boolean")
3943
- return A;
3944
- if (typeof A == "string")
3945
- return (0, t._)`${A}`;
3740
+ function d({ topSchemaRef: w, schemaPath: k }, D, V, H) {
3741
+ if (!H) {
3742
+ if (typeof D == "number" || typeof D == "boolean")
3743
+ return D;
3744
+ if (typeof D == "string")
3745
+ return (0, t._)`${D}`;
3946
3746
  }
3947
3747
  return (0, t._)`${w}${k}${(0, t.getProperty)(V)}`;
3948
3748
  }
@@ -3951,10 +3751,10 @@ var util = {};
3951
3751
  return O(decodeURIComponent(w));
3952
3752
  }
3953
3753
  e.unescapeFragment = u;
3954
- function p(w) {
3754
+ function f(w) {
3955
3755
  return encodeURIComponent(g(w));
3956
3756
  }
3957
- e.escapeFragment = p;
3757
+ e.escapeFragment = f;
3958
3758
  function g(w) {
3959
3759
  return typeof w == "number" ? `${w}` : w.replace(/~/g, "~0").replace(/\//g, "~1");
3960
3760
  }
@@ -3965,45 +3765,45 @@ var util = {};
3965
3765
  e.unescapeJsonPointer = O;
3966
3766
  function C(w, k) {
3967
3767
  if (Array.isArray(w))
3968
- for (const A of w)
3969
- k(A);
3768
+ for (const D of w)
3769
+ k(D);
3970
3770
  else
3971
3771
  k(w);
3972
3772
  }
3973
3773
  e.eachItem = C;
3974
- function S({ mergeNames: w, mergeToName: k, mergeValues: A, resultToName: V }) {
3975
- return (x, te, J, ue) => {
3976
- const oe = J === void 0 ? te : J instanceof t.Name ? (te instanceof t.Name ? w(x, te, J) : k(x, te, J), J) : te instanceof t.Name ? (k(x, J, te), te) : A(te, J);
3977
- return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
3774
+ function S({ mergeNames: w, mergeToName: k, mergeValues: D, resultToName: V }) {
3775
+ return (H, X, G, de) => {
3776
+ const ie = G === void 0 ? X : G instanceof t.Name ? (X instanceof t.Name ? w(H, X, G) : k(H, X, G), G) : X instanceof t.Name ? (k(H, G, X), X) : D(X, G);
3777
+ return de === t.Name && !(ie instanceof t.Name) ? V(H, ie) : ie;
3978
3778
  };
3979
3779
  }
3980
3780
  e.mergeEvaluated = {
3981
3781
  props: S({
3982
- mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => {
3983
- w.if((0, t._)`${k} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${k})`));
3782
+ mergeNames: (w, k, D) => w.if((0, t._)`${D} !== true && ${k} !== undefined`, () => {
3783
+ w.if((0, t._)`${k} === true`, () => w.assign(D, !0), () => w.assign(D, (0, t._)`${D} || {}`).code((0, t._)`Object.assign(${D}, ${k})`));
3984
3784
  }),
3985
- mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => {
3986
- k === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), y(w, A, k));
3785
+ mergeToName: (w, k, D) => w.if((0, t._)`${D} !== true`, () => {
3786
+ k === !0 ? w.assign(D, !0) : (w.assign(D, (0, t._)`${D} || {}`), y(w, D, k));
3987
3787
  }),
3988
3788
  mergeValues: (w, k) => w === !0 ? !0 : { ...w, ...k },
3989
- resultToName: T
3789
+ resultToName: R
3990
3790
  }),
3991
3791
  items: S({
3992
- mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => w.assign(A, (0, t._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),
3993
- mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => w.assign(A, k === !0 ? !0 : (0, t._)`${A} > ${k} ? ${A} : ${k}`)),
3792
+ mergeNames: (w, k, D) => w.if((0, t._)`${D} !== true && ${k} !== undefined`, () => w.assign(D, (0, t._)`${k} === true ? true : ${D} > ${k} ? ${D} : ${k}`)),
3793
+ mergeToName: (w, k, D) => w.if((0, t._)`${D} !== true`, () => w.assign(D, k === !0 ? !0 : (0, t._)`${D} > ${k} ? ${D} : ${k}`)),
3994
3794
  mergeValues: (w, k) => w === !0 ? !0 : Math.max(w, k),
3995
3795
  resultToName: (w, k) => w.var("items", k)
3996
3796
  })
3997
3797
  };
3998
- function T(w, k) {
3798
+ function R(w, k) {
3999
3799
  if (k === !0)
4000
3800
  return w.var("props", !0);
4001
- const A = w.var("props", (0, t._)`{}`);
4002
- return k !== void 0 && y(w, A, k), A;
3801
+ const D = w.var("props", (0, t._)`{}`);
3802
+ return k !== void 0 && y(w, D, k), D;
4003
3803
  }
4004
- e.evaluatedPropsToName = T;
4005
- function y(w, k, A) {
4006
- Object.keys(A).forEach((V) => w.assign((0, t._)`${k}${(0, t.getProperty)(V)}`, !0));
3804
+ e.evaluatedPropsToName = R;
3805
+ function y(w, k, D) {
3806
+ Object.keys(D).forEach((V) => w.assign((0, t._)`${k}${(0, t.getProperty)(V)}`, !0));
4007
3807
  }
4008
3808
  e.setEvaluated = y;
4009
3809
  const _ = {};
@@ -4014,26 +3814,26 @@ var util = {};
4014
3814
  });
4015
3815
  }
4016
3816
  e.useFunc = $;
4017
- var P;
3817
+ var b;
4018
3818
  (function(w) {
4019
3819
  w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
4020
- })(P = e.Type || (e.Type = {}));
4021
- function I(w, k, A) {
3820
+ })(b = e.Type || (e.Type = {}));
3821
+ function I(w, k, D) {
4022
3822
  if (w instanceof t.Name) {
4023
- const V = k === P.Num;
4024
- return A ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
3823
+ const V = k === b.Num;
3824
+ return D ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
4025
3825
  }
4026
- return A ? (0, t.getProperty)(w).toString() : "/" + g(w);
3826
+ return D ? (0, t.getProperty)(w).toString() : "/" + g(w);
4027
3827
  }
4028
3828
  e.getErrorPath = I;
4029
- function D(w, k, A = w.opts.strictSchema) {
4030
- if (A) {
4031
- if (k = `strict mode: ${k}`, A === !0)
3829
+ function A(w, k, D = w.opts.strictSchema) {
3830
+ if (D) {
3831
+ if (k = `strict mode: ${k}`, D === !0)
4032
3832
  throw new Error(k);
4033
3833
  w.self.logger.warn(k);
4034
3834
  }
4035
3835
  }
4036
- e.checkStrictMode = D;
3836
+ e.checkStrictMode = A;
4037
3837
  })(util);
4038
3838
  var names$1 = {};
4039
3839
  Object.defineProperty(names$1, "__esModule", { value: !0 });
@@ -4069,26 +3869,26 @@ names$1.default = names;
4069
3869
  }, e.keyword$DataError = {
4070
3870
  message: ({ keyword: y, schemaType: _ }) => _ ? (0, t.str)`"${y}" keyword must be ${_} ($data)` : (0, t.str)`"${y}" keyword is invalid ($data)`
4071
3871
  };
4072
- function s(y, _ = e.keywordError, $, P) {
4073
- const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A = g(y, _, $);
4074
- P ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3872
+ function s(y, _ = e.keywordError, $, b) {
3873
+ const { it: I } = y, { gen: A, compositeRule: w, allErrors: k } = I, D = g(y, _, $);
3874
+ b ?? (w || k) ? d(A, D) : u(I, (0, t._)`[${D}]`);
4075
3875
  }
4076
3876
  e.reportError = s;
4077
3877
  function i(y, _ = e.keywordError, $) {
4078
- const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k = g(y, _, $);
4079
- d(I, k), D || w || u(P, n.default.vErrors);
3878
+ const { it: b } = y, { gen: I, compositeRule: A, allErrors: w } = b, k = g(y, _, $);
3879
+ d(I, k), A || w || u(b, n.default.vErrors);
4080
3880
  }
4081
3881
  e.reportExtraError = i;
4082
3882
  function o(y, _) {
4083
3883
  y.assign(n.default.errors, _), y.if((0, t._)`${n.default.vErrors} !== null`, () => y.if(_, () => y.assign((0, t._)`${n.default.vErrors}.length`, _), () => y.assign(n.default.vErrors, null)));
4084
3884
  }
4085
3885
  e.resetErrorsCount = o;
4086
- function l({ gen: y, keyword: _, schemaValue: $, data: P, errsCount: I, it: D }) {
3886
+ function l({ gen: y, keyword: _, schemaValue: $, data: b, errsCount: I, it: A }) {
4087
3887
  if (I === void 0)
4088
3888
  throw new Error("ajv implementation error");
4089
3889
  const w = y.name("err");
4090
3890
  y.forRange("i", I, n.default.errors, (k) => {
4091
- y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`, $), y.assign((0, t._)`${w}.data`, P));
3891
+ y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, A.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${A.errSchemaPath}/${_}`), A.opts.verbose && (y.assign((0, t._)`${w}.schema`, $), y.assign((0, t._)`${w}.data`, b));
4092
3892
  });
4093
3893
  }
4094
3894
  e.extendErrors = l;
@@ -4097,10 +3897,10 @@ names$1.default = names;
4097
3897
  y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${$}]`), (0, t._)`${n.default.vErrors}.push(${$})`), y.code((0, t._)`${n.default.errors}++`);
4098
3898
  }
4099
3899
  function u(y, _) {
4100
- const { gen: $, validateName: P, schemaEnv: I } = y;
4101
- I.$async ? $.throw((0, t._)`new ${y.ValidationError}(${_})`) : ($.assign((0, t._)`${P}.errors`, _), $.return(!1));
3900
+ const { gen: $, validateName: b, schemaEnv: I } = y;
3901
+ I.$async ? $.throw((0, t._)`new ${y.ValidationError}(${_})`) : ($.assign((0, t._)`${b}.errors`, _), $.return(!1));
4102
3902
  }
4103
- const p = {
3903
+ const f = {
4104
3904
  keyword: new t.Name("keyword"),
4105
3905
  schemaPath: new t.Name("schemaPath"),
4106
3906
  params: new t.Name("params"),
@@ -4110,27 +3910,27 @@ names$1.default = names;
4110
3910
  parentSchema: new t.Name("parentSchema")
4111
3911
  };
4112
3912
  function g(y, _, $) {
4113
- const { createErrors: P } = y.it;
4114
- return P === !1 ? (0, t._)`{}` : O(y, _, $);
3913
+ const { createErrors: b } = y.it;
3914
+ return b === !1 ? (0, t._)`{}` : O(y, _, $);
4115
3915
  }
4116
3916
  function O(y, _, $ = {}) {
4117
- const { gen: P, it: I } = y, D = [
3917
+ const { gen: b, it: I } = y, A = [
4118
3918
  C(I, $),
4119
3919
  S(y, $)
4120
3920
  ];
4121
- return T(y, _, D), P.object(...D);
3921
+ return R(y, _, A), b.object(...A);
4122
3922
  }
4123
3923
  function C({ errorPath: y }, { instancePath: _ }) {
4124
3924
  const $ = _ ? (0, t.str)`${y}${(0, r.getErrorPath)(_, r.Type.Str)}` : y;
4125
3925
  return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, $)];
4126
3926
  }
4127
- function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: $, parentSchema: P }) {
4128
- let I = P ? _ : (0, t.str)`${_}/${y}`;
4129
- return $ && (I = (0, t.str)`${I}${(0, r.getErrorPath)($, r.Type.Str)}`), [p.schemaPath, I];
3927
+ function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: $, parentSchema: b }) {
3928
+ let I = b ? _ : (0, t.str)`${_}/${y}`;
3929
+ return $ && (I = (0, t.str)`${I}${(0, r.getErrorPath)($, r.Type.Str)}`), [f.schemaPath, I];
4130
3930
  }
4131
- function T(y, { params: _, message: $ }, P) {
4132
- const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: te } = k;
4133
- P.push([p.keyword, I], [p.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), A.messages && P.push([p.message, typeof $ == "function" ? $(y) : $]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${te}`], [n.default.data, D]), V && P.push([p.propertyName, V]);
3931
+ function R(y, { params: _, message: $ }, b) {
3932
+ const { keyword: I, data: A, schemaValue: w, it: k } = y, { opts: D, propertyName: V, topSchemaRef: H, schemaPath: X } = k;
3933
+ b.push([f.keyword, I], [f.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), D.messages && b.push([f.message, typeof $ == "function" ? $(y) : $]), D.verbose && b.push([f.schema, w], [f.parentSchema, (0, t._)`${H}${X}`], [n.default.data, A]), V && b.push([f.propertyName, V]);
4134
3934
  }
4135
3935
  })(errors);
4136
3936
  Object.defineProperty(boolSchema, "__esModule", { value: !0 });
@@ -4206,144 +4006,144 @@ applicability.shouldUseRule = shouldUseRule;
4206
4006
  Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
4207
4007
  const t = rules, r = applicability, n = errors, s = codegen, i = util;
4208
4008
  var o;
4209
- (function(P) {
4210
- P[P.Correct = 0] = "Correct", P[P.Wrong = 1] = "Wrong";
4009
+ (function(b) {
4010
+ b[b.Correct = 0] = "Correct", b[b.Wrong = 1] = "Wrong";
4211
4011
  })(o = e.DataType || (e.DataType = {}));
4212
- function l(P) {
4213
- const I = d(P.type);
4012
+ function l(b) {
4013
+ const I = d(b.type);
4214
4014
  if (I.includes("null")) {
4215
- if (P.nullable === !1)
4015
+ if (b.nullable === !1)
4216
4016
  throw new Error("type: null contradicts nullable: false");
4217
4017
  } else {
4218
- if (!I.length && P.nullable !== void 0)
4018
+ if (!I.length && b.nullable !== void 0)
4219
4019
  throw new Error('"nullable" cannot be used without "type"');
4220
- P.nullable === !0 && I.push("null");
4020
+ b.nullable === !0 && I.push("null");
4221
4021
  }
4222
4022
  return I;
4223
4023
  }
4224
4024
  e.getSchemaTypes = l;
4225
- function d(P) {
4226
- const I = Array.isArray(P) ? P : P ? [P] : [];
4025
+ function d(b) {
4026
+ const I = Array.isArray(b) ? b : b ? [b] : [];
4227
4027
  if (I.every(t.isJSONType))
4228
4028
  return I;
4229
4029
  throw new Error("type must be JSONType or JSONType[]: " + I.join(","));
4230
4030
  }
4231
4031
  e.getJSONTypes = d;
4232
- function u(P, I) {
4233
- const { gen: D, data: w, opts: k } = P, A = g(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4032
+ function u(b, I) {
4033
+ const { gen: A, data: w, opts: k } = b, D = g(I, k.coerceTypes), V = I.length > 0 && !(D.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(b, I[0]));
4234
4034
  if (V) {
4235
- const x = T(I, w, k.strictNumbers, o.Wrong);
4236
- D.if(x, () => {
4237
- A.length ? O(P, I, A) : _(P);
4035
+ const H = R(I, w, k.strictNumbers, o.Wrong);
4036
+ A.if(H, () => {
4037
+ D.length ? O(b, I, D) : _(b);
4238
4038
  });
4239
4039
  }
4240
4040
  return V;
4241
4041
  }
4242
4042
  e.coerceAndCheckDataType = u;
4243
- const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4244
- function g(P, I) {
4245
- return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
4246
- }
4247
- function O(P, I, D) {
4248
- const { gen: w, data: k, opts: A } = P, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
4249
- A.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(T(I, k, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
4250
- for (const J of D)
4251
- (p.has(J) || J === "array" && A.coerceTypes === "array") && te(J);
4252
- w.else(), _(P), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
4253
- w.assign(k, x), C(P, x);
4043
+ const f = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4044
+ function g(b, I) {
4045
+ return I ? b.filter((A) => f.has(A) || I === "array" && A === "array") : [];
4046
+ }
4047
+ function O(b, I, A) {
4048
+ const { gen: w, data: k, opts: D } = b, V = w.let("dataType", (0, s._)`typeof ${k}`), H = w.let("coerced", (0, s._)`undefined`);
4049
+ D.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(R(I, k, D.strictNumbers), () => w.assign(H, k))), w.if((0, s._)`${H} !== undefined`);
4050
+ for (const G of A)
4051
+ (f.has(G) || G === "array" && D.coerceTypes === "array") && X(G);
4052
+ w.else(), _(b), w.endIf(), w.if((0, s._)`${H} !== undefined`, () => {
4053
+ w.assign(k, H), C(b, H);
4254
4054
  });
4255
- function te(J) {
4256
- switch (J) {
4055
+ function X(G) {
4056
+ switch (G) {
4257
4057
  case "string":
4258
- w.elseIf((0, s._)`${V} == "number" || ${V} == "boolean"`).assign(x, (0, s._)`"" + ${k}`).elseIf((0, s._)`${k} === null`).assign(x, (0, s._)`""`);
4058
+ w.elseIf((0, s._)`${V} == "number" || ${V} == "boolean"`).assign(H, (0, s._)`"" + ${k}`).elseIf((0, s._)`${k} === null`).assign(H, (0, s._)`""`);
4259
4059
  return;
4260
4060
  case "number":
4261
4061
  w.elseIf((0, s._)`${V} == "boolean" || ${k} === null
4262
- || (${V} == "string" && ${k} && ${k} == +${k})`).assign(x, (0, s._)`+${k}`);
4062
+ || (${V} == "string" && ${k} && ${k} == +${k})`).assign(H, (0, s._)`+${k}`);
4263
4063
  return;
4264
4064
  case "integer":
4265
4065
  w.elseIf((0, s._)`${V} === "boolean" || ${k} === null
4266
- || (${V} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(x, (0, s._)`+${k}`);
4066
+ || (${V} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(H, (0, s._)`+${k}`);
4267
4067
  return;
4268
4068
  case "boolean":
4269
- w.elseIf((0, s._)`${k} === "false" || ${k} === 0 || ${k} === null`).assign(x, !1).elseIf((0, s._)`${k} === "true" || ${k} === 1`).assign(x, !0);
4069
+ w.elseIf((0, s._)`${k} === "false" || ${k} === 0 || ${k} === null`).assign(H, !1).elseIf((0, s._)`${k} === "true" || ${k} === 1`).assign(H, !0);
4270
4070
  return;
4271
4071
  case "null":
4272
- w.elseIf((0, s._)`${k} === "" || ${k} === 0 || ${k} === false`), w.assign(x, null);
4072
+ w.elseIf((0, s._)`${k} === "" || ${k} === 0 || ${k} === false`), w.assign(H, null);
4273
4073
  return;
4274
4074
  case "array":
4275
4075
  w.elseIf((0, s._)`${V} === "string" || ${V} === "number"
4276
- || ${V} === "boolean" || ${k} === null`).assign(x, (0, s._)`[${k}]`);
4076
+ || ${V} === "boolean" || ${k} === null`).assign(H, (0, s._)`[${k}]`);
4277
4077
  }
4278
4078
  }
4279
4079
  }
4280
- function C({ gen: P, parentData: I, parentDataProperty: D }, w) {
4281
- P.if((0, s._)`${I} !== undefined`, () => P.assign((0, s._)`${I}[${D}]`, w));
4080
+ function C({ gen: b, parentData: I, parentDataProperty: A }, w) {
4081
+ b.if((0, s._)`${I} !== undefined`, () => b.assign((0, s._)`${I}[${A}]`, w));
4282
4082
  }
4283
- function S(P, I, D, w = o.Correct) {
4083
+ function S(b, I, A, w = o.Correct) {
4284
4084
  const k = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
4285
- let A;
4286
- switch (P) {
4085
+ let D;
4086
+ switch (b) {
4287
4087
  case "null":
4288
4088
  return (0, s._)`${I} ${k} null`;
4289
4089
  case "array":
4290
- A = (0, s._)`Array.isArray(${I})`;
4090
+ D = (0, s._)`Array.isArray(${I})`;
4291
4091
  break;
4292
4092
  case "object":
4293
- A = (0, s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;
4093
+ D = (0, s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;
4294
4094
  break;
4295
4095
  case "integer":
4296
- A = V((0, s._)`!(${I} % 1) && !isNaN(${I})`);
4096
+ D = V((0, s._)`!(${I} % 1) && !isNaN(${I})`);
4297
4097
  break;
4298
4098
  case "number":
4299
- A = V();
4099
+ D = V();
4300
4100
  break;
4301
4101
  default:
4302
- return (0, s._)`typeof ${I} ${k} ${P}`;
4102
+ return (0, s._)`typeof ${I} ${k} ${b}`;
4303
4103
  }
4304
- return w === o.Correct ? A : (0, s.not)(A);
4305
- function V(x = s.nil) {
4306
- return (0, s.and)((0, s._)`typeof ${I} == "number"`, x, D ? (0, s._)`isFinite(${I})` : s.nil);
4104
+ return w === o.Correct ? D : (0, s.not)(D);
4105
+ function V(H = s.nil) {
4106
+ return (0, s.and)((0, s._)`typeof ${I} == "number"`, H, A ? (0, s._)`isFinite(${I})` : s.nil);
4307
4107
  }
4308
4108
  }
4309
4109
  e.checkDataType = S;
4310
- function T(P, I, D, w) {
4311
- if (P.length === 1)
4312
- return S(P[0], I, D, w);
4110
+ function R(b, I, A, w) {
4111
+ if (b.length === 1)
4112
+ return S(b[0], I, A, w);
4313
4113
  let k;
4314
- const A = (0, i.toHash)(P);
4315
- if (A.array && A.object) {
4114
+ const D = (0, i.toHash)(b);
4115
+ if (D.array && D.object) {
4316
4116
  const V = (0, s._)`typeof ${I} != "object"`;
4317
- k = A.null ? V : (0, s._)`!${I} || ${V}`, delete A.null, delete A.array, delete A.object;
4117
+ k = D.null ? V : (0, s._)`!${I} || ${V}`, delete D.null, delete D.array, delete D.object;
4318
4118
  } else
4319
4119
  k = s.nil;
4320
- A.number && delete A.integer;
4321
- for (const V in A)
4322
- k = (0, s.and)(k, S(V, I, D, w));
4120
+ D.number && delete D.integer;
4121
+ for (const V in D)
4122
+ k = (0, s.and)(k, S(V, I, A, w));
4323
4123
  return k;
4324
4124
  }
4325
- e.checkDataTypes = T;
4125
+ e.checkDataTypes = R;
4326
4126
  const y = {
4327
- message: ({ schema: P }) => `must be ${P}`,
4328
- params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
4127
+ message: ({ schema: b }) => `must be ${b}`,
4128
+ params: ({ schema: b, schemaValue: I }) => typeof b == "string" ? (0, s._)`{type: ${b}}` : (0, s._)`{type: ${I}}`
4329
4129
  };
4330
- function _(P) {
4331
- const I = $(P);
4130
+ function _(b) {
4131
+ const I = $(b);
4332
4132
  (0, n.reportError)(I, y);
4333
4133
  }
4334
4134
  e.reportTypeError = _;
4335
- function $(P) {
4336
- const { gen: I, data: D, schema: w } = P, k = (0, i.schemaRefOrVal)(P, w, "type");
4135
+ function $(b) {
4136
+ const { gen: I, data: A, schema: w } = b, k = (0, i.schemaRefOrVal)(b, w, "type");
4337
4137
  return {
4338
4138
  gen: I,
4339
4139
  keyword: "type",
4340
- data: D,
4140
+ data: A,
4341
4141
  schema: w.type,
4342
4142
  schemaCode: k,
4343
4143
  schemaValue: k,
4344
4144
  parentSchema: w,
4345
4145
  params: {},
4346
- it: P
4146
+ it: b
4347
4147
  };
4348
4148
  }
4349
4149
  })(dataType);
@@ -4422,14 +4222,14 @@ function schemaProperties(e, t) {
4422
4222
  }
4423
4223
  code.schemaProperties = schemaProperties;
4424
4224
  function callValidateCode({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, l, d, u) {
4425
- const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, g = [
4225
+ const f = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, g = [
4426
4226
  [names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, i)],
4427
4227
  [names_1$5.default.parentData, o.parentData],
4428
4228
  [names_1$5.default.parentDataProperty, o.parentDataProperty],
4429
4229
  [names_1$5.default.rootData, names_1$5.default.rootData]
4430
4230
  ];
4431
4231
  o.opts.dynamicRef && g.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
4432
- const O = (0, codegen_1$q._)`${p}, ${r.object(...g)}`;
4232
+ const O = (0, codegen_1$q._)`${f}, ${r.object(...g)}`;
4433
4233
  return d !== codegen_1$q.nil ? (0, codegen_1$q._)`${l}.call(${d}, ${O})` : (0, codegen_1$q._)`${l}(${O})`;
4434
4234
  }
4435
4235
  code.callValidateCode = callValidateCode;
@@ -4470,12 +4270,12 @@ function validateUnion(e) {
4470
4270
  return;
4471
4271
  const o = t.let("valid", !1), l = t.name("_valid");
4472
4272
  t.block(() => r.forEach((d, u) => {
4473
- const p = e.subschema({
4273
+ const f = e.subschema({
4474
4274
  keyword: n,
4475
4275
  schemaProp: u,
4476
4276
  compositeRule: !0
4477
4277
  }, l);
4478
- t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(p, l) || t.if((0, codegen_1$q.not)(o));
4278
+ t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(f, l) || t.if((0, codegen_1$q.not)(o));
4479
4279
  })), e.result(o, () => e.reset(), () => e.error(!0));
4480
4280
  }
4481
4281
  code.validateUnion = validateUnion;
@@ -4499,11 +4299,11 @@ function funcKeywordCode(e, t) {
4499
4299
  var r;
4500
4300
  const { gen: n, keyword: s, schema: i, parentSchema: o, $data: l, it: d } = e;
4501
4301
  checkAsyncKeyword(d, t);
4502
- const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), g = n.let("valid");
4302
+ const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, f = useKeyword(n, s, u), g = n.let("valid");
4503
4303
  e.block$data(g, O), e.ok((r = t.valid) !== null && r !== void 0 ? r : g);
4504
4304
  function O() {
4505
4305
  if (t.errors === !1)
4506
- T(), t.modifying && modifyData(e), y(() => e.error());
4306
+ R(), t.modifying && modifyData(e), y(() => e.error());
4507
4307
  else {
4508
4308
  const _ = t.async ? C() : S();
4509
4309
  t.modifying && modifyData(e), y(() => addErrs(e, _));
@@ -4511,15 +4311,15 @@ function funcKeywordCode(e, t) {
4511
4311
  }
4512
4312
  function C() {
4513
4313
  const _ = n.let("ruleErrs", null);
4514
- return n.try(() => T((0, codegen_1$p._)`await `), ($) => n.assign(g, !1).if((0, codegen_1$p._)`${$} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${$}.errors`), () => n.throw($))), _;
4314
+ return n.try(() => R((0, codegen_1$p._)`await `), ($) => n.assign(g, !1).if((0, codegen_1$p._)`${$} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${$}.errors`), () => n.throw($))), _;
4515
4315
  }
4516
4316
  function S() {
4517
- const _ = (0, codegen_1$p._)`${p}.errors`;
4518
- return n.assign(_, null), T(codegen_1$p.nil), _;
4317
+ const _ = (0, codegen_1$p._)`${f}.errors`;
4318
+ return n.assign(_, null), R(codegen_1$p.nil), _;
4519
4319
  }
4520
- function T(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4521
- const $ = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !l || t.schema === !1);
4522
- n.assign(g, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, p, $, P)}`, t.modifying);
4320
+ function R(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4321
+ const $ = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, b = !("compile" in t && !l || t.schema === !1);
4322
+ n.assign(g, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, f, $, b)}`, t.modifying);
4523
4323
  }
4524
4324
  function y(_) {
4525
4325
  var $;
@@ -4602,8 +4402,8 @@ function extendSubschemaData(e, t, { dataProp: r, dataPropType: n, data: s, data
4602
4402
  throw new Error('both "data" and "dataProp" passed, only one allowed');
4603
4403
  const { gen: l } = t;
4604
4404
  if (r !== void 0) {
4605
- const { errorPath: u, dataPathArr: p, opts: g } = t, O = l.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4606
- d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, g.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
4405
+ const { errorPath: u, dataPathArr: f, opts: g } = t, O = l.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4406
+ d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, g.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...f, e.parentDataProperty];
4607
4407
  }
4608
4408
  if (s !== void 0) {
4609
4409
  const u = s instanceof codegen_1$o.Name ? s : l.let("data", s, !0);
@@ -4707,18 +4507,18 @@ traverse$1.skipKeywords = {
4707
4507
  function _traverse(e, t, r, n, s, i, o, l, d, u) {
4708
4508
  if (n && typeof n == "object" && !Array.isArray(n)) {
4709
4509
  t(n, s, i, o, l, d, u);
4710
- for (var p in n) {
4711
- var g = n[p];
4510
+ for (var f in n) {
4511
+ var g = n[f];
4712
4512
  if (Array.isArray(g)) {
4713
- if (p in traverse$1.arrayKeywords)
4513
+ if (f in traverse$1.arrayKeywords)
4714
4514
  for (var O = 0; O < g.length; O++)
4715
- _traverse(e, t, r, g[O], s + "/" + p + "/" + O, i, s, p, n, O);
4716
- } else if (p in traverse$1.propsKeywords) {
4515
+ _traverse(e, t, r, g[O], s + "/" + f + "/" + O, i, s, f, n, O);
4516
+ } else if (f in traverse$1.propsKeywords) {
4717
4517
  if (g && typeof g == "object")
4718
4518
  for (var C in g)
4719
- _traverse(e, t, r, g[C], s + "/" + p + "/" + escapeJsonPtr(C), i, s, p, n, C);
4519
+ _traverse(e, t, r, g[C], s + "/" + f + "/" + escapeJsonPtr(C), i, s, f, n, C);
4720
4520
  } else
4721
- (p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, g, s + "/" + p, i, s, p, n);
4521
+ (f in traverse$1.keywords || e.allKeys && !(f in traverse$1.skipKeywords)) && _traverse(e, t, r, g, s + "/" + f, i, s, f, n);
4722
4522
  }
4723
4523
  r(n, s, i, o, l, d, u);
4724
4524
  }
@@ -4805,30 +4605,30 @@ function getSchemaRefs(e, t) {
4805
4605
  return traverse(e, { allKeys: !0 }, (g, O, C, S) => {
4806
4606
  if (S === void 0)
4807
4607
  return;
4808
- const T = o + O;
4608
+ const R = o + O;
4809
4609
  let y = i[S];
4810
4610
  typeof g[r] == "string" && (y = _.call(this, g[r])), $.call(this, g.$anchor), $.call(this, g.$dynamicAnchor), i[O] = y;
4811
- function _(P) {
4611
+ function _(b) {
4812
4612
  const I = this.opts.uriResolver.resolve;
4813
- if (P = normalizeId(y ? I(y, P) : P), d.has(P))
4814
- throw p(P);
4815
- d.add(P);
4816
- let D = this.refs[P];
4817
- return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(g, D.schema, P) : P !== normalizeId(T) && (P[0] === "#" ? (u(g, l[P], P), l[P] = g) : this.refs[P] = T), P;
4818
- }
4819
- function $(P) {
4820
- if (typeof P == "string") {
4821
- if (!ANCHOR.test(P))
4822
- throw new Error(`invalid anchor "${P}"`);
4823
- _.call(this, `#${P}`);
4613
+ if (b = normalizeId(y ? I(y, b) : b), d.has(b))
4614
+ throw f(b);
4615
+ d.add(b);
4616
+ let A = this.refs[b];
4617
+ return typeof A == "string" && (A = this.refs[A]), typeof A == "object" ? u(g, A.schema, b) : b !== normalizeId(R) && (b[0] === "#" ? (u(g, l[b], b), l[b] = g) : this.refs[b] = R), b;
4618
+ }
4619
+ function $(b) {
4620
+ if (typeof b == "string") {
4621
+ if (!ANCHOR.test(b))
4622
+ throw new Error(`invalid anchor "${b}"`);
4623
+ _.call(this, `#${b}`);
4824
4624
  }
4825
4625
  }
4826
4626
  }), l;
4827
4627
  function u(g, O, C) {
4828
4628
  if (O !== void 0 && !equal$2(g, O))
4829
- throw p(C);
4629
+ throw f(C);
4830
4630
  }
4831
- function p(g) {
4631
+ function f(g) {
4832
4632
  return new Error(`reference "${g}" resolves to more than one schema`);
4833
4633
  }
4834
4634
  }
@@ -4939,15 +4739,15 @@ function assignEvaluated({ gen: e, evaluated: t, props: r, items: n }) {
4939
4739
  r instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.props`, r), n instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.items`, n);
4940
4740
  }
4941
4741
  function schemaKeywords(e, t, r, n) {
4942
- const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: p } = u;
4943
- if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i, p))) {
4944
- s.block(() => keywordCode(e, "$ref", p.all.$ref.definition));
4742
+ const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: f } = u;
4743
+ if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i, f))) {
4744
+ s.block(() => keywordCode(e, "$ref", f.all.$ref.definition));
4945
4745
  return;
4946
4746
  }
4947
4747
  d.jtd || checkStrictTypes(e, t), s.block(() => {
4948
- for (const O of p.rules)
4748
+ for (const O of f.rules)
4949
4749
  g(O);
4950
- g(p.post);
4750
+ g(f.post);
4951
4751
  });
4952
4752
  function g(O) {
4953
4753
  (0, applicability_1.shouldUseGroup)(i, O) && (O.type ? (s.if((0, dataType_2.checkDataType)(O.type, o, d.strictNumbers)), iterateKeywords(e, O), t.length === 1 && t[0] === O.type && r && (s.else(), (0, dataType_2.reportTypeError)(e)), s.endIf()) : iterateKeywords(e, O), l || s.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${n || 0}`));
@@ -5122,15 +4922,15 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
5122
4922
  const u = RELATIVE_JSON_POINTER.exec(e);
5123
4923
  if (!u)
5124
4924
  throw new Error(`Invalid JSON-pointer: ${e}`);
5125
- const p = +u[1];
4925
+ const f = +u[1];
5126
4926
  if (s = u[2], s === "#") {
5127
- if (p >= t)
5128
- throw new Error(d("property/index", p));
5129
- return n[t - p];
4927
+ if (f >= t)
4928
+ throw new Error(d("property/index", f));
4929
+ return n[t - f];
5130
4930
  }
5131
- if (p > t)
5132
- throw new Error(d("data", p));
5133
- if (i = r[t - p], !s)
4931
+ if (f > t)
4932
+ throw new Error(d("data", f));
4933
+ if (i = r[t - f], !s)
5134
4934
  return i;
5135
4935
  }
5136
4936
  let o = i;
@@ -5138,8 +4938,8 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
5138
4938
  for (const u of l)
5139
4939
  u && (i = (0, codegen_1$n._)`${i}${(0, codegen_1$n.getProperty)((0, util_1$l.unescapeJsonPointer)(u))}`, o = (0, codegen_1$n._)`${o} && ${i}`);
5140
4940
  return o;
5141
- function d(u, p) {
5142
- return `Cannot access ${u} ${p} levels up, current level is ${t}`;
4941
+ function d(u, f) {
4942
+ return `Cannot access ${u} ${f} levels up, current level is ${t}`;
5143
4943
  }
5144
4944
  }
5145
4945
  validate.getData = getData;
@@ -5209,24 +5009,24 @@ function compileSchema(e) {
5209
5009
  opts: this.opts,
5210
5010
  self: this
5211
5011
  };
5212
- let p;
5012
+ let f;
5213
5013
  try {
5214
5014
  this._compilations.add(e), (0, validate_1$1.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
5215
5015
  const g = o.toString();
5216
- p = `${o.scopeRefs(names_1$2.default.scope)}return ${g}`, this.opts.code.process && (p = this.opts.code.process(p, e));
5217
- const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
5016
+ f = `${o.scopeRefs(names_1$2.default.scope)}return ${g}`, this.opts.code.process && (f = this.opts.code.process(f, e));
5017
+ const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, f)(this, this.scope.get());
5218
5018
  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: g, scopeValues: o._values }), this.opts.unevaluated) {
5219
- const { props: S, items: T } = u;
5019
+ const { props: S, items: R } = u;
5220
5020
  C.evaluated = {
5221
5021
  props: S instanceof codegen_1$m.Name ? void 0 : S,
5222
- items: T instanceof codegen_1$m.Name ? void 0 : T,
5022
+ items: R instanceof codegen_1$m.Name ? void 0 : R,
5223
5023
  dynamicProps: S instanceof codegen_1$m.Name,
5224
- dynamicItems: T instanceof codegen_1$m.Name
5024
+ dynamicItems: R instanceof codegen_1$m.Name
5225
5025
  }, C.source && (C.source.evaluated = (0, codegen_1$m.stringify)(C.evaluated));
5226
5026
  }
5227
5027
  return e.validate = C, e;
5228
5028
  } catch (g) {
5229
- throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), g;
5029
+ throw delete e.validate, delete e.validateName, f && this.logger.error("Error compiling schema, function code:", f), g;
5230
5030
  } finally {
5231
5031
  this._compilations.delete(e);
5232
5032
  }
@@ -5343,240 +5143,240 @@ var uri$1 = {}, uri_all = { exports: {} };
5343
5143
  n(t);
5344
5144
  })(commonjsGlobal, function(r) {
5345
5145
  function n() {
5346
- for (var f = arguments.length, c = Array(f), m = 0; m < f; m++)
5146
+ for (var p = arguments.length, c = Array(p), m = 0; m < p; m++)
5347
5147
  c[m] = arguments[m];
5348
5148
  if (c.length > 1) {
5349
5149
  c[0] = c[0].slice(0, -1);
5350
- for (var R = c.length - 1, E = 1; E < R; ++E)
5150
+ for (var T = c.length - 1, E = 1; E < T; ++E)
5351
5151
  c[E] = c[E].slice(1, -1);
5352
- return c[R] = c[R].slice(1), c.join("");
5152
+ return c[T] = c[T].slice(1), c.join("");
5353
5153
  } else
5354
5154
  return c[0];
5355
5155
  }
5356
- function s(f) {
5357
- return "(?:" + f + ")";
5156
+ function s(p) {
5157
+ return "(?:" + p + ")";
5358
5158
  }
5359
- function i(f) {
5360
- return f === void 0 ? "undefined" : f === null ? "null" : Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase();
5159
+ function i(p) {
5160
+ return p === void 0 ? "undefined" : p === null ? "null" : Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase();
5361
5161
  }
5362
- function o(f) {
5363
- return f.toUpperCase();
5162
+ function o(p) {
5163
+ return p.toUpperCase();
5364
5164
  }
5365
- function l(f) {
5366
- return f != null ? f instanceof Array ? f : typeof f.length != "number" || f.split || f.setInterval || f.call ? [f] : Array.prototype.slice.call(f) : [];
5165
+ function l(p) {
5166
+ return p != null ? p instanceof Array ? p : typeof p.length != "number" || p.split || p.setInterval || p.call ? [p] : Array.prototype.slice.call(p) : [];
5367
5167
  }
5368
- function d(f, c) {
5369
- var m = f;
5168
+ function d(p, c) {
5169
+ var m = p;
5370
5170
  if (c)
5371
- for (var R in c)
5372
- m[R] = c[R];
5171
+ for (var T in c)
5172
+ m[T] = c[T];
5373
5173
  return m;
5374
5174
  }
5375
- function u(f) {
5376
- var c = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", Q = n(U, L), Z = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", ne = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Z);
5377
- s(c + n(c, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, L, "[\\:]")) + "*");
5378
- var Y = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), se = s(Y + "\\." + Y + "\\." + Y + "\\." + Y), z = s(R + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + se), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), ge = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), $e = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), xe = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ne = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), Ie = s([ae, ee, Se, ge, $e, xe, Ne, fe, ye].join("|")), we = s(s(B + "|" + E) + "+");
5379
- s("[vV]" + R + "+\\." + n(B, L, "[\\:]") + "+"), s(s(E + "|" + n(B, L)) + "*");
5380
- var ot = s(E + "|" + n(B, L, "[\\:\\@]"));
5381
- return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(ot + "|" + n("[\\/\\?]", ne)) + "*"), {
5175
+ function u(p) {
5176
+ var c = "[A-Za-z]", m = "[0-9]", T = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + T + "%" + T + T + "%" + T + T) + "|" + s("%[89A-Fa-f]" + T + "%" + T + T) + "|" + s("%" + T + T)), L = "[\\:\\/\\?\\#\\[\\]\\@]", U = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", K = n(L, U), Q = p ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", re = p ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Q);
5177
+ s(c + n(c, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, U, "[\\:]")) + "*");
5178
+ var J = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ne = s(J + "\\." + J + "\\." + J + "\\." + J), z = s(T + "{1,4}"), Z = s(s(z + "\\:" + z) + "|" + ne), oe = s(s(z + "\\:") + "{6}" + Z), Y = s("\\:\\:" + s(z + "\\:") + "{5}" + Z), Pe = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + Z), ge = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + Z), $e = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + Z), Ue = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + Z), Ce = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + Z), pe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), Oe = s([oe, Y, Pe, ge, $e, Ue, Ce, pe, ye].join("|")), we = s(s(B + "|" + E) + "+");
5179
+ s("[vV]" + T + "+\\." + n(B, U, "[\\:]") + "+"), s(s(E + "|" + n(B, U)) + "*");
5180
+ var Ye = s(E + "|" + n(B, U, "[\\:\\@]"));
5181
+ return s(s(E + "|" + n(B, U, "[\\@]")) + "+"), s(s(Ye + "|" + n("[\\/\\?]", re)) + "*"), {
5382
5182
  NOT_SCHEME: new RegExp(n("[^]", c, m, "[\\+\\-\\.]"), "g"),
5383
- NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, L), "g"),
5384
- NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, L), "g"),
5385
- NOT_PATH: new RegExp(n("[^\\%\\/\\:\\@]", B, L), "g"),
5386
- NOT_PATH_NOSCHEME: new RegExp(n("[^\\%\\/\\@]", B, L), "g"),
5387
- NOT_QUERY: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]", ne), "g"),
5388
- NOT_FRAGMENT: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]"), "g"),
5389
- ESCAPE: new RegExp(n("[^]", B, L), "g"),
5183
+ NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, U), "g"),
5184
+ NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, U), "g"),
5185
+ NOT_PATH: new RegExp(n("[^\\%\\/\\:\\@]", B, U), "g"),
5186
+ NOT_PATH_NOSCHEME: new RegExp(n("[^\\%\\/\\@]", B, U), "g"),
5187
+ NOT_QUERY: new RegExp(n("[^\\%]", B, U, "[\\:\\@\\/\\?]", re), "g"),
5188
+ NOT_FRAGMENT: new RegExp(n("[^\\%]", B, U, "[\\:\\@\\/\\?]"), "g"),
5189
+ ESCAPE: new RegExp(n("[^]", B, U), "g"),
5390
5190
  UNRESERVED: new RegExp(B, "g"),
5391
- OTHER_CHARS: new RegExp(n("[^\\%]", B, Q), "g"),
5191
+ OTHER_CHARS: new RegExp(n("[^\\%]", B, K), "g"),
5392
5192
  PCT_ENCODED: new RegExp(E, "g"),
5393
- IPV4ADDRESS: new RegExp("^(" + se + ")$"),
5394
- IPV6ADDRESS: new RegExp("^\\[?(" + Ie + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
5193
+ IPV4ADDRESS: new RegExp("^(" + ne + ")$"),
5194
+ IPV6ADDRESS: new RegExp("^\\[?(" + Oe + ")" + s(s("\\%25|\\%(?!" + T + "{2})") + "(" + we + ")") + "?\\]?$")
5395
5195
  //RFC 6874, with relaxed parsing rules
5396
5196
  };
5397
5197
  }
5398
- var p = u(!1), g = u(!0), O = function() {
5399
- function f(c, m) {
5400
- var R = [], E = !0, U = !1, L = void 0;
5198
+ var f = u(!1), g = u(!0), O = function() {
5199
+ function p(c, m) {
5200
+ var T = [], E = !0, L = !1, U = void 0;
5401
5201
  try {
5402
- for (var Q = c[Symbol.iterator](), Z; !(E = (Z = Q.next()).done) && (R.push(Z.value), !(m && R.length === m)); E = !0)
5202
+ for (var K = c[Symbol.iterator](), Q; !(E = (Q = K.next()).done) && (T.push(Q.value), !(m && T.length === m)); E = !0)
5403
5203
  ;
5404
- } catch (ne) {
5405
- U = !0, L = ne;
5204
+ } catch (re) {
5205
+ L = !0, U = re;
5406
5206
  } finally {
5407
5207
  try {
5408
- !E && Q.return && Q.return();
5208
+ !E && K.return && K.return();
5409
5209
  } finally {
5410
- if (U)
5411
- throw L;
5210
+ if (L)
5211
+ throw U;
5412
5212
  }
5413
5213
  }
5414
- return R;
5214
+ return T;
5415
5215
  }
5416
5216
  return function(c, m) {
5417
5217
  if (Array.isArray(c))
5418
5218
  return c;
5419
5219
  if (Symbol.iterator in Object(c))
5420
- return f(c, m);
5220
+ return p(c, m);
5421
5221
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
5422
5222
  };
5423
- }(), C = function(f) {
5424
- if (Array.isArray(f)) {
5425
- for (var c = 0, m = Array(f.length); c < f.length; c++)
5426
- m[c] = f[c];
5223
+ }(), C = function(p) {
5224
+ if (Array.isArray(p)) {
5225
+ for (var c = 0, m = Array(p.length); c < p.length; c++)
5226
+ m[c] = p[c];
5427
5227
  return m;
5428
5228
  } else
5429
- return Array.from(f);
5430
- }, S = 2147483647, T = 36, y = 1, _ = 26, $ = 38, P = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
5229
+ return Array.from(p);
5230
+ }, S = 2147483647, R = 36, y = 1, _ = 26, $ = 38, b = 700, I = 72, A = 128, w = "-", k = /^xn--/, D = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, H = {
5431
5231
  overflow: "Overflow: input needs wider integers to process",
5432
5232
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
5433
5233
  "invalid-input": "Invalid input"
5434
- }, te = T - y, J = Math.floor, ue = String.fromCharCode;
5435
- function oe(f) {
5436
- throw new RangeError(x[f]);
5234
+ }, X = R - y, G = Math.floor, de = String.fromCharCode;
5235
+ function ie(p) {
5236
+ throw new RangeError(H[p]);
5437
5237
  }
5438
- function Te(f, c) {
5439
- for (var m = [], R = f.length; R--; )
5440
- m[R] = c(f[R]);
5238
+ function Se(p, c) {
5239
+ for (var m = [], T = p.length; T--; )
5240
+ m[T] = c(p[T]);
5441
5241
  return m;
5442
5242
  }
5443
- function ke(f, c) {
5444
- var m = f.split("@"), R = "";
5445
- m.length > 1 && (R = m[0] + "@", f = m[1]), f = f.replace(V, ".");
5446
- var E = f.split("."), U = Te(E, c).join(".");
5447
- return R + U;
5448
- }
5449
- function Fe(f) {
5450
- for (var c = [], m = 0, R = f.length; m < R; ) {
5451
- var E = f.charCodeAt(m++);
5452
- if (E >= 55296 && E <= 56319 && m < R) {
5453
- var U = f.charCodeAt(m++);
5454
- (U & 64512) == 56320 ? c.push(((E & 1023) << 10) + (U & 1023) + 65536) : (c.push(E), m--);
5243
+ function Te(p, c) {
5244
+ var m = p.split("@"), T = "";
5245
+ m.length > 1 && (T = m[0] + "@", p = m[1]), p = p.replace(V, ".");
5246
+ var E = p.split("."), L = Se(E, c).join(".");
5247
+ return T + L;
5248
+ }
5249
+ function Ie(p) {
5250
+ for (var c = [], m = 0, T = p.length; m < T; ) {
5251
+ var E = p.charCodeAt(m++);
5252
+ if (E >= 55296 && E <= 56319 && m < T) {
5253
+ var L = p.charCodeAt(m++);
5254
+ (L & 64512) == 56320 ? c.push(((E & 1023) << 10) + (L & 1023) + 65536) : (c.push(E), m--);
5455
5255
  } else
5456
5256
  c.push(E);
5457
5257
  }
5458
5258
  return c;
5459
5259
  }
5460
- var Ze = function(c) {
5260
+ var xe = function(c) {
5461
5261
  return String.fromCodePoint.apply(String, C(c));
5462
- }, Me = function(c) {
5463
- return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : T;
5262
+ }, je = function(c) {
5263
+ return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : R;
5464
5264
  }, F = function(c, m) {
5465
5265
  return c + 22 + 75 * (c < 26) - ((m != 0) << 5);
5466
- }, v = function(c, m, R) {
5266
+ }, v = function(c, m, T) {
5467
5267
  var E = 0;
5468
5268
  for (
5469
- c = R ? J(c / P) : c >> 1, c += J(c / m);
5269
+ c = T ? G(c / b) : c >> 1, c += G(c / m);
5470
5270
  /* no initialization */
5471
- c > te * _ >> 1;
5472
- E += T
5271
+ c > X * _ >> 1;
5272
+ E += R
5473
5273
  )
5474
- c = J(c / te);
5475
- return J(E + (te + 1) * c / (c + $));
5274
+ c = G(c / X);
5275
+ return G(E + (X + 1) * c / (c + $));
5476
5276
  }, j = function(c) {
5477
- var m = [], R = c.length, E = 0, U = D, L = I, Q = c.lastIndexOf(w);
5478
- Q < 0 && (Q = 0);
5479
- for (var Z = 0; Z < Q; ++Z)
5480
- c.charCodeAt(Z) >= 128 && oe("not-basic"), m.push(c.charCodeAt(Z));
5481
- for (var ne = Q > 0 ? Q + 1 : 0; ne < R; ) {
5277
+ var m = [], T = c.length, E = 0, L = A, U = I, K = c.lastIndexOf(w);
5278
+ K < 0 && (K = 0);
5279
+ for (var Q = 0; Q < K; ++Q)
5280
+ c.charCodeAt(Q) >= 128 && ie("not-basic"), m.push(c.charCodeAt(Q));
5281
+ for (var re = K > 0 ? K + 1 : 0; re < T; ) {
5482
5282
  for (
5483
- var B = E, Y = 1, se = T;
5283
+ var B = E, J = 1, ne = R;
5484
5284
  ;
5485
5285
  /* no condition */
5486
- se += T
5286
+ ne += R
5487
5287
  ) {
5488
- ne >= R && oe("invalid-input");
5489
- var z = Me(c.charCodeAt(ne++));
5490
- (z >= T || z > J((S - E) / Y)) && oe("overflow"), E += z * Y;
5491
- var X = se <= L ? y : se >= L + _ ? _ : se - L;
5492
- if (z < X)
5288
+ re >= T && ie("invalid-input");
5289
+ var z = je(c.charCodeAt(re++));
5290
+ (z >= R || z > G((S - E) / J)) && ie("overflow"), E += z * J;
5291
+ var Z = ne <= U ? y : ne >= U + _ ? _ : ne - U;
5292
+ if (z < Z)
5493
5293
  break;
5494
- var ae = T - X;
5495
- Y > J(S / ae) && oe("overflow"), Y *= ae;
5294
+ var oe = R - Z;
5295
+ J > G(S / oe) && ie("overflow"), J *= oe;
5496
5296
  }
5497
- var ee = m.length + 1;
5498
- L = v(E - B, ee, B == 0), J(E / ee) > S - U && oe("overflow"), U += J(E / ee), E %= ee, m.splice(E++, 0, U);
5297
+ var Y = m.length + 1;
5298
+ U = v(E - B, Y, B == 0), G(E / Y) > S - L && ie("overflow"), L += G(E / Y), E %= Y, m.splice(E++, 0, L);
5499
5299
  }
5500
5300
  return String.fromCodePoint.apply(String, m);
5501
- }, b = function(c) {
5301
+ }, P = function(c) {
5502
5302
  var m = [];
5503
- c = Fe(c);
5504
- var R = c.length, E = D, U = 0, L = I, Q = !0, Z = !1, ne = void 0;
5303
+ c = Ie(c);
5304
+ var T = c.length, E = A, L = 0, U = I, K = !0, Q = !1, re = void 0;
5505
5305
  try {
5506
- for (var B = c[Symbol.iterator](), Y; !(Q = (Y = B.next()).done); Q = !0) {
5507
- var se = Y.value;
5508
- se < 128 && m.push(ue(se));
5306
+ for (var B = c[Symbol.iterator](), J; !(K = (J = B.next()).done); K = !0) {
5307
+ var ne = J.value;
5308
+ ne < 128 && m.push(de(ne));
5509
5309
  }
5510
- } catch (at) {
5511
- Z = !0, ne = at;
5310
+ } catch (Xe) {
5311
+ Q = !0, re = Xe;
5512
5312
  } finally {
5513
5313
  try {
5514
- !Q && B.return && B.return();
5314
+ !K && B.return && B.return();
5515
5315
  } finally {
5516
- if (Z)
5517
- throw ne;
5316
+ if (Q)
5317
+ throw re;
5518
5318
  }
5519
5319
  }
5520
- var z = m.length, X = z;
5521
- for (z && m.push(w); X < R; ) {
5522
- var ae = S, ee = !0, Se = !1, ge = void 0;
5320
+ var z = m.length, Z = z;
5321
+ for (z && m.push(w); Z < T; ) {
5322
+ var oe = S, Y = !0, Pe = !1, ge = void 0;
5523
5323
  try {
5524
- for (var $e = c[Symbol.iterator](), xe; !(ee = (xe = $e.next()).done); ee = !0) {
5525
- var Ne = xe.value;
5526
- Ne >= E && Ne < ae && (ae = Ne);
5324
+ for (var $e = c[Symbol.iterator](), Ue; !(Y = (Ue = $e.next()).done); Y = !0) {
5325
+ var Ce = Ue.value;
5326
+ Ce >= E && Ce < oe && (oe = Ce);
5527
5327
  }
5528
- } catch (at) {
5529
- Se = !0, ge = at;
5328
+ } catch (Xe) {
5329
+ Pe = !0, ge = Xe;
5530
5330
  } finally {
5531
5331
  try {
5532
- !ee && $e.return && $e.return();
5332
+ !Y && $e.return && $e.return();
5533
5333
  } finally {
5534
- if (Se)
5334
+ if (Pe)
5535
5335
  throw ge;
5536
5336
  }
5537
5337
  }
5538
- var fe = X + 1;
5539
- ae - E > J((S - U) / fe) && oe("overflow"), U += (ae - E) * fe, E = ae;
5540
- var ye = !0, Ie = !1, we = void 0;
5338
+ var pe = Z + 1;
5339
+ oe - E > G((S - L) / pe) && ie("overflow"), L += (oe - E) * pe, E = oe;
5340
+ var ye = !0, Oe = !1, we = void 0;
5541
5341
  try {
5542
- for (var ot = c[Symbol.iterator](), Ht; !(ye = (Ht = ot.next()).done); ye = !0) {
5543
- var Vt = Ht.value;
5544
- if (Vt < E && ++U > S && oe("overflow"), Vt == E) {
5342
+ for (var Ye = c[Symbol.iterator](), Ct; !(ye = (Ct = Ye.next()).done); ye = !0) {
5343
+ var Ot = Ct.value;
5344
+ if (Ot < E && ++L > S && ie("overflow"), Ot == E) {
5545
5345
  for (
5546
- var dt = U, ut = T;
5346
+ var tt = L, rt = R;
5547
5347
  ;
5548
5348
  /* no condition */
5549
- ut += T
5349
+ rt += R
5550
5350
  ) {
5551
- var pt = ut <= L ? y : ut >= L + _ ? _ : ut - L;
5552
- if (dt < pt)
5351
+ var nt = rt <= U ? y : rt >= U + _ ? _ : rt - U;
5352
+ if (tt < nt)
5553
5353
  break;
5554
- var zt = dt - pt, xt = T - pt;
5555
- m.push(ue(F(pt + zt % xt, 0))), dt = J(zt / xt);
5354
+ var Nt = tt - nt, It = R - nt;
5355
+ m.push(de(F(nt + Nt % It, 0))), tt = G(Nt / It);
5556
5356
  }
5557
- m.push(ue(F(dt, 0))), L = v(U, fe, X == z), U = 0, ++X;
5357
+ m.push(de(F(tt, 0))), U = v(L, pe, Z == z), L = 0, ++Z;
5558
5358
  }
5559
5359
  }
5560
- } catch (at) {
5561
- Ie = !0, we = at;
5360
+ } catch (Xe) {
5361
+ Oe = !0, we = Xe;
5562
5362
  } finally {
5563
5363
  try {
5564
- !ye && ot.return && ot.return();
5364
+ !ye && Ye.return && Ye.return();
5565
5365
  } finally {
5566
- if (Ie)
5366
+ if (Oe)
5567
5367
  throw we;
5568
5368
  }
5569
5369
  }
5570
- ++U, ++E;
5370
+ ++L, ++E;
5571
5371
  }
5572
5372
  return m.join("");
5573
5373
  }, a = function(c) {
5574
- return ke(c, function(m) {
5374
+ return Te(c, function(m) {
5575
5375
  return k.test(m) ? j(m.slice(4).toLowerCase()) : m;
5576
5376
  });
5577
5377
  }, h = function(c) {
5578
- return ke(c, function(m) {
5579
- return A.test(m) ? "xn--" + b(m) : m;
5378
+ return Te(c, function(m) {
5379
+ return D.test(m) ? "xn--" + P(m) : m;
5580
5380
  });
5581
5381
  }, N = {
5582
5382
  /**
@@ -5593,301 +5393,301 @@ var uri$1 = {}, uri_all = { exports: {} };
5593
5393
  * @type Object
5594
5394
  */
5595
5395
  ucs2: {
5596
- decode: Fe,
5597
- encode: Ze
5396
+ decode: Ie,
5397
+ encode: xe
5598
5398
  },
5599
5399
  decode: j,
5600
- encode: b,
5400
+ encode: P,
5601
5401
  toASCII: h,
5602
5402
  toUnicode: a
5603
5403
  }, M = {};
5604
- function q(f) {
5605
- var c = f.charCodeAt(0), m = void 0;
5404
+ function q(p) {
5405
+ var c = p.charCodeAt(0), m = void 0;
5606
5406
  return c < 16 ? m = "%0" + c.toString(16).toUpperCase() : c < 128 ? m = "%" + c.toString(16).toUpperCase() : c < 2048 ? m = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase() : m = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(), m;
5607
5407
  }
5608
- function W(f) {
5609
- for (var c = "", m = 0, R = f.length; m < R; ) {
5610
- var E = parseInt(f.substr(m + 1, 2), 16);
5408
+ function x(p) {
5409
+ for (var c = "", m = 0, T = p.length; m < T; ) {
5410
+ var E = parseInt(p.substr(m + 1, 2), 16);
5611
5411
  if (E < 128)
5612
5412
  c += String.fromCharCode(E), m += 3;
5613
5413
  else if (E >= 194 && E < 224) {
5614
- if (R - m >= 6) {
5615
- var U = parseInt(f.substr(m + 4, 2), 16);
5616
- c += String.fromCharCode((E & 31) << 6 | U & 63);
5414
+ if (T - m >= 6) {
5415
+ var L = parseInt(p.substr(m + 4, 2), 16);
5416
+ c += String.fromCharCode((E & 31) << 6 | L & 63);
5617
5417
  } else
5618
- c += f.substr(m, 6);
5418
+ c += p.substr(m, 6);
5619
5419
  m += 6;
5620
5420
  } else if (E >= 224) {
5621
- if (R - m >= 9) {
5622
- var L = parseInt(f.substr(m + 4, 2), 16), Q = parseInt(f.substr(m + 7, 2), 16);
5623
- c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 | Q & 63);
5421
+ if (T - m >= 9) {
5422
+ var U = parseInt(p.substr(m + 4, 2), 16), K = parseInt(p.substr(m + 7, 2), 16);
5423
+ c += String.fromCharCode((E & 15) << 12 | (U & 63) << 6 | K & 63);
5624
5424
  } else
5625
- c += f.substr(m, 9);
5425
+ c += p.substr(m, 9);
5626
5426
  m += 9;
5627
5427
  } else
5628
- c += f.substr(m, 3), m += 3;
5428
+ c += p.substr(m, 3), m += 3;
5629
5429
  }
5630
5430
  return c;
5631
5431
  }
5632
- function G(f, c) {
5633
- function m(R) {
5634
- var E = W(R);
5635
- return E.match(c.UNRESERVED) ? E : R;
5432
+ function W(p, c) {
5433
+ function m(T) {
5434
+ var E = x(T);
5435
+ return E.match(c.UNRESERVED) ? E : T;
5636
5436
  }
5637
- return f.scheme && (f.scheme = String(f.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(c.PCT_ENCODED, m).replace(f.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), f;
5437
+ return p.scheme && (p.scheme = String(p.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), p.userinfo !== void 0 && (p.userinfo = String(p.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), p.host !== void 0 && (p.host = String(p.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), p.path !== void 0 && (p.path = String(p.path).replace(c.PCT_ENCODED, m).replace(p.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), p.query !== void 0 && (p.query = String(p.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), p.fragment !== void 0 && (p.fragment = String(p.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), p;
5638
5438
  }
5639
- function re(f) {
5640
- return f.replace(/^0*(.*)/, "$1") || "0";
5439
+ function te(p) {
5440
+ return p.replace(/^0*(.*)/, "$1") || "0";
5641
5441
  }
5642
- function he(f, c) {
5643
- var m = f.match(c.IPV4ADDRESS) || [], R = O(m, 2), E = R[1];
5644
- return E ? E.split(".").map(re).join(".") : f;
5442
+ function he(p, c) {
5443
+ var m = p.match(c.IPV4ADDRESS) || [], T = O(m, 2), E = T[1];
5444
+ return E ? E.split(".").map(te).join(".") : p;
5645
5445
  }
5646
- function qe(f, c) {
5647
- var m = f.match(c.IPV6ADDRESS) || [], R = O(m, 3), E = R[1], U = R[2];
5446
+ function De(p, c) {
5447
+ var m = p.match(c.IPV6ADDRESS) || [], T = O(m, 3), E = T[1], L = T[2];
5648
5448
  if (E) {
5649
- for (var L = E.toLowerCase().split("::").reverse(), Q = O(L, 2), Z = Q[0], ne = Q[1], B = ne ? ne.split(":").map(re) : [], Y = Z.split(":").map(re), se = c.IPV4ADDRESS.test(Y[Y.length - 1]), z = se ? 7 : 8, X = Y.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
5650
- ae[ee] = B[ee] || Y[X + ee] || "";
5651
- se && (ae[z - 1] = he(ae[z - 1], c));
5652
- var Se = ae.reduce(function(fe, ye, Ie) {
5449
+ for (var U = E.toLowerCase().split("::").reverse(), K = O(U, 2), Q = K[0], re = K[1], B = re ? re.split(":").map(te) : [], J = Q.split(":").map(te), ne = c.IPV4ADDRESS.test(J[J.length - 1]), z = ne ? 7 : 8, Z = J.length - z, oe = Array(z), Y = 0; Y < z; ++Y)
5450
+ oe[Y] = B[Y] || J[Z + Y] || "";
5451
+ ne && (oe[z - 1] = he(oe[z - 1], c));
5452
+ var Pe = oe.reduce(function(pe, ye, Oe) {
5653
5453
  if (!ye || ye === "0") {
5654
- var we = fe[fe.length - 1];
5655
- we && we.index + we.length === Ie ? we.length++ : fe.push({ index: Ie, length: 1 });
5454
+ var we = pe[pe.length - 1];
5455
+ we && we.index + we.length === Oe ? we.length++ : pe.push({ index: Oe, length: 1 });
5656
5456
  }
5657
- return fe;
5658
- }, []), ge = Se.sort(function(fe, ye) {
5659
- return ye.length - fe.length;
5457
+ return pe;
5458
+ }, []), ge = Pe.sort(function(pe, ye) {
5459
+ return ye.length - pe.length;
5660
5460
  })[0], $e = void 0;
5661
5461
  if (ge && ge.length > 1) {
5662
- var xe = ae.slice(0, ge.index), Ne = ae.slice(ge.index + ge.length);
5663
- $e = xe.join(":") + "::" + Ne.join(":");
5462
+ var Ue = oe.slice(0, ge.index), Ce = oe.slice(ge.index + ge.length);
5463
+ $e = Ue.join(":") + "::" + Ce.join(":");
5664
5464
  } else
5665
- $e = ae.join(":");
5666
- return U && ($e += "%" + U), $e;
5465
+ $e = oe.join(":");
5466
+ return L && ($e += "%" + L), $e;
5667
5467
  } else
5668
- return f;
5468
+ return p;
5669
5469
  }
5670
- var Xe = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, et = "".match(/(){0}/)[1] === void 0;
5671
- function de(f) {
5672
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = c.iri !== !1 ? g : p;
5673
- c.reference === "suffix" && (f = (c.scheme ? c.scheme + ":" : "") + "//" + f);
5674
- var E = f.match(Xe);
5470
+ var Be = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, We = "".match(/(){0}/)[1] === void 0;
5471
+ function le(p) {
5472
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, T = c.iri !== !1 ? g : f;
5473
+ c.reference === "suffix" && (p = (c.scheme ? c.scheme + ":" : "") + "//" + p);
5474
+ var E = p.match(Be);
5675
5475
  if (E) {
5676
- et ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? E[3] : void 0, m.host = f.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = f.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = qe(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", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
5677
- var U = M[(c.scheme || m.scheme || "").toLowerCase()];
5678
- if (!c.unicodeSupport && (!U || !U.unicodeSupport)) {
5679
- if (m.host && (c.domainHost || U && U.domainHost))
5476
+ We ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = p.indexOf("@") !== -1 ? E[3] : void 0, m.host = p.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = p.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = p.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = De(he(m.host, T), T)), 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", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
5477
+ var L = M[(c.scheme || m.scheme || "").toLowerCase()];
5478
+ if (!c.unicodeSupport && (!L || !L.unicodeSupport)) {
5479
+ if (m.host && (c.domainHost || L && L.domainHost))
5680
5480
  try {
5681
- m.host = N.toASCII(m.host.replace(R.PCT_ENCODED, W).toLowerCase());
5682
- } catch (L) {
5683
- m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + L;
5481
+ m.host = N.toASCII(m.host.replace(T.PCT_ENCODED, x).toLowerCase());
5482
+ } catch (U) {
5483
+ m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + U;
5684
5484
  }
5685
- G(m, p);
5485
+ W(m, f);
5686
5486
  } else
5687
- G(m, R);
5688
- U && U.parse && U.parse(m, c);
5487
+ W(m, T);
5488
+ L && L.parse && L.parse(m, c);
5689
5489
  } else
5690
5490
  m.error = m.error || "URI can not be parsed.";
5691
5491
  return m;
5692
5492
  }
5693
- function tt(f, c) {
5694
- var m = c.iri !== !1 ? g : p, R = [];
5695
- return f.userinfo !== void 0 && (R.push(f.userinfo), R.push("@")), f.host !== void 0 && R.push(qe(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(E, U, L) {
5696
- return "[" + U + (L ? "%25" + L : "") + "]";
5697
- })), (typeof f.port == "number" || typeof f.port == "string") && (R.push(":"), R.push(String(f.port))), R.length ? R.join("") : void 0;
5698
- }
5699
- var Ue = /^\.\.?\//, Le = /^\/\.(\/|$)/, He = /^\/\.\.(\/|$)/, rt = /^\/?(?:.|\n)*?(?=\/|$)/;
5700
- function me(f) {
5701
- for (var c = []; f.length; )
5702
- if (f.match(Ue))
5703
- f = f.replace(Ue, "");
5704
- else if (f.match(Le))
5705
- f = f.replace(Le, "/");
5706
- else if (f.match(He))
5707
- f = f.replace(He, "/"), c.pop();
5708
- else if (f === "." || f === "..")
5709
- f = "";
5493
+ function Ge(p, c) {
5494
+ var m = c.iri !== !1 ? g : f, T = [];
5495
+ return p.userinfo !== void 0 && (T.push(p.userinfo), T.push("@")), p.host !== void 0 && T.push(De(he(String(p.host), m), m).replace(m.IPV6ADDRESS, function(E, L, U) {
5496
+ return "[" + L + (U ? "%25" + U : "") + "]";
5497
+ })), (typeof p.port == "number" || typeof p.port == "string") && (T.push(":"), T.push(String(p.port))), T.length ? T.join("") : void 0;
5498
+ }
5499
+ var Ae = /^\.\.?\//, Fe = /^\/\.(\/|$)/, Me = /^\/\.\.(\/|$)/, Ke = /^\/?(?:.|\n)*?(?=\/|$)/;
5500
+ function me(p) {
5501
+ for (var c = []; p.length; )
5502
+ if (p.match(Ae))
5503
+ p = p.replace(Ae, "");
5504
+ else if (p.match(Fe))
5505
+ p = p.replace(Fe, "/");
5506
+ else if (p.match(Me))
5507
+ p = p.replace(Me, "/"), c.pop();
5508
+ else if (p === "." || p === "..")
5509
+ p = "";
5710
5510
  else {
5711
- var m = f.match(rt);
5511
+ var m = p.match(Ke);
5712
5512
  if (m) {
5713
- var R = m[0];
5714
- f = f.slice(R.length), c.push(R);
5513
+ var T = m[0];
5514
+ p = p.slice(T.length), c.push(T);
5715
5515
  } else
5716
5516
  throw new Error("Unexpected dot segment condition");
5717
5517
  }
5718
5518
  return c.join("");
5719
5519
  }
5720
- function le(f) {
5721
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? g : p, R = [], E = M[(c.scheme || f.scheme || "").toLowerCase()];
5722
- if (E && E.serialize && E.serialize(f, c), f.host && !m.IPV6ADDRESS.test(f.host)) {
5520
+ function ce(p) {
5521
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? g : f, T = [], E = M[(c.scheme || p.scheme || "").toLowerCase()];
5522
+ if (E && E.serialize && E.serialize(p, c), p.host && !m.IPV6ADDRESS.test(p.host)) {
5723
5523
  if (c.domainHost || E && E.domainHost)
5724
5524
  try {
5725
- f.host = c.iri ? N.toUnicode(f.host) : N.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
5726
- } catch (Q) {
5727
- f.error = f.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + Q;
5525
+ p.host = c.iri ? N.toUnicode(p.host) : N.toASCII(p.host.replace(m.PCT_ENCODED, x).toLowerCase());
5526
+ } catch (K) {
5527
+ p.error = p.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + K;
5728
5528
  }
5729
5529
  }
5730
- G(f, m), c.reference !== "suffix" && f.scheme && (R.push(f.scheme), R.push(":"));
5731
- var U = tt(f, c);
5732
- if (U !== void 0 && (c.reference !== "suffix" && R.push("//"), R.push(U), f.path && f.path.charAt(0) !== "/" && R.push("/")), f.path !== void 0) {
5733
- var L = f.path;
5734
- !c.absolutePath && (!E || !E.absolutePath) && (L = me(L)), U === void 0 && (L = L.replace(/^\/\//, "/%2F")), R.push(L);
5530
+ W(p, m), c.reference !== "suffix" && p.scheme && (T.push(p.scheme), T.push(":"));
5531
+ var L = Ge(p, c);
5532
+ if (L !== void 0 && (c.reference !== "suffix" && T.push("//"), T.push(L), p.path && p.path.charAt(0) !== "/" && T.push("/")), p.path !== void 0) {
5533
+ var U = p.path;
5534
+ !c.absolutePath && (!E || !E.absolutePath) && (U = me(U)), L === void 0 && (U = U.replace(/^\/\//, "/%2F")), T.push(U);
5735
5535
  }
5736
- return f.query !== void 0 && (R.push("?"), R.push(f.query)), f.fragment !== void 0 && (R.push("#"), R.push(f.fragment)), R.join("");
5536
+ return p.query !== void 0 && (T.push("?"), T.push(p.query)), p.fragment !== void 0 && (T.push("#"), T.push(p.fragment)), T.join("");
5737
5537
  }
5738
- function Ve(f, c) {
5739
- var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, R = arguments[3], E = {};
5740
- return R || (f = de(le(f, m), m), c = de(le(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? E.path = "/" + c.path : f.path ? E.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = f.path, c.query !== void 0 ? E.query = c.query : E.query = f.query), E.userinfo = f.userinfo, E.host = f.host, E.port = f.port), E.scheme = f.scheme), E.fragment = c.fragment, E;
5538
+ function qe(p, c) {
5539
+ var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, T = arguments[3], E = {};
5540
+ return T || (p = le(ce(p, m), m), c = le(ce(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((p.userinfo !== void 0 || p.host !== void 0 || p.port !== void 0) && !p.path ? E.path = "/" + c.path : p.path ? E.path = p.path.slice(0, p.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = p.path, c.query !== void 0 ? E.query = c.query : E.query = p.query), E.userinfo = p.userinfo, E.host = p.host, E.port = p.port), E.scheme = p.scheme), E.fragment = c.fragment, E;
5741
5541
  }
5742
- function nt(f, c, m) {
5743
- var R = d({ scheme: "null" }, m);
5744
- return le(Ve(de(f, R), de(c, R), R, !0), R);
5542
+ function Je(p, c, m) {
5543
+ var T = d({ scheme: "null" }, m);
5544
+ return ce(qe(le(p, T), le(c, T), T, !0), T);
5745
5545
  }
5746
- function Ce(f, c) {
5747
- return typeof f == "string" ? f = le(de(f, c), c) : i(f) === "object" && (f = de(le(f, c), c)), f;
5546
+ function Re(p, c) {
5547
+ return typeof p == "string" ? p = ce(le(p, c), c) : i(p) === "object" && (p = le(ce(p, c), c)), p;
5748
5548
  }
5749
- function st(f, c, m) {
5750
- return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof c == "string" ? c = le(de(c, m), m) : i(c) === "object" && (c = le(c, m)), f === c;
5549
+ function Qe(p, c, m) {
5550
+ return typeof p == "string" ? p = ce(le(p, m), m) : i(p) === "object" && (p = ce(p, m)), typeof c == "string" ? c = ce(le(c, m), m) : i(c) === "object" && (c = ce(c, m)), p === c;
5751
5551
  }
5752
- function lt(f, c) {
5753
- return f && f.toString().replace(!c || !c.iri ? p.ESCAPE : g.ESCAPE, q);
5552
+ function et(p, c) {
5553
+ return p && p.toString().replace(!c || !c.iri ? f.ESCAPE : g.ESCAPE, q);
5754
5554
  }
5755
- function pe(f, c) {
5756
- return f && f.toString().replace(!c || !c.iri ? p.PCT_ENCODED : g.PCT_ENCODED, W);
5555
+ function ue(p, c) {
5556
+ return p && p.toString().replace(!c || !c.iri ? f.PCT_ENCODED : g.PCT_ENCODED, x);
5757
5557
  }
5758
- var Oe = {
5558
+ var ke = {
5759
5559
  scheme: "http",
5760
5560
  domainHost: !0,
5761
5561
  parse: function(c, m) {
5762
5562
  return c.host || (c.error = c.error || "HTTP URIs must have a host."), c;
5763
5563
  },
5764
5564
  serialize: function(c, m) {
5765
- var R = String(c.scheme).toLowerCase() === "https";
5766
- return (c.port === (R ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
5565
+ var T = String(c.scheme).toLowerCase() === "https";
5566
+ return (c.port === (T ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
5767
5567
  }
5768
- }, jt = {
5568
+ }, wt = {
5769
5569
  scheme: "https",
5770
- domainHost: Oe.domainHost,
5771
- parse: Oe.parse,
5772
- serialize: Oe.serialize
5570
+ domainHost: ke.domainHost,
5571
+ parse: ke.parse,
5572
+ serialize: ke.serialize
5773
5573
  };
5774
- function At(f) {
5775
- return typeof f.secure == "boolean" ? f.secure : String(f.scheme).toLowerCase() === "wss";
5574
+ function bt(p) {
5575
+ return typeof p.secure == "boolean" ? p.secure : String(p.scheme).toLowerCase() === "wss";
5776
5576
  }
5777
- var it = {
5577
+ var Ze = {
5778
5578
  scheme: "ws",
5779
5579
  domainHost: !0,
5780
5580
  parse: function(c, m) {
5781
- var R = c;
5782
- return R.secure = At(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
5581
+ var T = c;
5582
+ return T.secure = bt(T), T.resourceName = (T.path || "/") + (T.query ? "?" + T.query : ""), T.path = void 0, T.query = void 0, T;
5783
5583
  },
5784
5584
  serialize: function(c, m) {
5785
- if ((c.port === (At(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
5786
- var R = c.resourceName.split("?"), E = O(R, 2), U = E[0], L = E[1];
5787
- c.path = U && U !== "/" ? U : void 0, c.query = L, c.resourceName = void 0;
5585
+ if ((c.port === (bt(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
5586
+ var T = c.resourceName.split("?"), E = O(T, 2), L = E[0], U = E[1];
5587
+ c.path = L && L !== "/" ? L : void 0, c.query = U, c.resourceName = void 0;
5788
5588
  }
5789
5589
  return c.fragment = void 0, c;
5790
5590
  }
5791
- }, Dt = {
5591
+ }, Pt = {
5792
5592
  scheme: "wss",
5793
- domainHost: it.domainHost,
5794
- parse: it.parse,
5795
- serialize: it.serialize
5796
- }, lr = {}, Ft = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", dr = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ur = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", pr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", fr = n(pr, '[\\"\\\\]'), hr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", mr = new RegExp(Ft, "g"), ze = new RegExp(dr, "g"), _r = new RegExp(n("[^]", ur, "[\\.]", '[\\"]', fr), "g"), Mt = new RegExp(n("[^]", Ft, hr), "g"), gr = Mt;
5797
- function Nt(f) {
5798
- var c = W(f);
5799
- return c.match(mr) ? c : f;
5800
- }
5801
- var qt = {
5593
+ domainHost: Ze.domainHost,
5594
+ parse: Ze.parse,
5595
+ serialize: Ze.serialize
5596
+ }, Kt = {}, Et = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", Jt = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), Qt = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", Zt = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", Yt = n(Zt, '[\\"\\\\]'), Xt = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", er = new RegExp(Et, "g"), Le = new RegExp(Jt, "g"), tr = new RegExp(n("[^]", Qt, "[\\.]", '[\\"]', Yt), "g"), St = new RegExp(n("[^]", Et, Xt), "g"), rr = St;
5597
+ function yt(p) {
5598
+ var c = x(p);
5599
+ return c.match(er) ? c : p;
5600
+ }
5601
+ var Tt = {
5802
5602
  scheme: "mailto",
5803
5603
  parse: function(c, m) {
5804
- var R = c, E = R.to = R.path ? R.path.split(",") : [];
5805
- if (R.path = void 0, R.query) {
5806
- for (var U = !1, L = {}, Q = R.query.split("&"), Z = 0, ne = Q.length; Z < ne; ++Z) {
5807
- var B = Q[Z].split("=");
5604
+ var T = c, E = T.to = T.path ? T.path.split(",") : [];
5605
+ if (T.path = void 0, T.query) {
5606
+ for (var L = !1, U = {}, K = T.query.split("&"), Q = 0, re = K.length; Q < re; ++Q) {
5607
+ var B = K[Q].split("=");
5808
5608
  switch (B[0]) {
5809
5609
  case "to":
5810
- for (var Y = B[1].split(","), se = 0, z = Y.length; se < z; ++se)
5811
- E.push(Y[se]);
5610
+ for (var J = B[1].split(","), ne = 0, z = J.length; ne < z; ++ne)
5611
+ E.push(J[ne]);
5812
5612
  break;
5813
5613
  case "subject":
5814
- R.subject = pe(B[1], m);
5614
+ T.subject = ue(B[1], m);
5815
5615
  break;
5816
5616
  case "body":
5817
- R.body = pe(B[1], m);
5617
+ T.body = ue(B[1], m);
5818
5618
  break;
5819
5619
  default:
5820
- U = !0, L[pe(B[0], m)] = pe(B[1], m);
5620
+ L = !0, U[ue(B[0], m)] = ue(B[1], m);
5821
5621
  break;
5822
5622
  }
5823
5623
  }
5824
- U && (R.headers = L);
5624
+ L && (T.headers = U);
5825
5625
  }
5826
- R.query = void 0;
5827
- for (var X = 0, ae = E.length; X < ae; ++X) {
5828
- var ee = E[X].split("@");
5829
- if (ee[0] = pe(ee[0]), m.unicodeSupport)
5830
- ee[1] = pe(ee[1], m).toLowerCase();
5626
+ T.query = void 0;
5627
+ for (var Z = 0, oe = E.length; Z < oe; ++Z) {
5628
+ var Y = E[Z].split("@");
5629
+ if (Y[0] = ue(Y[0]), m.unicodeSupport)
5630
+ Y[1] = ue(Y[1], m).toLowerCase();
5831
5631
  else
5832
5632
  try {
5833
- ee[1] = N.toASCII(pe(ee[1], m).toLowerCase());
5834
- } catch (Se) {
5835
- R.error = R.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
5633
+ Y[1] = N.toASCII(ue(Y[1], m).toLowerCase());
5634
+ } catch (Pe) {
5635
+ T.error = T.error || "Email address's domain name can not be converted to ASCII via punycode: " + Pe;
5836
5636
  }
5837
- E[X] = ee.join("@");
5637
+ E[Z] = Y.join("@");
5838
5638
  }
5839
- return R;
5639
+ return T;
5840
5640
  },
5841
5641
  serialize: function(c, m) {
5842
- var R = c, E = l(c.to);
5642
+ var T = c, E = l(c.to);
5843
5643
  if (E) {
5844
- for (var U = 0, L = E.length; U < L; ++U) {
5845
- var Q = String(E[U]), Z = Q.lastIndexOf("@"), ne = Q.slice(0, Z).replace(ze, Nt).replace(ze, o).replace(_r, q), B = Q.slice(Z + 1);
5644
+ for (var L = 0, U = E.length; L < U; ++L) {
5645
+ var K = String(E[L]), Q = K.lastIndexOf("@"), re = K.slice(0, Q).replace(Le, yt).replace(Le, o).replace(tr, q), B = K.slice(Q + 1);
5846
5646
  try {
5847
- B = m.iri ? N.toUnicode(B) : N.toASCII(pe(B, m).toLowerCase());
5848
- } catch (X) {
5849
- R.error = R.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5647
+ B = m.iri ? N.toUnicode(B) : N.toASCII(ue(B, m).toLowerCase());
5648
+ } catch (Z) {
5649
+ T.error = T.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + Z;
5850
5650
  }
5851
- E[U] = ne + "@" + B;
5651
+ E[L] = re + "@" + B;
5852
5652
  }
5853
- R.path = E.join(",");
5653
+ T.path = E.join(",");
5854
5654
  }
5855
- var Y = c.headers = c.headers || {};
5856
- c.subject && (Y.subject = c.subject), c.body && (Y.body = c.body);
5857
- var se = [];
5858
- for (var z in Y)
5859
- Y[z] !== lr[z] && se.push(z.replace(ze, Nt).replace(ze, o).replace(Mt, q) + "=" + Y[z].replace(ze, Nt).replace(ze, o).replace(gr, q));
5860
- return se.length && (R.query = se.join("&")), R;
5655
+ var J = c.headers = c.headers || {};
5656
+ c.subject && (J.subject = c.subject), c.body && (J.body = c.body);
5657
+ var ne = [];
5658
+ for (var z in J)
5659
+ J[z] !== Kt[z] && ne.push(z.replace(Le, yt).replace(Le, o).replace(St, q) + "=" + J[z].replace(Le, yt).replace(Le, o).replace(rr, q));
5660
+ return ne.length && (T.query = ne.join("&")), T;
5861
5661
  }
5862
- }, $r = /^([^\:]+)\:(.*)/, Ut = {
5662
+ }, nr = /^([^\:]+)\:(.*)/, Rt = {
5863
5663
  scheme: "urn",
5864
5664
  parse: function(c, m) {
5865
- var R = c.path && c.path.match($r), E = c;
5866
- if (R) {
5867
- var U = m.scheme || E.scheme || "urn", L = R[1].toLowerCase(), Q = R[2], Z = U + ":" + (m.nid || L), ne = M[Z];
5868
- E.nid = L, E.nss = Q, E.path = void 0, ne && (E = ne.parse(E, m));
5665
+ var T = c.path && c.path.match(nr), E = c;
5666
+ if (T) {
5667
+ var L = m.scheme || E.scheme || "urn", U = T[1].toLowerCase(), K = T[2], Q = L + ":" + (m.nid || U), re = M[Q];
5668
+ E.nid = U, E.nss = K, E.path = void 0, re && (E = re.parse(E, m));
5869
5669
  } else
5870
5670
  E.error = E.error || "URN can not be parsed.";
5871
5671
  return E;
5872
5672
  },
5873
5673
  serialize: function(c, m) {
5874
- var R = m.scheme || c.scheme || "urn", E = c.nid, U = R + ":" + (m.nid || E), L = M[U];
5875
- L && (c = L.serialize(c, m));
5876
- var Q = c, Z = c.nss;
5877
- return Q.path = (E || m.nid) + ":" + Z, Q;
5674
+ var T = m.scheme || c.scheme || "urn", E = c.nid, L = T + ":" + (m.nid || E), U = M[L];
5675
+ U && (c = U.serialize(c, m));
5676
+ var K = c, Q = c.nss;
5677
+ return K.path = (E || m.nid) + ":" + Q, K;
5878
5678
  }
5879
- }, yr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Lt = {
5679
+ }, sr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, kt = {
5880
5680
  scheme: "urn:uuid",
5881
5681
  parse: function(c, m) {
5882
- var R = c;
5883
- return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(yr)) && (R.error = R.error || "UUID is not valid."), R;
5682
+ var T = c;
5683
+ return T.uuid = T.nss, T.nss = void 0, !m.tolerant && (!T.uuid || !T.uuid.match(sr)) && (T.error = T.error || "UUID is not valid."), T;
5884
5684
  },
5885
5685
  serialize: function(c, m) {
5886
- var R = c;
5887
- return R.nss = (c.uuid || "").toLowerCase(), R;
5686
+ var T = c;
5687
+ return T.nss = (c.uuid || "").toLowerCase(), T;
5888
5688
  }
5889
5689
  };
5890
- M[Oe.scheme] = Oe, M[jt.scheme] = jt, M[it.scheme] = it, M[Dt.scheme] = Dt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, M[Lt.scheme] = Lt, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = Ve, r.resolve = nt, r.normalize = Ce, r.equal = st, r.escapeComponent = lt, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
5690
+ M[ke.scheme] = ke, M[wt.scheme] = wt, M[Ze.scheme] = Ze, M[Pt.scheme] = Pt, M[Tt.scheme] = Tt, M[Rt.scheme] = Rt, M[kt.scheme] = kt, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = x, r.parse = le, r.removeDotSegments = me, r.serialize = ce, r.resolveComponents = qe, r.resolve = Je, r.normalize = Re, r.equal = Qe, r.escapeComponent = et, r.unescapeComponent = ue, Object.defineProperty(r, "__esModule", { value: !0 });
5891
5691
  });
5892
5692
  })(uri_all, uri_all.exports);
5893
5693
  var uri_allExports = uri_all.exports;
@@ -5915,9 +5715,9 @@ uri$1.default = uri;
5915
5715
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
5916
5716
  return r.CodeGen;
5917
5717
  } });
5918
- const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, g = require$$9, O = uri$1, C = (F, v) => new RegExp(F, v);
5718
+ const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, f = util, g = require$$9, O = uri$1, C = (F, v) => new RegExp(F, v);
5919
5719
  C.code = "new RegExp";
5920
- const S = ["removeAdditional", "useDefaults", "coerceTypes"], T = /* @__PURE__ */ new Set([
5720
+ const S = ["removeAdditional", "useDefaults", "coerceTypes"], R = /* @__PURE__ */ new Set([
5921
5721
  "validate",
5922
5722
  "serialize",
5923
5723
  "parse",
@@ -5952,110 +5752,110 @@ uri$1.default = uri;
5952
5752
  jsPropertySyntax: "",
5953
5753
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
5954
5754
  }, $ = 200;
5955
- function P(F) {
5956
- var v, j, b, a, h, N, M, q, W, G, re, he, qe, Xe, et, de, tt, Ue, Le, He, rt, me, le, Ve, nt;
5957
- const Ce = F.strict, st = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, lt = st === !0 || st === void 0 ? 1 : st || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : C, Oe = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5755
+ function b(F) {
5756
+ var v, j, P, a, h, N, M, q, x, W, te, he, De, Be, We, le, Ge, Ae, Fe, Me, Ke, me, ce, qe, Je;
5757
+ const Re = F.strict, Qe = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, et = Qe === !0 || Qe === void 0 ? 1 : Qe || 0, ue = (P = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && P !== void 0 ? P : C, ke = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5958
5758
  return {
5959
- strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Ce) !== null && N !== void 0 ? N : !0,
5960
- strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Ce) !== null && q !== void 0 ? q : !0,
5961
- strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Ce) !== null && G !== void 0 ? G : "log",
5962
- strictTuples: (he = (re = F.strictTuples) !== null && re !== void 0 ? re : Ce) !== null && he !== void 0 ? he : "log",
5963
- strictRequired: (Xe = (qe = F.strictRequired) !== null && qe !== void 0 ? qe : Ce) !== null && Xe !== void 0 ? Xe : !1,
5964
- code: F.code ? { ...F.code, optimize: lt, regExp: pe } : { optimize: lt, regExp: pe },
5965
- loopRequired: (et = F.loopRequired) !== null && et !== void 0 ? et : $,
5966
- loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : $,
5967
- meta: (tt = F.meta) !== null && tt !== void 0 ? tt : !0,
5968
- messages: (Ue = F.messages) !== null && Ue !== void 0 ? Ue : !0,
5969
- inlineRefs: (Le = F.inlineRefs) !== null && Le !== void 0 ? Le : !0,
5970
- schemaId: (He = F.schemaId) !== null && He !== void 0 ? He : "$id",
5971
- addUsedSchema: (rt = F.addUsedSchema) !== null && rt !== void 0 ? rt : !0,
5759
+ strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Re) !== null && N !== void 0 ? N : !0,
5760
+ strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Re) !== null && q !== void 0 ? q : !0,
5761
+ strictTypes: (W = (x = F.strictTypes) !== null && x !== void 0 ? x : Re) !== null && W !== void 0 ? W : "log",
5762
+ strictTuples: (he = (te = F.strictTuples) !== null && te !== void 0 ? te : Re) !== null && he !== void 0 ? he : "log",
5763
+ strictRequired: (Be = (De = F.strictRequired) !== null && De !== void 0 ? De : Re) !== null && Be !== void 0 ? Be : !1,
5764
+ code: F.code ? { ...F.code, optimize: et, regExp: ue } : { optimize: et, regExp: ue },
5765
+ loopRequired: (We = F.loopRequired) !== null && We !== void 0 ? We : $,
5766
+ loopEnum: (le = F.loopEnum) !== null && le !== void 0 ? le : $,
5767
+ meta: (Ge = F.meta) !== null && Ge !== void 0 ? Ge : !0,
5768
+ messages: (Ae = F.messages) !== null && Ae !== void 0 ? Ae : !0,
5769
+ inlineRefs: (Fe = F.inlineRefs) !== null && Fe !== void 0 ? Fe : !0,
5770
+ schemaId: (Me = F.schemaId) !== null && Me !== void 0 ? Me : "$id",
5771
+ addUsedSchema: (Ke = F.addUsedSchema) !== null && Ke !== void 0 ? Ke : !0,
5972
5772
  validateSchema: (me = F.validateSchema) !== null && me !== void 0 ? me : !0,
5973
- validateFormats: (le = F.validateFormats) !== null && le !== void 0 ? le : !0,
5974
- unicodeRegExp: (Ve = F.unicodeRegExp) !== null && Ve !== void 0 ? Ve : !0,
5975
- int32range: (nt = F.int32range) !== null && nt !== void 0 ? nt : !0,
5976
- uriResolver: Oe
5773
+ validateFormats: (ce = F.validateFormats) !== null && ce !== void 0 ? ce : !0,
5774
+ unicodeRegExp: (qe = F.unicodeRegExp) !== null && qe !== void 0 ? qe : !0,
5775
+ int32range: (Je = F.int32range) !== null && Je !== void 0 ? Je : !0,
5776
+ uriResolver: ke
5977
5777
  };
5978
5778
  }
5979
5779
  class I {
5980
5780
  constructor(v = {}) {
5981
- this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
5982
- const { es5: j, lines: b } = this.opts.code;
5983
- this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger = J(v.logger);
5781
+ this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...b(v) };
5782
+ const { es5: j, lines: P } = this.opts.code;
5783
+ this.scope = new l.ValueScope({ scope: {}, prefixes: R, es5: j, lines: P }), this.logger = G(v.logger);
5984
5784
  const a = v.validateFormats;
5985
- v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, y, v, "NOT SUPPORTED"), D.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = x.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && V.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), k.call(this), v.validateFormats = a;
5785
+ v.validateFormats = !1, this.RULES = (0, i.getRules)(), A.call(this, y, v, "NOT SUPPORTED"), A.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = H.call(this), v.formats && D.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && V.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), k.call(this), v.validateFormats = a;
5986
5786
  }
5987
5787
  _addVocabularies() {
5988
5788
  this.addKeyword("$async");
5989
5789
  }
5990
5790
  _addDefaultMetaSchema() {
5991
- const { $data: v, meta: j, schemaId: b } = this.opts;
5791
+ const { $data: v, meta: j, schemaId: P } = this.opts;
5992
5792
  let a = g;
5993
- b === "id" && (a = { ...g }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
5793
+ P === "id" && (a = { ...g }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[P], !1);
5994
5794
  }
5995
5795
  defaultMeta() {
5996
5796
  const { meta: v, schemaId: j } = this.opts;
5997
5797
  return this.opts.defaultMeta = typeof v == "object" ? v[j] || v : void 0;
5998
5798
  }
5999
5799
  validate(v, j) {
6000
- let b;
5800
+ let P;
6001
5801
  if (typeof v == "string") {
6002
- if (b = this.getSchema(v), !b)
5802
+ if (P = this.getSchema(v), !P)
6003
5803
  throw new Error(`no schema with key or ref "${v}"`);
6004
5804
  } else
6005
- b = this.compile(v);
6006
- const a = b(j);
6007
- return "$async" in b || (this.errors = b.errors), a;
5805
+ P = this.compile(v);
5806
+ const a = P(j);
5807
+ return "$async" in P || (this.errors = P.errors), a;
6008
5808
  }
6009
5809
  compile(v, j) {
6010
- const b = this._addSchema(v, j);
6011
- return b.validate || this._compileSchemaEnv(b);
5810
+ const P = this._addSchema(v, j);
5811
+ return P.validate || this._compileSchemaEnv(P);
6012
5812
  }
6013
5813
  compileAsync(v, j) {
6014
5814
  if (typeof this.opts.loadSchema != "function")
6015
5815
  throw new Error("options.loadSchema should be a function");
6016
- const { loadSchema: b } = this.opts;
5816
+ const { loadSchema: P } = this.opts;
6017
5817
  return a.call(this, v, j);
6018
- async function a(G, re) {
6019
- await h.call(this, G.$schema);
6020
- const he = this._addSchema(G, re);
5818
+ async function a(W, te) {
5819
+ await h.call(this, W.$schema);
5820
+ const he = this._addSchema(W, te);
6021
5821
  return he.validate || N.call(this, he);
6022
5822
  }
6023
- async function h(G) {
6024
- G && !this.getSchema(G) && await a.call(this, { $ref: G }, !0);
5823
+ async function h(W) {
5824
+ W && !this.getSchema(W) && await a.call(this, { $ref: W }, !0);
6025
5825
  }
6026
- async function N(G) {
5826
+ async function N(W) {
6027
5827
  try {
6028
- return this._compileSchemaEnv(G);
6029
- } catch (re) {
6030
- if (!(re instanceof s.default))
6031
- throw re;
6032
- return M.call(this, re), await q.call(this, re.missingSchema), N.call(this, G);
5828
+ return this._compileSchemaEnv(W);
5829
+ } catch (te) {
5830
+ if (!(te instanceof s.default))
5831
+ throw te;
5832
+ return M.call(this, te), await q.call(this, te.missingSchema), N.call(this, W);
6033
5833
  }
6034
5834
  }
6035
- function M({ missingSchema: G, missingRef: re }) {
6036
- if (this.refs[G])
6037
- throw new Error(`AnySchema ${G} is loaded but ${re} cannot be resolved`);
5835
+ function M({ missingSchema: W, missingRef: te }) {
5836
+ if (this.refs[W])
5837
+ throw new Error(`AnySchema ${W} is loaded but ${te} cannot be resolved`);
6038
5838
  }
6039
- async function q(G) {
6040
- const re = await W.call(this, G);
6041
- this.refs[G] || await h.call(this, re.$schema), this.refs[G] || this.addSchema(re, G, j);
5839
+ async function q(W) {
5840
+ const te = await x.call(this, W);
5841
+ this.refs[W] || await h.call(this, te.$schema), this.refs[W] || this.addSchema(te, W, j);
6042
5842
  }
6043
- async function W(G) {
6044
- const re = this._loading[G];
6045
- if (re)
6046
- return re;
5843
+ async function x(W) {
5844
+ const te = this._loading[W];
5845
+ if (te)
5846
+ return te;
6047
5847
  try {
6048
- return await (this._loading[G] = b(G));
5848
+ return await (this._loading[W] = P(W));
6049
5849
  } finally {
6050
- delete this._loading[G];
5850
+ delete this._loading[W];
6051
5851
  }
6052
5852
  }
6053
5853
  }
6054
5854
  // Adds schema to the instance
6055
- addSchema(v, j, b, a = this.opts.validateSchema) {
5855
+ addSchema(v, j, P, a = this.opts.validateSchema) {
6056
5856
  if (Array.isArray(v)) {
6057
5857
  for (const N of v)
6058
- this.addSchema(N, void 0, b, a);
5858
+ this.addSchema(N, void 0, P, a);
6059
5859
  return this;
6060
5860
  }
6061
5861
  let h;
@@ -6064,23 +5864,23 @@ uri$1.default = uri;
6064
5864
  if (h = v[N], h !== void 0 && typeof h != "string")
6065
5865
  throw new Error(`schema ${N} must be string`);
6066
5866
  }
6067
- return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, b, j, a, !0), this;
5867
+ return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, P, j, a, !0), this;
6068
5868
  }
6069
5869
  // Add schema that will be used to validate other schemas
6070
5870
  // options in META_IGNORE_OPTIONS are alway set to false
6071
- addMetaSchema(v, j, b = this.opts.validateSchema) {
6072
- return this.addSchema(v, j, !0, b), this;
5871
+ addMetaSchema(v, j, P = this.opts.validateSchema) {
5872
+ return this.addSchema(v, j, !0, P), this;
6073
5873
  }
6074
5874
  // Validate schema against its meta-schema
6075
5875
  validateSchema(v, j) {
6076
5876
  if (typeof v == "boolean")
6077
5877
  return !0;
6078
- let b;
6079
- if (b = v.$schema, b !== void 0 && typeof b != "string")
5878
+ let P;
5879
+ if (P = v.$schema, P !== void 0 && typeof P != "string")
6080
5880
  throw new Error("$schema must be a string");
6081
- if (b = b || this.opts.defaultMeta || this.defaultMeta(), !b)
5881
+ if (P = P || this.opts.defaultMeta || this.defaultMeta(), !P)
6082
5882
  return this.logger.warn("meta-schema not available"), this.errors = null, !0;
6083
- const a = this.validate(b, v);
5883
+ const a = this.validate(P, v);
6084
5884
  if (!a && j) {
6085
5885
  const h = "schema is invalid: " + this.errorsText();
6086
5886
  if (this.opts.validateSchema === "log")
@@ -6097,7 +5897,7 @@ uri$1.default = uri;
6097
5897
  for (; typeof (j = w.call(this, v)) == "string"; )
6098
5898
  v = j;
6099
5899
  if (j === void 0) {
6100
- const { schemaId: b } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: b });
5900
+ const { schemaId: P } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: P });
6101
5901
  if (j = o.resolveSchema.call(this, a, v), !j)
6102
5902
  return;
6103
5903
  this.refs[v] = j;
@@ -6121,8 +5921,8 @@ uri$1.default = uri;
6121
5921
  case "object": {
6122
5922
  const j = v;
6123
5923
  this._cache.delete(j);
6124
- let b = v[this.opts.schemaId];
6125
- return b && (b = (0, d.normalizeId)(b), delete this.schemas[b], delete this.refs[b]), this;
5924
+ let P = v[this.opts.schemaId];
5925
+ return P && (P = (0, d.normalizeId)(P), delete this.schemas[P], delete this.refs[P]), this;
6126
5926
  }
6127
5927
  default:
6128
5928
  throw new Error("ajv.removeSchema: invalid parameter");
@@ -6135,23 +5935,23 @@ uri$1.default = uri;
6135
5935
  return this;
6136
5936
  }
6137
5937
  addKeyword(v, j) {
6138
- let b;
5938
+ let P;
6139
5939
  if (typeof v == "string")
6140
- b = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = b);
5940
+ P = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = P);
6141
5941
  else if (typeof v == "object" && j === void 0) {
6142
- if (j = v, b = j.keyword, Array.isArray(b) && !b.length)
5942
+ if (j = v, P = j.keyword, Array.isArray(P) && !P.length)
6143
5943
  throw new Error("addKeywords: keyword must be string or non-empty array");
6144
5944
  } else
6145
5945
  throw new Error("invalid addKeywords parameters");
6146
- if (oe.call(this, b, j), !j)
6147
- return (0, p.eachItem)(b, (h) => Te.call(this, h)), this;
6148
- Fe.call(this, j);
5946
+ if (ie.call(this, P, j), !j)
5947
+ return (0, f.eachItem)(P, (h) => Se.call(this, h)), this;
5948
+ Ie.call(this, j);
6149
5949
  const a = {
6150
5950
  ...j,
6151
5951
  type: (0, u.getJSONTypes)(j.type),
6152
5952
  schemaType: (0, u.getJSONTypes)(j.schemaType)
6153
5953
  };
6154
- return (0, p.eachItem)(b, a.type.length === 0 ? (h) => Te.call(this, h, a) : (h) => a.type.forEach((N) => Te.call(this, h, a, N))), this;
5954
+ return (0, f.eachItem)(P, a.type.length === 0 ? (h) => Se.call(this, h, a) : (h) => a.type.forEach((N) => Se.call(this, h, a, N))), this;
6155
5955
  }
6156
5956
  getKeyword(v) {
6157
5957
  const j = this.RULES.all[v];
@@ -6161,9 +5961,9 @@ uri$1.default = uri;
6161
5961
  removeKeyword(v) {
6162
5962
  const { RULES: j } = this;
6163
5963
  delete j.keywords[v], delete j.all[v];
6164
- for (const b of j.rules) {
6165
- const a = b.rules.findIndex((h) => h.keyword === v);
6166
- a >= 0 && b.rules.splice(a, 1);
5964
+ for (const P of j.rules) {
5965
+ const a = P.rules.findIndex((h) => h.keyword === v);
5966
+ a >= 0 && P.rules.splice(a, 1);
6167
5967
  }
6168
5968
  return this;
6169
5969
  }
@@ -6171,34 +5971,34 @@ uri$1.default = uri;
6171
5971
  addFormat(v, j) {
6172
5972
  return typeof j == "string" && (j = new RegExp(j)), this.formats[v] = j, this;
6173
5973
  }
6174
- errorsText(v = this.errors, { separator: j = ", ", dataVar: b = "data" } = {}) {
6175
- return !v || v.length === 0 ? "No errors" : v.map((a) => `${b}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
5974
+ errorsText(v = this.errors, { separator: j = ", ", dataVar: P = "data" } = {}) {
5975
+ return !v || v.length === 0 ? "No errors" : v.map((a) => `${P}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
6176
5976
  }
6177
5977
  $dataMetaSchema(v, j) {
6178
- const b = this.RULES.all;
5978
+ const P = this.RULES.all;
6179
5979
  v = JSON.parse(JSON.stringify(v));
6180
5980
  for (const a of j) {
6181
5981
  const h = a.split("/").slice(1);
6182
5982
  let N = v;
6183
5983
  for (const M of h)
6184
5984
  N = N[M];
6185
- for (const M in b) {
6186
- const q = b[M];
5985
+ for (const M in P) {
5986
+ const q = P[M];
6187
5987
  if (typeof q != "object")
6188
5988
  continue;
6189
- const { $data: W } = q.definition, G = N[M];
6190
- W && G && (N[M] = Me(G));
5989
+ const { $data: x } = q.definition, W = N[M];
5990
+ x && W && (N[M] = je(W));
6191
5991
  }
6192
5992
  }
6193
5993
  return v;
6194
5994
  }
6195
5995
  _removeAllSchemas(v, j) {
6196
- for (const b in v) {
6197
- const a = v[b];
6198
- (!j || j.test(b)) && (typeof a == "string" ? delete v[b] : a && !a.meta && (this._cache.delete(a.schema), delete v[b]));
5996
+ for (const P in v) {
5997
+ const a = v[P];
5998
+ (!j || j.test(P)) && (typeof a == "string" ? delete v[P] : a && !a.meta && (this._cache.delete(a.schema), delete v[P]));
6199
5999
  }
6200
6000
  }
6201
- _addSchema(v, j, b, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6001
+ _addSchema(v, j, P, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6202
6002
  let N;
6203
6003
  const { schemaId: M } = this.opts;
6204
6004
  if (typeof v == "object")
@@ -6212,9 +6012,9 @@ uri$1.default = uri;
6212
6012
  let q = this._cache.get(v);
6213
6013
  if (q !== void 0)
6214
6014
  return q;
6215
- b = (0, d.normalizeId)(N || b);
6216
- const W = d.getSchemaRefs.call(this, v, b);
6217
- return q = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: b, localRefs: W }), this._cache.set(q.schema, q), h && !b.startsWith("#") && (b && this._checkUnique(b), this.refs[b] = q), a && this.validateSchema(v, !0), q;
6015
+ P = (0, d.normalizeId)(N || P);
6016
+ const x = d.getSchemaRefs.call(this, v, P);
6017
+ return q = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: P, localRefs: x }), this._cache.set(q.schema, q), h && !P.startsWith("#") && (P && this._checkUnique(P), this.refs[P] = q), a && this.validateSchema(v, !0), q;
6218
6018
  }
6219
6019
  _checkUnique(v) {
6220
6020
  if (this.schemas[v] || this.refs[v])
@@ -6236,10 +6036,10 @@ uri$1.default = uri;
6236
6036
  }
6237
6037
  }
6238
6038
  e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
6239
- function D(F, v, j, b = "error") {
6039
+ function A(F, v, j, P = "error") {
6240
6040
  for (const a in F) {
6241
6041
  const h = a;
6242
- h in v && this.logger[b](`${j}: option ${a}. ${F[h]}`);
6042
+ h in v && this.logger[P](`${j}: option ${a}. ${F[h]}`);
6243
6043
  }
6244
6044
  }
6245
6045
  function w(F) {
@@ -6254,7 +6054,7 @@ uri$1.default = uri;
6254
6054
  for (const v in F)
6255
6055
  this.addSchema(F[v], v);
6256
6056
  }
6257
- function A() {
6057
+ function D() {
6258
6058
  for (const F in this.opts.formats) {
6259
6059
  const v = this.opts.formats[F];
6260
6060
  v && this.addFormat(F, v);
@@ -6271,38 +6071,38 @@ uri$1.default = uri;
6271
6071
  j.keyword || (j.keyword = v), this.addKeyword(j);
6272
6072
  }
6273
6073
  }
6274
- function x() {
6074
+ function H() {
6275
6075
  const F = { ...this.opts };
6276
6076
  for (const v of S)
6277
6077
  delete F[v];
6278
6078
  return F;
6279
6079
  }
6280
- const te = { log() {
6080
+ const X = { log() {
6281
6081
  }, warn() {
6282
6082
  }, error() {
6283
6083
  } };
6284
- function J(F) {
6084
+ function G(F) {
6285
6085
  if (F === !1)
6286
- return te;
6086
+ return X;
6287
6087
  if (F === void 0)
6288
6088
  return console;
6289
6089
  if (F.log && F.warn && F.error)
6290
6090
  return F;
6291
6091
  throw new Error("logger must implement log, warn and error methods");
6292
6092
  }
6293
- const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
6294
- function oe(F, v) {
6093
+ const de = /^[a-z_$][a-z0-9_$:-]*$/i;
6094
+ function ie(F, v) {
6295
6095
  const { RULES: j } = this;
6296
- if ((0, p.eachItem)(F, (b) => {
6297
- if (j.keywords[b])
6298
- throw new Error(`Keyword ${b} is already defined`);
6299
- if (!ue.test(b))
6300
- throw new Error(`Keyword ${b} has invalid name`);
6096
+ if ((0, f.eachItem)(F, (P) => {
6097
+ if (j.keywords[P])
6098
+ throw new Error(`Keyword ${P} is already defined`);
6099
+ if (!de.test(P))
6100
+ throw new Error(`Keyword ${P} has invalid name`);
6301
6101
  }), !!v && v.$data && !("code" in v || "validate" in v))
6302
6102
  throw new Error('$data keyword must have "code" or "validate" function');
6303
6103
  }
6304
- function Te(F, v, j) {
6305
- var b;
6104
+ function Se(F, v, j) {
6105
+ var P;
6306
6106
  const a = v == null ? void 0 : v.post;
6307
6107
  if (j && a)
6308
6108
  throw new Error('keyword with "post" flag cannot have "type"');
@@ -6318,21 +6118,21 @@ uri$1.default = uri;
6318
6118
  schemaType: (0, u.getJSONTypes)(v.schemaType)
6319
6119
  }
6320
6120
  };
6321
- v.before ? ke.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((q) => this.addKeyword(q));
6121
+ v.before ? Te.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (P = v.implements) === null || P === void 0 || P.forEach((q) => this.addKeyword(q));
6322
6122
  }
6323
- function ke(F, v, j) {
6324
- const b = F.rules.findIndex((a) => a.keyword === j);
6325
- b >= 0 ? F.rules.splice(b, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6123
+ function Te(F, v, j) {
6124
+ const P = F.rules.findIndex((a) => a.keyword === j);
6125
+ P >= 0 ? F.rules.splice(P, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6326
6126
  }
6327
- function Fe(F) {
6127
+ function Ie(F) {
6328
6128
  let { metaSchema: v } = F;
6329
- v !== void 0 && (F.$data && this.opts.$data && (v = Me(v)), F.validateSchema = this.compile(v, !0));
6129
+ v !== void 0 && (F.$data && this.opts.$data && (v = je(v)), F.validateSchema = this.compile(v, !0));
6330
6130
  }
6331
- const Ze = {
6131
+ const xe = {
6332
6132
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
6333
6133
  };
6334
- function Me(F) {
6335
- return { anyOf: [F, Ze] };
6134
+ function je(F) {
6135
+ return { anyOf: [F, xe] };
6336
6136
  }
6337
6137
  })(core$2);
6338
6138
  var draft7 = {}, core$1 = {}, id = {};
@@ -6354,12 +6154,12 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
6354
6154
  const { gen: t, schema: r, it: n } = e, { baseId: s, schemaEnv: i, validateName: o, opts: l, self: d } = n, { root: u } = i;
6355
6155
  if ((r === "#" || r === "#/") && s === u.baseId)
6356
6156
  return g();
6357
- const p = compile_1$1.resolveRef.call(d, u, s, r);
6358
- if (p === void 0)
6157
+ const f = compile_1$1.resolveRef.call(d, u, s, r);
6158
+ if (f === void 0)
6359
6159
  throw new ref_error_1.default(n.opts.uriResolver, s, r);
6360
- if (p instanceof compile_1$1.SchemaEnv)
6361
- return O(p);
6362
- return C(p);
6160
+ if (f instanceof compile_1$1.SchemaEnv)
6161
+ return O(f);
6162
+ return C(f);
6363
6163
  function g() {
6364
6164
  if (i === u)
6365
6165
  return callRef(e, o, i, i.$async);
@@ -6367,15 +6167,15 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
6367
6167
  return callRef(e, (0, codegen_1$l._)`${S}.validate`, u, u.$async);
6368
6168
  }
6369
6169
  function O(S) {
6370
- const T = getValidate(e, S);
6371
- callRef(e, T, S, S.$async);
6170
+ const R = getValidate(e, S);
6171
+ callRef(e, R, S, S.$async);
6372
6172
  }
6373
6173
  function C(S) {
6374
- const T = t.scopeValue("schema", l.code.source === !0 ? { ref: S, code: (0, codegen_1$l.stringify)(S) } : { ref: S }), y = t.name("valid"), _ = e.subschema({
6174
+ const R = t.scopeValue("schema", l.code.source === !0 ? { ref: S, code: (0, codegen_1$l.stringify)(S) } : { ref: S }), y = t.name("valid"), _ = e.subschema({
6375
6175
  schema: S,
6376
6176
  dataTypes: [],
6377
6177
  schemaPath: codegen_1$l.nil,
6378
- topSchemaRef: T,
6178
+ topSchemaRef: R,
6379
6179
  errSchemaPath: r
6380
6180
  }, y);
6381
6181
  e.mergeEvaluated(_), e.ok(y);
@@ -6389,29 +6189,29 @@ function getValidate(e, t) {
6389
6189
  ref.getValidate = getValidate;
6390
6190
  function callRef(e, t, r, n) {
6391
6191
  const { gen: s, it: i } = e, { allErrors: o, schemaEnv: l, opts: d } = i, u = d.passContext ? names_1$1.default.this : codegen_1$l.nil;
6392
- n ? p() : g();
6393
- function p() {
6192
+ n ? f() : g();
6193
+ function f() {
6394
6194
  if (!l.$async)
6395
6195
  throw new Error("async schema referenced by sync schema");
6396
6196
  const S = s.let("valid");
6397
6197
  s.try(() => {
6398
6198
  s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), C(t), o || s.assign(S, !0);
6399
- }, (T) => {
6400
- s.if((0, codegen_1$l._)`!(${T} instanceof ${i.ValidationError})`, () => s.throw(T)), O(T), o || s.assign(S, !1);
6199
+ }, (R) => {
6200
+ s.if((0, codegen_1$l._)`!(${R} instanceof ${i.ValidationError})`, () => s.throw(R)), O(R), o || s.assign(S, !1);
6401
6201
  }), e.ok(S);
6402
6202
  }
6403
6203
  function g() {
6404
6204
  e.result((0, code_1$8.callValidateCode)(e, t, u), () => C(t), () => O(t));
6405
6205
  }
6406
6206
  function O(S) {
6407
- const T = (0, codegen_1$l._)`${S}.errors`;
6408
- s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${T} : ${names_1$1.default.vErrors}.concat(${T})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
6207
+ const R = (0, codegen_1$l._)`${S}.errors`;
6208
+ s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${R} : ${names_1$1.default.vErrors}.concat(${R})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
6409
6209
  }
6410
6210
  function C(S) {
6411
- var T;
6211
+ var R;
6412
6212
  if (!i.opts.unevaluated)
6413
6213
  return;
6414
- const y = (T = r == null ? void 0 : r.validate) === null || T === void 0 ? void 0 : T.evaluated;
6214
+ const y = (R = r == null ? void 0 : r.validate) === null || R === void 0 ? void 0 : R.evaluated;
6415
6215
  if (i.props !== !0)
6416
6216
  if (y && !y.dynamicProps)
6417
6217
  y.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, y.props, i.props));
@@ -6564,11 +6364,11 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6564
6364
  if (!i && r.length === 0)
6565
6365
  return;
6566
6366
  const d = r.length >= l.loopRequired;
6567
- if (o.allErrors ? u() : p(), l.strictRequired) {
6367
+ if (o.allErrors ? u() : f(), l.strictRequired) {
6568
6368
  const C = e.parentSchema.properties, { definedProperties: S } = e.it;
6569
- for (const T of r)
6570
- if ((C == null ? void 0 : C[T]) === void 0 && !S.has(T)) {
6571
- const y = o.schemaEnv.baseId + o.errSchemaPath, _ = `required property "${T}" is not defined at "${y}" (strictRequired)`;
6369
+ for (const R of r)
6370
+ if ((C == null ? void 0 : C[R]) === void 0 && !S.has(R)) {
6371
+ const y = o.schemaEnv.baseId + o.errSchemaPath, _ = `required property "${R}" is not defined at "${y}" (strictRequired)`;
6572
6372
  (0, util_1$h.checkStrictMode)(o, _, o.opts.strictRequired);
6573
6373
  }
6574
6374
  }
@@ -6579,7 +6379,7 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6579
6379
  for (const C of r)
6580
6380
  (0, code_1$6.checkReportMissingProp)(e, C);
6581
6381
  }
6582
- function p() {
6382
+ function f() {
6583
6383
  const C = t.let("missing");
6584
6384
  if (d || i) {
6585
6385
  const S = t.let("valid", !0);
@@ -6642,25 +6442,25 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
6642
6442
  if (!n && !s)
6643
6443
  return;
6644
6444
  const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
6645
- e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6646
- function p() {
6647
- const S = t.let("i", (0, codegen_1$d._)`${r}.length`), T = t.let("j");
6648
- e.setParams({ i: S, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (g() ? O : C)(S, T));
6445
+ e.block$data(d, f, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6446
+ function f() {
6447
+ const S = t.let("i", (0, codegen_1$d._)`${r}.length`), R = t.let("j");
6448
+ e.setParams({ i: S, j: R }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (g() ? O : C)(S, R));
6649
6449
  }
6650
6450
  function g() {
6651
6451
  return u.length > 0 && !u.some((S) => S === "object" || S === "array");
6652
6452
  }
6653
- function O(S, T) {
6453
+ function O(S, R) {
6654
6454
  const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong), $ = t.const("indices", (0, codegen_1$d._)`{}`);
6655
6455
  t.for((0, codegen_1$d._)`;${S}--;`, () => {
6656
6456
  t.let(y, (0, codegen_1$d._)`${r}[${S}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${$}[${y}] == "number"`, () => {
6657
- t.assign(T, (0, codegen_1$d._)`${$}[${y}]`), e.error(), t.assign(d, !1).break();
6457
+ t.assign(R, (0, codegen_1$d._)`${$}[${y}]`), e.error(), t.assign(d, !1).break();
6658
6458
  }).code((0, codegen_1$d._)`${$}[${y}] = ${S}`);
6659
6459
  });
6660
6460
  }
6661
- function C(S, T) {
6461
+ function C(S, R) {
6662
6462
  const y = (0, util_1$g.useFunc)(t, equal_1$2.default), _ = t.name("outer");
6663
- t.label(_).for((0, codegen_1$d._)`;${S}--;`, () => t.for((0, codegen_1$d._)`${T} = ${S}; ${T}--;`, () => t.if((0, codegen_1$d._)`${y}(${r}[${S}], ${r}[${T}])`, () => {
6463
+ t.label(_).for((0, codegen_1$d._)`;${S}--;`, () => t.for((0, codegen_1$d._)`${R} = ${S}; ${R}--;`, () => t.if((0, codegen_1$d._)`${y}(${r}[${S}], ${r}[${R}])`, () => {
6664
6464
  e.error(), t.assign(d, !1).break(_);
6665
6465
  })));
6666
6466
  }
@@ -6699,22 +6499,22 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
6699
6499
  const l = s.length >= o.opts.loopEnum;
6700
6500
  let d;
6701
6501
  const u = () => d ?? (d = (0, util_1$e.useFunc)(t, equal_1.default));
6702
- let p;
6502
+ let f;
6703
6503
  if (l || n)
6704
- p = t.let("valid"), e.block$data(p, g);
6504
+ f = t.let("valid"), e.block$data(f, g);
6705
6505
  else {
6706
6506
  if (!Array.isArray(s))
6707
6507
  throw new Error("ajv implementation error");
6708
6508
  const C = t.const("vSchema", i);
6709
- p = (0, codegen_1$b.or)(...s.map((S, T) => O(C, T)));
6509
+ f = (0, codegen_1$b.or)(...s.map((S, R) => O(C, R)));
6710
6510
  }
6711
- e.pass(p);
6511
+ e.pass(f);
6712
6512
  function g() {
6713
- t.assign(p, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(p, !0).break()));
6513
+ t.assign(f, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(f, !0).break()));
6714
6514
  }
6715
6515
  function O(C, S) {
6716
- const T = s[S];
6717
- return typeof T == "object" && T !== null ? (0, codegen_1$b._)`${u()}(${r}, ${C}[${S}])` : (0, codegen_1$b._)`${r} === ${T}`;
6516
+ const R = s[S];
6517
+ return typeof R == "object" && R !== null ? (0, codegen_1$b._)`${u()}(${r}, ${C}[${S}])` : (0, codegen_1$b._)`${r} === ${R}`;
6718
6518
  }
6719
6519
  }
6720
6520
  };
@@ -6772,8 +6572,8 @@ function validateAdditionalItems(e, t) {
6772
6572
  r.if((0, codegen_1$a.not)(u), () => d(u)), e.ok(u);
6773
6573
  }
6774
6574
  function d(u) {
6775
- r.forRange("i", t.length, l, (p) => {
6776
- e.subschema({ keyword: i, dataProp: p, dataPropType: util_1$d.Type.Num }, u), o.allErrors || r.if((0, codegen_1$a.not)(u), () => r.break());
6575
+ r.forRange("i", t.length, l, (f) => {
6576
+ e.subschema({ keyword: i, dataProp: f, dataPropType: util_1$d.Type.Num }, u), o.allErrors || r.if((0, codegen_1$a.not)(u), () => r.break());
6777
6577
  });
6778
6578
  }
6779
6579
  }
@@ -6796,7 +6596,7 @@ const codegen_1$9 = codegen, util_1$c = util, code_1$5 = code, def$f = {
6796
6596
  };
6797
6597
  function validateTuple(e, t, r = e.schema) {
6798
6598
  const { gen: n, parentSchema: s, data: i, keyword: o, it: l } = e;
6799
- p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = util_1$c.mergeEvaluated.items(n, r.length, l.items));
6599
+ f(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = util_1$c.mergeEvaluated.items(n, r.length, l.items));
6800
6600
  const d = n.name("valid"), u = n.const("len", (0, codegen_1$9._)`${i}.length`);
6801
6601
  r.forEach((g, O) => {
6802
6602
  (0, util_1$c.alwaysValidSchema)(l, g) || (n.if((0, codegen_1$9._)`${u} > ${O}`, () => e.subschema({
@@ -6805,9 +6605,9 @@ function validateTuple(e, t, r = e.schema) {
6805
6605
  dataProp: O
6806
6606
  }, d)), e.ok(d));
6807
6607
  });
6808
- function p(g) {
6809
- const { opts: O, errSchemaPath: C } = l, S = r.length, T = S === g.minItems && (S === g.maxItems || g[t] === !1);
6810
- if (O.strictTuples && !T) {
6608
+ function f(g) {
6609
+ const { opts: O, errSchemaPath: C } = l, S = r.length, R = S === g.minItems && (S === g.maxItems || g[t] === !1);
6610
+ if (O.strictTuples && !R) {
6811
6611
  const y = `"${o}" is ${S}-tuple, but minItems or maxItems/${t} are not specified or different at path "${C}"`;
6812
6612
  (0, util_1$c.checkStrictMode)(l, y, O.strictTuples);
6813
6613
  }
@@ -6858,7 +6658,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6858
6658
  let o, l;
6859
6659
  const { minContains: d, maxContains: u } = n;
6860
6660
  i.opts.next ? (o = d === void 0 ? 1 : d, l = u) : o = 1;
6861
- const p = t.const("len", (0, codegen_1$7._)`${s}.length`);
6661
+ const f = t.const("len", (0, codegen_1$7._)`${s}.length`);
6862
6662
  if (e.setParams({ min: o, max: l }), l === void 0 && o === 0) {
6863
6663
  (0, util_1$a.checkStrictMode)(i, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
6864
6664
  return;
@@ -6868,29 +6668,29 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6868
6668
  return;
6869
6669
  }
6870
6670
  if ((0, util_1$a.alwaysValidSchema)(i, r)) {
6871
- let T = (0, codegen_1$7._)`${p} >= ${o}`;
6872
- l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${p} <= ${l}`), e.pass(T);
6671
+ let R = (0, codegen_1$7._)`${f} >= ${o}`;
6672
+ l !== void 0 && (R = (0, codegen_1$7._)`${R} && ${f} <= ${l}`), e.pass(R);
6873
6673
  return;
6874
6674
  }
6875
6675
  i.items = !0;
6876
6676
  const g = t.name("valid");
6877
6677
  l === void 0 && o === 1 ? C(g, () => t.if(g, () => t.break())) : o === 0 ? (t.let(g, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let(g, !1), O()), e.result(g, () => e.reset());
6878
6678
  function O() {
6879
- const T = t.name("_valid"), y = t.let("count", 0);
6880
- C(T, () => t.if(T, () => S(y)));
6679
+ const R = t.name("_valid"), y = t.let("count", 0);
6680
+ C(R, () => t.if(R, () => S(y)));
6881
6681
  }
6882
- function C(T, y) {
6883
- t.forRange("i", 0, p, (_) => {
6682
+ function C(R, y) {
6683
+ t.forRange("i", 0, f, (_) => {
6884
6684
  e.subschema({
6885
6685
  keyword: "contains",
6886
6686
  dataProp: _,
6887
6687
  dataPropType: util_1$a.Type.Num,
6888
6688
  compositeRule: !0
6889
- }, T), y();
6689
+ }, R), y();
6890
6690
  });
6891
6691
  }
6892
- function S(T) {
6893
- t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0).break()) : (t.if((0, codegen_1$7._)`${T} > ${l}`, () => t.assign(g, !1).break()), o === 1 ? t.assign(g, !0) : t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0)));
6692
+ function S(R) {
6693
+ t.code((0, codegen_1$7._)`${R}++`), l === void 0 ? t.if((0, codegen_1$7._)`${R} >= ${o}`, () => t.assign(g, !0).break()) : (t.if((0, codegen_1$7._)`${R} > ${l}`, () => t.assign(g, !1).break()), o === 1 ? t.assign(g, !0) : t.if((0, codegen_1$7._)`${R} >= ${o}`, () => t.assign(g, !0)));
6894
6694
  }
6895
6695
  }
6896
6696
  };
@@ -6900,14 +6700,14 @@ var dependencies = {};
6900
6700
  Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
6901
6701
  const t = codegen, r = util, n = code;
6902
6702
  e.error = {
6903
- message: ({ params: { property: d, depsCount: u, deps: p } }) => {
6703
+ message: ({ params: { property: d, depsCount: u, deps: f } }) => {
6904
6704
  const g = u === 1 ? "property" : "properties";
6905
- return (0, t.str)`must have ${g} ${p} when property ${d} is present`;
6705
+ return (0, t.str)`must have ${g} ${f} when property ${d} is present`;
6906
6706
  },
6907
- params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: g } }) => (0, t._)`{property: ${d},
6707
+ params: ({ params: { property: d, depsCount: u, deps: f, missingProperty: g } }) => (0, t._)`{property: ${d},
6908
6708
  missingProperty: ${g},
6909
6709
  depsCount: ${u},
6910
- deps: ${p}}`
6710
+ deps: ${f}}`
6911
6711
  // TODO change to reference
6912
6712
  };
6913
6713
  const s = {
@@ -6916,51 +6716,51 @@ var dependencies = {};
6916
6716
  schemaType: "object",
6917
6717
  error: e.error,
6918
6718
  code(d) {
6919
- const [u, p] = i(d);
6920
- o(d, u), l(d, p);
6719
+ const [u, f] = i(d);
6720
+ o(d, u), l(d, f);
6921
6721
  }
6922
6722
  };
6923
6723
  function i({ schema: d }) {
6924
- const u = {}, p = {};
6724
+ const u = {}, f = {};
6925
6725
  for (const g in d) {
6926
6726
  if (g === "__proto__")
6927
6727
  continue;
6928
- const O = Array.isArray(d[g]) ? u : p;
6728
+ const O = Array.isArray(d[g]) ? u : f;
6929
6729
  O[g] = d[g];
6930
6730
  }
6931
- return [u, p];
6731
+ return [u, f];
6932
6732
  }
6933
6733
  function o(d, u = d.schema) {
6934
- const { gen: p, data: g, it: O } = d;
6734
+ const { gen: f, data: g, it: O } = d;
6935
6735
  if (Object.keys(u).length === 0)
6936
6736
  return;
6937
- const C = p.let("missing");
6737
+ const C = f.let("missing");
6938
6738
  for (const S in u) {
6939
- const T = u[S];
6940
- if (T.length === 0)
6739
+ const R = u[S];
6740
+ if (R.length === 0)
6941
6741
  continue;
6942
- const y = (0, n.propertyInData)(p, g, S, O.opts.ownProperties);
6742
+ const y = (0, n.propertyInData)(f, g, S, O.opts.ownProperties);
6943
6743
  d.setParams({
6944
6744
  property: S,
6945
- depsCount: T.length,
6946
- deps: T.join(", ")
6947
- }), O.allErrors ? p.if(y, () => {
6948
- for (const _ of T)
6745
+ depsCount: R.length,
6746
+ deps: R.join(", ")
6747
+ }), O.allErrors ? f.if(y, () => {
6748
+ for (const _ of R)
6949
6749
  (0, n.checkReportMissingProp)(d, _);
6950
- }) : (p.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, T, C)})`), (0, n.reportMissingProp)(d, C), p.else());
6750
+ }) : (f.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, R, C)})`), (0, n.reportMissingProp)(d, C), f.else());
6951
6751
  }
6952
6752
  }
6953
6753
  e.validatePropertyDeps = o;
6954
6754
  function l(d, u = d.schema) {
6955
- const { gen: p, data: g, keyword: O, it: C } = d, S = p.name("valid");
6956
- for (const T in u)
6957
- (0, r.alwaysValidSchema)(C, u[T]) || (p.if(
6958
- (0, n.propertyInData)(p, g, T, C.opts.ownProperties),
6755
+ const { gen: f, data: g, keyword: O, it: C } = d, S = f.name("valid");
6756
+ for (const R in u)
6757
+ (0, r.alwaysValidSchema)(C, u[R]) || (f.if(
6758
+ (0, n.propertyInData)(f, g, R, C.opts.ownProperties),
6959
6759
  () => {
6960
- const y = d.subschema({ keyword: O, schemaProp: T }, S);
6760
+ const y = d.subschema({ keyword: O, schemaProp: R }, S);
6961
6761
  d.mergeValidEvaluated(y, S);
6962
6762
  },
6963
- () => p.var(S, !0)
6763
+ () => f.var(S, !0)
6964
6764
  // TODO var
6965
6765
  ), d.ok(S));
6966
6766
  }
@@ -7014,11 +6814,11 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
7014
6814
  const { allErrors: l, opts: d } = o;
7015
6815
  if (o.props = !0, d.removeAdditional !== "all" && (0, util_1$8.alwaysValidSchema)(o, r))
7016
6816
  return;
7017
- const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
6817
+ const u = (0, code_1$3.allSchemaProperties)(n.properties), f = (0, code_1$3.allSchemaProperties)(n.patternProperties);
7018
6818
  g(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
7019
6819
  function g() {
7020
6820
  t.forIn("key", s, (y) => {
7021
- !u.length && !p.length ? S(y) : t.if(O(y), () => S(y));
6821
+ !u.length && !f.length ? S(y) : t.if(O(y), () => S(y));
7022
6822
  });
7023
6823
  }
7024
6824
  function O(y) {
@@ -7028,7 +6828,7 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
7028
6828
  _ = (0, code_1$3.isOwnProperty)(t, $, y);
7029
6829
  } else
7030
6830
  u.length ? _ = (0, codegen_1$5.or)(...u.map(($) => (0, codegen_1$5._)`${y} === ${$}`)) : _ = codegen_1$5.nil;
7031
- return p.length && (_ = (0, codegen_1$5.or)(_, ...p.map(($) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, $)}.test(${y})`))), (0, codegen_1$5.not)(_);
6831
+ return f.length && (_ = (0, codegen_1$5.or)(_, ...f.map(($) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, $)}.test(${y})`))), (0, codegen_1$5.not)(_);
7032
6832
  }
7033
6833
  function C(y) {
7034
6834
  t.code((0, codegen_1$5._)`delete ${s}[${y}]`);
@@ -7044,22 +6844,22 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
7044
6844
  }
7045
6845
  if (typeof r == "object" && !(0, util_1$8.alwaysValidSchema)(o, r)) {
7046
6846
  const _ = t.name("valid");
7047
- d.removeAdditional === "failing" ? (T(y, _, !1), t.if((0, codegen_1$5.not)(_), () => {
6847
+ d.removeAdditional === "failing" ? (R(y, _, !1), t.if((0, codegen_1$5.not)(_), () => {
7048
6848
  e.reset(), C(y);
7049
- })) : (T(y, _), l || t.if((0, codegen_1$5.not)(_), () => t.break()));
6849
+ })) : (R(y, _), l || t.if((0, codegen_1$5.not)(_), () => t.break()));
7050
6850
  }
7051
6851
  }
7052
- function T(y, _, $) {
7053
- const P = {
6852
+ function R(y, _, $) {
6853
+ const b = {
7054
6854
  keyword: "additionalProperties",
7055
6855
  dataProp: y,
7056
6856
  dataPropType: util_1$8.Type.Str
7057
6857
  };
7058
- $ === !1 && Object.assign(P, {
6858
+ $ === !1 && Object.assign(b, {
7059
6859
  compositeRule: !0,
7060
6860
  createErrors: !1,
7061
6861
  allErrors: !1
7062
- }), e.subschema(P, _);
6862
+ }), e.subschema(b, _);
7063
6863
  }
7064
6864
  }
7065
6865
  };
@@ -7082,11 +6882,11 @@ const validate_1 = validate, code_1$2 = code, util_1$7 = util, additionalPropert
7082
6882
  return;
7083
6883
  const d = t.name("valid");
7084
6884
  for (const g of l)
7085
- u(g) ? p(g) : (t.if((0, code_1$2.propertyInData)(t, s, g, i.opts.ownProperties)), p(g), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(g), e.ok(d);
6885
+ u(g) ? f(g) : (t.if((0, code_1$2.propertyInData)(t, s, g, i.opts.ownProperties)), f(g), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(g), e.ok(d);
7086
6886
  function u(g) {
7087
6887
  return i.opts.useDefaults && !i.compositeRule && r[g].default !== void 0;
7088
6888
  }
7089
- function p(g) {
6889
+ function f(g) {
7090
6890
  e.subschema({
7091
6891
  keyword: "properties",
7092
6892
  schemaProp: g,
@@ -7103,31 +6903,31 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
7103
6903
  type: "object",
7104
6904
  schemaType: "object",
7105
6905
  code(e) {
7106
- const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((T) => (0, util_1$6.alwaysValidSchema)(i, r[T]));
6906
+ const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((R) => (0, util_1$6.alwaysValidSchema)(i, r[R]));
7107
6907
  if (l.length === 0 || d.length === l.length && (!i.opts.unevaluated || i.props === !0))
7108
6908
  return;
7109
- const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
6909
+ const u = o.strictSchema && !o.allowMatchingProperties && s.properties, f = t.name("valid");
7110
6910
  i.props !== !0 && !(i.props instanceof codegen_1$4.Name) && (i.props = (0, util_2.evaluatedPropsToName)(t, i.props));
7111
6911
  const { props: g } = i;
7112
6912
  O();
7113
6913
  function O() {
7114
- for (const T of l)
7115
- u && C(T), i.allErrors ? S(T) : (t.var(p, !0), S(T), t.if(p));
6914
+ for (const R of l)
6915
+ u && C(R), i.allErrors ? S(R) : (t.var(f, !0), S(R), t.if(f));
7116
6916
  }
7117
- function C(T) {
6917
+ function C(R) {
7118
6918
  for (const y in u)
7119
- new RegExp(T).test(y) && (0, util_1$6.checkStrictMode)(i, `property ${y} matches pattern ${T} (use allowMatchingProperties)`);
6919
+ new RegExp(R).test(y) && (0, util_1$6.checkStrictMode)(i, `property ${y} matches pattern ${R} (use allowMatchingProperties)`);
7120
6920
  }
7121
- function S(T) {
6921
+ function S(R) {
7122
6922
  t.forIn("key", n, (y) => {
7123
- t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, T)}.test(${y})`, () => {
7124
- const _ = d.includes(T);
6923
+ t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, R)}.test(${y})`, () => {
6924
+ const _ = d.includes(R);
7125
6925
  _ || e.subschema({
7126
6926
  keyword: "patternProperties",
7127
- schemaProp: T,
6927
+ schemaProp: R,
7128
6928
  dataProp: y,
7129
6929
  dataPropType: util_2.Type.Str
7130
- }, p), i.opts.unevaluated && g !== !0 ? t.assign((0, codegen_1$4._)`${g}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
6930
+ }, f), i.opts.unevaluated && g !== !0 ? t.assign((0, codegen_1$4._)`${g}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(f), () => t.break());
7131
6931
  });
7132
6932
  });
7133
6933
  }
@@ -7186,9 +6986,9 @@ const codegen_1$3 = codegen, util_1$4 = util, error$3 = {
7186
6986
  const i = r, o = t.let("valid", !1), l = t.let("passing", null), d = t.name("_valid");
7187
6987
  e.setParams({ passing: l }), t.block(u), e.result(o, () => e.reset(), () => e.error(!0));
7188
6988
  function u() {
7189
- i.forEach((p, g) => {
6989
+ i.forEach((f, g) => {
7190
6990
  let O;
7191
- (0, util_1$4.alwaysValidSchema)(s, p) ? t.var(d, !0) : O = e.subschema({
6991
+ (0, util_1$4.alwaysValidSchema)(s, f) ? t.var(d, !0) : O = e.subschema({
7192
6992
  keyword: "oneOf",
7193
6993
  schemaProp: g,
7194
6994
  compositeRule: !0
@@ -7237,24 +7037,24 @@ const codegen_1$2 = codegen, util_1$2 = util, error$2 = {
7237
7037
  return;
7238
7038
  const o = t.let("valid", !0), l = t.name("_valid");
7239
7039
  if (d(), e.reset(), s && i) {
7240
- const p = t.let("ifClause");
7241
- e.setParams({ ifClause: p }), t.if(l, u("then", p), u("else", p));
7040
+ const f = t.let("ifClause");
7041
+ e.setParams({ ifClause: f }), t.if(l, u("then", f), u("else", f));
7242
7042
  } else
7243
7043
  s ? t.if(l, u("then")) : t.if((0, codegen_1$2.not)(l), u("else"));
7244
7044
  e.pass(o, () => e.error(!0));
7245
7045
  function d() {
7246
- const p = e.subschema({
7046
+ const f = e.subschema({
7247
7047
  keyword: "if",
7248
7048
  compositeRule: !0,
7249
7049
  createErrors: !1,
7250
7050
  allErrors: !1
7251
7051
  }, l);
7252
- e.mergeEvaluated(p);
7052
+ e.mergeEvaluated(f);
7253
7053
  }
7254
- function u(p, g) {
7054
+ function u(f, g) {
7255
7055
  return () => {
7256
- const O = e.subschema({ keyword: p }, l);
7257
- t.assign(o, l), e.mergeValidEvaluated(O, o), g ? t.assign(g, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
7056
+ const O = e.subschema({ keyword: f }, l);
7057
+ t.assign(o, l), e.mergeValidEvaluated(O, o), g ? t.assign(g, (0, codegen_1$2._)`${f}`) : e.setParams({ ifClause: f });
7258
7058
  };
7259
7059
  }
7260
7060
  }
@@ -7307,7 +7107,7 @@ const codegen_1$1 = codegen, error$1 = {
7307
7107
  $data: !0,
7308
7108
  error: error$1,
7309
7109
  code(e, t) {
7310
- const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: g } = l;
7110
+ const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: f, self: g } = l;
7311
7111
  if (!d.validateFormats)
7312
7112
  return;
7313
7113
  s ? O() : C();
@@ -7315,14 +7115,14 @@ const codegen_1$1 = codegen, error$1 = {
7315
7115
  const S = r.scopeValue("formats", {
7316
7116
  ref: g.formats,
7317
7117
  code: d.code.formats
7318
- }), T = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), y = r.let("fType"), _ = r.let("format");
7319
- r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)($(), P()));
7118
+ }), R = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), y = r.let("fType"), _ = r.let("format");
7119
+ r.if((0, codegen_1$1._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${R}.type || "string"`).assign(_, (0, codegen_1$1._)`${R}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, R)), e.fail$data((0, codegen_1$1.or)($(), b()));
7320
7120
  function $() {
7321
7121
  return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${_}`;
7322
7122
  }
7323
- function P() {
7324
- const I = p.$async ? (0, codegen_1$1._)`(${T}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7325
- return (0, codegen_1$1._)`${_} && ${_} !== true && ${y} === ${t} && !${D}`;
7123
+ function b() {
7124
+ const I = f.$async ? (0, codegen_1$1._)`(${R}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, A = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7125
+ return (0, codegen_1$1._)`${_} && ${_} !== true && ${y} === ${t} && !${A}`;
7326
7126
  }
7327
7127
  }
7328
7128
  function C() {
@@ -7333,25 +7133,25 @@ const codegen_1$1 = codegen, error$1 = {
7333
7133
  }
7334
7134
  if (S === !0)
7335
7135
  return;
7336
- const [T, y, _] = P(S);
7337
- T === t && e.pass(I());
7136
+ const [R, y, _] = b(S);
7137
+ R === t && e.pass(I());
7338
7138
  function $() {
7339
7139
  if (d.strictSchema === !1) {
7340
- g.logger.warn(D());
7140
+ g.logger.warn(A());
7341
7141
  return;
7342
7142
  }
7343
- throw new Error(D());
7344
- function D() {
7143
+ throw new Error(A());
7144
+ function A() {
7345
7145
  return `unknown format "${i}" ignored in schema at path "${u}"`;
7346
7146
  }
7347
7147
  }
7348
- function P(D) {
7349
- 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, k = r.scopeValue("formats", { key: i, ref: D, code: w });
7350
- return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", D, k];
7148
+ function b(A) {
7149
+ const w = A instanceof RegExp ? (0, codegen_1$1.regexpCode)(A) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, k = r.scopeValue("formats", { key: i, ref: A, code: w });
7150
+ return typeof A == "object" && !(A instanceof RegExp) ? [A.type || "string", A.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", A, k];
7351
7151
  }
7352
7152
  function I() {
7353
7153
  if (typeof S == "object" && !(S instanceof RegExp) && S.async) {
7354
- if (!p.$async)
7154
+ if (!f.$async)
7355
7155
  throw new Error("async format in sync schema");
7356
7156
  return (0, codegen_1$1._)`await ${_}(${n})`;
7357
7157
  }
@@ -7418,8 +7218,8 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7418
7218
  if (!o)
7419
7219
  throw new Error("discriminator: requires oneOf keyword");
7420
7220
  const d = t.let("valid", !1), u = t.const("tag", (0, codegen_1._)`${r}${(0, codegen_1.getProperty)(l)}`);
7421
- t.if((0, codegen_1._)`typeof ${u} == "string"`, () => p(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: l })), e.ok(d);
7422
- function p() {
7221
+ t.if((0, codegen_1._)`typeof ${u} == "string"`, () => f(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: l })), e.ok(d);
7222
+ function f() {
7423
7223
  const C = O();
7424
7224
  t.if(!1);
7425
7225
  for (const S in C)
@@ -7427,20 +7227,20 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7427
7227
  t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
7428
7228
  }
7429
7229
  function g(C) {
7430
- const S = t.name("valid"), T = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
7431
- return e.mergeEvaluated(T, codegen_1.Name), S;
7230
+ const S = t.name("valid"), R = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
7231
+ return e.mergeEvaluated(R, codegen_1.Name), S;
7432
7232
  }
7433
7233
  function O() {
7434
7234
  var C;
7435
- const S = {}, T = _(s);
7235
+ const S = {}, R = _(s);
7436
7236
  let y = !0;
7437
7237
  for (let I = 0; I < o.length; I++) {
7438
- let D = o[I];
7439
- 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));
7440
- const w = (C = D == null ? void 0 : D.properties) === null || C === void 0 ? void 0 : C[l];
7238
+ let A = o[I];
7239
+ A != null && A.$ref && !(0, util_1.schemaHasRulesButRef)(A, i.self.RULES) && (A = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, A == null ? void 0 : A.$ref), A instanceof compile_1.SchemaEnv && (A = A.schema));
7240
+ const w = (C = A == null ? void 0 : A.properties) === null || C === void 0 ? void 0 : C[l];
7441
7241
  if (typeof w != "object")
7442
7242
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
7443
- y = y && (T || _(D)), $(w, I);
7243
+ y = y && (R || _(A)), $(w, I);
7444
7244
  }
7445
7245
  if (!y)
7446
7246
  throw new Error(`discriminator: "${l}" must be required`);
@@ -7448,19 +7248,19 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7448
7248
  function _({ required: I }) {
7449
7249
  return Array.isArray(I) && I.includes(l);
7450
7250
  }
7451
- function $(I, D) {
7251
+ function $(I, A) {
7452
7252
  if (I.const)
7453
- P(I.const, D);
7253
+ b(I.const, A);
7454
7254
  else if (I.enum)
7455
7255
  for (const w of I.enum)
7456
- P(w, D);
7256
+ b(w, A);
7457
7257
  else
7458
7258
  throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);
7459
7259
  }
7460
- function P(I, D) {
7260
+ function b(I, A) {
7461
7261
  if (typeof I != "string" || I in S)
7462
7262
  throw new Error(`discriminator: "${l}" values must be unique strings`);
7463
- S[I] = D;
7263
+ S[I] = A;
7464
7264
  }
7465
7265
  }
7466
7266
  }
@@ -7729,19 +7529,19 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
7729
7529
  Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
7730
7530
  return u.KeywordCxt;
7731
7531
  } });
7732
- var p = codegen;
7532
+ var f = codegen;
7733
7533
  Object.defineProperty(t, "_", { enumerable: !0, get: function() {
7734
- return p._;
7534
+ return f._;
7735
7535
  } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
7736
- return p.str;
7536
+ return f.str;
7737
7537
  } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
7738
- return p.stringify;
7538
+ return f.stringify;
7739
7539
  } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
7740
- return p.nil;
7540
+ return f.nil;
7741
7541
  } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
7742
- return p.Name;
7542
+ return f.Name;
7743
7543
  } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
7744
- return p.CodeGen;
7544
+ return f.CodeGen;
7745
7545
  } });
7746
7546
  var g = validation_error;
7747
7547
  Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
@@ -9351,13 +9151,13 @@ function compileBlueprint(e, {
9351
9151
  onStepCompleted: n = () => {
9352
9152
  }
9353
9153
  } = {}) {
9354
- var g, O, C, S, T, y, _;
9154
+ var g, O, C, S, R, y, _;
9355
9155
  e = {
9356
9156
  ...e,
9357
9157
  steps: (e.steps || []).filter(isStepDefinition).filter(isStepStillSupported)
9358
9158
  };
9359
9159
  for (const $ of e.steps)
9360
- typeof $ == "object" && $.step === "importFile" && ($.step = "importWxr", console.warn(
9160
+ typeof $ == "object" && $.step === "importFile" && ($.step = "importWxr", logger.warn(
9361
9161
  'The "importFile" step is deprecated. Use "importWxr" instead.'
9362
9162
  ));
9363
9163
  if (e.constants && e.steps.unshift({
@@ -9367,15 +9167,15 @@ function compileBlueprint(e, {
9367
9167
  step: "setSiteOptions",
9368
9168
  options: e.siteOptions
9369
9169
  }), e.plugins) {
9370
- const $ = e.plugins.map((P) => typeof P == "string" ? P.startsWith("https://") ? {
9170
+ const $ = e.plugins.map((b) => typeof b == "string" ? b.startsWith("https://") ? {
9371
9171
  resource: "url",
9372
- url: P
9172
+ url: b
9373
9173
  } : {
9374
9174
  resource: "wordpress.org/plugins",
9375
- slug: P
9376
- } : P).map((P) => ({
9175
+ slug: b
9176
+ } : b).map((b) => ({
9377
9177
  step: "installPlugin",
9378
- pluginZipFile: P
9178
+ pluginZipFile: b
9379
9179
  }));
9380
9180
  e.steps.unshift(...$);
9381
9181
  }
@@ -9388,7 +9188,7 @@ function compileBlueprint(e, {
9388
9188
  );
9389
9189
  s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9390
9190
  ($) => $ !== "light"
9391
- ), console.warn(
9191
+ ), logger.warn(
9392
9192
  "The wpCli 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. "
9393
9193
  )), (O = e.steps) == null || O.splice(s, 0, {
9394
9194
  step: "writeFile",
@@ -9413,7 +9213,7 @@ function compileBlueprint(e, {
9413
9213
  );
9414
9214
  i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9415
9215
  ($) => $ !== "light"
9416
- ), console.warn(
9216
+ ), logger.warn(
9417
9217
  "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. "
9418
9218
  )), (S = e.steps) == null || S.splice(i, 0, {
9419
9219
  step: "installPlugin",
@@ -9431,12 +9231,12 @@ function compileBlueprint(e, {
9431
9231
  throw $.errors = l, $;
9432
9232
  }
9433
9233
  const d = e.steps || [], u = d.reduce(
9434
- ($, P) => {
9234
+ ($, b) => {
9435
9235
  var I;
9436
- return $ + (((I = P.progress) == null ? void 0 : I.weight) || 1);
9236
+ return $ + (((I = b.progress) == null ? void 0 : I.weight) || 1);
9437
9237
  },
9438
9238
  0
9439
- ), p = d.map(
9239
+ ), f = d.map(
9440
9240
  ($) => compileStep($, {
9441
9241
  semaphore: r,
9442
9242
  rootProgressTracker: t,
@@ -9446,7 +9246,7 @@ function compileBlueprint(e, {
9446
9246
  return {
9447
9247
  versions: {
9448
9248
  php: compileVersion(
9449
- (T = e.preferredVersions) == null ? void 0 : T.php,
9249
+ (R = e.preferredVersions) == null ? void 0 : R.php,
9450
9250
  SupportedPHPVersions,
9451
9251
  LatestSupportedPHPVersion
9452
9252
  ),
@@ -9462,17 +9262,17 @@ function compileBlueprint(e, {
9462
9262
  },
9463
9263
  run: async ($) => {
9464
9264
  try {
9465
- for (const { resources: P } of p)
9466
- for (const I of P)
9265
+ for (const { resources: b } of f)
9266
+ for (const I of b)
9467
9267
  I.setPlayground($), I.isAsync && I.resolve();
9468
- for (const [P, { run: I, step: D }] of Object.entries(p))
9268
+ for (const [b, { run: I, step: A }] of Object.entries(f))
9469
9269
  try {
9470
9270
  const w = await I($);
9471
- n(w, D);
9271
+ n(w, A);
9472
9272
  } catch (w) {
9473
- throw console.error(w), new Error(
9474
- `Error when executing the blueprint step #${P} (${JSON.stringify(
9475
- D
9273
+ throw logger.error(w), new Error(
9274
+ `Error when executing the blueprint step #${b} (${JSON.stringify(
9275
+ A
9476
9276
  )}) ${w instanceof Error ? `: ${w.message}` : w}`,
9477
9277
  { cause: w }
9478
9278
  );
@@ -9523,7 +9323,7 @@ function isStepDefinition(e) {
9523
9323
  return !!(typeof e == "object" && e);
9524
9324
  }
9525
9325
  function isStepStillSupported(e) {
9526
- return e.step === "setPhpIniEntry" ? (console.warn(
9326
+ return e.step === "setPhpIniEntry" ? (logger.warn(
9527
9327
  'The "setPhpIniEntry" Blueprint is no longer supported and you can remove it from your Blueprint.'
9528
9328
  ), !1) : !0;
9529
9329
  }
@@ -9532,9 +9332,9 @@ function compileStep(e, {
9532
9332
  rootProgressTracker: r,
9533
9333
  totalProgressWeight: n
9534
9334
  }) {
9535
- var p;
9335
+ var f;
9536
9336
  const s = r.stage(
9537
- (((p = e.progress) == null ? void 0 : p.weight) || 1) / n
9337
+ (((f = e.progress) == null ? void 0 : f.weight) || 1) / n
9538
9338
  ), i = {};
9539
9339
  for (const g of Object.keys(e)) {
9540
9340
  let O = e[g];