import Q, { chmod as tu, rm as ru, existsSync as fn, mkdirSync as Qs } from "node:fs";
import Wr, { app as ce, session as nu, BrowserWindow as qs, Menu as su, MenuItem as ze, shell as wc, ipcMain as ne, dialog as Dt } from "electron";
import oe from "path";
import Xr from "fs";
import iu from "constants";
import Se from "stream";
import ks from "util";
import au from "assert";
import ae from "node:process";
import ie from "node:path";
import { promisify as he, isDeepStrictEqual as ou } from "node:util";
import ft from "node:crypto";
import cu from "node:assert";
import $c from "node:os";
import "node:events";
import "node:stream";
import { fileURLToPath as uu } from "node:url";
import lu from "child_process";
import Ls from "tty";
import Ec from "net";
import { writeFile as fu, appendFile as du, readFile as hu, readdir as pu } from "node:fs/promises";
import mu from "dgram";
import yu from "os";
import { createRequire as gu } from "module";
import { spawn as vu } from "node:child_process";
var dn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Yr(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function _u(e) {
  if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
  var t = e.default;
  if (typeof t == "function") {
    var n = function r() {
      var o = !1;
      try {
        o = this instanceof r;
      } catch {
      }
      return o ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
    };
    n.prototype = t.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
    var o = Object.getOwnPropertyDescriptor(e, r);
    Object.defineProperty(n, r, o.get ? o : {
      enumerable: !0,
      get: function() {
        return e[r];
      }
    });
  }), n;
}
var hn, ei;
function wu() {
  if (ei) return hn;
  ei = 1;
  var e = iu, t = process.cwd, n = null, r = process.env.GRACEFUL_FS_PLATFORM || process.platform;
  process.cwd = function() {
    return n || (n = t.call(process)), n;
  };
  try {
    process.cwd();
  } catch {
  }
  if (typeof process.chdir == "function") {
    var o = process.chdir;
    process.chdir = function(s) {
      n = null, o.call(process, s);
    }, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, o);
  }
  hn = a;
  function a(s) {
    e.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && u(s), s.lutimes || l(s), s.chown = f(s.chown), s.fchown = f(s.fchown), s.lchown = f(s.lchown), s.chmod = c(s.chmod), s.fchmod = c(s.fchmod), s.lchmod = c(s.lchmod), s.chownSync = d(s.chownSync), s.fchownSync = d(s.fchownSync), s.lchownSync = d(s.lchownSync), s.chmodSync = i(s.chmodSync), s.fchmodSync = i(s.fchmodSync), s.lchmodSync = i(s.lchmodSync), s.stat = p(s.stat), s.fstat = p(s.fstat), s.lstat = p(s.lstat), s.statSync = v(s.statSync), s.fstatSync = v(s.fstatSync), s.lstatSync = v(s.lstatSync), s.chmod && !s.lchmod && (s.lchmod = function(h, y, m) {
      m && process.nextTick(m);
    }, s.lchmodSync = function() {
    }), s.chown && !s.lchown && (s.lchown = function(h, y, m, g) {
      g && process.nextTick(g);
    }, s.lchownSync = function() {
    }), r === "win32" && (s.rename = typeof s.rename != "function" ? s.rename : (function(h) {
      function y(m, g, $) {
        var _ = Date.now(), E = 0;
        h(m, g, function R(O) {
          if (O && (O.code === "EACCES" || O.code === "EPERM" || O.code === "EBUSY") && Date.now() - _ < 6e4) {
            setTimeout(function() {
              s.stat(g, function(M, L) {
                M && M.code === "ENOENT" ? h(m, g, R) : $(O);
              });
            }, E), E < 100 && (E += 10);
            return;
          }
          $ && $(O);
        });
      }
      return Object.setPrototypeOf && Object.setPrototypeOf(y, h), y;
    })(s.rename)), s.read = typeof s.read != "function" ? s.read : (function(h) {
      function y(m, g, $, _, E, R) {
        var O;
        if (R && typeof R == "function") {
          var M = 0;
          O = function(L, k, z) {
            if (L && L.code === "EAGAIN" && M < 10)
              return M++, h.call(s, m, g, $, _, E, O);
            R.apply(this, arguments);
          };
        }
        return h.call(s, m, g, $, _, E, O);
      }
      return Object.setPrototypeOf && Object.setPrototypeOf(y, h), y;
    })(s.read), s.readSync = typeof s.readSync != "function" ? s.readSync : /* @__PURE__ */ (function(h) {
      return function(y, m, g, $, _) {
        for (var E = 0; ; )
          try {
            return h.call(s, y, m, g, $, _);
          } catch (R) {
            if (R.code === "EAGAIN" && E < 10) {
              E++;
              continue;
            }
            throw R;
          }
      };
    })(s.readSync);
    function u(h) {
      h.lchmod = function(y, m, g) {
        h.open(
          y,
          e.O_WRONLY | e.O_SYMLINK,
          m,
          function($, _) {
            if ($) {
              g && g($);
              return;
            }
            h.fchmod(_, m, function(E) {
              h.close(_, function(R) {
                g && g(E || R);
              });
            });
          }
        );
      }, h.lchmodSync = function(y, m) {
        var g = h.openSync(y, e.O_WRONLY | e.O_SYMLINK, m), $ = !0, _;
        try {
          _ = h.fchmodSync(g, m), $ = !1;
        } finally {
          if ($)
            try {
              h.closeSync(g);
            } catch {
            }
          else
            h.closeSync(g);
        }
        return _;
      };
    }
    function l(h) {
      e.hasOwnProperty("O_SYMLINK") && h.futimes ? (h.lutimes = function(y, m, g, $) {
        h.open(y, e.O_SYMLINK, function(_, E) {
          if (_) {
            $ && $(_);
            return;
          }
          h.futimes(E, m, g, function(R) {
            h.close(E, function(O) {
              $ && $(R || O);
            });
          });
        });
      }, h.lutimesSync = function(y, m, g) {
        var $ = h.openSync(y, e.O_SYMLINK), _, E = !0;
        try {
          _ = h.futimesSync($, m, g), E = !1;
        } finally {
          if (E)
            try {
              h.closeSync($);
            } catch {
            }
          else
            h.closeSync($);
        }
        return _;
      }) : h.futimes && (h.lutimes = function(y, m, g, $) {
        $ && process.nextTick($);
      }, h.lutimesSync = function() {
      });
    }
    function c(h) {
      return h && function(y, m, g) {
        return h.call(s, y, m, function($) {
          w($) && ($ = null), g && g.apply(this, arguments);
        });
      };
    }
    function i(h) {
      return h && function(y, m) {
        try {
          return h.call(s, y, m);
        } catch (g) {
          if (!w(g)) throw g;
        }
      };
    }
    function f(h) {
      return h && function(y, m, g, $) {
        return h.call(s, y, m, g, function(_) {
          w(_) && (_ = null), $ && $.apply(this, arguments);
        });
      };
    }
    function d(h) {
      return h && function(y, m, g) {
        try {
          return h.call(s, y, m, g);
        } catch ($) {
          if (!w($)) throw $;
        }
      };
    }
    function p(h) {
      return h && function(y, m, g) {
        typeof m == "function" && (g = m, m = null);
        function $(_, E) {
          E && (E.uid < 0 && (E.uid += 4294967296), E.gid < 0 && (E.gid += 4294967296)), g && g.apply(this, arguments);
        }
        return m ? h.call(s, y, m, $) : h.call(s, y, $);
      };
    }
    function v(h) {
      return h && function(y, m) {
        var g = m ? h.call(s, y, m) : h.call(s, y);
        return g && (g.uid < 0 && (g.uid += 4294967296), g.gid < 0 && (g.gid += 4294967296)), g;
      };
    }
    function w(h) {
      if (!h || h.code === "ENOSYS")
        return !0;
      var y = !process.getuid || process.getuid() !== 0;
      return !!(y && (h.code === "EINVAL" || h.code === "EPERM"));
    }
  }
  return hn;
}
var pn, ti;
function $u() {
  if (ti) return pn;
  ti = 1;
  var e = Se.Stream;
  pn = t;
  function t(n) {
    return {
      ReadStream: r,
      WriteStream: o
    };
    function r(a, s) {
      if (!(this instanceof r)) return new r(a, s);
      e.call(this);
      var u = this;
      this.path = a, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, s = s || {};
      for (var l = Object.keys(s), c = 0, i = l.length; c < i; c++) {
        var f = l[c];
        this[f] = s[f];
      }
      if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
        if (typeof this.start != "number")
          throw TypeError("start must be a Number");
        if (this.end === void 0)
          this.end = 1 / 0;
        else if (typeof this.end != "number")
          throw TypeError("end must be a Number");
        if (this.start > this.end)
          throw new Error("start must be <= end");
        this.pos = this.start;
      }
      if (this.fd !== null) {
        process.nextTick(function() {
          u._read();
        });
        return;
      }
      n.open(this.path, this.flags, this.mode, function(d, p) {
        if (d) {
          u.emit("error", d), u.readable = !1;
          return;
        }
        u.fd = p, u.emit("open", p), u._read();
      });
    }
    function o(a, s) {
      if (!(this instanceof o)) return new o(a, s);
      e.call(this), this.path = a, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, s = s || {};
      for (var u = Object.keys(s), l = 0, c = u.length; l < c; l++) {
        var i = u[l];
        this[i] = s[i];
      }
      if (this.start !== void 0) {
        if (typeof this.start != "number")
          throw TypeError("start must be a Number");
        if (this.start < 0)
          throw new Error("start must be >= zero");
        this.pos = this.start;
      }
      this.busy = !1, this._queue = [], this.fd === null && (this._open = n.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
    }
  }
  return pn;
}
var mn, ri;
function Eu() {
  if (ri) return mn;
  ri = 1, mn = t;
  var e = Object.getPrototypeOf || function(n) {
    return n.__proto__;
  };
  function t(n) {
    if (n === null || typeof n != "object")
      return n;
    if (n instanceof Object)
      var r = { __proto__: e(n) };
    else
      var r = /* @__PURE__ */ Object.create(null);
    return Object.getOwnPropertyNames(n).forEach(function(o) {
      Object.defineProperty(r, o, Object.getOwnPropertyDescriptor(n, o));
    }), r;
  }
  return mn;
}
var qt, ni;
function bu() {
  if (ni) return qt;
  ni = 1;
  var e = Xr, t = wu(), n = $u(), r = Eu(), o = ks, a, s;
  typeof Symbol == "function" && typeof Symbol.for == "function" ? (a = Symbol.for("graceful-fs.queue"), s = Symbol.for("graceful-fs.previous")) : (a = "___graceful-fs.queue", s = "___graceful-fs.previous");
  function u() {
  }
  function l(h, y) {
    Object.defineProperty(h, a, {
      get: function() {
        return y;
      }
    });
  }
  var c = u;
  if (o.debuglog ? c = o.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (c = function() {
    var h = o.format.apply(o, arguments);
    h = "GFS4: " + h.split(/\n/).join(`
GFS4: `), console.error(h);
  }), !e[a]) {
    var i = dn[a] || [];
    l(e, i), e.close = (function(h) {
      function y(m, g) {
        return h.call(e, m, function($) {
          $ || v(), typeof g == "function" && g.apply(this, arguments);
        });
      }
      return Object.defineProperty(y, s, {
        value: h
      }), y;
    })(e.close), e.closeSync = (function(h) {
      function y(m) {
        h.apply(e, arguments), v();
      }
      return Object.defineProperty(y, s, {
        value: h
      }), y;
    })(e.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
      c(e[a]), au.equal(e[a].length, 0);
    });
  }
  dn[a] || l(dn, e[a]), qt = f(r(e)), process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !e.__patched && (qt = f(e), e.__patched = !0);
  function f(h) {
    t(h), h.gracefulify = f, h.createReadStream = N, h.createWriteStream = j;
    var y = h.readFile;
    h.readFile = m;
    function m(S, C, V) {
      return typeof C == "function" && (V = C, C = null), W(S, C, V);
      function W(J, Y, P, T) {
        return y(J, Y, function(q) {
          q && (q.code === "EMFILE" || q.code === "ENFILE") ? d([W, [J, Y, P], q, T || Date.now(), Date.now()]) : typeof P == "function" && P.apply(this, arguments);
        });
      }
    }
    var g = h.writeFile;
    h.writeFile = $;
    function $(S, C, V, W) {
      return typeof V == "function" && (W = V, V = null), J(S, C, V, W);
      function J(Y, P, T, q, B) {
        return g(Y, P, T, function(U) {
          U && (U.code === "EMFILE" || U.code === "ENFILE") ? d([J, [Y, P, T, q], U, B || Date.now(), Date.now()]) : typeof q == "function" && q.apply(this, arguments);
        });
      }
    }
    var _ = h.appendFile;
    _ && (h.appendFile = E);
    function E(S, C, V, W) {
      return typeof V == "function" && (W = V, V = null), J(S, C, V, W);
      function J(Y, P, T, q, B) {
        return _(Y, P, T, function(U) {
          U && (U.code === "EMFILE" || U.code === "ENFILE") ? d([J, [Y, P, T, q], U, B || Date.now(), Date.now()]) : typeof q == "function" && q.apply(this, arguments);
        });
      }
    }
    var R = h.copyFile;
    R && (h.copyFile = O);
    function O(S, C, V, W) {
      return typeof V == "function" && (W = V, V = 0), J(S, C, V, W);
      function J(Y, P, T, q, B) {
        return R(Y, P, T, function(U) {
          U && (U.code === "EMFILE" || U.code === "ENFILE") ? d([J, [Y, P, T, q], U, B || Date.now(), Date.now()]) : typeof q == "function" && q.apply(this, arguments);
        });
      }
    }
    var M = h.readdir;
    h.readdir = k;
    var L = /^v[0-5]\./;
    function k(S, C, V) {
      typeof C == "function" && (V = C, C = null);
      var W = L.test(process.version) ? function(P, T, q, B) {
        return M(P, J(
          P,
          T,
          q,
          B
        ));
      } : function(P, T, q, B) {
        return M(P, T, J(
          P,
          T,
          q,
          B
        ));
      };
      return W(S, C, V);
      function J(Y, P, T, q) {
        return function(B, U) {
          B && (B.code === "EMFILE" || B.code === "ENFILE") ? d([
            W,
            [Y, P, T],
            B,
            q || Date.now(),
            Date.now()
          ]) : (U && U.sort && U.sort(), typeof T == "function" && T.call(this, B, U));
        };
      }
    }
    if (process.version.substr(0, 4) === "v0.8") {
      var z = n(h);
      G = z.ReadStream, H = z.WriteStream;
    }
    var K = h.ReadStream;
    K && (G.prototype = Object.create(K.prototype), G.prototype.open = x);
    var A = h.WriteStream;
    A && (H.prototype = Object.create(A.prototype), H.prototype.open = D), Object.defineProperty(h, "ReadStream", {
      get: function() {
        return G;
      },
      set: function(S) {
        G = S;
      },
      enumerable: !0,
      configurable: !0
    }), Object.defineProperty(h, "WriteStream", {
      get: function() {
        return H;
      },
      set: function(S) {
        H = S;
      },
      enumerable: !0,
      configurable: !0
    });
    var F = G;
    Object.defineProperty(h, "FileReadStream", {
      get: function() {
        return F;
      },
      set: function(S) {
        F = S;
      },
      enumerable: !0,
      configurable: !0
    });
    var X = H;
    Object.defineProperty(h, "FileWriteStream", {
      get: function() {
        return X;
      },
      set: function(S) {
        X = S;
      },
      enumerable: !0,
      configurable: !0
    });
    function G(S, C) {
      return this instanceof G ? (K.apply(this, arguments), this) : G.apply(Object.create(G.prototype), arguments);
    }
    function x() {
      var S = this;
      b(S.path, S.flags, S.mode, function(C, V) {
        C ? (S.autoClose && S.destroy(), S.emit("error", C)) : (S.fd = V, S.emit("open", V), S.read());
      });
    }
    function H(S, C) {
      return this instanceof H ? (A.apply(this, arguments), this) : H.apply(Object.create(H.prototype), arguments);
    }
    function D() {
      var S = this;
      b(S.path, S.flags, S.mode, function(C, V) {
        C ? (S.destroy(), S.emit("error", C)) : (S.fd = V, S.emit("open", V));
      });
    }
    function N(S, C) {
      return new h.ReadStream(S, C);
    }
    function j(S, C) {
      return new h.WriteStream(S, C);
    }
    var I = h.open;
    h.open = b;
    function b(S, C, V, W) {
      return typeof V == "function" && (W = V, V = null), J(S, C, V, W);
      function J(Y, P, T, q, B) {
        return I(Y, P, T, function(U, ee) {
          U && (U.code === "EMFILE" || U.code === "ENFILE") ? d([J, [Y, P, T, q], U, B || Date.now(), Date.now()]) : typeof q == "function" && q.apply(this, arguments);
        });
      }
    }
    return h;
  }
  function d(h) {
    c("ENQUEUE", h[0].name, h[1]), e[a].push(h), w();
  }
  var p;
  function v() {
    for (var h = Date.now(), y = 0; y < e[a].length; ++y)
      e[a][y].length > 2 && (e[a][y][3] = h, e[a][y][4] = h);
    w();
  }
  function w() {
    if (clearTimeout(p), p = void 0, e[a].length !== 0) {
      var h = e[a].shift(), y = h[0], m = h[1], g = h[2], $ = h[3], _ = h[4];
      if ($ === void 0)
        c("RETRY", y.name, m), y.apply(null, m);
      else if (Date.now() - $ >= 6e4) {
        c("TIMEOUT", y.name, m);
        var E = m.pop();
        typeof E == "function" && E.call(null, g);
      } else {
        var R = Date.now() - _, O = Math.max(_ - $, 1), M = Math.min(O * 1.2, 100);
        R >= M ? (c("RETRY", y.name, m), y.apply(null, m.concat([$]))) : e[a].push(h);
      }
      p === void 0 && (p = setTimeout(w, 0));
    }
  }
  return qt;
}
var yn, si;
function Su() {
  if (si) return yn;
  si = 1;
  var e;
  try {
    e = bu();
  } catch {
    e = Xr;
  }
  function t(l, c, i) {
    i == null && (i = c, c = {}), typeof c == "string" && (c = { encoding: c }), c = c || {};
    var f = c.fs || e, d = !0;
    "throws" in c && (d = c.throws), f.readFile(l, c, function(p, v) {
      if (p) return i(p);
      v = s(v);
      var w;
      try {
        w = JSON.parse(v, c ? c.reviver : null);
      } catch (h) {
        return d ? (h.message = l + ": " + h.message, i(h)) : i(null, null);
      }
      i(null, w);
    });
  }
  function n(l, c) {
    c = c || {}, typeof c == "string" && (c = { encoding: c });
    var i = c.fs || e, f = !0;
    "throws" in c && (f = c.throws);
    try {
      var d = i.readFileSync(l, c);
      return d = s(d), JSON.parse(d, c.reviver);
    } catch (p) {
      if (f)
        throw p.message = l + ": " + p.message, p;
      return null;
    }
  }
  function r(l, c) {
    var i, f = `
`;
    typeof c == "object" && c !== null && (c.spaces && (i = c.spaces), c.EOL && (f = c.EOL));
    var d = JSON.stringify(l, c ? c.replacer : null, i);
    return d.replace(/\n/g, f) + f;
  }
  function o(l, c, i, f) {
    f == null && (f = i, i = {}), i = i || {};
    var d = i.fs || e, p = "";
    try {
      p = r(c, i);
    } catch (v) {
      f && f(v, null);
      return;
    }
    d.writeFile(l, p, i, f);
  }
  function a(l, c, i) {
    i = i || {};
    var f = i.fs || e, d = r(c, i);
    return f.writeFileSync(l, d, i);
  }
  function s(l) {
    return Buffer.isBuffer(l) && (l = l.toString("utf8")), l = l.replace(/^\uFEFF/, ""), l;
  }
  var u = {
    readFile: t,
    readFileSync: n,
    writeFile: o,
    writeFileSync: a
  };
  return yn = u, yn;
}
var gn, ii;
function Ru() {
  if (ii) return gn;
  ii = 1;
  var e = oe, t = Xr, n = parseInt("0777", 8);
  gn = r.mkdirp = r.mkdirP = r;
  function r(o, a, s, u) {
    typeof a == "function" ? (s = a, a = {}) : (!a || typeof a != "object") && (a = { mode: a });
    var l = a.mode, c = a.fs || t;
    l === void 0 && (l = n), u || (u = null);
    var i = s || /* istanbul ignore next */
    function() {
    };
    o = e.resolve(o), c.mkdir(o, l, function(f) {
      if (!f)
        return u = u || o, i(null, u);
      switch (f.code) {
        case "ENOENT":
          if (e.dirname(o) === o) return i(f);
          r(e.dirname(o), a, function(d, p) {
            d ? i(d, p) : r(o, a, i, p);
          });
          break;
        // In the case of any other error, just see if there's a dir
        // there already.  If so, then hooray!  If not, then something
        // is borked.
        default:
          c.stat(o, function(d, p) {
            d || !p.isDirectory() ? i(f, u) : i(null, u);
          });
          break;
      }
    });
  }
  return r.sync = function o(a, s, u) {
    (!s || typeof s != "object") && (s = { mode: s });
    var l = s.mode, c = s.fs || t;
    l === void 0 && (l = n), u || (u = null), a = e.resolve(a);
    try {
      c.mkdirSync(a, l), u = u || a;
    } catch (f) {
      switch (f.code) {
        case "ENOENT":
          u = o(e.dirname(a), s, u), o(a, s, u);
          break;
        // In the case of any other error, just see if there's a dir
        // there already.  If so, then hooray!  If not, then something
        // is borked.
        default:
          var i;
          try {
            i = c.statSync(a);
          } catch {
            throw f;
          }
          if (!i.isDirectory()) throw f;
          break;
      }
    }
    return u;
  }, gn;
}
var vn, ai;
function Pu() {
  if (ai) return vn;
  ai = 1;
  const e = oe, t = Wr, n = Su(), r = Ru();
  return vn = function(o) {
    const a = t.app || t.remote.app, s = t.screen || t.remote.screen;
    let u, l, c;
    const i = 100, f = Object.assign({
      file: "window-state.json",
      path: a.getPath("userData"),
      maximize: !0,
      fullScreen: !0
    }, o), d = e.join(f.path, f.file);
    function p(L) {
      return !L.isMaximized() && !L.isMinimized() && !L.isFullScreen();
    }
    function v() {
      return u && Number.isInteger(u.x) && Number.isInteger(u.y) && Number.isInteger(u.width) && u.width > 0 && Number.isInteger(u.height) && u.height > 0;
    }
    function w() {
      const L = s.getPrimaryDisplay().bounds;
      u = {
        width: f.defaultWidth || 800,
        height: f.defaultHeight || 600,
        x: 0,
        y: 0,
        displayBounds: L
      };
    }
    function h(L) {
      return u.x >= L.x && u.y >= L.y && u.x + u.width <= L.x + L.width && u.y + u.height <= L.y + L.height;
    }
    function y() {
      if (!s.getAllDisplays().some((k) => h(k.bounds)))
        return w();
    }
    function m() {
      if (!(u && (v() || u.isMaximized || u.isFullScreen))) {
        u = null;
        return;
      }
      v() && u.displayBounds && y();
    }
    function g(L) {
      if (L = L || l, !!L)
        try {
          const k = L.getBounds();
          p(L) && (u.x = k.x, u.y = k.y, u.width = k.width, u.height = k.height), u.isMaximized = L.isMaximized(), u.isFullScreen = L.isFullScreen(), u.displayBounds = s.getDisplayMatching(k).bounds;
        } catch {
        }
    }
    function $(L) {
      L && g(L);
      try {
        r.sync(e.dirname(d)), n.writeFileSync(d, u);
      } catch {
      }
    }
    function _() {
      clearTimeout(c), c = setTimeout(g, i);
    }
    function E() {
      g();
    }
    function R() {
      M(), $();
    }
    function O(L) {
      f.maximize && u.isMaximized && L.maximize(), f.fullScreen && u.isFullScreen && L.setFullScreen(!0), L.on("resize", _), L.on("move", _), L.on("close", E), L.on("closed", R), l = L;
    }
    function M() {
      l && (l.removeListener("resize", _), l.removeListener("move", _), clearTimeout(c), l.removeListener("close", E), l.removeListener("closed", R), l = null);
    }
    try {
      u = n.readFileSync(d);
    } catch {
    }
    return m(), u = Object.assign({
      width: f.defaultWidth || 800,
      height: f.defaultHeight || 600
    }, u), {
      get x() {
        return u.x;
      },
      get y() {
        return u.y;
      },
      get width() {
        return u.width;
      },
      get height() {
        return u.height;
      },
      get displayBounds() {
        return u.displayBounds;
      },
      get isMaximized() {
        return u.isMaximized;
      },
      get isFullScreen() {
        return u.isFullScreen;
      },
      saveState: $,
      unmanage: M,
      manage: O,
      resetStateToDefault: w
    };
  }, vn;
}
var Ou = Pu();
const Nu = /* @__PURE__ */ Yr(Ou), Ye = (e) => {
  const t = typeof e;
  return e !== null && (t === "object" || t === "function");
}, _n = /* @__PURE__ */ new Set([
  "__proto__",
  "prototype",
  "constructor"
]), Iu = new Set("0123456789");
function Jr(e) {
  const t = [];
  let n = "", r = "start", o = !1;
  for (const a of e)
    switch (a) {
      case "\\": {
        if (r === "index")
          throw new Error("Invalid character in an index");
        if (r === "indexEnd")
          throw new Error("Invalid character after an index");
        o && (n += a), r = "property", o = !o;
        break;
      }
      case ".": {
        if (r === "index")
          throw new Error("Invalid character in an index");
        if (r === "indexEnd") {
          r = "property";
          break;
        }
        if (o) {
          o = !1, n += a;
          break;
        }
        if (_n.has(n))
          return [];
        t.push(n), n = "", r = "property";
        break;
      }
      case "[": {
        if (r === "index")
          throw new Error("Invalid character in an index");
        if (r === "indexEnd") {
          r = "index";
          break;
        }
        if (o) {
          o = !1, n += a;
          break;
        }
        if (r === "property") {
          if (_n.has(n))
            return [];
          t.push(n), n = "";
        }
        r = "index";
        break;
      }
      case "]": {
        if (r === "index") {
          t.push(Number.parseInt(n, 10)), n = "", r = "indexEnd";
          break;
        }
        if (r === "indexEnd")
          throw new Error("Invalid character after an index");
      }
      default: {
        if (r === "index" && !Iu.has(a))
          throw new Error("Invalid character in an index");
        if (r === "indexEnd")
          throw new Error("Invalid character after an index");
        r === "start" && (r = "property"), o && (o = !1, n += "\\"), n += a;
      }
    }
  switch (o && (n += "\\"), r) {
    case "property": {
      if (_n.has(n))
        return [];
      t.push(n);
      break;
    }
    case "index":
      throw new Error("Index was not closed");
    case "start": {
      t.push("");
      break;
    }
  }
  return t;
}
function Ms(e, t) {
  if (typeof t != "number" && Array.isArray(e)) {
    const n = Number.parseInt(t, 10);
    return Number.isInteger(n) && e[n] === e[t];
  }
  return !1;
}
function bc(e, t) {
  if (Ms(e, t))
    throw new Error("Cannot use string index");
}
function Tu(e, t, n) {
  if (!Ye(e) || typeof t != "string")
    return n === void 0 ? e : n;
  const r = Jr(t);
  if (r.length === 0)
    return n;
  for (let o = 0; o < r.length; o++) {
    const a = r[o];
    if (Ms(e, a) ? e = o === r.length - 1 ? void 0 : null : e = e[a], e == null) {
      if (o !== r.length - 1)
        return n;
      break;
    }
  }
  return e === void 0 ? n : e;
}
function oi(e, t, n) {
  if (!Ye(e) || typeof t != "string")
    return e;
  const r = e, o = Jr(t);
  for (let a = 0; a < o.length; a++) {
    const s = o[a];
    bc(e, s), a === o.length - 1 ? e[s] = n : Ye(e[s]) || (e[s] = typeof o[a + 1] == "number" ? [] : {}), e = e[s];
  }
  return r;
}
function Cu(e, t) {
  if (!Ye(e) || typeof t != "string")
    return !1;
  const n = Jr(t);
  for (let r = 0; r < n.length; r++) {
    const o = n[r];
    if (bc(e, o), r === n.length - 1)
      return delete e[o], !0;
    if (e = e[o], !Ye(e))
      return !1;
  }
}
function ju(e, t) {
  if (!Ye(e) || typeof t != "string")
    return !1;
  const n = Jr(t);
  if (n.length === 0)
    return !1;
  for (const r of n) {
    if (!Ye(e) || !(r in e) || Ms(e, r))
      return !1;
    e = e[r];
  }
  return !0;
}
const Ve = $c.homedir(), Fs = $c.tmpdir(), { env: at } = ae, Au = (e) => {
  const t = ie.join(Ve, "Library");
  return {
    data: ie.join(t, "Application Support", e),
    config: ie.join(t, "Preferences", e),
    cache: ie.join(t, "Caches", e),
    log: ie.join(t, "Logs", e),
    temp: ie.join(Fs, e)
  };
}, Du = (e) => {
  const t = at.APPDATA || ie.join(Ve, "AppData", "Roaming"), n = at.LOCALAPPDATA || ie.join(Ve, "AppData", "Local");
  return {
    // Data/config/cache/log are invented by me as Windows isn't opinionated about this
    data: ie.join(n, e, "Data"),
    config: ie.join(t, e, "Config"),
    cache: ie.join(n, e, "Cache"),
    log: ie.join(n, e, "Log"),
    temp: ie.join(Fs, e)
  };
}, qu = (e) => {
  const t = ie.basename(Ve);
  return {
    data: ie.join(at.XDG_DATA_HOME || ie.join(Ve, ".local", "share"), e),
    config: ie.join(at.XDG_CONFIG_HOME || ie.join(Ve, ".config"), e),
    cache: ie.join(at.XDG_CACHE_HOME || ie.join(Ve, ".cache"), e),
    // https://wiki.debian.org/XDGBaseDirectorySpecification#state
    log: ie.join(at.XDG_STATE_HOME || ie.join(Ve, ".local", "state"), e),
    temp: ie.join(Fs, t, e)
  };
};
function ku(e, { suffix: t = "nodejs" } = {}) {
  if (typeof e != "string")
    throw new TypeError(`Expected a string, got ${typeof e}`);
  return t && (e += `-${t}`), ae.platform === "darwin" ? Au(e) : ae.platform === "win32" ? Du(e) : qu(e);
}
const Le = (e, t) => {
  const { onError: n } = t;
  return function(...o) {
    return e.apply(void 0, o).catch(n);
  };
}, je = (e, t) => {
  const { onError: n } = t;
  return function(...o) {
    try {
      return e.apply(void 0, o);
    } catch (a) {
      return n(a);
    }
  };
}, Lu = 250, Me = (e, t) => {
  const { isRetriable: n } = t;
  return function(o) {
    const { timeout: a } = o, s = o.interval ?? Lu, u = Date.now() + a;
    return function l(...c) {
      return e.apply(void 0, c).catch((i) => {
        if (!n(i) || Date.now() >= u)
          throw i;
        const f = Math.round(s * Math.random());
        return f > 0 ? new Promise((p) => setTimeout(p, f)).then(() => l.apply(void 0, c)) : l.apply(void 0, c);
      });
    };
  };
}, Fe = (e, t) => {
  const { isRetriable: n } = t;
  return function(o) {
    const { timeout: a } = o, s = Date.now() + a;
    return function(...l) {
      for (; ; )
        try {
          return e.apply(void 0, l);
        } catch (c) {
          if (!n(c) || Date.now() >= s)
            throw c;
          continue;
        }
    };
  };
}, ot = {
  /* API */
  isChangeErrorOk: (e) => {
    if (!ot.isNodeError(e))
      return !1;
    const { code: t } = e;
    return t === "ENOSYS" || !Mu && (t === "EINVAL" || t === "EPERM");
  },
  isNodeError: (e) => e instanceof Error,
  isRetriableError: (e) => {
    if (!ot.isNodeError(e))
      return !1;
    const { code: t } = e;
    return t === "EMFILE" || t === "ENFILE" || t === "EAGAIN" || t === "EBUSY" || t === "EACCESS" || t === "EACCES" || t === "EACCS" || t === "EPERM";
  },
  onChangeError: (e) => {
    if (!ot.isNodeError(e))
      throw e;
    if (!ot.isChangeErrorOk(e))
      throw e;
  }
}, kt = {
  onError: ot.onChangeError
}, $e = {
  onError: () => {
  }
}, Mu = ae.getuid ? !ae.getuid() : !1, pe = {
  isRetriable: ot.isRetriableError
}, me = {
  attempt: {
    /* ASYNC */
    chmod: Le(he(Q.chmod), kt),
    chown: Le(he(Q.chown), kt),
    close: Le(he(Q.close), $e),
    fsync: Le(he(Q.fsync), $e),
    mkdir: Le(he(Q.mkdir), $e),
    realpath: Le(he(Q.realpath), $e),
    stat: Le(he(Q.stat), $e),
    unlink: Le(he(Q.unlink), $e),
    /* SYNC */
    chmodSync: je(Q.chmodSync, kt),
    chownSync: je(Q.chownSync, kt),
    closeSync: je(Q.closeSync, $e),
    existsSync: je(Q.existsSync, $e),
    fsyncSync: je(Q.fsync, $e),
    mkdirSync: je(Q.mkdirSync, $e),
    realpathSync: je(Q.realpathSync, $e),
    statSync: je(Q.statSync, $e),
    unlinkSync: je(Q.unlinkSync, $e)
  },
  retry: {
    /* ASYNC */
    close: Me(he(Q.close), pe),
    fsync: Me(he(Q.fsync), pe),
    open: Me(he(Q.open), pe),
    readFile: Me(he(Q.readFile), pe),
    rename: Me(he(Q.rename), pe),
    stat: Me(he(Q.stat), pe),
    write: Me(he(Q.write), pe),
    writeFile: Me(he(Q.writeFile), pe),
    /* SYNC */
    closeSync: Fe(Q.closeSync, pe),
    fsyncSync: Fe(Q.fsyncSync, pe),
    openSync: Fe(Q.openSync, pe),
    readFileSync: Fe(Q.readFileSync, pe),
    renameSync: Fe(Q.renameSync, pe),
    statSync: Fe(Q.statSync, pe),
    writeSync: Fe(Q.writeSync, pe),
    writeFileSync: Fe(Q.writeFileSync, pe)
  }
}, Fu = "utf8", ci = 438, Bu = 511, Vu = {}, zu = ae.geteuid ? ae.geteuid() : -1, Uu = ae.getegid ? ae.getegid() : -1, Gu = 1e3, xu = !!ae.getuid;
ae.getuid && ae.getuid();
const ui = 128, Hu = (e) => e instanceof Error && "code" in e, li = (e) => typeof e == "string", wn = (e) => e === void 0, Ku = ae.platform === "linux", Sc = ae.platform === "win32", Bs = ["SIGHUP", "SIGINT", "SIGTERM"];
Sc || Bs.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
Ku && Bs.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
class Wu {
  /* CONSTRUCTOR */
  constructor() {
    this.callbacks = /* @__PURE__ */ new Set(), this.exited = !1, this.exit = (t) => {
      if (!this.exited) {
        this.exited = !0;
        for (const n of this.callbacks)
          n();
        t && (Sc && t !== "SIGINT" && t !== "SIGTERM" && t !== "SIGKILL" ? ae.kill(ae.pid, "SIGTERM") : ae.kill(ae.pid, t));
      }
    }, this.hook = () => {
      ae.once("exit", () => this.exit());
      for (const t of Bs)
        try {
          ae.once(t, () => this.exit(t));
        } catch {
        }
    }, this.register = (t) => (this.callbacks.add(t), () => {
      this.callbacks.delete(t);
    }), this.hook();
  }
}
const Xu = new Wu(), Yu = Xu.register, ye = {
  /* VARIABLES */
  store: {},
  // filePath => purge
  /* API */
  create: (e) => {
    const t = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6), o = `.tmp-${Date.now().toString().slice(-10)}${t}`;
    return `${e}${o}`;
  },
  get: (e, t, n = !0) => {
    const r = ye.truncate(t(e));
    return r in ye.store ? ye.get(e, t, n) : (ye.store[r] = n, [r, () => delete ye.store[r]]);
  },
  purge: (e) => {
    ye.store[e] && (delete ye.store[e], me.attempt.unlink(e));
  },
  purgeSync: (e) => {
    ye.store[e] && (delete ye.store[e], me.attempt.unlinkSync(e));
  },
  purgeSyncAll: () => {
    for (const e in ye.store)
      ye.purgeSync(e);
  },
  truncate: (e) => {
    const t = ie.basename(e);
    if (t.length <= ui)
      return e;
    const n = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);
    if (!n)
      return e;
    const r = t.length - ui;
    return `${e.slice(0, -t.length)}${n[1]}${n[2].slice(0, -r)}${n[3]}`;
  }
};
Yu(ye.purgeSyncAll);
function Rc(e, t, n = Vu) {
  if (li(n))
    return Rc(e, t, { encoding: n });
  const o = { timeout: n.timeout ?? Gu };
  let a = null, s = null, u = null;
  try {
    const l = me.attempt.realpathSync(e), c = !!l;
    e = l || e, [s, a] = ye.get(e, n.tmpCreate || ye.create, n.tmpPurge !== !1);
    const i = xu && wn(n.chown), f = wn(n.mode);
    if (c && (i || f)) {
      const d = me.attempt.statSync(e);
      d && (n = { ...n }, i && (n.chown = { uid: d.uid, gid: d.gid }), f && (n.mode = d.mode));
    }
    if (!c) {
      const d = ie.dirname(e);
      me.attempt.mkdirSync(d, {
        mode: Bu,
        recursive: !0
      });
    }
    u = me.retry.openSync(o)(s, "w", n.mode || ci), n.tmpCreated && n.tmpCreated(s), li(t) ? me.retry.writeSync(o)(u, t, 0, n.encoding || Fu) : wn(t) || me.retry.writeSync(o)(u, t, 0, t.length, 0), n.fsync !== !1 && (n.fsyncWait !== !1 ? me.retry.fsyncSync(o)(u) : me.attempt.fsync(u)), me.retry.closeSync(o)(u), u = null, n.chown && (n.chown.uid !== zu || n.chown.gid !== Uu) && me.attempt.chownSync(s, n.chown.uid, n.chown.gid), n.mode && n.mode !== ci && me.attempt.chmodSync(s, n.mode);
    try {
      me.retry.renameSync(o)(s, e);
    } catch (d) {
      if (!Hu(d) || d.code !== "ENAMETOOLONG")
        throw d;
      me.retry.renameSync(o)(s, ye.truncate(e));
    }
    a(), s = null;
  } finally {
    u && me.attempt.closeSync(u), s && ye.purge(s);
  }
}
var Lt = { exports: {} }, $n = {}, Ae = {}, Ue = {}, En = {}, bn = {}, Sn = {}, fi;
function Hr() {
  return fi || (fi = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
    class t {
    }
    e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
    class n extends t {
      constructor(m) {
        if (super(), !e.IDENTIFIER.test(m))
          throw new Error("CodeGen: name must be a valid identifier");
        this.str = m;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        return !1;
      }
      get names() {
        return { [this.str]: 1 };
      }
    }
    e.Name = n;
    class r extends t {
      constructor(m) {
        super(), this._items = typeof m == "string" ? [m] : m;
      }
      toString() {
        return this.str;
      }
      emptyStr() {
        if (this._items.length > 1)
          return !1;
        const m = this._items[0];
        return m === "" || m === '""';
      }
      get str() {
        var m;
        return (m = this._str) !== null && m !== void 0 ? m : this._str = this._items.reduce((g, $) => `${g}${$}`, "");
      }
      get names() {
        var m;
        return (m = this._names) !== null && m !== void 0 ? m : this._names = this._items.reduce((g, $) => ($ instanceof n && (g[$.str] = (g[$.str] || 0) + 1), g), {});
      }
    }
    e._Code = r, e.nil = new r("");
    function o(y, ...m) {
      const g = [y[0]];
      let $ = 0;
      for (; $ < m.length; )
        u(g, m[$]), g.push(y[++$]);
      return new r(g);
    }
    e._ = o;
    const a = new r("+");
    function s(y, ...m) {
      const g = [p(y[0])];
      let $ = 0;
      for (; $ < m.length; )
        g.push(a), u(g, m[$]), g.push(a, p(y[++$]));
      return l(g), new r(g);
    }
    e.str = s;
    function u(y, m) {
      m instanceof r ? y.push(...m._items) : m instanceof n ? y.push(m) : y.push(f(m));
    }
    e.addCodeArg = u;
    function l(y) {
      let m = 1;
      for (; m < y.length - 1; ) {
        if (y[m] === a) {
          const g = c(y[m - 1], y[m + 1]);
          if (g !== void 0) {
            y.splice(m - 1, 3, g);
            continue;
          }
          y[m++] = "+";
        }
        m++;
      }
    }
    function c(y, m) {
      if (m === '""')
        return y;
      if (y === '""')
        return m;
      if (typeof y == "string")
        return m instanceof n || y[y.length - 1] !== '"' ? void 0 : typeof m != "string" ? `${y.slice(0, -1)}${m}"` : m[0] === '"' ? y.slice(0, -1) + m.slice(1) : void 0;
      if (typeof m == "string" && m[0] === '"' && !(y instanceof n))
        return `"${y}${m.slice(1)}`;
    }
    function i(y, m) {
      return m.emptyStr() ? y : y.emptyStr() ? m : s`${y}${m}`;
    }
    e.strConcat = i;
    function f(y) {
      return typeof y == "number" || typeof y == "boolean" || y === null ? y : p(Array.isArray(y) ? y.join(",") : y);
    }
    function d(y) {
      return new r(p(y));
    }
    e.stringify = d;
    function p(y) {
      return JSON.stringify(y).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
    }
    e.safeStringify = p;
    function v(y) {
      return typeof y == "string" && e.IDENTIFIER.test(y) ? new r(`.${y}`) : o`[${y}]`;
    }
    e.getProperty = v;
    function w(y) {
      if (typeof y == "string" && e.IDENTIFIER.test(y))
        return new r(`${y}`);
      throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`);
    }
    e.getEsmExportName = w;
    function h(y) {
      return new r(y.toString());
    }
    e.regexpCode = h;
  })(Sn)), Sn;
}
var Rn = {}, di;
function hi() {
  return di || (di = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
    const t = Hr();
    class n extends Error {
      constructor(c) {
        super(`CodeGen: "code" for ${c} not defined`), this.value = c.value;
      }
    }
    var r;
    (function(l) {
      l[l.Started = 0] = "Started", l[l.Completed = 1] = "Completed";
    })(r || (e.UsedValueState = r = {})), e.varKinds = {
      const: new t.Name("const"),
      let: new t.Name("let"),
      var: new t.Name("var")
    };
    class o {
      constructor({ prefixes: c, parent: i } = {}) {
        this._names = {}, this._prefixes = c, this._parent = i;
      }
      toName(c) {
        return c instanceof t.Name ? c : this.name(c);
      }
      name(c) {
        return new t.Name(this._newName(c));
      }
      _newName(c) {
        const i = this._names[c] || this._nameGroup(c);
        return `${c}${i.index++}`;
      }
      _nameGroup(c) {
        var i, f;
        if (!((f = (i = this._parent) === null || i === void 0 ? void 0 : i._prefixes) === null || f === void 0) && f.has(c) || this._prefixes && !this._prefixes.has(c))
          throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);
        return this._names[c] = { prefix: c, index: 0 };
      }
    }
    e.Scope = o;
    class a extends t.Name {
      constructor(c, i) {
        super(i), this.prefix = c;
      }
      setValue(c, { property: i, itemIndex: f }) {
        this.value = c, this.scopePath = (0, t._)`.${new t.Name(i)}[${f}]`;
      }
    }
    e.ValueScopeName = a;
    const s = (0, t._)`\n`;
    class u extends o {
      constructor(c) {
        super(c), this._values = {}, this._scope = c.scope, this.opts = { ...c, _n: c.lines ? s : t.nil };
      }
      get() {
        return this._scope;
      }
      name(c) {
        return new a(c, this._newName(c));
      }
      value(c, i) {
        var f;
        if (i.ref === void 0)
          throw new Error("CodeGen: ref must be passed in value");
        const d = this.toName(c), { prefix: p } = d, v = (f = i.key) !== null && f !== void 0 ? f : i.ref;
        let w = this._values[p];
        if (w) {
          const m = w.get(v);
          if (m)
            return m;
        } else
          w = this._values[p] = /* @__PURE__ */ new Map();
        w.set(v, d);
        const h = this._scope[p] || (this._scope[p] = []), y = h.length;
        return h[y] = i.ref, d.setValue(i, { property: p, itemIndex: y }), d;
      }
      getValue(c, i) {
        const f = this._values[c];
        if (f)
          return f.get(i);
      }
      scopeRefs(c, i = this._values) {
        return this._reduceValues(i, (f) => {
          if (f.scopePath === void 0)
            throw new Error(`CodeGen: name "${f}" has no value`);
          return (0, t._)`${c}${f.scopePath}`;
        });
      }
      scopeCode(c = this._values, i, f) {
        return this._reduceValues(c, (d) => {
          if (d.value === void 0)
            throw new Error(`CodeGen: name "${d}" has no value`);
          return d.value.code;
        }, i, f);
      }
      _reduceValues(c, i, f = {}, d) {
        let p = t.nil;
        for (const v in c) {
          const w = c[v];
          if (!w)
            continue;
          const h = f[v] = f[v] || /* @__PURE__ */ new Map();
          w.forEach((y) => {
            if (h.has(y))
              return;
            h.set(y, r.Started);
            let m = i(y);
            if (m) {
              const g = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
              p = (0, t._)`${p}${g} ${y} = ${m};${this.opts._n}`;
            } else if (m = d?.(y))
              p = (0, t._)`${p}${m}${this.opts._n}`;
            else
              throw new n(y);
            h.set(y, r.Completed);
          });
        }
        return p;
      }
    }
    e.ValueScope = u;
  })(Rn)), Rn;
}
var pi;
function Z() {
  return pi || (pi = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
    const t = Hr(), n = hi();
    var r = Hr();
    Object.defineProperty(e, "_", { enumerable: !0, get: function() {
      return r._;
    } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
      return r.str;
    } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() {
      return r.strConcat;
    } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
      return r.nil;
    } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() {
      return r.getProperty;
    } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
      return r.stringify;
    } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() {
      return r.regexpCode;
    } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
      return r.Name;
    } });
    var o = hi();
    Object.defineProperty(e, "Scope", { enumerable: !0, get: function() {
      return o.Scope;
    } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() {
      return o.ValueScope;
    } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() {
      return o.ValueScopeName;
    } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() {
      return o.varKinds;
    } }), e.operators = {
      GT: new t._Code(">"),
      GTE: new t._Code(">="),
      LT: new t._Code("<"),
      LTE: new t._Code("<="),
      EQ: new t._Code("==="),
      NEQ: new t._Code("!=="),
      NOT: new t._Code("!"),
      OR: new t._Code("||"),
      AND: new t._Code("&&"),
      ADD: new t._Code("+")
    };
    class a {
      optimizeNodes() {
        return this;
      }
      optimizeNames(b, S) {
        return this;
      }
    }
    class s extends a {
      constructor(b, S, C) {
        super(), this.varKind = b, this.name = S, this.rhs = C;
      }
      render({ es5: b, _n: S }) {
        const C = b ? n.varKinds.var : this.varKind, V = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
        return `${C} ${this.name}${V};` + S;
      }
      optimizeNames(b, S) {
        if (b[this.name.str])
          return this.rhs && (this.rhs = A(this.rhs, b, S)), this;
      }
      get names() {
        return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
      }
    }
    class u extends a {
      constructor(b, S, C) {
        super(), this.lhs = b, this.rhs = S, this.sideEffects = C;
      }
      render({ _n: b }) {
        return `${this.lhs} = ${this.rhs};` + b;
      }
      optimizeNames(b, S) {
        if (!(this.lhs instanceof t.Name && !b[this.lhs.str] && !this.sideEffects))
          return this.rhs = A(this.rhs, b, S), this;
      }
      get names() {
        const b = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
        return K(b, this.rhs);
      }
    }
    class l extends u {
      constructor(b, S, C, V) {
        super(b, C, V), this.op = S;
      }
      render({ _n: b }) {
        return `${this.lhs} ${this.op}= ${this.rhs};` + b;
      }
    }
    class c extends a {
      constructor(b) {
        super(), this.label = b, this.names = {};
      }
      render({ _n: b }) {
        return `${this.label}:` + b;
      }
    }
    class i extends a {
      constructor(b) {
        super(), this.label = b, this.names = {};
      }
      render({ _n: b }) {
        return `break${this.label ? ` ${this.label}` : ""};` + b;
      }
    }
    class f extends a {
      constructor(b) {
        super(), this.error = b;
      }
      render({ _n: b }) {
        return `throw ${this.error};` + b;
      }
      get names() {
        return this.error.names;
      }
    }
    class d extends a {
      constructor(b) {
        super(), this.code = b;
      }
      render({ _n: b }) {
        return `${this.code};` + b;
      }
      optimizeNodes() {
        return `${this.code}` ? this : void 0;
      }
      optimizeNames(b, S) {
        return this.code = A(this.code, b, S), this;
      }
      get names() {
        return this.code instanceof t._CodeOrName ? this.code.names : {};
      }
    }
    class p extends a {
      constructor(b = []) {
        super(), this.nodes = b;
      }
      render(b) {
        return this.nodes.reduce((S, C) => S + C.render(b), "");
      }
      optimizeNodes() {
        const { nodes: b } = this;
        let S = b.length;
        for (; S--; ) {
          const C = b[S].optimizeNodes();
          Array.isArray(C) ? b.splice(S, 1, ...C) : C ? b[S] = C : b.splice(S, 1);
        }
        return b.length > 0 ? this : void 0;
      }
      optimizeNames(b, S) {
        const { nodes: C } = this;
        let V = C.length;
        for (; V--; ) {
          const W = C[V];
          W.optimizeNames(b, S) || (F(b, W.names), C.splice(V, 1));
        }
        return C.length > 0 ? this : void 0;
      }
      get names() {
        return this.nodes.reduce((b, S) => z(b, S.names), {});
      }
    }
    class v extends p {
      render(b) {
        return "{" + b._n + super.render(b) + "}" + b._n;
      }
    }
    class w extends p {
    }
    class h extends v {
    }
    h.kind = "else";
    class y extends v {
      constructor(b, S) {
        super(S), this.condition = b;
      }
      render(b) {
        let S = `if(${this.condition})` + super.render(b);
        return this.else && (S += "else " + this.else.render(b)), S;
      }
      optimizeNodes() {
        super.optimizeNodes();
        const b = this.condition;
        if (b === !0)
          return this.nodes;
        let S = this.else;
        if (S) {
          const C = S.optimizeNodes();
          S = this.else = Array.isArray(C) ? new h(C) : C;
        }
        if (S)
          return b === !1 ? S instanceof y ? S : S.nodes : this.nodes.length ? this : new y(X(b), S instanceof y ? [S] : S.nodes);
        if (!(b === !1 || !this.nodes.length))
          return this;
      }
      optimizeNames(b, S) {
        var C;
        if (this.else = (C = this.else) === null || C === void 0 ? void 0 : C.optimizeNames(b, S), !!(super.optimizeNames(b, S) || this.else))
          return this.condition = A(this.condition, b, S), this;
      }
      get names() {
        const b = super.names;
        return K(b, this.condition), this.else && z(b, this.else.names), b;
      }
    }
    y.kind = "if";
    class m extends v {
    }
    m.kind = "for";
    class g extends m {
      constructor(b) {
        super(), this.iteration = b;
      }
      render(b) {
        return `for(${this.iteration})` + super.render(b);
      }
      optimizeNames(b, S) {
        if (super.optimizeNames(b, S))
          return this.iteration = A(this.iteration, b, S), this;
      }
      get names() {
        return z(super.names, this.iteration.names);
      }
    }
    class $ extends m {
      constructor(b, S, C, V) {
        super(), this.varKind = b, this.name = S, this.from = C, this.to = V;
      }
      render(b) {
        const S = b.es5 ? n.varKinds.var : this.varKind, { name: C, from: V, to: W } = this;
        return `for(${S} ${C}=${V}; ${C}<${W}; ${C}++)` + super.render(b);
      }
      get names() {
        const b = K(super.names, this.from);
        return K(b, this.to);
      }
    }
    class _ extends m {
      constructor(b, S, C, V) {
        super(), this.loop = b, this.varKind = S, this.name = C, this.iterable = V;
      }
      render(b) {
        return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(b);
      }
      optimizeNames(b, S) {
        if (super.optimizeNames(b, S))
          return this.iterable = A(this.iterable, b, S), this;
      }
      get names() {
        return z(super.names, this.iterable.names);
      }
    }
    class E extends v {
      constructor(b, S, C) {
        super(), this.name = b, this.args = S, this.async = C;
      }
      render(b) {
        return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(b);
      }
    }
    E.kind = "func";
    class R extends p {
      render(b) {
        return "return " + super.render(b);
      }
    }
    R.kind = "return";
    class O extends v {
      render(b) {
        let S = "try" + super.render(b);
        return this.catch && (S += this.catch.render(b)), this.finally && (S += this.finally.render(b)), S;
      }
      optimizeNodes() {
        var b, S;
        return super.optimizeNodes(), (b = this.catch) === null || b === void 0 || b.optimizeNodes(), (S = this.finally) === null || S === void 0 || S.optimizeNodes(), this;
      }
      optimizeNames(b, S) {
        var C, V;
        return super.optimizeNames(b, S), (C = this.catch) === null || C === void 0 || C.optimizeNames(b, S), (V = this.finally) === null || V === void 0 || V.optimizeNames(b, S), this;
      }
      get names() {
        const b = super.names;
        return this.catch && z(b, this.catch.names), this.finally && z(b, this.finally.names), b;
      }
    }
    class M extends v {
      constructor(b) {
        super(), this.error = b;
      }
      render(b) {
        return `catch(${this.error})` + super.render(b);
      }
    }
    M.kind = "catch";
    class L extends v {
      render(b) {
        return "finally" + super.render(b);
      }
    }
    L.kind = "finally";
    class k {
      constructor(b, S = {}) {
        this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...S, _n: S.lines ? `
` : "" }, this._extScope = b, this._scope = new n.Scope({ parent: b }), this._nodes = [new w()];
      }
      toString() {
        return this._root.render(this.opts);
      }
      // returns unique name in the internal scope
      name(b) {
        return this._scope.name(b);
      }
      // reserves unique name in the external scope
      scopeName(b) {
        return this._extScope.name(b);
      }
      // reserves unique name in the external scope and assigns value to it
      scopeValue(b, S) {
        const C = this._extScope.value(b, S);
        return (this._values[C.prefix] || (this._values[C.prefix] = /* @__PURE__ */ new Set())).add(C), C;
      }
      getScopeValue(b, S) {
        return this._extScope.getValue(b, S);
      }
      // return code that assigns values in the external scope to the names that are used internally
      // (same names that were returned by gen.scopeName or gen.scopeValue)
      scopeRefs(b) {
        return this._extScope.scopeRefs(b, this._values);
      }
      scopeCode() {
        return this._extScope.scopeCode(this._values);
      }
      _def(b, S, C, V) {
        const W = this._scope.toName(S);
        return C !== void 0 && V && (this._constants[W.str] = C), this._leafNode(new s(b, W, C)), W;
      }
      // `const` declaration (`var` in es5 mode)
      const(b, S, C) {
        return this._def(n.varKinds.const, b, S, C);
      }
      // `let` declaration with optional assignment (`var` in es5 mode)
      let(b, S, C) {
        return this._def(n.varKinds.let, b, S, C);
      }
      // `var` declaration with optional assignment
      var(b, S, C) {
        return this._def(n.varKinds.var, b, S, C);
      }
      // assignment code
      assign(b, S, C) {
        return this._leafNode(new u(b, S, C));
      }
      // `+=` code
      add(b, S) {
        return this._leafNode(new l(b, e.operators.ADD, S));
      }
      // appends passed SafeExpr to code or executes Block
      code(b) {
        return typeof b == "function" ? b() : b !== t.nil && this._leafNode(new d(b)), this;
      }
      // returns code for object literal for the passed argument list of key-value pairs
      object(...b) {
        const S = ["{"];
        for (const [C, V] of b)
          S.length > 1 && S.push(","), S.push(C), (C !== V || this.opts.es5) && (S.push(":"), (0, t.addCodeArg)(S, V));
        return S.push("}"), new t._Code(S);
      }
      // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
      if(b, S, C) {
        if (this._blockNode(new y(b)), S && C)
          this.code(S).else().code(C).endIf();
        else if (S)
          this.code(S).endIf();
        else if (C)
          throw new Error('CodeGen: "else" body without "then" body');
        return this;
      }
      // `else if` clause - invalid without `if` or after `else` clauses
      elseIf(b) {
        return this._elseNode(new y(b));
      }
      // `else` clause - only valid after `if` or `else if` clauses
      else() {
        return this._elseNode(new h());
      }
      // end `if` statement (needed if gen.if was used only with condition)
      endIf() {
        return this._endBlockNode(y, h);
      }
      _for(b, S) {
        return this._blockNode(b), S && this.code(S).endFor(), this;
      }
      // a generic `for` clause (or statement if `forBody` is passed)
      for(b, S) {
        return this._for(new g(b), S);
      }
      // `for` statement for a range of values
      forRange(b, S, C, V, W = this.opts.es5 ? n.varKinds.var : n.varKinds.let) {
        const J = this._scope.toName(b);
        return this._for(new $(W, J, S, C), () => V(J));
      }
      // `for-of` statement (in es5 mode replace with a normal for loop)
      forOf(b, S, C, V = n.varKinds.const) {
        const W = this._scope.toName(b);
        if (this.opts.es5) {
          const J = S instanceof t.Name ? S : this.var("_arr", S);
          return this.forRange("_i", 0, (0, t._)`${J}.length`, (Y) => {
            this.var(W, (0, t._)`${J}[${Y}]`), C(W);
          });
        }
        return this._for(new _("of", V, W, S), () => C(W));
      }
      // `for-in` statement.
      // With option `ownProperties` replaced with a `for-of` loop for object keys
      forIn(b, S, C, V = this.opts.es5 ? n.varKinds.var : n.varKinds.const) {
        if (this.opts.ownProperties)
          return this.forOf(b, (0, t._)`Object.keys(${S})`, C);
        const W = this._scope.toName(b);
        return this._for(new _("in", V, W, S), () => C(W));
      }
      // end `for` loop
      endFor() {
        return this._endBlockNode(m);
      }
      // `label` statement
      label(b) {
        return this._leafNode(new c(b));
      }
      // `break` statement
      break(b) {
        return this._leafNode(new i(b));
      }
      // `return` statement
      return(b) {
        const S = new R();
        if (this._blockNode(S), this.code(b), S.nodes.length !== 1)
          throw new Error('CodeGen: "return" should have one node');
        return this._endBlockNode(R);
      }
      // `try` statement
      try(b, S, C) {
        if (!S && !C)
          throw new Error('CodeGen: "try" without "catch" and "finally"');
        const V = new O();
        if (this._blockNode(V), this.code(b), S) {
          const W = this.name("e");
          this._currNode = V.catch = new M(W), S(W);
        }
        return C && (this._currNode = V.finally = new L(), this.code(C)), this._endBlockNode(M, L);
      }
      // `throw` statement
      throw(b) {
        return this._leafNode(new f(b));
      }
      // start self-balancing block
      block(b, S) {
        return this._blockStarts.push(this._nodes.length), b && this.code(b).endBlock(S), this;
      }
      // end the current self-balancing block
      endBlock(b) {
        const S = this._blockStarts.pop();
        if (S === void 0)
          throw new Error("CodeGen: not in self-balancing block");
        const C = this._nodes.length - S;
        if (C < 0 || b !== void 0 && C !== b)
          throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${b} expected`);
        return this._nodes.length = S, this;
      }
      // `function` heading (or definition if funcBody is passed)
      func(b, S = t.nil, C, V) {
        return this._blockNode(new E(b, S, C)), V && this.code(V).endFunc(), this;
      }
      // end function definition
      endFunc() {
        return this._endBlockNode(E);
      }
      optimize(b = 1) {
        for (; b-- > 0; )
          this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
      }
      _leafNode(b) {
        return this._currNode.nodes.push(b), this;
      }
      _blockNode(b) {
        this._currNode.nodes.push(b), this._nodes.push(b);
      }
      _endBlockNode(b, S) {
        const C = this._currNode;
        if (C instanceof b || S && C instanceof S)
          return this._nodes.pop(), this;
        throw new Error(`CodeGen: not in block "${S ? `${b.kind}/${S.kind}` : b.kind}"`);
      }
      _elseNode(b) {
        const S = this._currNode;
        if (!(S instanceof y))
          throw new Error('CodeGen: "else" without "if"');
        return this._currNode = S.else = b, this;
      }
      get _root() {
        return this._nodes[0];
      }
      get _currNode() {
        const b = this._nodes;
        return b[b.length - 1];
      }
      set _currNode(b) {
        const S = this._nodes;
        S[S.length - 1] = b;
      }
    }
    e.CodeGen = k;
    function z(I, b) {
      for (const S in b)
        I[S] = (I[S] || 0) + (b[S] || 0);
      return I;
    }
    function K(I, b) {
      return b instanceof t._CodeOrName ? z(I, b.names) : I;
    }
    function A(I, b, S) {
      if (I instanceof t.Name)
        return C(I);
      if (!V(I))
        return I;
      return new t._Code(I._items.reduce((W, J) => (J instanceof t.Name && (J = C(J)), J instanceof t._Code ? W.push(...J._items) : W.push(J), W), []));
      function C(W) {
        const J = S[W.str];
        return J === void 0 || b[W.str] !== 1 ? W : (delete b[W.str], J);
      }
      function V(W) {
        return W instanceof t._Code && W._items.some((J) => J instanceof t.Name && b[J.str] === 1 && S[J.str] !== void 0);
      }
    }
    function F(I, b) {
      for (const S in b)
        I[S] = (I[S] || 0) - (b[S] || 0);
    }
    function X(I) {
      return typeof I == "boolean" || typeof I == "number" || I === null ? !I : (0, t._)`!${j(I)}`;
    }
    e.not = X;
    const G = N(e.operators.AND);
    function x(...I) {
      return I.reduce(G);
    }
    e.and = x;
    const H = N(e.operators.OR);
    function D(...I) {
      return I.reduce(H);
    }
    e.or = D;
    function N(I) {
      return (b, S) => b === t.nil ? S : S === t.nil ? b : (0, t._)`${j(b)} ${I} ${j(S)}`;
    }
    function j(I) {
      return I instanceof t.Name ? I : (0, t._)`(${I})`;
    }
  })(bn)), bn;
}
var te = {}, mi;
function re() {
  if (mi) return te;
  mi = 1, Object.defineProperty(te, "__esModule", { value: !0 }), te.checkStrictMode = te.getErrorPath = te.Type = te.useFunc = te.setEvaluated = te.evaluatedPropsToName = te.mergeEvaluated = te.eachItem = te.unescapeJsonPointer = te.escapeJsonPointer = te.escapeFragment = te.unescapeFragment = te.schemaRefOrVal = te.schemaHasRulesButRef = te.schemaHasRules = te.checkUnknownRules = te.alwaysValidSchema = te.toHash = void 0;
  const e = Z(), t = Hr();
  function n(_) {
    const E = {};
    for (const R of _)
      E[R] = !0;
    return E;
  }
  te.toHash = n;
  function r(_, E) {
    return typeof E == "boolean" ? E : Object.keys(E).length === 0 ? !0 : (o(_, E), !a(E, _.self.RULES.all));
  }
  te.alwaysValidSchema = r;
  function o(_, E = _.schema) {
    const { opts: R, self: O } = _;
    if (!R.strictSchema || typeof E == "boolean")
      return;
    const M = O.RULES.keywords;
    for (const L in E)
      M[L] || $(_, `unknown keyword: "${L}"`);
  }
  te.checkUnknownRules = o;
  function a(_, E) {
    if (typeof _ == "boolean")
      return !_;
    for (const R in _)
      if (E[R])
        return !0;
    return !1;
  }
  te.schemaHasRules = a;
  function s(_, E) {
    if (typeof _ == "boolean")
      return !_;
    for (const R in _)
      if (R !== "$ref" && E.all[R])
        return !0;
    return !1;
  }
  te.schemaHasRulesButRef = s;
  function u({ topSchemaRef: _, schemaPath: E }, R, O, M) {
    if (!M) {
      if (typeof R == "number" || typeof R == "boolean")
        return R;
      if (typeof R == "string")
        return (0, e._)`${R}`;
    }
    return (0, e._)`${_}${E}${(0, e.getProperty)(O)}`;
  }
  te.schemaRefOrVal = u;
  function l(_) {
    return f(decodeURIComponent(_));
  }
  te.unescapeFragment = l;
  function c(_) {
    return encodeURIComponent(i(_));
  }
  te.escapeFragment = c;
  function i(_) {
    return typeof _ == "number" ? `${_}` : _.replace(/~/g, "~0").replace(/\//g, "~1");
  }
  te.escapeJsonPointer = i;
  function f(_) {
    return _.replace(/~1/g, "/").replace(/~0/g, "~");
  }
  te.unescapeJsonPointer = f;
  function d(_, E) {
    if (Array.isArray(_))
      for (const R of _)
        E(R);
    else
      E(_);
  }
  te.eachItem = d;
  function p({ mergeNames: _, mergeToName: E, mergeValues: R, resultToName: O }) {
    return (M, L, k, z) => {
      const K = k === void 0 ? L : k instanceof e.Name ? (L instanceof e.Name ? _(M, L, k) : E(M, L, k), k) : L instanceof e.Name ? (E(M, k, L), L) : R(L, k);
      return z === e.Name && !(K instanceof e.Name) ? O(M, K) : K;
    };
  }
  te.mergeEvaluated = {
    props: p({
      mergeNames: (_, E, R) => _.if((0, e._)`${R} !== true && ${E} !== undefined`, () => {
        _.if((0, e._)`${E} === true`, () => _.assign(R, !0), () => _.assign(R, (0, e._)`${R} || {}`).code((0, e._)`Object.assign(${R}, ${E})`));
      }),
      mergeToName: (_, E, R) => _.if((0, e._)`${R} !== true`, () => {
        E === !0 ? _.assign(R, !0) : (_.assign(R, (0, e._)`${R} || {}`), w(_, R, E));
      }),
      mergeValues: (_, E) => _ === !0 ? !0 : { ..._, ...E },
      resultToName: v
    }),
    items: p({
      mergeNames: (_, E, R) => _.if((0, e._)`${R} !== true && ${E} !== undefined`, () => _.assign(R, (0, e._)`${E} === true ? true : ${R} > ${E} ? ${R} : ${E}`)),
      mergeToName: (_, E, R) => _.if((0, e._)`${R} !== true`, () => _.assign(R, E === !0 ? !0 : (0, e._)`${R} > ${E} ? ${R} : ${E}`)),
      mergeValues: (_, E) => _ === !0 ? !0 : Math.max(_, E),
      resultToName: (_, E) => _.var("items", E)
    })
  };
  function v(_, E) {
    if (E === !0)
      return _.var("props", !0);
    const R = _.var("props", (0, e._)`{}`);
    return E !== void 0 && w(_, R, E), R;
  }
  te.evaluatedPropsToName = v;
  function w(_, E, R) {
    Object.keys(R).forEach((O) => _.assign((0, e._)`${E}${(0, e.getProperty)(O)}`, !0));
  }
  te.setEvaluated = w;
  const h = {};
  function y(_, E) {
    return _.scopeValue("func", {
      ref: E,
      code: h[E.code] || (h[E.code] = new t._Code(E.code))
    });
  }
  te.useFunc = y;
  var m;
  (function(_) {
    _[_.Num = 0] = "Num", _[_.Str = 1] = "Str";
  })(m || (te.Type = m = {}));
  function g(_, E, R) {
    if (_ instanceof e.Name) {
      const O = E === m.Num;
      return R ? O ? (0, e._)`"[" + ${_} + "]"` : (0, e._)`"['" + ${_} + "']"` : O ? (0, e._)`"/" + ${_}` : (0, e._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
    }
    return R ? (0, e.getProperty)(_).toString() : "/" + i(_);
  }
  te.getErrorPath = g;
  function $(_, E, R = _.opts.strictSchema) {
    if (R) {
      if (E = `strict mode: ${E}`, R === !0)
        throw new Error(E);
      _.self.logger.warn(E);
    }
  }
  return te.checkStrictMode = $, te;
}
var Mt = {}, yi;
function Ne() {
  if (yi) return Mt;
  yi = 1, Object.defineProperty(Mt, "__esModule", { value: !0 });
  const e = Z(), t = {
    // validation function arguments
    data: new e.Name("data"),
    // data passed to validation function
    // args passed from referencing schema
    valCxt: new e.Name("valCxt"),
    // validation/data context - should not be used directly, it is destructured to the names below
    instancePath: new e.Name("instancePath"),
    parentData: new e.Name("parentData"),
    parentDataProperty: new e.Name("parentDataProperty"),
    rootData: new e.Name("rootData"),
    // root data - same as the data passed to the first/top validation function
    dynamicAnchors: new e.Name("dynamicAnchors"),
    // used to support recursiveRef and dynamicRef
    // function scoped variables
    vErrors: new e.Name("vErrors"),
    // null or array of validation errors
    errors: new e.Name("errors"),
    // counter of validation errors
    this: new e.Name("this"),
    // "globals"
    self: new e.Name("self"),
    scope: new e.Name("scope"),
    // JTD serialize/parse name for JSON string and position
    json: new e.Name("json"),
    jsonPos: new e.Name("jsonPos"),
    jsonLen: new e.Name("jsonLen"),
    jsonPart: new e.Name("jsonPart")
  };
  return Mt.default = t, Mt;
}
var gi;
function Zr() {
  return gi || (gi = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
    const t = Z(), n = re(), r = Ne();
    e.keywordError = {
      message: ({ keyword: h }) => (0, t.str)`must pass "${h}" keyword validation`
    }, e.keyword$DataError = {
      message: ({ keyword: h, schemaType: y }) => y ? (0, t.str)`"${h}" keyword must be ${y} ($data)` : (0, t.str)`"${h}" keyword is invalid ($data)`
    };
    function o(h, y = e.keywordError, m, g) {
      const { it: $ } = h, { gen: _, compositeRule: E, allErrors: R } = $, O = f(h, y, m);
      g ?? (E || R) ? l(_, O) : c($, (0, t._)`[${O}]`);
    }
    e.reportError = o;
    function a(h, y = e.keywordError, m) {
      const { it: g } = h, { gen: $, compositeRule: _, allErrors: E } = g, R = f(h, y, m);
      l($, R), _ || E || c(g, r.default.vErrors);
    }
    e.reportExtraError = a;
    function s(h, y) {
      h.assign(r.default.errors, y), h.if((0, t._)`${r.default.vErrors} !== null`, () => h.if(y, () => h.assign((0, t._)`${r.default.vErrors}.length`, y), () => h.assign(r.default.vErrors, null)));
    }
    e.resetErrorsCount = s;
    function u({ gen: h, keyword: y, schemaValue: m, data: g, errsCount: $, it: _ }) {
      if ($ === void 0)
        throw new Error("ajv implementation error");
      const E = h.name("err");
      h.forRange("i", $, r.default.errors, (R) => {
        h.const(E, (0, t._)`${r.default.vErrors}[${R}]`), h.if((0, t._)`${E}.instancePath === undefined`, () => h.assign((0, t._)`${E}.instancePath`, (0, t.strConcat)(r.default.instancePath, _.errorPath))), h.assign((0, t._)`${E}.schemaPath`, (0, t.str)`${_.errSchemaPath}/${y}`), _.opts.verbose && (h.assign((0, t._)`${E}.schema`, m), h.assign((0, t._)`${E}.data`, g));
      });
    }
    e.extendErrors = u;
    function l(h, y) {
      const m = h.const("err", y);
      h.if((0, t._)`${r.default.vErrors} === null`, () => h.assign(r.default.vErrors, (0, t._)`[${m}]`), (0, t._)`${r.default.vErrors}.push(${m})`), h.code((0, t._)`${r.default.errors}++`);
    }
    function c(h, y) {
      const { gen: m, validateName: g, schemaEnv: $ } = h;
      $.$async ? m.throw((0, t._)`new ${h.ValidationError}(${y})`) : (m.assign((0, t._)`${g}.errors`, y), m.return(!1));
    }
    const i = {
      keyword: new t.Name("keyword"),
      schemaPath: new t.Name("schemaPath"),
      // also used in JTD errors
      params: new t.Name("params"),
      propertyName: new t.Name("propertyName"),
      message: new t.Name("message"),
      schema: new t.Name("schema"),
      parentSchema: new t.Name("parentSchema")
    };
    function f(h, y, m) {
      const { createErrors: g } = h.it;
      return g === !1 ? (0, t._)`{}` : d(h, y, m);
    }
    function d(h, y, m = {}) {
      const { gen: g, it: $ } = h, _ = [
        p($, m),
        v(h, m)
      ];
      return w(h, y, _), g.object(..._);
    }
    function p({ errorPath: h }, { instancePath: y }) {
      const m = y ? (0, t.str)`${h}${(0, n.getErrorPath)(y, n.Type.Str)}` : h;
      return [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, m)];
    }
    function v({ keyword: h, it: { errSchemaPath: y } }, { schemaPath: m, parentSchema: g }) {
      let $ = g ? y : (0, t.str)`${y}/${h}`;
      return m && ($ = (0, t.str)`${$}${(0, n.getErrorPath)(m, n.Type.Str)}`), [i.schemaPath, $];
    }
    function w(h, { params: y, message: m }, g) {
      const { keyword: $, data: _, schemaValue: E, it: R } = h, { opts: O, propertyName: M, topSchemaRef: L, schemaPath: k } = R;
      g.push([i.keyword, $], [i.params, typeof y == "function" ? y(h) : y || (0, t._)`{}`]), O.messages && g.push([i.message, typeof m == "function" ? m(h) : m]), O.verbose && g.push([i.schema, E], [i.parentSchema, (0, t._)`${L}${k}`], [r.default.data, _]), M && g.push([i.propertyName, M]);
    }
  })(En)), En;
}
var vi;
function Ju() {
  if (vi) return Ue;
  vi = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.boolOrEmptySchema = Ue.topBoolOrEmptySchema = void 0;
  const e = Zr(), t = Z(), n = Ne(), r = {
    message: "boolean schema is false"
  };
  function o(u) {
    const { gen: l, schema: c, validateName: i } = u;
    c === !1 ? s(u, !1) : typeof c == "object" && c.$async === !0 ? l.return(n.default.data) : (l.assign((0, t._)`${i}.errors`, null), l.return(!0));
  }
  Ue.topBoolOrEmptySchema = o;
  function a(u, l) {
    const { gen: c, schema: i } = u;
    i === !1 ? (c.var(l, !1), s(u)) : c.var(l, !0);
  }
  Ue.boolOrEmptySchema = a;
  function s(u, l) {
    const { gen: c, data: i } = u, f = {
      gen: c,
      keyword: "false schema",
      data: i,
      schema: !1,
      schemaCode: !1,
      schemaValue: !1,
      params: {},
      it: u
    };
    (0, e.reportError)(f, r, void 0, l);
  }
  return Ue;
}
var fe = {}, Ge = {}, _i;
function Pc() {
  if (_i) return Ge;
  _i = 1, Object.defineProperty(Ge, "__esModule", { value: !0 }), Ge.getRules = Ge.isJSONType = void 0;
  const e = ["string", "number", "integer", "boolean", "null", "object", "array"], t = new Set(e);
  function n(o) {
    return typeof o == "string" && t.has(o);
  }
  Ge.isJSONType = n;
  function r() {
    const o = {
      number: { type: "number", rules: [] },
      string: { type: "string", rules: [] },
      array: { type: "array", rules: [] },
      object: { type: "object", rules: [] }
    };
    return {
      types: { ...o, integer: !0, boolean: !0, null: !0 },
      rules: [{ rules: [] }, o.number, o.string, o.array, o.object],
      post: { rules: [] },
      all: {},
      keywords: {}
    };
  }
  return Ge.getRules = r, Ge;
}
var De = {}, wi;
function Oc() {
  if (wi) return De;
  wi = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.shouldUseRule = De.shouldUseGroup = De.schemaHasRulesForType = void 0;
  function e({ schema: r, self: o }, a) {
    const s = o.RULES.types[a];
    return s && s !== !0 && t(r, s);
  }
  De.schemaHasRulesForType = e;
  function t(r, o) {
    return o.rules.some((a) => n(r, a));
  }
  De.shouldUseGroup = t;
  function n(r, o) {
    var a;
    return r[o.keyword] !== void 0 || ((a = o.definition.implements) === null || a === void 0 ? void 0 : a.some((s) => r[s] !== void 0));
  }
  return De.shouldUseRule = n, De;
}
var $i;
function Kr() {
  if ($i) return fe;
  $i = 1, Object.defineProperty(fe, "__esModule", { value: !0 }), fe.reportTypeError = fe.checkDataTypes = fe.checkDataType = fe.coerceAndCheckDataType = fe.getJSONTypes = fe.getSchemaTypes = fe.DataType = void 0;
  const e = Pc(), t = Oc(), n = Zr(), r = Z(), o = re();
  var a;
  (function(m) {
    m[m.Correct = 0] = "Correct", m[m.Wrong = 1] = "Wrong";
  })(a || (fe.DataType = a = {}));
  function s(m) {
    const g = u(m.type);
    if (g.includes("null")) {
      if (m.nullable === !1)
        throw new Error("type: null contradicts nullable: false");
    } else {
      if (!g.length && m.nullable !== void 0)
        throw new Error('"nullable" cannot be used without "type"');
      m.nullable === !0 && g.push("null");
    }
    return g;
  }
  fe.getSchemaTypes = s;
  function u(m) {
    const g = Array.isArray(m) ? m : m ? [m] : [];
    if (g.every(e.isJSONType))
      return g;
    throw new Error("type must be JSONType or JSONType[]: " + g.join(","));
  }
  fe.getJSONTypes = u;
  function l(m, g) {
    const { gen: $, data: _, opts: E } = m, R = i(g, E.coerceTypes), O = g.length > 0 && !(R.length === 0 && g.length === 1 && (0, t.schemaHasRulesForType)(m, g[0]));
    if (O) {
      const M = v(g, _, E.strictNumbers, a.Wrong);
      $.if(M, () => {
        R.length ? f(m, g, R) : h(m);
      });
    }
    return O;
  }
  fe.coerceAndCheckDataType = l;
  const c = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
  function i(m, g) {
    return g ? m.filter(($) => c.has($) || g === "array" && $ === "array") : [];
  }
  function f(m, g, $) {
    const { gen: _, data: E, opts: R } = m, O = _.let("dataType", (0, r._)`typeof ${E}`), M = _.let("coerced", (0, r._)`undefined`);
    R.coerceTypes === "array" && _.if((0, r._)`${O} == 'object' && Array.isArray(${E}) && ${E}.length == 1`, () => _.assign(E, (0, r._)`${E}[0]`).assign(O, (0, r._)`typeof ${E}`).if(v(g, E, R.strictNumbers), () => _.assign(M, E))), _.if((0, r._)`${M} !== undefined`);
    for (const k of $)
      (c.has(k) || k === "array" && R.coerceTypes === "array") && L(k);
    _.else(), h(m), _.endIf(), _.if((0, r._)`${M} !== undefined`, () => {
      _.assign(E, M), d(m, M);
    });
    function L(k) {
      switch (k) {
        case "string":
          _.elseIf((0, r._)`${O} == "number" || ${O} == "boolean"`).assign(M, (0, r._)`"" + ${E}`).elseIf((0, r._)`${E} === null`).assign(M, (0, r._)`""`);
          return;
        case "number":
          _.elseIf((0, r._)`${O} == "boolean" || ${E} === null
              || (${O} == "string" && ${E} && ${E} == +${E})`).assign(M, (0, r._)`+${E}`);
          return;
        case "integer":
          _.elseIf((0, r._)`${O} === "boolean" || ${E} === null
              || (${O} === "string" && ${E} && ${E} == +${E} && !(${E} % 1))`).assign(M, (0, r._)`+${E}`);
          return;
        case "boolean":
          _.elseIf((0, r._)`${E} === "false" || ${E} === 0 || ${E} === null`).assign(M, !1).elseIf((0, r._)`${E} === "true" || ${E} === 1`).assign(M, !0);
          return;
        case "null":
          _.elseIf((0, r._)`${E} === "" || ${E} === 0 || ${E} === false`), _.assign(M, null);
          return;
        case "array":
          _.elseIf((0, r._)`${O} === "string" || ${O} === "number"
              || ${O} === "boolean" || ${E} === null`).assign(M, (0, r._)`[${E}]`);
      }
    }
  }
  function d({ gen: m, parentData: g, parentDataProperty: $ }, _) {
    m.if((0, r._)`${g} !== undefined`, () => m.assign((0, r._)`${g}[${$}]`, _));
  }
  function p(m, g, $, _ = a.Correct) {
    const E = _ === a.Correct ? r.operators.EQ : r.operators.NEQ;
    let R;
    switch (m) {
      case "null":
        return (0, r._)`${g} ${E} null`;
      case "array":
        R = (0, r._)`Array.isArray(${g})`;
        break;
      case "object":
        R = (0, r._)`${g} && typeof ${g} == "object" && !Array.isArray(${g})`;
        break;
      case "integer":
        R = O((0, r._)`!(${g} % 1) && !isNaN(${g})`);
        break;
      case "number":
        R = O();
        break;
      default:
        return (0, r._)`typeof ${g} ${E} ${m}`;
    }
    return _ === a.Correct ? R : (0, r.not)(R);
    function O(M = r.nil) {
      return (0, r.and)((0, r._)`typeof ${g} == "number"`, M, $ ? (0, r._)`isFinite(${g})` : r.nil);
    }
  }
  fe.checkDataType = p;
  function v(m, g, $, _) {
    if (m.length === 1)
      return p(m[0], g, $, _);
    let E;
    const R = (0, o.toHash)(m);
    if (R.array && R.object) {
      const O = (0, r._)`typeof ${g} != "object"`;
      E = R.null ? O : (0, r._)`!${g} || ${O}`, delete R.null, delete R.array, delete R.object;
    } else
      E = r.nil;
    R.number && delete R.integer;
    for (const O in R)
      E = (0, r.and)(E, p(O, g, $, _));
    return E;
  }
  fe.checkDataTypes = v;
  const w = {
    message: ({ schema: m }) => `must be ${m}`,
    params: ({ schema: m, schemaValue: g }) => typeof m == "string" ? (0, r._)`{type: ${m}}` : (0, r._)`{type: ${g}}`
  };
  function h(m) {
    const g = y(m);
    (0, n.reportError)(g, w);
  }
  fe.reportTypeError = h;
  function y(m) {
    const { gen: g, data: $, schema: _ } = m, E = (0, o.schemaRefOrVal)(m, _, "type");
    return {
      gen: g,
      keyword: "type",
      data: $,
      schema: _.type,
      schemaCode: E,
      schemaValue: E,
      parentSchema: _,
      params: {},
      it: m
    };
  }
  return fe;
}
var dt = {}, Ei;
function Zu() {
  if (Ei) return dt;
  Ei = 1, Object.defineProperty(dt, "__esModule", { value: !0 }), dt.assignDefaults = void 0;
  const e = Z(), t = re();
  function n(o, a) {
    const { properties: s, items: u } = o.schema;
    if (a === "object" && s)
      for (const l in s)
        r(o, l, s[l].default);
    else a === "array" && Array.isArray(u) && u.forEach((l, c) => r(o, c, l.default));
  }
  dt.assignDefaults = n;
  function r(o, a, s) {
    const { gen: u, compositeRule: l, data: c, opts: i } = o;
    if (s === void 0)
      return;
    const f = (0, e._)`${c}${(0, e.getProperty)(a)}`;
    if (l) {
      (0, t.checkStrictMode)(o, `default is ignored for: ${f}`);
      return;
    }
    let d = (0, e._)`${f} === undefined`;
    i.useDefaults === "empty" && (d = (0, e._)`${d} || ${f} === null || ${f} === ""`), u.if(d, (0, e._)`${f} = ${(0, e.stringify)(s)}`);
  }
  return dt;
}
var Pe = {}, se = {}, bi;
function Ie() {
  if (bi) return se;
  bi = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.validateUnion = se.validateArray = se.usePattern = se.callValidateCode = se.schemaProperties = se.allSchemaProperties = se.noPropertyInData = se.propertyInData = se.isOwnProperty = se.hasPropFunc = se.reportMissingProp = se.checkMissingProp = se.checkReportMissingProp = void 0;
  const e = Z(), t = re(), n = Ne(), r = re();
  function o(m, g) {
    const { gen: $, data: _, it: E } = m;
    $.if(i($, _, g, E.opts.ownProperties), () => {
      m.setParams({ missingProperty: (0, e._)`${g}` }, !0), m.error();
    });
  }
  se.checkReportMissingProp = o;
  function a({ gen: m, data: g, it: { opts: $ } }, _, E) {
    return (0, e.or)(..._.map((R) => (0, e.and)(i(m, g, R, $.ownProperties), (0, e._)`${E} = ${R}`)));
  }
  se.checkMissingProp = a;
  function s(m, g) {
    m.setParams({ missingProperty: g }, !0), m.error();
  }
  se.reportMissingProp = s;
  function u(m) {
    return m.scopeValue("func", {
      // eslint-disable-next-line @typescript-eslint/unbound-method
      ref: Object.prototype.hasOwnProperty,
      code: (0, e._)`Object.prototype.hasOwnProperty`
    });
  }
  se.hasPropFunc = u;
  function l(m, g, $) {
    return (0, e._)`${u(m)}.call(${g}, ${$})`;
  }
  se.isOwnProperty = l;
  function c(m, g, $, _) {
    const E = (0, e._)`${g}${(0, e.getProperty)($)} !== undefined`;
    return _ ? (0, e._)`${E} && ${l(m, g, $)}` : E;
  }
  se.propertyInData = c;
  function i(m, g, $, _) {
    const E = (0, e._)`${g}${(0, e.getProperty)($)} === undefined`;
    return _ ? (0, e.or)(E, (0, e.not)(l(m, g, $))) : E;
  }
  se.noPropertyInData = i;
  function f(m) {
    return m ? Object.keys(m).filter((g) => g !== "__proto__") : [];
  }
  se.allSchemaProperties = f;
  function d(m, g) {
    return f(g).filter(($) => !(0, t.alwaysValidSchema)(m, g[$]));
  }
  se.schemaProperties = d;
  function p({ schemaCode: m, data: g, it: { gen: $, topSchemaRef: _, schemaPath: E, errorPath: R }, it: O }, M, L, k) {
    const z = k ? (0, e._)`${m}, ${g}, ${_}${E}` : g, K = [
      [n.default.instancePath, (0, e.strConcat)(n.default.instancePath, R)],
      [n.default.parentData, O.parentData],
      [n.default.parentDataProperty, O.parentDataProperty],
      [n.default.rootData, n.default.rootData]
    ];
    O.opts.dynamicRef && K.push([n.default.dynamicAnchors, n.default.dynamicAnchors]);
    const A = (0, e._)`${z}, ${$.object(...K)}`;
    return L !== e.nil ? (0, e._)`${M}.call(${L}, ${A})` : (0, e._)`${M}(${A})`;
  }
  se.callValidateCode = p;
  const v = (0, e._)`new RegExp`;
  function w({ gen: m, it: { opts: g } }, $) {
    const _ = g.unicodeRegExp ? "u" : "", { regExp: E } = g.code, R = E($, _);
    return m.scopeValue("pattern", {
      key: R.toString(),
      ref: R,
      code: (0, e._)`${E.code === "new RegExp" ? v : (0, r.useFunc)(m, E)}(${$}, ${_})`
    });
  }
  se.usePattern = w;
  function h(m) {
    const { gen: g, data: $, keyword: _, it: E } = m, R = g.name("valid");
    if (E.allErrors) {
      const M = g.let("valid", !0);
      return O(() => g.assign(M, !1)), M;
    }
    return g.var(R, !0), O(() => g.break()), R;
    function O(M) {
      const L = g.const("len", (0, e._)`${$}.length`);
      g.forRange("i", 0, L, (k) => {
        m.subschema({
          keyword: _,
          dataProp: k,
          dataPropType: t.Type.Num
        }, R), g.if((0, e.not)(R), M);
      });
    }
  }
  se.validateArray = h;
  function y(m) {
    const { gen: g, schema: $, keyword: _, it: E } = m;
    if (!Array.isArray($))
      throw new Error("ajv implementation error");
    if ($.some((L) => (0, t.alwaysValidSchema)(E, L)) && !E.opts.unevaluated)
      return;
    const O = g.let("valid", !1), M = g.name("_valid");
    g.block(() => $.forEach((L, k) => {
      const z = m.subschema({
        keyword: _,
        schemaProp: k,
        compositeRule: !0
      }, M);
      g.assign(O, (0, e._)`${O} || ${M}`), m.mergeValidEvaluated(z, M) || g.if((0, e.not)(O));
    })), m.result(O, () => m.reset(), () => m.error(!0));
  }
  return se.validateUnion = y, se;
}
var Si;
function Qu() {
  if (Si) return Pe;
  Si = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.validateKeywordUsage = Pe.validSchemaType = Pe.funcKeywordCode = Pe.macroKeywordCode = void 0;
  const e = Z(), t = Ne(), n = Ie(), r = Zr();
  function o(d, p) {
    const { gen: v, keyword: w, schema: h, parentSchema: y, it: m } = d, g = p.macro.call(m.self, h, y, m), $ = c(v, w, g);
    m.opts.validateSchema !== !1 && m.self.validateSchema(g, !0);
    const _ = v.name("valid");
    d.subschema({
      schema: g,
      schemaPath: e.nil,
      errSchemaPath: `${m.errSchemaPath}/${w}`,
      topSchemaRef: $,
      compositeRule: !0
    }, _), d.pass(_, () => d.error(!0));
  }
  Pe.macroKeywordCode = o;
  function a(d, p) {
    var v;
    const { gen: w, keyword: h, schema: y, parentSchema: m, $data: g, it: $ } = d;
    l($, p);
    const _ = !g && p.compile ? p.compile.call($.self, y, m, $) : p.validate, E = c(w, h, _), R = w.let("valid");
    d.block$data(R, O), d.ok((v = p.valid) !== null && v !== void 0 ? v : R);
    function O() {
      if (p.errors === !1)
        k(), p.modifying && s(d), z(() => d.error());
      else {
        const K = p.async ? M() : L();
        p.modifying && s(d), z(() => u(d, K));
      }
    }
    function M() {
      const K = w.let("ruleErrs", null);
      return w.try(() => k((0, e._)`await `), (A) => w.assign(R, !1).if((0, e._)`${A} instanceof ${$.ValidationError}`, () => w.assign(K, (0, e._)`${A}.errors`), () => w.throw(A))), K;
    }
    function L() {
      const K = (0, e._)`${E}.errors`;
      return w.assign(K, null), k(e.nil), K;
    }
    function k(K = p.async ? (0, e._)`await ` : e.nil) {
      const A = $.opts.passContext ? t.default.this : t.default.self, F = !("compile" in p && !g || p.schema === !1);
      w.assign(R, (0, e._)`${K}${(0, n.callValidateCode)(d, E, A, F)}`, p.modifying);
    }
    function z(K) {
      var A;
      w.if((0, e.not)((A = p.valid) !== null && A !== void 0 ? A : R), K);
    }
  }
  Pe.funcKeywordCode = a;
  function s(d) {
    const { gen: p, data: v, it: w } = d;
    p.if(w.parentData, () => p.assign(v, (0, e._)`${w.parentData}[${w.parentDataProperty}]`));
  }
  function u(d, p) {
    const { gen: v } = d;
    v.if((0, e._)`Array.isArray(${p})`, () => {
      v.assign(t.default.vErrors, (0, e._)`${t.default.vErrors} === null ? ${p} : ${t.default.vErrors}.concat(${p})`).assign(t.default.errors, (0, e._)`${t.default.vErrors}.length`), (0, r.extendErrors)(d);
    }, () => d.error());
  }
  function l({ schemaEnv: d }, p) {
    if (p.async && !d.$async)
      throw new Error("async keyword in sync schema");
  }
  function c(d, p, v) {
    if (v === void 0)
      throw new Error(`keyword "${p}" failed to compile`);
    return d.scopeValue("keyword", typeof v == "function" ? { ref: v } : { ref: v, code: (0, e.stringify)(v) });
  }
  function i(d, p, v = !1) {
    return !p.length || p.some((w) => w === "array" ? Array.isArray(d) : w === "object" ? d && typeof d == "object" && !Array.isArray(d) : typeof d == w || v && typeof d > "u");
  }
  Pe.validSchemaType = i;
  function f({ schema: d, opts: p, self: v, errSchemaPath: w }, h, y) {
    if (Array.isArray(h.keyword) ? !h.keyword.includes(y) : h.keyword !== y)
      throw new Error("ajv implementation error");
    const m = h.dependencies;
    if (m?.some((g) => !Object.prototype.hasOwnProperty.call(d, g)))
      throw new Error(`parent schema must have dependencies of ${y}: ${m.join(",")}`);
    if (h.validateSchema && !h.validateSchema(d[y])) {
      const $ = `keyword "${y}" value is invalid at path "${w}": ` + v.errorsText(h.validateSchema.errors);
      if (p.validateSchema === "log")
        v.logger.error($);
      else
        throw new Error($);
    }
  }
  return Pe.validateKeywordUsage = f, Pe;
}
var qe = {}, Ri;
function el() {
  if (Ri) return qe;
  Ri = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.extendSubschemaMode = qe.extendSubschemaData = qe.getSubschema = void 0;
  const e = Z(), t = re();
  function n(a, { keyword: s, schemaProp: u, schema: l, schemaPath: c, errSchemaPath: i, topSchemaRef: f }) {
    if (s !== void 0 && l !== void 0)
      throw new Error('both "keyword" and "schema" passed, only one allowed');
    if (s !== void 0) {
      const d = a.schema[s];
      return u === void 0 ? {
        schema: d,
        schemaPath: (0, e._)`${a.schemaPath}${(0, e.getProperty)(s)}`,
        errSchemaPath: `${a.errSchemaPath}/${s}`
      } : {
        schema: d[u],
        schemaPath: (0, e._)`${a.schemaPath}${(0, e.getProperty)(s)}${(0, e.getProperty)(u)}`,
        errSchemaPath: `${a.errSchemaPath}/${s}/${(0, t.escapeFragment)(u)}`
      };
    }
    if (l !== void 0) {
      if (c === void 0 || i === void 0 || f === void 0)
        throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
      return {
        schema: l,
        schemaPath: c,
        topSchemaRef: f,
        errSchemaPath: i
      };
    }
    throw new Error('either "keyword" or "schema" must be passed');
  }
  qe.getSubschema = n;
  function r(a, s, { dataProp: u, dataPropType: l, data: c, dataTypes: i, propertyName: f }) {
    if (c !== void 0 && u !== void 0)
      throw new Error('both "data" and "dataProp" passed, only one allowed');
    const { gen: d } = s;
    if (u !== void 0) {
      const { errorPath: v, dataPathArr: w, opts: h } = s, y = d.let("data", (0, e._)`${s.data}${(0, e.getProperty)(u)}`, !0);
      p(y), a.errorPath = (0, e.str)`${v}${(0, t.getErrorPath)(u, l, h.jsPropertySyntax)}`, a.parentDataProperty = (0, e._)`${u}`, a.dataPathArr = [...w, a.parentDataProperty];
    }
    if (c !== void 0) {
      const v = c instanceof e.Name ? c : d.let("data", c, !0);
      p(v), f !== void 0 && (a.propertyName = f);
    }
    i && (a.dataTypes = i);
    function p(v) {
      a.data = v, a.dataLevel = s.dataLevel + 1, a.dataTypes = [], s.definedProperties = /* @__PURE__ */ new Set(), a.parentData = s.data, a.dataNames = [...s.dataNames, v];
    }
  }
  qe.extendSubschemaData = r;
  function o(a, { jtdDiscriminator: s, jtdMetadata: u, compositeRule: l, createErrors: c, allErrors: i }) {
    l !== void 0 && (a.compositeRule = l), c !== void 0 && (a.createErrors = c), i !== void 0 && (a.allErrors = i), a.jtdDiscriminator = s, a.jtdMetadata = u;
  }
  return qe.extendSubschemaMode = o, qe;
}
var ge = {}, Pn, Pi;
function Nc() {
  return Pi || (Pi = 1, Pn = function e(t, n) {
    if (t === n) return !0;
    if (t && n && typeof t == "object" && typeof n == "object") {
      if (t.constructor !== n.constructor) return !1;
      var r, o, a;
      if (Array.isArray(t)) {
        if (r = t.length, r != n.length) return !1;
        for (o = r; o-- !== 0; )
          if (!e(t[o], n[o])) return !1;
        return !0;
      }
      if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
      if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
      if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
      if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
      for (o = r; o-- !== 0; )
        if (!Object.prototype.hasOwnProperty.call(n, a[o])) return !1;
      for (o = r; o-- !== 0; ) {
        var s = a[o];
        if (!e(t[s], n[s])) return !1;
      }
      return !0;
    }
    return t !== t && n !== n;
  }), Pn;
}
var On = { exports: {} }, Oi;
function tl() {
  if (Oi) return On.exports;
  Oi = 1;
  var e = On.exports = function(r, o, a) {
    typeof o == "function" && (a = o, o = {}), a = o.cb || a;
    var s = typeof a == "function" ? a : a.pre || function() {
    }, u = a.post || function() {
    };
    t(o, s, u, r, "", r);
  };
  e.keywords = {
    additionalItems: !0,
    items: !0,
    contains: !0,
    additionalProperties: !0,
    propertyNames: !0,
    not: !0,
    if: !0,
    then: !0,
    else: !0
  }, e.arrayKeywords = {
    items: !0,
    allOf: !0,
    anyOf: !0,
    oneOf: !0
  }, e.propsKeywords = {
    $defs: !0,
    definitions: !0,
    properties: !0,
    patternProperties: !0,
    dependencies: !0
  }, e.skipKeywords = {
    default: !0,
    enum: !0,
    const: !0,
    required: !0,
    maximum: !0,
    minimum: !0,
    exclusiveMaximum: !0,
    exclusiveMinimum: !0,
    multipleOf: !0,
    maxLength: !0,
    minLength: !0,
    pattern: !0,
    format: !0,
    maxItems: !0,
    minItems: !0,
    uniqueItems: !0,
    maxProperties: !0,
    minProperties: !0
  };
  function t(r, o, a, s, u, l, c, i, f, d) {
    if (s && typeof s == "object" && !Array.isArray(s)) {
      o(s, u, l, c, i, f, d);
      for (var p in s) {
        var v = s[p];
        if (Array.isArray(v)) {
          if (p in e.arrayKeywords)
            for (var w = 0; w < v.length; w++)
              t(r, o, a, v[w], u + "/" + p + "/" + w, l, u, p, s, w);
        } else if (p in e.propsKeywords) {
          if (v && typeof v == "object")
            for (var h in v)
              t(r, o, a, v[h], u + "/" + p + "/" + n(h), l, u, p, s, h);
        } else (p in e.keywords || r.allKeys && !(p in e.skipKeywords)) && t(r, o, a, v, u + "/" + p, l, u, p, s);
      }
      a(s, u, l, c, i, f, d);
    }
  }
  function n(r) {
    return r.replace(/~/g, "~0").replace(/\//g, "~1");
  }
  return On.exports;
}
var Ni;
function Qr() {
  if (Ni) return ge;
  Ni = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.getSchemaRefs = ge.resolveUrl = ge.normalizeId = ge._getFullPath = ge.getFullPath = ge.inlineRef = void 0;
  const e = re(), t = Nc(), n = tl(), r = /* @__PURE__ */ new Set([
    "type",
    "format",
    "pattern",
    "maxLength",
    "minLength",
    "maxProperties",
    "minProperties",
    "maxItems",
    "minItems",
    "maximum",
    "minimum",
    "uniqueItems",
    "multipleOf",
    "required",
    "enum",
    "const"
  ]);
  function o(w, h = !0) {
    return typeof w == "boolean" ? !0 : h === !0 ? !s(w) : h ? u(w) <= h : !1;
  }
  ge.inlineRef = o;
  const a = /* @__PURE__ */ new Set([
    "$ref",
    "$recursiveRef",
    "$recursiveAnchor",
    "$dynamicRef",
    "$dynamicAnchor"
  ]);
  function s(w) {
    for (const h in w) {
      if (a.has(h))
        return !0;
      const y = w[h];
      if (Array.isArray(y) && y.some(s) || typeof y == "object" && s(y))
        return !0;
    }
    return !1;
  }
  function u(w) {
    let h = 0;
    for (const y in w) {
      if (y === "$ref")
        return 1 / 0;
      if (h++, !r.has(y) && (typeof w[y] == "object" && (0, e.eachItem)(w[y], (m) => h += u(m)), h === 1 / 0))
        return 1 / 0;
    }
    return h;
  }
  function l(w, h = "", y) {
    y !== !1 && (h = f(h));
    const m = w.parse(h);
    return c(w, m);
  }
  ge.getFullPath = l;
  function c(w, h) {
    return w.serialize(h).split("#")[0] + "#";
  }
  ge._getFullPath = c;
  const i = /#\/?$/;
  function f(w) {
    return w ? w.replace(i, "") : "";
  }
  ge.normalizeId = f;
  function d(w, h, y) {
    return y = f(y), w.resolve(h, y);
  }
  ge.resolveUrl = d;
  const p = /^[a-z_][-a-z0-9._]*$/i;
  function v(w, h) {
    if (typeof w == "boolean")
      return {};
    const { schemaId: y, uriResolver: m } = this.opts, g = f(w[y] || h), $ = { "": g }, _ = l(m, g, !1), E = {}, R = /* @__PURE__ */ new Set();
    return n(w, { allKeys: !0 }, (L, k, z, K) => {
      if (K === void 0)
        return;
      const A = _ + k;
      let F = $[K];
      typeof L[y] == "string" && (F = X.call(this, L[y])), G.call(this, L.$anchor), G.call(this, L.$dynamicAnchor), $[k] = F;
      function X(x) {
        const H = this.opts.uriResolver.resolve;
        if (x = f(F ? H(F, x) : x), R.has(x))
          throw M(x);
        R.add(x);
        let D = this.refs[x];
        return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? O(L, D.schema, x) : x !== f(A) && (x[0] === "#" ? (O(L, E[x], x), E[x] = L) : this.refs[x] = A), x;
      }
      function G(x) {
        if (typeof x == "string") {
          if (!p.test(x))
            throw new Error(`invalid anchor "${x}"`);
          X.call(this, `#${x}`);
        }
      }
    }), E;
    function O(L, k, z) {
      if (k !== void 0 && !t(L, k))
        throw M(z);
    }
    function M(L) {
      return new Error(`reference "${L}" resolves to more than one schema`);
    }
  }
  return ge.getSchemaRefs = v, ge;
}
var Ii;
function Ct() {
  if (Ii) return Ae;
  Ii = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.getData = Ae.KeywordCxt = Ae.validateFunctionCode = void 0;
  const e = Ju(), t = Kr(), n = Oc(), r = Kr(), o = Zu(), a = Qu(), s = el(), u = Z(), l = Ne(), c = Qr(), i = re(), f = Zr();
  function d(P) {
    if (_(P) && (R(P), $(P))) {
      h(P);
      return;
    }
    p(P, () => (0, e.topBoolOrEmptySchema)(P));
  }
  Ae.validateFunctionCode = d;
  function p({ gen: P, validateName: T, schema: q, schemaEnv: B, opts: U }, ee) {
    U.code.es5 ? P.func(T, (0, u._)`${l.default.data}, ${l.default.valCxt}`, B.$async, () => {
      P.code((0, u._)`"use strict"; ${m(q, U)}`), w(P, U), P.code(ee);
    }) : P.func(T, (0, u._)`${l.default.data}, ${v(U)}`, B.$async, () => P.code(m(q, U)).code(ee));
  }
  function v(P) {
    return (0, u._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${P.dynamicRef ? (0, u._)`, ${l.default.dynamicAnchors}={}` : u.nil}}={}`;
  }
  function w(P, T) {
    P.if(l.default.valCxt, () => {
      P.var(l.default.instancePath, (0, u._)`${l.default.valCxt}.${l.default.instancePath}`), P.var(l.default.parentData, (0, u._)`${l.default.valCxt}.${l.default.parentData}`), P.var(l.default.parentDataProperty, (0, u._)`${l.default.valCxt}.${l.default.parentDataProperty}`), P.var(l.default.rootData, (0, u._)`${l.default.valCxt}.${l.default.rootData}`), T.dynamicRef && P.var(l.default.dynamicAnchors, (0, u._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);
    }, () => {
      P.var(l.default.instancePath, (0, u._)`""`), P.var(l.default.parentData, (0, u._)`undefined`), P.var(l.default.parentDataProperty, (0, u._)`undefined`), P.var(l.default.rootData, l.default.data), T.dynamicRef && P.var(l.default.dynamicAnchors, (0, u._)`{}`);
    });
  }
  function h(P) {
    const { schema: T, opts: q, gen: B } = P;
    p(P, () => {
      q.$comment && T.$comment && K(P), L(P), B.let(l.default.vErrors, null), B.let(l.default.errors, 0), q.unevaluated && y(P), O(P), A(P);
    });
  }
  function y(P) {
    const { gen: T, validateName: q } = P;
    P.evaluated = T.const("evaluated", (0, u._)`${q}.evaluated`), T.if((0, u._)`${P.evaluated}.dynamicProps`, () => T.assign((0, u._)`${P.evaluated}.props`, (0, u._)`undefined`)), T.if((0, u._)`${P.evaluated}.dynamicItems`, () => T.assign((0, u._)`${P.evaluated}.items`, (0, u._)`undefined`));
  }
  function m(P, T) {
    const q = typeof P == "object" && P[T.schemaId];
    return q && (T.code.source || T.code.process) ? (0, u._)`/*# sourceURL=${q} */` : u.nil;
  }
  function g(P, T) {
    if (_(P) && (R(P), $(P))) {
      E(P, T);
      return;
    }
    (0, e.boolOrEmptySchema)(P, T);
  }
  function $({ schema: P, self: T }) {
    if (typeof P == "boolean")
      return !P;
    for (const q in P)
      if (T.RULES.all[q])
        return !0;
    return !1;
  }
  function _(P) {
    return typeof P.schema != "boolean";
  }
  function E(P, T) {
    const { schema: q, gen: B, opts: U } = P;
    U.$comment && q.$comment && K(P), k(P), z(P);
    const ee = B.const("_errs", l.default.errors);
    O(P, ee), B.var(T, (0, u._)`${ee} === ${l.default.errors}`);
  }
  function R(P) {
    (0, i.checkUnknownRules)(P), M(P);
  }
  function O(P, T) {
    if (P.opts.jtd)
      return X(P, [], !1, T);
    const q = (0, t.getSchemaTypes)(P.schema), B = (0, t.coerceAndCheckDataType)(P, q);
    X(P, q, !B, T);
  }
  function M(P) {
    const { schema: T, errSchemaPath: q, opts: B, self: U } = P;
    T.$ref && B.ignoreKeywordsWithRef && (0, i.schemaHasRulesButRef)(T, U.RULES) && U.logger.warn(`$ref: keywords ignored in schema at path "${q}"`);
  }
  function L(P) {
    const { schema: T, opts: q } = P;
    T.default !== void 0 && q.useDefaults && q.strictSchema && (0, i.checkStrictMode)(P, "default is ignored in the schema root");
  }
  function k(P) {
    const T = P.schema[P.opts.schemaId];
    T && (P.baseId = (0, c.resolveUrl)(P.opts.uriResolver, P.baseId, T));
  }
  function z(P) {
    if (P.schema.$async && !P.schemaEnv.$async)
      throw new Error("async schema in sync schema");
  }
  function K({ gen: P, schemaEnv: T, schema: q, errSchemaPath: B, opts: U }) {
    const ee = q.$comment;
    if (U.$comment === !0)
      P.code((0, u._)`${l.default.self}.logger.log(${ee})`);
    else if (typeof U.$comment == "function") {
      const ue = (0, u.str)`${B}/$comment`, Re = P.scopeValue("root", { ref: T.root });
      P.code((0, u._)`${l.default.self}.opts.$comment(${ee}, ${ue}, ${Re}.schema)`);
    }
  }
  function A(P) {
    const { gen: T, schemaEnv: q, validateName: B, ValidationError: U, opts: ee } = P;
    q.$async ? T.if((0, u._)`${l.default.errors} === 0`, () => T.return(l.default.data), () => T.throw((0, u._)`new ${U}(${l.default.vErrors})`)) : (T.assign((0, u._)`${B}.errors`, l.default.vErrors), ee.unevaluated && F(P), T.return((0, u._)`${l.default.errors} === 0`));
  }
  function F({ gen: P, evaluated: T, props: q, items: B }) {
    q instanceof u.Name && P.assign((0, u._)`${T}.props`, q), B instanceof u.Name && P.assign((0, u._)`${T}.items`, B);
  }
  function X(P, T, q, B) {
    const { gen: U, schema: ee, data: ue, allErrors: Re, opts: _e, self: we } = P, { RULES: le } = we;
    if (ee.$ref && (_e.ignoreKeywordsWithRef || !(0, i.schemaHasRulesButRef)(ee, le))) {
      U.block(() => V(P, "$ref", le.all.$ref.definition));
      return;
    }
    _e.jtd || x(P, T), U.block(() => {
      for (const be of le.rules)
        Je(be);
      Je(le.post);
    });
    function Je(be) {
      (0, n.shouldUseGroup)(ee, be) && (be.type ? (U.if((0, r.checkDataType)(be.type, ue, _e.strictNumbers)), G(P, be), T.length === 1 && T[0] === be.type && q && (U.else(), (0, r.reportTypeError)(P)), U.endIf()) : G(P, be), Re || U.if((0, u._)`${l.default.errors} === ${B || 0}`));
    }
  }
  function G(P, T) {
    const { gen: q, schema: B, opts: { useDefaults: U } } = P;
    U && (0, o.assignDefaults)(P, T.type), q.block(() => {
      for (const ee of T.rules)
        (0, n.shouldUseRule)(B, ee) && V(P, ee.keyword, ee.definition, T.type);
    });
  }
  function x(P, T) {
    P.schemaEnv.meta || !P.opts.strictTypes || (H(P, T), P.opts.allowUnionTypes || D(P, T), N(P, P.dataTypes));
  }
  function H(P, T) {
    if (T.length) {
      if (!P.dataTypes.length) {
        P.dataTypes = T;
        return;
      }
      T.forEach((q) => {
        I(P.dataTypes, q) || S(P, `type "${q}" not allowed by context "${P.dataTypes.join(",")}"`);
      }), b(P, T);
    }
  }
  function D(P, T) {
    T.length > 1 && !(T.length === 2 && T.includes("null")) && S(P, "use allowUnionTypes to allow union type keyword");
  }
  function N(P, T) {
    const q = P.self.RULES.all;
    for (const B in q) {
      const U = q[B];
      if (typeof U == "object" && (0, n.shouldUseRule)(P.schema, U)) {
        const { type: ee } = U.definition;
        ee.length && !ee.some((ue) => j(T, ue)) && S(P, `missing type "${ee.join(",")}" for keyword "${B}"`);
      }
    }
  }
  function j(P, T) {
    return P.includes(T) || T === "number" && P.includes("integer");
  }
  function I(P, T) {
    return P.includes(T) || T === "integer" && P.includes("number");
  }
  function b(P, T) {
    const q = [];
    for (const B of P.dataTypes)
      I(T, B) ? q.push(B) : T.includes("integer") && B === "number" && q.push("integer");
    P.dataTypes = q;
  }
  function S(P, T) {
    const q = P.schemaEnv.baseId + P.errSchemaPath;
    T += ` at "${q}" (strictTypes)`, (0, i.checkStrictMode)(P, T, P.opts.strictTypes);
  }
  class C {
    constructor(T, q, B) {
      if ((0, a.validateKeywordUsage)(T, q, B), this.gen = T.gen, this.allErrors = T.allErrors, this.keyword = B, this.data = T.data, this.schema = T.schema[B], this.$data = q.$data && T.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, i.schemaRefOrVal)(T, this.schema, B, this.$data), this.schemaType = q.schemaType, this.parentSchema = T.schema, this.params = {}, this.it = T, this.def = q, this.$data)
        this.schemaCode = T.gen.const("vSchema", Y(this.$data, T));
      else if (this.schemaCode = this.schemaValue, !(0, a.validSchemaType)(this.schema, q.schemaType, q.allowUndefined))
        throw new Error(`${B} value must be ${JSON.stringify(q.schemaType)}`);
      ("code" in q ? q.trackErrors : q.errors !== !1) && (this.errsCount = T.gen.const("_errs", l.default.errors));
    }
    result(T, q, B) {
      this.failResult((0, u.not)(T), q, B);
    }
    failResult(T, q, B) {
      this.gen.if(T), B ? B() : this.error(), q ? (this.gen.else(), q(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
    }
    pass(T, q) {
      this.failResult((0, u.not)(T), void 0, q);
    }
    fail(T) {
      if (T === void 0) {
        this.error(), this.allErrors || this.gen.if(!1);
        return;
      }
      this.gen.if(T), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
    }
    fail$data(T) {
      if (!this.$data)
        return this.fail(T);
      const { schemaCode: q } = this;
      this.fail((0, u._)`${q} !== undefined && (${(0, u.or)(this.invalid$data(), T)})`);
    }
    error(T, q, B) {
      if (q) {
        this.setParams(q), this._error(T, B), this.setParams({});
        return;
      }
      this._error(T, B);
    }
    _error(T, q) {
      (T ? f.reportExtraError : f.reportError)(this, this.def.error, q);
    }
    $dataError() {
      (0, f.reportError)(this, this.def.$dataError || f.keyword$DataError);
    }
    reset() {
      if (this.errsCount === void 0)
        throw new Error('add "trackErrors" to keyword definition');
      (0, f.resetErrorsCount)(this.gen, this.errsCount);
    }
    ok(T) {
      this.allErrors || this.gen.if(T);
    }
    setParams(T, q) {
      q ? Object.assign(this.params, T) : this.params = T;
    }
    block$data(T, q, B = u.nil) {
      this.gen.block(() => {
        this.check$data(T, B), q();
      });
    }
    check$data(T = u.nil, q = u.nil) {
      if (!this.$data)
        return;
      const { gen: B, schemaCode: U, schemaType: ee, def: ue } = this;
      B.if((0, u.or)((0, u._)`${U} === undefined`, q)), T !== u.nil && B.assign(T, !0), (ee.length || ue.validateSchema) && (B.elseIf(this.invalid$data()), this.$dataError(), T !== u.nil && B.assign(T, !1)), B.else();
    }
    invalid$data() {
      const { gen: T, schemaCode: q, schemaType: B, def: U, it: ee } = this;
      return (0, u.or)(ue(), Re());
      function ue() {
        if (B.length) {
          if (!(q instanceof u.Name))
            throw new Error("ajv implementation error");
          const _e = Array.isArray(B) ? B : [B];
          return (0, u._)`${(0, r.checkDataTypes)(_e, q, ee.opts.strictNumbers, r.DataType.Wrong)}`;
        }
        return u.nil;
      }
      function Re() {
        if (U.validateSchema) {
          const _e = T.scopeValue("validate$data", { ref: U.validateSchema });
          return (0, u._)`!${_e}(${q})`;
        }
        return u.nil;
      }
    }
    subschema(T, q) {
      const B = (0, s.getSubschema)(this.it, T);
      (0, s.extendSubschemaData)(B, this.it, T), (0, s.extendSubschemaMode)(B, T);
      const U = { ...this.it, ...B, items: void 0, props: void 0 };
      return g(U, q), U;
    }
    mergeEvaluated(T, q) {
      const { it: B, gen: U } = this;
      B.opts.unevaluated && (B.props !== !0 && T.props !== void 0 && (B.props = i.mergeEvaluated.props(U, T.props, B.props, q)), B.items !== !0 && T.items !== void 0 && (B.items = i.mergeEvaluated.items(U, T.items, B.items, q)));
    }
    mergeValidEvaluated(T, q) {
      const { it: B, gen: U } = this;
      if (B.opts.unevaluated && (B.props !== !0 || B.items !== !0))
        return U.if(q, () => this.mergeEvaluated(T, u.Name)), !0;
    }
  }
  Ae.KeywordCxt = C;
  function V(P, T, q, B) {
    const U = new C(P, q, T);
    "code" in q ? q.code(U, B) : U.$data && q.validate ? (0, a.funcKeywordCode)(U, q) : "macro" in q ? (0, a.macroKeywordCode)(U, q) : (q.compile || q.validate) && (0, a.funcKeywordCode)(U, q);
  }
  const W = /^\/(?:[^~]|~0|~1)*$/, J = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
  function Y(P, { dataLevel: T, dataNames: q, dataPathArr: B }) {
    let U, ee;
    if (P === "")
      return l.default.rootData;
    if (P[0] === "/") {
      if (!W.test(P))
        throw new Error(`Invalid JSON-pointer: ${P}`);
      U = P, ee = l.default.rootData;
    } else {
      const we = J.exec(P);
      if (!we)
        throw new Error(`Invalid JSON-pointer: ${P}`);
      const le = +we[1];
      if (U = we[2], U === "#") {
        if (le >= T)
          throw new Error(_e("property/index", le));
        return B[T - le];
      }
      if (le > T)
        throw new Error(_e("data", le));
      if (ee = q[T - le], !U)
        return ee;
    }
    let ue = ee;
    const Re = U.split("/");
    for (const we of Re)
      we && (ee = (0, u._)`${ee}${(0, u.getProperty)((0, i.unescapeJsonPointer)(we))}`, ue = (0, u._)`${ue} && ${ee}`);
    return ue;
    function _e(we, le) {
      return `Cannot access ${we} ${le} levels up, current level is ${T}`;
    }
  }
  return Ae.getData = Y, Ae;
}
var Ft = {}, Ti;
function en() {
  if (Ti) return Ft;
  Ti = 1, Object.defineProperty(Ft, "__esModule", { value: !0 });
  class e extends Error {
    constructor(n) {
      super("validation failed"), this.errors = n, this.ajv = this.validation = !0;
    }
  }
  return Ft.default = e, Ft;
}
var Bt = {}, Ci;
function jt() {
  if (Ci) return Bt;
  Ci = 1, Object.defineProperty(Bt, "__esModule", { value: !0 });
  const e = Qr();
  class t extends Error {
    constructor(r, o, a, s) {
      super(s || `can't resolve reference ${a} from id ${o}`), this.missingRef = (0, e.resolveUrl)(r, o, a), this.missingSchema = (0, e.normalizeId)((0, e.getFullPath)(r, this.missingRef));
    }
  }
  return Bt.default = t, Bt;
}
var Ee = {}, ji;
function tn() {
  if (ji) return Ee;
  ji = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.resolveSchema = Ee.getCompilingSchema = Ee.resolveRef = Ee.compileSchema = Ee.SchemaEnv = void 0;
  const e = Z(), t = en(), n = Ne(), r = Qr(), o = re(), a = Ct();
  class s {
    constructor(y) {
      var m;
      this.refs = {}, this.dynamicAnchors = {};
      let g;
      typeof y.schema == "object" && (g = y.schema), this.schema = y.schema, this.schemaId = y.schemaId, this.root = y.root || this, this.baseId = (m = y.baseId) !== null && m !== void 0 ? m : (0, r.normalizeId)(g?.[y.schemaId || "$id"]), this.schemaPath = y.schemaPath, this.localRefs = y.localRefs, this.meta = y.meta, this.$async = g?.$async, this.refs = {};
    }
  }
  Ee.SchemaEnv = s;
  function u(h) {
    const y = i.call(this, h);
    if (y)
      return y;
    const m = (0, r.getFullPath)(this.opts.uriResolver, h.root.baseId), { es5: g, lines: $ } = this.opts.code, { ownProperties: _ } = this.opts, E = new e.CodeGen(this.scope, { es5: g, lines: $, ownProperties: _ });
    let R;
    h.$async && (R = E.scopeValue("Error", {
      ref: t.default,
      code: (0, e._)`require("ajv/dist/runtime/validation_error").default`
    }));
    const O = E.scopeName("validate");
    h.validateName = O;
    const M = {
      gen: E,
      allErrors: this.opts.allErrors,
      data: n.default.data,
      parentData: n.default.parentData,
      parentDataProperty: n.default.parentDataProperty,
      dataNames: [n.default.data],
      dataPathArr: [e.nil],
      // TODO can its length be used as dataLevel if nil is removed?
      dataLevel: 0,
      dataTypes: [],
      definedProperties: /* @__PURE__ */ new Set(),
      topSchemaRef: E.scopeValue("schema", this.opts.code.source === !0 ? { ref: h.schema, code: (0, e.stringify)(h.schema) } : { ref: h.schema }),
      validateName: O,
      ValidationError: R,
      schema: h.schema,
      schemaEnv: h,
      rootId: m,
      baseId: h.baseId || m,
      schemaPath: e.nil,
      errSchemaPath: h.schemaPath || (this.opts.jtd ? "" : "#"),
      errorPath: (0, e._)`""`,
      opts: this.opts,
      self: this
    };
    let L;
    try {
      this._compilations.add(h), (0, a.validateFunctionCode)(M), E.optimize(this.opts.code.optimize);
      const k = E.toString();
      L = `${E.scopeRefs(n.default.scope)}return ${k}`, this.opts.code.process && (L = this.opts.code.process(L, h));
      const K = new Function(`${n.default.self}`, `${n.default.scope}`, L)(this, this.scope.get());
      if (this.scope.value(O, { ref: K }), K.errors = null, K.schema = h.schema, K.schemaEnv = h, h.$async && (K.$async = !0), this.opts.code.source === !0 && (K.source = { validateName: O, validateCode: k, scopeValues: E._values }), this.opts.unevaluated) {
        const { props: A, items: F } = M;
        K.evaluated = {
          props: A instanceof e.Name ? void 0 : A,
          items: F instanceof e.Name ? void 0 : F,
          dynamicProps: A instanceof e.Name,
          dynamicItems: F instanceof e.Name
        }, K.source && (K.source.evaluated = (0, e.stringify)(K.evaluated));
      }
      return h.validate = K, h;
    } catch (k) {
      throw delete h.validate, delete h.validateName, L && this.logger.error("Error compiling schema, function code:", L), k;
    } finally {
      this._compilations.delete(h);
    }
  }
  Ee.compileSchema = u;
  function l(h, y, m) {
    var g;
    m = (0, r.resolveUrl)(this.opts.uriResolver, y, m);
    const $ = h.refs[m];
    if ($)
      return $;
    let _ = d.call(this, h, m);
    if (_ === void 0) {
      const E = (g = h.localRefs) === null || g === void 0 ? void 0 : g[m], { schemaId: R } = this.opts;
      E && (_ = new s({ schema: E, schemaId: R, root: h, baseId: y }));
    }
    if (_ !== void 0)
      return h.refs[m] = c.call(this, _);
  }
  Ee.resolveRef = l;
  function c(h) {
    return (0, r.inlineRef)(h.schema, this.opts.inlineRefs) ? h.schema : h.validate ? h : u.call(this, h);
  }
  function i(h) {
    for (const y of this._compilations)
      if (f(y, h))
        return y;
  }
  Ee.getCompilingSchema = i;
  function f(h, y) {
    return h.schema === y.schema && h.root === y.root && h.baseId === y.baseId;
  }
  function d(h, y) {
    let m;
    for (; typeof (m = this.refs[y]) == "string"; )
      y = m;
    return m || this.schemas[y] || p.call(this, h, y);
  }
  function p(h, y) {
    const m = this.opts.uriResolver.parse(y), g = (0, r._getFullPath)(this.opts.uriResolver, m);
    let $ = (0, r.getFullPath)(this.opts.uriResolver, h.baseId, void 0);
    if (Object.keys(h.schema).length > 0 && g === $)
      return w.call(this, m, h);
    const _ = (0, r.normalizeId)(g), E = this.refs[_] || this.schemas[_];
    if (typeof E == "string") {
      const R = p.call(this, h, E);
      return typeof R?.schema != "object" ? void 0 : w.call(this, m, R);
    }
    if (typeof E?.schema == "object") {
      if (E.validate || u.call(this, E), _ === (0, r.normalizeId)(y)) {
        const { schema: R } = E, { schemaId: O } = this.opts, M = R[O];
        return M && ($ = (0, r.resolveUrl)(this.opts.uriResolver, $, M)), new s({ schema: R, schemaId: O, root: h, baseId: $ });
      }
      return w.call(this, m, E);
    }
  }
  Ee.resolveSchema = p;
  const v = /* @__PURE__ */ new Set([
    "properties",
    "patternProperties",
    "enum",
    "dependencies",
    "definitions"
  ]);
  function w(h, { baseId: y, schema: m, root: g }) {
    var $;
    if ((($ = h.fragment) === null || $ === void 0 ? void 0 : $[0]) !== "/")
      return;
    for (const R of h.fragment.slice(1).split("/")) {
      if (typeof m == "boolean")
        return;
      const O = m[(0, o.unescapeFragment)(R)];
      if (O === void 0)
        return;
      m = O;
      const M = typeof m == "object" && m[this.opts.schemaId];
      !v.has(R) && M && (y = (0, r.resolveUrl)(this.opts.uriResolver, y, M));
    }
    let _;
    if (typeof m != "boolean" && m.$ref && !(0, o.schemaHasRulesButRef)(m, this.RULES)) {
      const R = (0, r.resolveUrl)(this.opts.uriResolver, y, m.$ref);
      _ = p.call(this, g, R);
    }
    const { schemaId: E } = this.opts;
    if (_ = _ || new s({ schema: m, schemaId: E, root: g, baseId: y }), _.schema !== _.root.schema)
      return _;
  }
  return Ee;
}
const rl = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", nl = "Meta-schema for $data reference (JSON AnySchema extension proposal)", sl = "object", il = ["$data"], al = { $data: { type: "string", anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] } }, ol = !1, cl = {
  $id: rl,
  description: nl,
  type: sl,
  required: il,
  properties: al,
  additionalProperties: ol
};
var Vt = {}, ht = { exports: {} }, Nn, Ai;
function Ic() {
  if (Ai) return Nn;
  Ai = 1;
  const e = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), t = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
  function n(d) {
    let p = "", v = 0, w = 0;
    for (w = 0; w < d.length; w++)
      if (v = d[w].charCodeAt(0), v !== 48) {
        if (!(v >= 48 && v <= 57 || v >= 65 && v <= 70 || v >= 97 && v <= 102))
          return "";
        p += d[w];
        break;
      }
    for (w += 1; w < d.length; w++) {
      if (v = d[w].charCodeAt(0), !(v >= 48 && v <= 57 || v >= 65 && v <= 70 || v >= 97 && v <= 102))
        return "";
      p += d[w];
    }
    return p;
  }
  const r = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
  function o(d) {
    return d.length = 0, !0;
  }
  function a(d, p, v) {
    if (d.length) {
      const w = n(d);
      if (w !== "")
        p.push(w);
      else
        return v.error = !0, !1;
      d.length = 0;
    }
    return !0;
  }
  function s(d) {
    let p = 0;
    const v = { error: !1, address: "", zone: "" }, w = [], h = [];
    let y = !1, m = !1, g = a;
    for (let $ = 0; $ < d.length; $++) {
      const _ = d[$];
      if (!(_ === "[" || _ === "]"))
        if (_ === ":") {
          if (y === !0 && (m = !0), !g(h, w, v))
            break;
          if (++p > 7) {
            v.error = !0;
            break;
          }
          $ > 0 && d[$ - 1] === ":" && (y = !0), w.push(":");
          continue;
        } else if (_ === "%") {
          if (!g(h, w, v))
            break;
          g = o;
        } else {
          h.push(_);
          continue;
        }
    }
    return h.length && (g === o ? v.zone = h.join("") : m ? w.push(h.join("")) : w.push(n(h))), v.address = w.join(""), v;
  }
  function u(d) {
    if (l(d, ":") < 2)
      return { host: d, isIPV6: !1 };
    const p = s(d);
    if (p.error)
      return { host: d, isIPV6: !1 };
    {
      let v = p.address, w = p.address;
      return p.zone && (v += "%" + p.zone, w += "%25" + p.zone), { host: v, isIPV6: !0, escapedHost: w };
    }
  }
  function l(d, p) {
    let v = 0;
    for (let w = 0; w < d.length; w++)
      d[w] === p && v++;
    return v;
  }
  function c(d) {
    let p = d;
    const v = [];
    let w = -1, h = 0;
    for (; h = p.length; ) {
      if (h === 1) {
        if (p === ".")
          break;
        if (p === "/") {
          v.push("/");
          break;
        } else {
          v.push(p);
          break;
        }
      } else if (h === 2) {
        if (p[0] === ".") {
          if (p[1] === ".")
            break;
          if (p[1] === "/") {
            p = p.slice(2);
            continue;
          }
        } else if (p[0] === "/" && (p[1] === "." || p[1] === "/")) {
          v.push("/");
          break;
        }
      } else if (h === 3 && p === "/..") {
        v.length !== 0 && v.pop(), v.push("/");
        break;
      }
      if (p[0] === ".") {
        if (p[1] === ".") {
          if (p[2] === "/") {
            p = p.slice(3);
            continue;
          }
        } else if (p[1] === "/") {
          p = p.slice(2);
          continue;
        }
      } else if (p[0] === "/" && p[1] === ".") {
        if (p[2] === "/") {
          p = p.slice(2);
          continue;
        } else if (p[2] === "." && p[3] === "/") {
          p = p.slice(3), v.length !== 0 && v.pop();
          continue;
        }
      }
      if ((w = p.indexOf("/", 1)) === -1) {
        v.push(p);
        break;
      } else
        v.push(p.slice(0, w)), p = p.slice(w);
    }
    return v.join("");
  }
  function i(d, p) {
    const v = p !== !0 ? escape : unescape;
    return d.scheme !== void 0 && (d.scheme = v(d.scheme)), d.userinfo !== void 0 && (d.userinfo = v(d.userinfo)), d.host !== void 0 && (d.host = v(d.host)), d.path !== void 0 && (d.path = v(d.path)), d.query !== void 0 && (d.query = v(d.query)), d.fragment !== void 0 && (d.fragment = v(d.fragment)), d;
  }
  function f(d) {
    const p = [];
    if (d.userinfo !== void 0 && (p.push(d.userinfo), p.push("@")), d.host !== void 0) {
      let v = unescape(d.host);
      if (!t(v)) {
        const w = u(v);
        w.isIPV6 === !0 ? v = `[${w.escapedHost}]` : v = d.host;
      }
      p.push(v);
    }
    return (typeof d.port == "number" || typeof d.port == "string") && (p.push(":"), p.push(String(d.port))), p.length ? p.join("") : void 0;
  }
  return Nn = {
    nonSimpleDomain: r,
    recomposeAuthority: f,
    normalizeComponentEncoding: i,
    removeDotSegments: c,
    isIPv4: t,
    isUUID: e,
    normalizeIPv6: u,
    stringArrayToHexStripped: n
  }, Nn;
}
var In, Di;
function ul() {
  if (Di) return In;
  Di = 1;
  const { isUUID: e } = Ic(), t = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, n = (
    /** @type {const} */
    [
      "http",
      "https",
      "ws",
      "wss",
      "urn",
      "urn:uuid"
    ]
  );
  function r(_) {
    return n.indexOf(
      /** @type {*} */
      _
    ) !== -1;
  }
  function o(_) {
    return _.secure === !0 ? !0 : _.secure === !1 ? !1 : _.scheme ? _.scheme.length === 3 && (_.scheme[0] === "w" || _.scheme[0] === "W") && (_.scheme[1] === "s" || _.scheme[1] === "S") && (_.scheme[2] === "s" || _.scheme[2] === "S") : !1;
  }
  function a(_) {
    return _.host || (_.error = _.error || "HTTP URIs must have a host."), _;
  }
  function s(_) {
    const E = String(_.scheme).toLowerCase() === "https";
    return (_.port === (E ? 443 : 80) || _.port === "") && (_.port = void 0), _.path || (_.path = "/"), _;
  }
  function u(_) {
    return _.secure = o(_), _.resourceName = (_.path || "/") + (_.query ? "?" + _.query : ""), _.path = void 0, _.query = void 0, _;
  }
  function l(_) {
    if ((_.port === (o(_) ? 443 : 80) || _.port === "") && (_.port = void 0), typeof _.secure == "boolean" && (_.scheme = _.secure ? "wss" : "ws", _.secure = void 0), _.resourceName) {
      const [E, R] = _.resourceName.split("?");
      _.path = E && E !== "/" ? E : void 0, _.query = R, _.resourceName = void 0;
    }
    return _.fragment = void 0, _;
  }
  function c(_, E) {
    if (!_.path)
      return _.error = "URN can not be parsed", _;
    const R = _.path.match(t);
    if (R) {
      const O = E.scheme || _.scheme || "urn";
      _.nid = R[1].toLowerCase(), _.nss = R[2];
      const M = `${O}:${E.nid || _.nid}`, L = $(M);
      _.path = void 0, L && (_ = L.parse(_, E));
    } else
      _.error = _.error || "URN can not be parsed.";
    return _;
  }
  function i(_, E) {
    if (_.nid === void 0)
      throw new Error("URN without nid cannot be serialized");
    const R = E.scheme || _.scheme || "urn", O = _.nid.toLowerCase(), M = `${R}:${E.nid || O}`, L = $(M);
    L && (_ = L.serialize(_, E));
    const k = _, z = _.nss;
    return k.path = `${O || E.nid}:${z}`, E.skipEscape = !0, k;
  }
  function f(_, E) {
    const R = _;
    return R.uuid = R.nss, R.nss = void 0, !E.tolerant && (!R.uuid || !e(R.uuid)) && (R.error = R.error || "UUID is not valid."), R;
  }
  function d(_) {
    const E = _;
    return E.nss = (_.uuid || "").toLowerCase(), E;
  }
  const p = (
    /** @type {SchemeHandler} */
    {
      scheme: "http",
      domainHost: !0,
      parse: a,
      serialize: s
    }
  ), v = (
    /** @type {SchemeHandler} */
    {
      scheme: "https",
      domainHost: p.domainHost,
      parse: a,
      serialize: s
    }
  ), w = (
    /** @type {SchemeHandler} */
    {
      scheme: "ws",
      domainHost: !0,
      parse: u,
      serialize: l
    }
  ), h = (
    /** @type {SchemeHandler} */
    {
      scheme: "wss",
      domainHost: w.domainHost,
      parse: w.parse,
      serialize: w.serialize
    }
  ), g = (
    /** @type {Record<SchemeName, SchemeHandler>} */
    {
      http: p,
      https: v,
      ws: w,
      wss: h,
      urn: (
        /** @type {SchemeHandler} */
        {
          scheme: "urn",
          parse: c,
          serialize: i,
          skipNormalize: !0
        }
      ),
      "urn:uuid": (
        /** @type {SchemeHandler} */
        {
          scheme: "urn:uuid",
          parse: f,
          serialize: d,
          skipNormalize: !0
        }
      )
    }
  );
  Object.setPrototypeOf(g, null);
  function $(_) {
    return _ && (g[
      /** @type {SchemeName} */
      _
    ] || g[
      /** @type {SchemeName} */
      _.toLowerCase()
    ]) || void 0;
  }
  return In = {
    wsIsSecure: o,
    SCHEMES: g,
    isValidSchemeName: r,
    getSchemeHandler: $
  }, In;
}
var qi;
function ll() {
  if (qi) return ht.exports;
  qi = 1;
  const { normalizeIPv6: e, removeDotSegments: t, recomposeAuthority: n, normalizeComponentEncoding: r, isIPv4: o, nonSimpleDomain: a } = Ic(), { SCHEMES: s, getSchemeHandler: u } = ul();
  function l(h, y) {
    return typeof h == "string" ? h = /** @type {T} */
    d(v(h, y), y) : typeof h == "object" && (h = /** @type {T} */
    v(d(h, y), y)), h;
  }
  function c(h, y, m) {
    const g = m ? Object.assign({ scheme: "null" }, m) : { scheme: "null" }, $ = i(v(h, g), v(y, g), g, !0);
    return g.skipEscape = !0, d($, g);
  }
  function i(h, y, m, g) {
    const $ = {};
    return g || (h = v(d(h, m), m), y = v(d(y, m), m)), m = m || {}, !m.tolerant && y.scheme ? ($.scheme = y.scheme, $.userinfo = y.userinfo, $.host = y.host, $.port = y.port, $.path = t(y.path || ""), $.query = y.query) : (y.userinfo !== void 0 || y.host !== void 0 || y.port !== void 0 ? ($.userinfo = y.userinfo, $.host = y.host, $.port = y.port, $.path = t(y.path || ""), $.query = y.query) : (y.path ? (y.path[0] === "/" ? $.path = t(y.path) : ((h.userinfo !== void 0 || h.host !== void 0 || h.port !== void 0) && !h.path ? $.path = "/" + y.path : h.path ? $.path = h.path.slice(0, h.path.lastIndexOf("/") + 1) + y.path : $.path = y.path, $.path = t($.path)), $.query = y.query) : ($.path = h.path, y.query !== void 0 ? $.query = y.query : $.query = h.query), $.userinfo = h.userinfo, $.host = h.host, $.port = h.port), $.scheme = h.scheme), $.fragment = y.fragment, $;
  }
  function f(h, y, m) {
    return typeof h == "string" ? (h = unescape(h), h = d(r(v(h, m), !0), { ...m, skipEscape: !0 })) : typeof h == "object" && (h = d(r(h, !0), { ...m, skipEscape: !0 })), typeof y == "string" ? (y = unescape(y), y = d(r(v(y, m), !0), { ...m, skipEscape: !0 })) : typeof y == "object" && (y = d(r(y, !0), { ...m, skipEscape: !0 })), h.toLowerCase() === y.toLowerCase();
  }
  function d(h, y) {
    const m = {
      host: h.host,
      scheme: h.scheme,
      userinfo: h.userinfo,
      port: h.port,
      path: h.path,
      query: h.query,
      nid: h.nid,
      nss: h.nss,
      uuid: h.uuid,
      fragment: h.fragment,
      reference: h.reference,
      resourceName: h.resourceName,
      secure: h.secure,
      error: ""
    }, g = Object.assign({}, y), $ = [], _ = u(g.scheme || m.scheme);
    _ && _.serialize && _.serialize(m, g), m.path !== void 0 && (g.skipEscape ? m.path = unescape(m.path) : (m.path = escape(m.path), m.scheme !== void 0 && (m.path = m.path.split("%3A").join(":")))), g.reference !== "suffix" && m.scheme && $.push(m.scheme, ":");
    const E = n(m);
    if (E !== void 0 && (g.reference !== "suffix" && $.push("//"), $.push(E), m.path && m.path[0] !== "/" && $.push("/")), m.path !== void 0) {
      let R = m.path;
      !g.absolutePath && (!_ || !_.absolutePath) && (R = t(R)), E === void 0 && R[0] === "/" && R[1] === "/" && (R = "/%2F" + R.slice(2)), $.push(R);
    }
    return m.query !== void 0 && $.push("?", m.query), m.fragment !== void 0 && $.push("#", m.fragment), $.join("");
  }
  const p = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
  function v(h, y) {
    const m = Object.assign({}, y), g = {
      scheme: void 0,
      userinfo: void 0,
      host: "",
      port: void 0,
      path: "",
      query: void 0,
      fragment: void 0
    };
    let $ = !1;
    m.reference === "suffix" && (m.scheme ? h = m.scheme + ":" + h : h = "//" + h);
    const _ = h.match(p);
    if (_) {
      if (g.scheme = _[1], g.userinfo = _[3], g.host = _[4], g.port = parseInt(_[5], 10), g.path = _[6] || "", g.query = _[7], g.fragment = _[8], isNaN(g.port) && (g.port = _[5]), g.host)
        if (o(g.host) === !1) {
          const O = e(g.host);
          g.host = O.host.toLowerCase(), $ = O.isIPV6;
        } else
          $ = !0;
      g.scheme === void 0 && g.userinfo === void 0 && g.host === void 0 && g.port === void 0 && g.query === void 0 && !g.path ? g.reference = "same-document" : g.scheme === void 0 ? g.reference = "relative" : g.fragment === void 0 ? g.reference = "absolute" : g.reference = "uri", m.reference && m.reference !== "suffix" && m.reference !== g.reference && (g.error = g.error || "URI is not a " + m.reference + " reference.");
      const E = u(m.scheme || g.scheme);
      if (!m.unicodeSupport && (!E || !E.unicodeSupport) && g.host && (m.domainHost || E && E.domainHost) && $ === !1 && a(g.host))
        try {
          g.host = URL.domainToASCII(g.host.toLowerCase());
        } catch (R) {
          g.error = g.error || "Host's domain name can not be converted to ASCII: " + R;
        }
      (!E || E && !E.skipNormalize) && (h.indexOf("%") !== -1 && (g.scheme !== void 0 && (g.scheme = unescape(g.scheme)), g.host !== void 0 && (g.host = unescape(g.host))), g.path && (g.path = escape(unescape(g.path))), g.fragment && (g.fragment = encodeURI(decodeURIComponent(g.fragment)))), E && E.parse && E.parse(g, m);
    } else
      g.error = g.error || "URI can not be parsed.";
    return g;
  }
  const w = {
    SCHEMES: s,
    normalize: l,
    resolve: c,
    resolveComponent: i,
    equal: f,
    serialize: d,
    parse: v
  };
  return ht.exports = w, ht.exports.default = w, ht.exports.fastUri = w, ht.exports;
}
var ki;
function fl() {
  if (ki) return Vt;
  ki = 1, Object.defineProperty(Vt, "__esModule", { value: !0 });
  const e = ll();
  return e.code = 'require("ajv/dist/runtime/uri").default', Vt.default = e, Vt;
}
var Li;
function Tc() {
  return Li || (Li = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
    var t = Ct();
    Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
      return t.KeywordCxt;
    } });
    var n = Z();
    Object.defineProperty(e, "_", { enumerable: !0, get: function() {
      return n._;
    } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() {
      return n.str;
    } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() {
      return n.stringify;
    } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() {
      return n.nil;
    } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() {
      return n.Name;
    } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
      return n.CodeGen;
    } });
    const r = en(), o = jt(), a = Pc(), s = tn(), u = Z(), l = Qr(), c = Kr(), i = re(), f = cl, d = fl(), p = (D, N) => new RegExp(D, N);
    p.code = "new RegExp";
    const v = ["removeAdditional", "useDefaults", "coerceTypes"], w = /* @__PURE__ */ new Set([
      "validate",
      "serialize",
      "parse",
      "wrapper",
      "root",
      "schema",
      "keyword",
      "pattern",
      "formats",
      "validate$data",
      "func",
      "obj",
      "Error"
    ]), h = {
      errorDataPath: "",
      format: "`validateFormats: false` can be used instead.",
      nullable: '"nullable" keyword is supported by default.',
      jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
      extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
      missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
      processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
      sourceCode: "Use option `code: {source: true}`",
      strictDefaults: "It is default now, see option `strict`.",
      strictKeywords: "It is default now, see option `strict`.",
      uniqueItems: '"uniqueItems" keyword is always validated.',
      unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
      cache: "Map is used as cache, schema object as key.",
      serialize: "Map is used as cache, schema object as key.",
      ajvErrors: "It is default now."
    }, y = {
      ignoreKeywordsWithRef: "",
      jsPropertySyntax: "",
      unicode: '"minLength"/"maxLength" account for unicode characters by default.'
    }, m = 200;
    function g(D) {
      var N, j, I, b, S, C, V, W, J, Y, P, T, q, B, U, ee, ue, Re, _e, we, le, Je, be, cn, un;
      const lt = D.strict, ln = (N = D.code) === null || N === void 0 ? void 0 : N.optimize, Js = ln === !0 || ln === void 0 ? 1 : ln || 0, Zs = (I = (j = D.code) === null || j === void 0 ? void 0 : j.regExp) !== null && I !== void 0 ? I : p, eu = (b = D.uriResolver) !== null && b !== void 0 ? b : d.default;
      return {
        strictSchema: (C = (S = D.strictSchema) !== null && S !== void 0 ? S : lt) !== null && C !== void 0 ? C : !0,
        strictNumbers: (W = (V = D.strictNumbers) !== null && V !== void 0 ? V : lt) !== null && W !== void 0 ? W : !0,
        strictTypes: (Y = (J = D.strictTypes) !== null && J !== void 0 ? J : lt) !== null && Y !== void 0 ? Y : "log",
        strictTuples: (T = (P = D.strictTuples) !== null && P !== void 0 ? P : lt) !== null && T !== void 0 ? T : "log",
        strictRequired: (B = (q = D.strictRequired) !== null && q !== void 0 ? q : lt) !== null && B !== void 0 ? B : !1,
        code: D.code ? { ...D.code, optimize: Js, regExp: Zs } : { optimize: Js, regExp: Zs },
        loopRequired: (U = D.loopRequired) !== null && U !== void 0 ? U : m,
        loopEnum: (ee = D.loopEnum) !== null && ee !== void 0 ? ee : m,
        meta: (ue = D.meta) !== null && ue !== void 0 ? ue : !0,
        messages: (Re = D.messages) !== null && Re !== void 0 ? Re : !0,
        inlineRefs: (_e = D.inlineRefs) !== null && _e !== void 0 ? _e : !0,
        schemaId: (we = D.schemaId) !== null && we !== void 0 ? we : "$id",
        addUsedSchema: (le = D.addUsedSchema) !== null && le !== void 0 ? le : !0,
        validateSchema: (Je = D.validateSchema) !== null && Je !== void 0 ? Je : !0,
        validateFormats: (be = D.validateFormats) !== null && be !== void 0 ? be : !0,
        unicodeRegExp: (cn = D.unicodeRegExp) !== null && cn !== void 0 ? cn : !0,
        int32range: (un = D.int32range) !== null && un !== void 0 ? un : !0,
        uriResolver: eu
      };
    }
    class $ {
      constructor(N = {}) {
        this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), N = this.opts = { ...N, ...g(N) };
        const { es5: j, lines: I } = this.opts.code;
        this.scope = new u.ValueScope({ scope: {}, prefixes: w, es5: j, lines: I }), this.logger = z(N.logger);
        const b = N.validateFormats;
        N.validateFormats = !1, this.RULES = (0, a.getRules)(), _.call(this, h, N, "NOT SUPPORTED"), _.call(this, y, N, "DEPRECATED", "warn"), this._metaOpts = L.call(this), N.formats && O.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), N.keywords && M.call(this, N.keywords), typeof N.meta == "object" && this.addMetaSchema(N.meta), R.call(this), N.validateFormats = b;
      }
      _addVocabularies() {
        this.addKeyword("$async");
      }
      _addDefaultMetaSchema() {
        const { $data: N, meta: j, schemaId: I } = this.opts;
        let b = f;
        I === "id" && (b = { ...f }, b.id = b.$id, delete b.$id), j && N && this.addMetaSchema(b, b[I], !1);
      }
      defaultMeta() {
        const { meta: N, schemaId: j } = this.opts;
        return this.opts.defaultMeta = typeof N == "object" ? N[j] || N : void 0;
      }
      validate(N, j) {
        let I;
        if (typeof N == "string") {
          if (I = this.getSchema(N), !I)
            throw new Error(`no schema with key or ref "${N}"`);
        } else
          I = this.compile(N);
        const b = I(j);
        return "$async" in I || (this.errors = I.errors), b;
      }
      compile(N, j) {
        const I = this._addSchema(N, j);
        return I.validate || this._compileSchemaEnv(I);
      }
      compileAsync(N, j) {
        if (typeof this.opts.loadSchema != "function")
          throw new Error("options.loadSchema should be a function");
        const { loadSchema: I } = this.opts;
        return b.call(this, N, j);
        async function b(Y, P) {
          await S.call(this, Y.$schema);
          const T = this._addSchema(Y, P);
          return T.validate || C.call(this, T);
        }
        async function S(Y) {
          Y && !this.getSchema(Y) && await b.call(this, { $ref: Y }, !0);
        }
        async function C(Y) {
          try {
            return this._compileSchemaEnv(Y);
          } catch (P) {
            if (!(P instanceof o.default))
              throw P;
            return V.call(this, P), await W.call(this, P.missingSchema), C.call(this, Y);
          }
        }
        function V({ missingSchema: Y, missingRef: P }) {
          if (this.refs[Y])
            throw new Error(`AnySchema ${Y} is loaded but ${P} cannot be resolved`);
        }
        async function W(Y) {
          const P = await J.call(this, Y);
          this.refs[Y] || await S.call(this, P.$schema), this.refs[Y] || this.addSchema(P, Y, j);
        }
        async function J(Y) {
          const P = this._loading[Y];
          if (P)
            return P;
          try {
            return await (this._loading[Y] = I(Y));
          } finally {
            delete this._loading[Y];
          }
        }
      }
      // Adds schema to the instance
      addSchema(N, j, I, b = this.opts.validateSchema) {
        if (Array.isArray(N)) {
          for (const C of N)
            this.addSchema(C, void 0, I, b);
          return this;
        }
        let S;
        if (typeof N == "object") {
          const { schemaId: C } = this.opts;
          if (S = N[C], S !== void 0 && typeof S != "string")
            throw new Error(`schema ${C} must be string`);
        }
        return j = (0, l.normalizeId)(j || S), this._checkUnique(j), this.schemas[j] = this._addSchema(N, I, j, b, !0), this;
      }
      // Add schema that will be used to validate other schemas
      // options in META_IGNORE_OPTIONS are alway set to false
      addMetaSchema(N, j, I = this.opts.validateSchema) {
        return this.addSchema(N, j, !0, I), this;
      }
      //  Validate schema against its meta-schema
      validateSchema(N, j) {
        if (typeof N == "boolean")
          return !0;
        let I;
        if (I = N.$schema, I !== void 0 && typeof I != "string")
          throw new Error("$schema must be a string");
        if (I = I || this.opts.defaultMeta || this.defaultMeta(), !I)
          return this.logger.warn("meta-schema not available"), this.errors = null, !0;
        const b = this.validate(I, N);
        if (!b && j) {
          const S = "schema is invalid: " + this.errorsText();
          if (this.opts.validateSchema === "log")
            this.logger.error(S);
          else
            throw new Error(S);
        }
        return b;
      }
      // Get compiled schema by `key` or `ref`.
      // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
      getSchema(N) {
        let j;
        for (; typeof (j = E.call(this, N)) == "string"; )
          N = j;
        if (j === void 0) {
          const { schemaId: I } = this.opts, b = new s.SchemaEnv({ schema: {}, schemaId: I });
          if (j = s.resolveSchema.call(this, b, N), !j)
            return;
          this.refs[N] = j;
        }
        return j.validate || this._compileSchemaEnv(j);
      }
      // Remove cached schema(s).
      // If no parameter is passed all schemas but meta-schemas are removed.
      // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
      // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
      removeSchema(N) {
        if (N instanceof RegExp)
          return this._removeAllSchemas(this.schemas, N), this._removeAllSchemas(this.refs, N), this;
        switch (typeof N) {
          case "undefined":
            return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
          case "string": {
            const j = E.call(this, N);
            return typeof j == "object" && this._cache.delete(j.schema), delete this.schemas[N], delete this.refs[N], this;
          }
          case "object": {
            const j = N;
            this._cache.delete(j);
            let I = N[this.opts.schemaId];
            return I && (I = (0, l.normalizeId)(I), delete this.schemas[I], delete this.refs[I]), this;
          }
          default:
            throw new Error("ajv.removeSchema: invalid parameter");
        }
      }
      // add "vocabulary" - a collection of keywords
      addVocabulary(N) {
        for (const j of N)
          this.addKeyword(j);
        return this;
      }
      addKeyword(N, j) {
        let I;
        if (typeof N == "string")
          I = N, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = I);
        else if (typeof N == "object" && j === void 0) {
          if (j = N, I = j.keyword, Array.isArray(I) && !I.length)
            throw new Error("addKeywords: keyword must be string or non-empty array");
        } else
          throw new Error("invalid addKeywords parameters");
        if (A.call(this, I, j), !j)
          return (0, i.eachItem)(I, (S) => F.call(this, S)), this;
        G.call(this, j);
        const b = {
          ...j,
          type: (0, c.getJSONTypes)(j.type),
          schemaType: (0, c.getJSONTypes)(j.schemaType)
        };
        return (0, i.eachItem)(I, b.type.length === 0 ? (S) => F.call(this, S, b) : (S) => b.type.forEach((C) => F.call(this, S, b, C))), this;
      }
      getKeyword(N) {
        const j = this.RULES.all[N];
        return typeof j == "object" ? j.definition : !!j;
      }
      // Remove keyword
      removeKeyword(N) {
        const { RULES: j } = this;
        delete j.keywords[N], delete j.all[N];
        for (const I of j.rules) {
          const b = I.rules.findIndex((S) => S.keyword === N);
          b >= 0 && I.rules.splice(b, 1);
        }
        return this;
      }
      // Add format
      addFormat(N, j) {
        return typeof j == "string" && (j = new RegExp(j)), this.formats[N] = j, this;
      }
      errorsText(N = this.errors, { separator: j = ", ", dataVar: I = "data" } = {}) {
        return !N || N.length === 0 ? "No errors" : N.map((b) => `${I}${b.instancePath} ${b.message}`).reduce((b, S) => b + j + S);
      }
      $dataMetaSchema(N, j) {
        const I = this.RULES.all;
        N = JSON.parse(JSON.stringify(N));
        for (const b of j) {
          const S = b.split("/").slice(1);
          let C = N;
          for (const V of S)
            C = C[V];
          for (const V in I) {
            const W = I[V];
            if (typeof W != "object")
              continue;
            const { $data: J } = W.definition, Y = C[V];
            J && Y && (C[V] = H(Y));
          }
        }
        return N;
      }
      _removeAllSchemas(N, j) {
        for (const I in N) {
          const b = N[I];
          (!j || j.test(I)) && (typeof b == "string" ? delete N[I] : b && !b.meta && (this._cache.delete(b.schema), delete N[I]));
        }
      }
      _addSchema(N, j, I, b = this.opts.validateSchema, S = this.opts.addUsedSchema) {
        let C;
        const { schemaId: V } = this.opts;
        if (typeof N == "object")
          C = N[V];
        else {
          if (this.opts.jtd)
            throw new Error("schema must be object");
          if (typeof N != "boolean")
            throw new Error("schema must be object or boolean");
        }
        let W = this._cache.get(N);
        if (W !== void 0)
          return W;
        I = (0, l.normalizeId)(C || I);
        const J = l.getSchemaRefs.call(this, N, I);
        return W = new s.SchemaEnv({ schema: N, schemaId: V, meta: j, baseId: I, localRefs: J }), this._cache.set(W.schema, W), S && !I.startsWith("#") && (I && this._checkUnique(I), this.refs[I] = W), b && this.validateSchema(N, !0), W;
      }
      _checkUnique(N) {
        if (this.schemas[N] || this.refs[N])
          throw new Error(`schema with key or id "${N}" already exists`);
      }
      _compileSchemaEnv(N) {
        if (N.meta ? this._compileMetaSchema(N) : s.compileSchema.call(this, N), !N.validate)
          throw new Error("ajv implementation error");
        return N.validate;
      }
      _compileMetaSchema(N) {
        const j = this.opts;
        this.opts = this._metaOpts;
        try {
          s.compileSchema.call(this, N);
        } finally {
          this.opts = j;
        }
      }
    }
    $.ValidationError = r.default, $.MissingRefError = o.default, e.default = $;
    function _(D, N, j, I = "error") {
      for (const b in D) {
        const S = b;
        S in N && this.logger[I](`${j}: option ${b}. ${D[S]}`);
      }
    }
    function E(D) {
      return D = (0, l.normalizeId)(D), this.schemas[D] || this.refs[D];
    }
    function R() {
      const D = this.opts.schemas;
      if (D)
        if (Array.isArray(D))
          this.addSchema(D);
        else
          for (const N in D)
            this.addSchema(D[N], N);
    }
    function O() {
      for (const D in this.opts.formats) {
        const N = this.opts.formats[D];
        N && this.addFormat(D, N);
      }
    }
    function M(D) {
      if (Array.isArray(D)) {
        this.addVocabulary(D);
        return;
      }
      this.logger.warn("keywords option as map is deprecated, pass array");
      for (const N in D) {
        const j = D[N];
        j.keyword || (j.keyword = N), this.addKeyword(j);
      }
    }
    function L() {
      const D = { ...this.opts };
      for (const N of v)
        delete D[N];
      return D;
    }
    const k = { log() {
    }, warn() {
    }, error() {
    } };
    function z(D) {
      if (D === !1)
        return k;
      if (D === void 0)
        return console;
      if (D.log && D.warn && D.error)
        return D;
      throw new Error("logger must implement log, warn and error methods");
    }
    const K = /^[a-z_$][a-z0-9_$:-]*$/i;
    function A(D, N) {
      const { RULES: j } = this;
      if ((0, i.eachItem)(D, (I) => {
        if (j.keywords[I])
          throw new Error(`Keyword ${I} is already defined`);
        if (!K.test(I))
          throw new Error(`Keyword ${I} has invalid name`);
      }), !!N && N.$data && !("code" in N || "validate" in N))
        throw new Error('$data keyword must have "code" or "validate" function');
    }
    function F(D, N, j) {
      var I;
      const b = N?.post;
      if (j && b)
        throw new Error('keyword with "post" flag cannot have "type"');
      const { RULES: S } = this;
      let C = b ? S.post : S.rules.find(({ type: W }) => W === j);
      if (C || (C = { type: j, rules: [] }, S.rules.push(C)), S.keywords[D] = !0, !N)
        return;
      const V = {
        keyword: D,
        definition: {
          ...N,
          type: (0, c.getJSONTypes)(N.type),
          schemaType: (0, c.getJSONTypes)(N.schemaType)
        }
      };
      N.before ? X.call(this, C, V, N.before) : C.rules.push(V), S.all[D] = V, (I = N.implements) === null || I === void 0 || I.forEach((W) => this.addKeyword(W));
    }
    function X(D, N, j) {
      const I = D.rules.findIndex((b) => b.keyword === j);
      I >= 0 ? D.rules.splice(I, 0, N) : (D.rules.push(N), this.logger.warn(`rule ${j} is not defined`));
    }
    function G(D) {
      let { metaSchema: N } = D;
      N !== void 0 && (D.$data && this.opts.$data && (N = H(N)), D.validateSchema = this.compile(N, !0));
    }
    const x = {
      $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
    };
    function H(D) {
      return { anyOf: [D, x] };
    }
  })($n)), $n;
}
var zt = {}, Ut = {}, Gt = {}, Mi;
function dl() {
  if (Mi) return Gt;
  Mi = 1, Object.defineProperty(Gt, "__esModule", { value: !0 });
  const e = {
    keyword: "id",
    code() {
      throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
    }
  };
  return Gt.default = e, Gt;
}
var Be = {}, Fi;
function Vs() {
  if (Fi) return Be;
  Fi = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.callRef = Be.getValidate = void 0;
  const e = jt(), t = Ie(), n = Z(), r = Ne(), o = tn(), a = re(), s = {
    keyword: "$ref",
    schemaType: "string",
    code(c) {
      const { gen: i, schema: f, it: d } = c, { baseId: p, schemaEnv: v, validateName: w, opts: h, self: y } = d, { root: m } = v;
      if ((f === "#" || f === "#/") && p === m.baseId)
        return $();
      const g = o.resolveRef.call(y, m, p, f);
      if (g === void 0)
        throw new e.default(d.opts.uriResolver, p, f);
      if (g instanceof o.SchemaEnv)
        return _(g);
      return E(g);
      function $() {
        if (v === m)
          return l(c, w, v, v.$async);
        const R = i.scopeValue("root", { ref: m });
        return l(c, (0, n._)`${R}.validate`, m, m.$async);
      }
      function _(R) {
        const O = u(c, R);
        l(c, O, R, R.$async);
      }
      function E(R) {
        const O = i.scopeValue("schema", h.code.source === !0 ? { ref: R, code: (0, n.stringify)(R) } : { ref: R }), M = i.name("valid"), L = c.subschema({
          schema: R,
          dataTypes: [],
          schemaPath: n.nil,
          topSchemaRef: O,
          errSchemaPath: f
        }, M);
        c.mergeEvaluated(L), c.ok(M);
      }
    }
  };
  function u(c, i) {
    const { gen: f } = c;
    return i.validate ? f.scopeValue("validate", { ref: i.validate }) : (0, n._)`${f.scopeValue("wrapper", { ref: i })}.validate`;
  }
  Be.getValidate = u;
  function l(c, i, f, d) {
    const { gen: p, it: v } = c, { allErrors: w, schemaEnv: h, opts: y } = v, m = y.passContext ? r.default.this : n.nil;
    d ? g() : $();
    function g() {
      if (!h.$async)
        throw new Error("async schema referenced by sync schema");
      const R = p.let("valid");
      p.try(() => {
        p.code((0, n._)`await ${(0, t.callValidateCode)(c, i, m)}`), E(i), w || p.assign(R, !0);
      }, (O) => {
        p.if((0, n._)`!(${O} instanceof ${v.ValidationError})`, () => p.throw(O)), _(O), w || p.assign(R, !1);
      }), c.ok(R);
    }
    function $() {
      c.result((0, t.callValidateCode)(c, i, m), () => E(i), () => _(i));
    }
    function _(R) {
      const O = (0, n._)`${R}.errors`;
      p.assign(r.default.vErrors, (0, n._)`${r.default.vErrors} === null ? ${O} : ${r.default.vErrors}.concat(${O})`), p.assign(r.default.errors, (0, n._)`${r.default.vErrors}.length`);
    }
    function E(R) {
      var O;
      if (!v.opts.unevaluated)
        return;
      const M = (O = f?.validate) === null || O === void 0 ? void 0 : O.evaluated;
      if (v.props !== !0)
        if (M && !M.dynamicProps)
          M.props !== void 0 && (v.props = a.mergeEvaluated.props(p, M.props, v.props));
        else {
          const L = p.var("props", (0, n._)`${R}.evaluated.props`);
          v.props = a.mergeEvaluated.props(p, L, v.props, n.Name);
        }
      if (v.items !== !0)
        if (M && !M.dynamicItems)
          M.items !== void 0 && (v.items = a.mergeEvaluated.items(p, M.items, v.items));
        else {
          const L = p.var("items", (0, n._)`${R}.evaluated.items`);
          v.items = a.mergeEvaluated.items(p, L, v.items, n.Name);
        }
    }
  }
  return Be.callRef = l, Be.default = s, Be;
}
var Bi;
function Cc() {
  if (Bi) return Ut;
  Bi = 1, Object.defineProperty(Ut, "__esModule", { value: !0 });
  const e = dl(), t = Vs(), n = [
    "$schema",
    "$id",
    "$defs",
    "$vocabulary",
    { keyword: "$comment" },
    "definitions",
    e.default,
    t.default
  ];
  return Ut.default = n, Ut;
}
var xt = {}, Ht = {}, Vi;
function hl() {
  if (Vi) return Ht;
  Vi = 1, Object.defineProperty(Ht, "__esModule", { value: !0 });
  const e = Z(), t = e.operators, n = {
    maximum: { okStr: "<=", ok: t.LTE, fail: t.GT },
    minimum: { okStr: ">=", ok: t.GTE, fail: t.LT },
    exclusiveMaximum: { okStr: "<", ok: t.LT, fail: t.GTE },
    exclusiveMinimum: { okStr: ">", ok: t.GT, fail: t.LTE }
  }, r = {
    message: ({ keyword: a, schemaCode: s }) => (0, e.str)`must be ${n[a].okStr} ${s}`,
    params: ({ keyword: a, schemaCode: s }) => (0, e._)`{comparison: ${n[a].okStr}, limit: ${s}}`
  }, o = {
    keyword: Object.keys(n),
    type: "number",
    schemaType: "number",
    $data: !0,
    error: r,
    code(a) {
      const { keyword: s, data: u, schemaCode: l } = a;
      a.fail$data((0, e._)`${u} ${n[s].fail} ${l} || isNaN(${u})`);
    }
  };
  return Ht.default = o, Ht;
}
var Kt = {}, zi;
function pl() {
  if (zi) return Kt;
  zi = 1, Object.defineProperty(Kt, "__esModule", { value: !0 });
  const e = Z(), n = {
    keyword: "multipleOf",
    type: "number",
    schemaType: "number",
    $data: !0,
    error: {
      message: ({ schemaCode: r }) => (0, e.str)`must be multiple of ${r}`,
      params: ({ schemaCode: r }) => (0, e._)`{multipleOf: ${r}}`
    },
    code(r) {
      const { gen: o, data: a, schemaCode: s, it: u } = r, l = u.opts.multipleOfPrecision, c = o.let("res"), i = l ? (0, e._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${l}` : (0, e._)`${c} !== parseInt(${c})`;
      r.fail$data((0, e._)`(${s} === 0 || (${c} = ${a}/${s}, ${i}))`);
    }
  };
  return Kt.default = n, Kt;
}
var Wt = {}, Xt = {}, Ui;
function ml() {
  if (Ui) return Xt;
  Ui = 1, Object.defineProperty(Xt, "__esModule", { value: !0 });
  function e(t) {
    const n = t.length;
    let r = 0, o = 0, a;
    for (; o < n; )
      r++, a = t.charCodeAt(o++), a >= 55296 && a <= 56319 && o < n && (a = t.charCodeAt(o), (a & 64512) === 56320 && o++);
    return r;
  }
  return Xt.default = e, e.code = 'require("ajv/dist/runtime/ucs2length").default', Xt;
}
var Gi;
function yl() {
  if (Gi) return Wt;
  Gi = 1, Object.defineProperty(Wt, "__esModule", { value: !0 });
  const e = Z(), t = re(), n = ml(), o = {
    keyword: ["maxLength", "minLength"],
    type: "string",
    schemaType: "number",
    $data: !0,
    error: {
      message({ keyword: a, schemaCode: s }) {
        const u = a === "maxLength" ? "more" : "fewer";
        return (0, e.str)`must NOT have ${u} than ${s} characters`;
      },
      params: ({ schemaCode: a }) => (0, e._)`{limit: ${a}}`
    },
    code(a) {
      const { keyword: s, data: u, schemaCode: l, it: c } = a, i = s === "maxLength" ? e.operators.GT : e.operators.LT, f = c.opts.unicode === !1 ? (0, e._)`${u}.length` : (0, e._)`${(0, t.useFunc)(a.gen, n.default)}(${u})`;
      a.fail$data((0, e._)`${f} ${i} ${l}`);
    }
  };
  return Wt.default = o, Wt;
}
var Yt = {}, xi;
function gl() {
  if (xi) return Yt;
  xi = 1, Object.defineProperty(Yt, "__esModule", { value: !0 });
  const e = Ie(), t = Z(), r = {
    keyword: "pattern",
    type: "string",
    schemaType: "string",
    $data: !0,
    error: {
      message: ({ schemaCode: o }) => (0, t.str)`must match pattern "${o}"`,
      params: ({ schemaCode: o }) => (0, t._)`{pattern: ${o}}`
    },
    code(o) {
      const { data: a, $data: s, schema: u, schemaCode: l, it: c } = o, i = c.opts.unicodeRegExp ? "u" : "", f = s ? (0, t._)`(new RegExp(${l}, ${i}))` : (0, e.usePattern)(o, u);
      o.fail$data((0, t._)`!${f}.test(${a})`);
    }
  };
  return Yt.default = r, Yt;
}
var Jt = {}, Hi;
function vl() {
  if (Hi) return Jt;
  Hi = 1, Object.defineProperty(Jt, "__esModule", { value: !0 });
  const e = Z(), n = {
    keyword: ["maxProperties", "minProperties"],
    type: "object",
    schemaType: "number",
    $data: !0,
    error: {
      message({ keyword: r, schemaCode: o }) {
        const a = r === "maxProperties" ? "more" : "fewer";
        return (0, e.str)`must NOT have ${a} than ${o} properties`;
      },
      params: ({ schemaCode: r }) => (0, e._)`{limit: ${r}}`
    },
    code(r) {
      const { keyword: o, data: a, schemaCode: s } = r, u = o === "maxProperties" ? e.operators.GT : e.operators.LT;
      r.fail$data((0, e._)`Object.keys(${a}).length ${u} ${s}`);
    }
  };
  return Jt.default = n, Jt;
}
var Zt = {}, Ki;
function _l() {
  if (Ki) return Zt;
  Ki = 1, Object.defineProperty(Zt, "__esModule", { value: !0 });
  const e = Ie(), t = Z(), n = re(), o = {
    keyword: "required",
    type: "object",
    schemaType: "array",
    $data: !0,
    error: {
      message: ({ params: { missingProperty: a } }) => (0, t.str)`must have required property '${a}'`,
      params: ({ params: { missingProperty: a } }) => (0, t._)`{missingProperty: ${a}}`
    },
    code(a) {
      const { gen: s, schema: u, schemaCode: l, data: c, $data: i, it: f } = a, { opts: d } = f;
      if (!i && u.length === 0)
        return;
      const p = u.length >= d.loopRequired;
      if (f.allErrors ? v() : w(), d.strictRequired) {
        const m = a.parentSchema.properties, { definedProperties: g } = a.it;
        for (const $ of u)
          if (m?.[$] === void 0 && !g.has($)) {
            const _ = f.schemaEnv.baseId + f.errSchemaPath, E = `required property "${$}" is not defined at "${_}" (strictRequired)`;
            (0, n.checkStrictMode)(f, E, f.opts.strictRequired);
          }
      }
      function v() {
        if (p || i)
          a.block$data(t.nil, h);
        else
          for (const m of u)
            (0, e.checkReportMissingProp)(a, m);
      }
      function w() {
        const m = s.let("missing");
        if (p || i) {
          const g = s.let("valid", !0);
          a.block$data(g, () => y(m, g)), a.ok(g);
        } else
          s.if((0, e.checkMissingProp)(a, u, m)), (0, e.reportMissingProp)(a, m), s.else();
      }
      function h() {
        s.forOf("prop", l, (m) => {
          a.setParams({ missingProperty: m }), s.if((0, e.noPropertyInData)(s, c, m, d.ownProperties), () => a.error());
        });
      }
      function y(m, g) {
        a.setParams({ missingProperty: m }), s.forOf(m, l, () => {
          s.assign(g, (0, e.propertyInData)(s, c, m, d.ownProperties)), s.if((0, t.not)(g), () => {
            a.error(), s.break();
          });
        }, t.nil);
      }
    }
  };
  return Zt.default = o, Zt;
}
var Qt = {}, Wi;
function wl() {
  if (Wi) return Qt;
  Wi = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
  const e = Z(), n = {
    keyword: ["maxItems", "minItems"],
    type: "array",
    schemaType: "number",
    $data: !0,
    error: {
      message({ keyword: r, schemaCode: o }) {
        const a = r === "maxItems" ? "more" : "fewer";
        return (0, e.str)`must NOT have ${a} than ${o} items`;
      },
      params: ({ schemaCode: r }) => (0, e._)`{limit: ${r}}`
    },
    code(r) {
      const { keyword: o, data: a, schemaCode: s } = r, u = o === "maxItems" ? e.operators.GT : e.operators.LT;
      r.fail$data((0, e._)`${a}.length ${u} ${s}`);
    }
  };
  return Qt.default = n, Qt;
}
var er = {}, tr = {}, Xi;
function zs() {
  if (Xi) return tr;
  Xi = 1, Object.defineProperty(tr, "__esModule", { value: !0 });
  const e = Nc();
  return e.code = 'require("ajv/dist/runtime/equal").default', tr.default = e, tr;
}
var Yi;
function $l() {
  if (Yi) return er;
  Yi = 1, Object.defineProperty(er, "__esModule", { value: !0 });
  const e = Kr(), t = Z(), n = re(), r = zs(), a = {
    keyword: "uniqueItems",
    type: "array",
    schemaType: "boolean",
    $data: !0,
    error: {
      message: ({ params: { i: s, j: u } }) => (0, t.str)`must NOT have duplicate items (items ## ${u} and ${s} are identical)`,
      params: ({ params: { i: s, j: u } }) => (0, t._)`{i: ${s}, j: ${u}}`
    },
    code(s) {
      const { gen: u, data: l, $data: c, schema: i, parentSchema: f, schemaCode: d, it: p } = s;
      if (!c && !i)
        return;
      const v = u.let("valid"), w = f.items ? (0, e.getSchemaTypes)(f.items) : [];
      s.block$data(v, h, (0, t._)`${d} === false`), s.ok(v);
      function h() {
        const $ = u.let("i", (0, t._)`${l}.length`), _ = u.let("j");
        s.setParams({ i: $, j: _ }), u.assign(v, !0), u.if((0, t._)`${$} > 1`, () => (y() ? m : g)($, _));
      }
      function y() {
        return w.length > 0 && !w.some(($) => $ === "object" || $ === "array");
      }
      function m($, _) {
        const E = u.name("item"), R = (0, e.checkDataTypes)(w, E, p.opts.strictNumbers, e.DataType.Wrong), O = u.const("indices", (0, t._)`{}`);
        u.for((0, t._)`;${$}--;`, () => {
          u.let(E, (0, t._)`${l}[${$}]`), u.if(R, (0, t._)`continue`), w.length > 1 && u.if((0, t._)`typeof ${E} == "string"`, (0, t._)`${E} += "_"`), u.if((0, t._)`typeof ${O}[${E}] == "number"`, () => {
            u.assign(_, (0, t._)`${O}[${E}]`), s.error(), u.assign(v, !1).break();
          }).code((0, t._)`${O}[${E}] = ${$}`);
        });
      }
      function g($, _) {
        const E = (0, n.useFunc)(u, r.default), R = u.name("outer");
        u.label(R).for((0, t._)`;${$}--;`, () => u.for((0, t._)`${_} = ${$}; ${_}--;`, () => u.if((0, t._)`${E}(${l}[${$}], ${l}[${_}])`, () => {
          s.error(), u.assign(v, !1).break(R);
        })));
      }
    }
  };
  return er.default = a, er;
}
var rr = {}, Ji;
function El() {
  if (Ji) return rr;
  Ji = 1, Object.defineProperty(rr, "__esModule", { value: !0 });
  const e = Z(), t = re(), n = zs(), o = {
    keyword: "const",
    $data: !0,
    error: {
      message: "must be equal to constant",
      params: ({ schemaCode: a }) => (0, e._)`{allowedValue: ${a}}`
    },
    code(a) {
      const { gen: s, data: u, $data: l, schemaCode: c, schema: i } = a;
      l || i && typeof i == "object" ? a.fail$data((0, e._)`!${(0, t.useFunc)(s, n.default)}(${u}, ${c})`) : a.fail((0, e._)`${i} !== ${u}`);
    }
  };
  return rr.default = o, rr;
}
var nr = {}, Zi;
function bl() {
  if (Zi) return nr;
  Zi = 1, Object.defineProperty(nr, "__esModule", { value: !0 });
  const e = Z(), t = re(), n = zs(), o = {
    keyword: "enum",
    schemaType: "array",
    $data: !0,
    error: {
      message: "must be equal to one of the allowed values",
      params: ({ schemaCode: a }) => (0, e._)`{allowedValues: ${a}}`
    },
    code(a) {
      const { gen: s, data: u, $data: l, schema: c, schemaCode: i, it: f } = a;
      if (!l && c.length === 0)
        throw new Error("enum must have non-empty array");
      const d = c.length >= f.opts.loopEnum;
      let p;
      const v = () => p ?? (p = (0, t.useFunc)(s, n.default));
      let w;
      if (d || l)
        w = s.let("valid"), a.block$data(w, h);
      else {
        if (!Array.isArray(c))
          throw new Error("ajv implementation error");
        const m = s.const("vSchema", i);
        w = (0, e.or)(...c.map((g, $) => y(m, $)));
      }
      a.pass(w);
      function h() {
        s.assign(w, !1), s.forOf("v", i, (m) => s.if((0, e._)`${v()}(${u}, ${m})`, () => s.assign(w, !0).break()));
      }
      function y(m, g) {
        const $ = c[g];
        return typeof $ == "object" && $ !== null ? (0, e._)`${v()}(${u}, ${m}[${g}])` : (0, e._)`${u} === ${$}`;
      }
    }
  };
  return nr.default = o, nr;
}
var Qi;
function jc() {
  if (Qi) return xt;
  Qi = 1, Object.defineProperty(xt, "__esModule", { value: !0 });
  const e = hl(), t = pl(), n = yl(), r = gl(), o = vl(), a = _l(), s = wl(), u = $l(), l = El(), c = bl(), i = [
    // number
    e.default,
    t.default,
    // string
    n.default,
    r.default,
    // object
    o.default,
    a.default,
    // array
    s.default,
    u.default,
    // any
    { keyword: "type", schemaType: ["string", "array"] },
    { keyword: "nullable", schemaType: "boolean" },
    l.default,
    c.default
  ];
  return xt.default = i, xt;
}
var sr = {}, Ze = {}, ea;
function Ac() {
  if (ea) return Ze;
  ea = 1, Object.defineProperty(Ze, "__esModule", { value: !0 }), Ze.validateAdditionalItems = void 0;
  const e = Z(), t = re(), r = {
    keyword: "additionalItems",
    type: "array",
    schemaType: ["boolean", "object"],
    before: "uniqueItems",
    error: {
      message: ({ params: { len: a } }) => (0, e.str)`must NOT have more than ${a} items`,
      params: ({ params: { len: a } }) => (0, e._)`{limit: ${a}}`
    },
    code(a) {
      const { parentSchema: s, it: u } = a, { items: l } = s;
      if (!Array.isArray(l)) {
        (0, t.checkStrictMode)(u, '"additionalItems" is ignored when "items" is not an array of schemas');
        return;
      }
      o(a, l);
    }
  };
  function o(a, s) {
    const { gen: u, schema: l, data: c, keyword: i, it: f } = a;
    f.items = !0;
    const d = u.const("len", (0, e._)`${c}.length`);
    if (l === !1)
      a.setParams({ len: s.length }), a.pass((0, e._)`${d} <= ${s.length}`);
    else if (typeof l == "object" && !(0, t.alwaysValidSchema)(f, l)) {
      const v = u.var("valid", (0, e._)`${d} <= ${s.length}`);
      u.if((0, e.not)(v), () => p(v)), a.ok(v);
    }
    function p(v) {
      u.forRange("i", s.length, d, (w) => {
        a.subschema({ keyword: i, dataProp: w, dataPropType: t.Type.Num }, v), f.allErrors || u.if((0, e.not)(v), () => u.break());
      });
    }
  }
  return Ze.validateAdditionalItems = o, Ze.default = r, Ze;
}
var ir = {}, Qe = {}, ta;
function Dc() {
  if (ta) return Qe;
  ta = 1, Object.defineProperty(Qe, "__esModule", { value: !0 }), Qe.validateTuple = void 0;
  const e = Z(), t = re(), n = Ie(), r = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "array", "boolean"],
    before: "uniqueItems",
    code(a) {
      const { schema: s, it: u } = a;
      if (Array.isArray(s))
        return o(a, "additionalItems", s);
      u.items = !0, !(0, t.alwaysValidSchema)(u, s) && a.ok((0, n.validateArray)(a));
    }
  };
  function o(a, s, u = a.schema) {
    const { gen: l, parentSchema: c, data: i, keyword: f, it: d } = a;
    w(c), d.opts.unevaluated && u.length && d.items !== !0 && (d.items = t.mergeEvaluated.items(l, u.length, d.items));
    const p = l.name("valid"), v = l.const("len", (0, e._)`${i}.length`);
    u.forEach((h, y) => {
      (0, t.alwaysValidSchema)(d, h) || (l.if((0, e._)`${v} > ${y}`, () => a.subschema({
        keyword: f,
        schemaProp: y,
        dataProp: y
      }, p)), a.ok(p));
    });
    function w(h) {
      const { opts: y, errSchemaPath: m } = d, g = u.length, $ = g === h.minItems && (g === h.maxItems || h[s] === !1);
      if (y.strictTuples && !$) {
        const _ = `"${f}" is ${g}-tuple, but minItems or maxItems/${s} are not specified or different at path "${m}"`;
        (0, t.checkStrictMode)(d, _, y.strictTuples);
      }
    }
  }
  return Qe.validateTuple = o, Qe.default = r, Qe;
}
var ra;
function Sl() {
  if (ra) return ir;
  ra = 1, Object.defineProperty(ir, "__esModule", { value: !0 });
  const e = Dc(), t = {
    keyword: "prefixItems",
    type: "array",
    schemaType: ["array"],
    before: "uniqueItems",
    code: (n) => (0, e.validateTuple)(n, "items")
  };
  return ir.default = t, ir;
}
var ar = {}, na;
function Rl() {
  if (na) return ar;
  na = 1, Object.defineProperty(ar, "__esModule", { value: !0 });
  const e = Z(), t = re(), n = Ie(), r = Ac(), a = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    error: {
      message: ({ params: { len: s } }) => (0, e.str)`must NOT have more than ${s} items`,
      params: ({ params: { len: s } }) => (0, e._)`{limit: ${s}}`
    },
    code(s) {
      const { schema: u, parentSchema: l, it: c } = s, { prefixItems: i } = l;
      c.items = !0, !(0, t.alwaysValidSchema)(c, u) && (i ? (0, r.validateAdditionalItems)(s, i) : s.ok((0, n.validateArray)(s)));
    }
  };
  return ar.default = a, ar;
}
var or = {}, sa;
function Pl() {
  if (sa) return or;
  sa = 1, Object.defineProperty(or, "__esModule", { value: !0 });
  const e = Z(), t = re(), r = {
    keyword: "contains",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    trackErrors: !0,
    error: {
      message: ({ params: { min: o, max: a } }) => a === void 0 ? (0, e.str)`must contain at least ${o} valid item(s)` : (0, e.str)`must contain at least ${o} and no more than ${a} valid item(s)`,
      params: ({ params: { min: o, max: a } }) => a === void 0 ? (0, e._)`{minContains: ${o}}` : (0, e._)`{minContains: ${o}, maxContains: ${a}}`
    },
    code(o) {
      const { gen: a, schema: s, parentSchema: u, data: l, it: c } = o;
      let i, f;
      const { minContains: d, maxContains: p } = u;
      c.opts.next ? (i = d === void 0 ? 1 : d, f = p) : i = 1;
      const v = a.const("len", (0, e._)`${l}.length`);
      if (o.setParams({ min: i, max: f }), f === void 0 && i === 0) {
        (0, t.checkStrictMode)(c, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
        return;
      }
      if (f !== void 0 && i > f) {
        (0, t.checkStrictMode)(c, '"minContains" > "maxContains" is always invalid'), o.fail();
        return;
      }
      if ((0, t.alwaysValidSchema)(c, s)) {
        let g = (0, e._)`${v} >= ${i}`;
        f !== void 0 && (g = (0, e._)`${g} && ${v} <= ${f}`), o.pass(g);
        return;
      }
      c.items = !0;
      const w = a.name("valid");
      f === void 0 && i === 1 ? y(w, () => a.if(w, () => a.break())) : i === 0 ? (a.let(w, !0), f !== void 0 && a.if((0, e._)`${l}.length > 0`, h)) : (a.let(w, !1), h()), o.result(w, () => o.reset());
      function h() {
        const g = a.name("_valid"), $ = a.let("count", 0);
        y(g, () => a.if(g, () => m($)));
      }
      function y(g, $) {
        a.forRange("i", 0, v, (_) => {
          o.subschema({
            keyword: "contains",
            dataProp: _,
            dataPropType: t.Type.Num,
            compositeRule: !0
          }, g), $();
        });
      }
      function m(g) {
        a.code((0, e._)`${g}++`), f === void 0 ? a.if((0, e._)`${g} >= ${i}`, () => a.assign(w, !0).break()) : (a.if((0, e._)`${g} > ${f}`, () => a.assign(w, !1).break()), i === 1 ? a.assign(w, !0) : a.if((0, e._)`${g} >= ${i}`, () => a.assign(w, !0)));
      }
    }
  };
  return or.default = r, or;
}
var Tn = {}, ia;
function Us() {
  return ia || (ia = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
    const t = Z(), n = re(), r = Ie();
    e.error = {
      message: ({ params: { property: l, depsCount: c, deps: i } }) => {
        const f = c === 1 ? "property" : "properties";
        return (0, t.str)`must have ${f} ${i} when property ${l} is present`;
      },
      params: ({ params: { property: l, depsCount: c, deps: i, missingProperty: f } }) => (0, t._)`{property: ${l},
    missingProperty: ${f},
    depsCount: ${c},
    deps: ${i}}`
      // TODO change to reference
    };
    const o = {
      keyword: "dependencies",
      type: "object",
      schemaType: "object",
      error: e.error,
      code(l) {
        const [c, i] = a(l);
        s(l, c), u(l, i);
      }
    };
    function a({ schema: l }) {
      const c = {}, i = {};
      for (const f in l) {
        if (f === "__proto__")
          continue;
        const d = Array.isArray(l[f]) ? c : i;
        d[f] = l[f];
      }
      return [c, i];
    }
    function s(l, c = l.schema) {
      const { gen: i, data: f, it: d } = l;
      if (Object.keys(c).length === 0)
        return;
      const p = i.let("missing");
      for (const v in c) {
        const w = c[v];
        if (w.length === 0)
          continue;
        const h = (0, r.propertyInData)(i, f, v, d.opts.ownProperties);
        l.setParams({
          property: v,
          depsCount: w.length,
          deps: w.join(", ")
        }), d.allErrors ? i.if(h, () => {
          for (const y of w)
            (0, r.checkReportMissingProp)(l, y);
        }) : (i.if((0, t._)`${h} && (${(0, r.checkMissingProp)(l, w, p)})`), (0, r.reportMissingProp)(l, p), i.else());
      }
    }
    e.validatePropertyDeps = s;
    function u(l, c = l.schema) {
      const { gen: i, data: f, keyword: d, it: p } = l, v = i.name("valid");
      for (const w in c)
        (0, n.alwaysValidSchema)(p, c[w]) || (i.if(
          (0, r.propertyInData)(i, f, w, p.opts.ownProperties),
          () => {
            const h = l.subschema({ keyword: d, schemaProp: w }, v);
            l.mergeValidEvaluated(h, v);
          },
          () => i.var(v, !0)
          // TODO var
        ), l.ok(v));
    }
    e.validateSchemaDeps = u, e.default = o;
  })(Tn)), Tn;
}
var cr = {}, aa;
function Ol() {
  if (aa) return cr;
  aa = 1, Object.defineProperty(cr, "__esModule", { value: !0 });
  const e = Z(), t = re(), r = {
    keyword: "propertyNames",
    type: "object",
    schemaType: ["object", "boolean"],
    error: {
      message: "property name must be valid",
      params: ({ params: o }) => (0, e._)`{propertyName: ${o.propertyName}}`
    },
    code(o) {
      const { gen: a, schema: s, data: u, it: l } = o;
      if ((0, t.alwaysValidSchema)(l, s))
        return;
      const c = a.name("valid");
      a.forIn("key", u, (i) => {
        o.setParams({ propertyName: i }), o.subschema({
          keyword: "propertyNames",
          data: i,
          dataTypes: ["string"],
          propertyName: i,
          compositeRule: !0
        }, c), a.if((0, e.not)(c), () => {
          o.error(!0), l.allErrors || a.break();
        });
      }), o.ok(c);
    }
  };
  return cr.default = r, cr;
}
var ur = {}, oa;
function qc() {
  if (oa) return ur;
  oa = 1, Object.defineProperty(ur, "__esModule", { value: !0 });
  const e = Ie(), t = Z(), n = Ne(), r = re(), a = {
    keyword: "additionalProperties",
    type: ["object"],
    schemaType: ["boolean", "object"],
    allowUndefined: !0,
    trackErrors: !0,
    error: {
      message: "must NOT have additional properties",
      params: ({ params: s }) => (0, t._)`{additionalProperty: ${s.additionalProperty}}`
    },
    code(s) {
      const { gen: u, schema: l, parentSchema: c, data: i, errsCount: f, it: d } = s;
      if (!f)
        throw new Error("ajv implementation error");
      const { allErrors: p, opts: v } = d;
      if (d.props = !0, v.removeAdditional !== "all" && (0, r.alwaysValidSchema)(d, l))
        return;
      const w = (0, e.allSchemaProperties)(c.properties), h = (0, e.allSchemaProperties)(c.patternProperties);
      y(), s.ok((0, t._)`${f} === ${n.default.errors}`);
      function y() {
        u.forIn("key", i, (E) => {
          !w.length && !h.length ? $(E) : u.if(m(E), () => $(E));
        });
      }
      function m(E) {
        let R;
        if (w.length > 8) {
          const O = (0, r.schemaRefOrVal)(d, c.properties, "properties");
          R = (0, e.isOwnProperty)(u, O, E);
        } else w.length ? R = (0, t.or)(...w.map((O) => (0, t._)`${E} === ${O}`)) : R = t.nil;
        return h.length && (R = (0, t.or)(R, ...h.map((O) => (0, t._)`${(0, e.usePattern)(s, O)}.test(${E})`))), (0, t.not)(R);
      }
      function g(E) {
        u.code((0, t._)`delete ${i}[${E}]`);
      }
      function $(E) {
        if (v.removeAdditional === "all" || v.removeAdditional && l === !1) {
          g(E);
          return;
        }
        if (l === !1) {
          s.setParams({ additionalProperty: E }), s.error(), p || u.break();
          return;
        }
        if (typeof l == "object" && !(0, r.alwaysValidSchema)(d, l)) {
          const R = u.name("valid");
          v.removeAdditional === "failing" ? (_(E, R, !1), u.if((0, t.not)(R), () => {
            s.reset(), g(E);
          })) : (_(E, R), p || u.if((0, t.not)(R), () => u.break()));
        }
      }
      function _(E, R, O) {
        const M = {
          keyword: "additionalProperties",
          dataProp: E,
          dataPropType: r.Type.Str
        };
        O === !1 && Object.assign(M, {
          compositeRule: !0,
          createErrors: !1,
          allErrors: !1
        }), s.subschema(M, R);
      }
    }
  };
  return ur.default = a, ur;
}
var lr = {}, ca;
function Nl() {
  if (ca) return lr;
  ca = 1, Object.defineProperty(lr, "__esModule", { value: !0 });
  const e = Ct(), t = Ie(), n = re(), r = qc(), o = {
    keyword: "properties",
    type: "object",
    schemaType: "object",
    code(a) {
      const { gen: s, schema: u, parentSchema: l, data: c, it: i } = a;
      i.opts.removeAdditional === "all" && l.additionalProperties === void 0 && r.default.code(new e.KeywordCxt(i, r.default, "additionalProperties"));
      const f = (0, t.allSchemaProperties)(u);
      for (const h of f)
        i.definedProperties.add(h);
      i.opts.unevaluated && f.length && i.props !== !0 && (i.props = n.mergeEvaluated.props(s, (0, n.toHash)(f), i.props));
      const d = f.filter((h) => !(0, n.alwaysValidSchema)(i, u[h]));
      if (d.length === 0)
        return;
      const p = s.name("valid");
      for (const h of d)
        v(h) ? w(h) : (s.if((0, t.propertyInData)(s, c, h, i.opts.ownProperties)), w(h), i.allErrors || s.else().var(p, !0), s.endIf()), a.it.definedProperties.add(h), a.ok(p);
      function v(h) {
        return i.opts.useDefaults && !i.compositeRule && u[h].default !== void 0;
      }
      function w(h) {
        a.subschema({
          keyword: "properties",
          schemaProp: h,
          dataProp: h
        }, p);
      }
    }
  };
  return lr.default = o, lr;
}
var fr = {}, ua;
function Il() {
  if (ua) return fr;
  ua = 1, Object.defineProperty(fr, "__esModule", { value: !0 });
  const e = Ie(), t = Z(), n = re(), r = re(), o = {
    keyword: "patternProperties",
    type: "object",
    schemaType: "object",
    code(a) {
      const { gen: s, schema: u, data: l, parentSchema: c, it: i } = a, { opts: f } = i, d = (0, e.allSchemaProperties)(u), p = d.filter(($) => (0, n.alwaysValidSchema)(i, u[$]));
      if (d.length === 0 || p.length === d.length && (!i.opts.unevaluated || i.props === !0))
        return;
      const v = f.strictSchema && !f.allowMatchingProperties && c.properties, w = s.name("valid");
      i.props !== !0 && !(i.props instanceof t.Name) && (i.props = (0, r.evaluatedPropsToName)(s, i.props));
      const { props: h } = i;
      y();
      function y() {
        for (const $ of d)
          v && m($), i.allErrors ? g($) : (s.var(w, !0), g($), s.if(w));
      }
      function m($) {
        for (const _ in v)
          new RegExp($).test(_) && (0, n.checkStrictMode)(i, `property ${_} matches pattern ${$} (use allowMatchingProperties)`);
      }
      function g($) {
        s.forIn("key", l, (_) => {
          s.if((0, t._)`${(0, e.usePattern)(a, $)}.test(${_})`, () => {
            const E = p.includes($);
            E || a.subschema({
              keyword: "patternProperties",
              schemaProp: $,
              dataProp: _,
              dataPropType: r.Type.Str
            }, w), i.opts.unevaluated && h !== !0 ? s.assign((0, t._)`${h}[${_}]`, !0) : !E && !i.allErrors && s.if((0, t.not)(w), () => s.break());
          });
        });
      }
    }
  };
  return fr.default = o, fr;
}
var dr = {}, la;
function Tl() {
  if (la) return dr;
  la = 1, Object.defineProperty(dr, "__esModule", { value: !0 });
  const e = re(), t = {
    keyword: "not",
    schemaType: ["object", "boolean"],
    trackErrors: !0,
    code(n) {
      const { gen: r, schema: o, it: a } = n;
      if ((0, e.alwaysValidSchema)(a, o)) {
        n.fail();
        return;
      }
      const s = r.name("valid");
      n.subschema({
        keyword: "not",
        compositeRule: !0,
        createErrors: !1,
        allErrors: !1
      }, s), n.failResult(s, () => n.reset(), () => n.error());
    },
    error: { message: "must NOT be valid" }
  };
  return dr.default = t, dr;
}
var hr = {}, fa;
function Cl() {
  if (fa) return hr;
  fa = 1, Object.defineProperty(hr, "__esModule", { value: !0 });
  const t = {
    keyword: "anyOf",
    schemaType: "array",
    trackErrors: !0,
    code: Ie().validateUnion,
    error: { message: "must match a schema in anyOf" }
  };
  return hr.default = t, hr;
}
var pr = {}, da;
function jl() {
  if (da) return pr;
  da = 1, Object.defineProperty(pr, "__esModule", { value: !0 });
  const e = Z(), t = re(), r = {
    keyword: "oneOf",
    schemaType: "array",
    trackErrors: !0,
    error: {
      message: "must match exactly one schema in oneOf",
      params: ({ params: o }) => (0, e._)`{passingSchemas: ${o.passing}}`
    },
    code(o) {
      const { gen: a, schema: s, parentSchema: u, it: l } = o;
      if (!Array.isArray(s))
        throw new Error("ajv implementation error");
      if (l.opts.discriminator && u.discriminator)
        return;
      const c = s, i = a.let("valid", !1), f = a.let("passing", null), d = a.name("_valid");
      o.setParams({ passing: f }), a.block(p), o.result(i, () => o.reset(), () => o.error(!0));
      function p() {
        c.forEach((v, w) => {
          let h;
          (0, t.alwaysValidSchema)(l, v) ? a.var(d, !0) : h = o.subschema({
            keyword: "oneOf",
            schemaProp: w,
            compositeRule: !0
          }, d), w > 0 && a.if((0, e._)`${d} && ${i}`).assign(i, !1).assign(f, (0, e._)`[${f}, ${w}]`).else(), a.if(d, () => {
            a.assign(i, !0), a.assign(f, w), h && o.mergeEvaluated(h, e.Name);
          });
        });
      }
    }
  };
  return pr.default = r, pr;
}
var mr = {}, ha;
function Al() {
  if (ha) return mr;
  ha = 1, Object.defineProperty(mr, "__esModule", { value: !0 });
  const e = re(), t = {
    keyword: "allOf",
    schemaType: "array",
    code(n) {
      const { gen: r, schema: o, it: a } = n;
      if (!Array.isArray(o))
        throw new Error("ajv implementation error");
      const s = r.name("valid");
      o.forEach((u, l) => {
        if ((0, e.alwaysValidSchema)(a, u))
          return;
        const c = n.subschema({ keyword: "allOf", schemaProp: l }, s);
        n.ok(s), n.mergeEvaluated(c);
      });
    }
  };
  return mr.default = t, mr;
}
var yr = {}, pa;
function Dl() {
  if (pa) return yr;
  pa = 1, Object.defineProperty(yr, "__esModule", { value: !0 });
  const e = Z(), t = re(), r = {
    keyword: "if",
    schemaType: ["object", "boolean"],
    trackErrors: !0,
    error: {
      message: ({ params: a }) => (0, e.str)`must match "${a.ifClause}" schema`,
      params: ({ params: a }) => (0, e._)`{failingKeyword: ${a.ifClause}}`
    },
    code(a) {
      const { gen: s, parentSchema: u, it: l } = a;
      u.then === void 0 && u.else === void 0 && (0, t.checkStrictMode)(l, '"if" without "then" and "else" is ignored');
      const c = o(l, "then"), i = o(l, "else");
      if (!c && !i)
        return;
      const f = s.let("valid", !0), d = s.name("_valid");
      if (p(), a.reset(), c && i) {
        const w = s.let("ifClause");
        a.setParams({ ifClause: w }), s.if(d, v("then", w), v("else", w));
      } else c ? s.if(d, v("then")) : s.if((0, e.not)(d), v("else"));
      a.pass(f, () => a.error(!0));
      function p() {
        const w = a.subschema({
          keyword: "if",
          compositeRule: !0,
          createErrors: !1,
          allErrors: !1
        }, d);
        a.mergeEvaluated(w);
      }
      function v(w, h) {
        return () => {
          const y = a.subschema({ keyword: w }, d);
          s.assign(f, d), a.mergeValidEvaluated(y, f), h ? s.assign(h, (0, e._)`${w}`) : a.setParams({ ifClause: w });
        };
      }
    }
  };
  function o(a, s) {
    const u = a.schema[s];
    return u !== void 0 && !(0, t.alwaysValidSchema)(a, u);
  }
  return yr.default = r, yr;
}
var gr = {}, ma;
function ql() {
  if (ma) return gr;
  ma = 1, Object.defineProperty(gr, "__esModule", { value: !0 });
  const e = re(), t = {
    keyword: ["then", "else"],
    schemaType: ["object", "boolean"],
    code({ keyword: n, parentSchema: r, it: o }) {
      r.if === void 0 && (0, e.checkStrictMode)(o, `"${n}" without "if" is ignored`);
    }
  };
  return gr.default = t, gr;
}
var ya;
function kc() {
  if (ya) return sr;
  ya = 1, Object.defineProperty(sr, "__esModule", { value: !0 });
  const e = Ac(), t = Sl(), n = Dc(), r = Rl(), o = Pl(), a = Us(), s = Ol(), u = qc(), l = Nl(), c = Il(), i = Tl(), f = Cl(), d = jl(), p = Al(), v = Dl(), w = ql();
  function h(y = !1) {
    const m = [
      // any
      i.default,
      f.default,
      d.default,
      p.default,
      v.default,
      w.default,
      // object
      s.default,
      u.default,
      a.default,
      l.default,
      c.default
    ];
    return y ? m.push(t.default, r.default) : m.push(e.default, n.default), m.push(o.default), m;
  }
  return sr.default = h, sr;
}
var vr = {}, et = {}, ga;
function Lc() {
  if (ga) return et;
  ga = 1, Object.defineProperty(et, "__esModule", { value: !0 }), et.dynamicAnchor = void 0;
  const e = Z(), t = Ne(), n = tn(), r = Vs(), o = {
    keyword: "$dynamicAnchor",
    schemaType: "string",
    code: (u) => a(u, u.schema)
  };
  function a(u, l) {
    const { gen: c, it: i } = u;
    i.schemaEnv.root.dynamicAnchors[l] = !0;
    const f = (0, e._)`${t.default.dynamicAnchors}${(0, e.getProperty)(l)}`, d = i.errSchemaPath === "#" ? i.validateName : s(u);
    c.if((0, e._)`!${f}`, () => c.assign(f, d));
  }
  et.dynamicAnchor = a;
  function s(u) {
    const { schemaEnv: l, schema: c, self: i } = u.it, { root: f, baseId: d, localRefs: p, meta: v } = l.root, { schemaId: w } = i.opts, h = new n.SchemaEnv({ schema: c, schemaId: w, root: f, baseId: d, localRefs: p, meta: v });
    return n.compileSchema.call(i, h), (0, r.getValidate)(u, h);
  }
  return et.default = o, et;
}
var tt = {}, va;
function Mc() {
  if (va) return tt;
  va = 1, Object.defineProperty(tt, "__esModule", { value: !0 }), tt.dynamicRef = void 0;
  const e = Z(), t = Ne(), n = Vs(), r = {
    keyword: "$dynamicRef",
    schemaType: "string",
    code: (a) => o(a, a.schema)
  };
  function o(a, s) {
    const { gen: u, keyword: l, it: c } = a;
    if (s[0] !== "#")
      throw new Error(`"${l}" only supports hash fragment reference`);
    const i = s.slice(1);
    if (c.allErrors)
      f();
    else {
      const p = u.let("valid", !1);
      f(p), a.ok(p);
    }
    function f(p) {
      if (c.schemaEnv.root.dynamicAnchors[i]) {
        const v = u.let("_v", (0, e._)`${t.default.dynamicAnchors}${(0, e.getProperty)(i)}`);
        u.if(v, d(v, p), d(c.validateName, p));
      } else
        d(c.validateName, p)();
    }
    function d(p, v) {
      return v ? () => u.block(() => {
        (0, n.callRef)(a, p), u.let(v, !0);
      }) : () => (0, n.callRef)(a, p);
    }
  }
  return tt.dynamicRef = o, tt.default = r, tt;
}
var _r = {}, _a;
function kl() {
  if (_a) return _r;
  _a = 1, Object.defineProperty(_r, "__esModule", { value: !0 });
  const e = Lc(), t = re(), n = {
    keyword: "$recursiveAnchor",
    schemaType: "boolean",
    code(r) {
      r.schema ? (0, e.dynamicAnchor)(r, "") : (0, t.checkStrictMode)(r.it, "$recursiveAnchor: false is ignored");
    }
  };
  return _r.default = n, _r;
}
var wr = {}, wa;
function Ll() {
  if (wa) return wr;
  wa = 1, Object.defineProperty(wr, "__esModule", { value: !0 });
  const e = Mc(), t = {
    keyword: "$recursiveRef",
    schemaType: "string",
    code: (n) => (0, e.dynamicRef)(n, n.schema)
  };
  return wr.default = t, wr;
}
var $a;
function Ml() {
  if ($a) return vr;
  $a = 1, Object.defineProperty(vr, "__esModule", { value: !0 });
  const e = Lc(), t = Mc(), n = kl(), r = Ll(), o = [e.default, t.default, n.default, r.default];
  return vr.default = o, vr;
}
var $r = {}, Er = {}, Ea;
function Fl() {
  if (Ea) return Er;
  Ea = 1, Object.defineProperty(Er, "__esModule", { value: !0 });
  const e = Us(), t = {
    keyword: "dependentRequired",
    type: "object",
    schemaType: "object",
    error: e.error,
    code: (n) => (0, e.validatePropertyDeps)(n)
  };
  return Er.default = t, Er;
}
var br = {}, ba;
function Bl() {
  if (ba) return br;
  ba = 1, Object.defineProperty(br, "__esModule", { value: !0 });
  const e = Us(), t = {
    keyword: "dependentSchemas",
    type: "object",
    schemaType: "object",
    code: (n) => (0, e.validateSchemaDeps)(n)
  };
  return br.default = t, br;
}
var Sr = {}, Sa;
function Vl() {
  if (Sa) return Sr;
  Sa = 1, Object.defineProperty(Sr, "__esModule", { value: !0 });
  const e = re(), t = {
    keyword: ["maxContains", "minContains"],
    type: "array",
    schemaType: "number",
    code({ keyword: n, parentSchema: r, it: o }) {
      r.contains === void 0 && (0, e.checkStrictMode)(o, `"${n}" without "contains" is ignored`);
    }
  };
  return Sr.default = t, Sr;
}
var Ra;
function zl() {
  if (Ra) return $r;
  Ra = 1, Object.defineProperty($r, "__esModule", { value: !0 });
  const e = Fl(), t = Bl(), n = Vl(), r = [e.default, t.default, n.default];
  return $r.default = r, $r;
}
var Rr = {}, Pr = {}, Pa;
function Ul() {
  if (Pa) return Pr;
  Pa = 1, Object.defineProperty(Pr, "__esModule", { value: !0 });
  const e = Z(), t = re(), n = Ne(), o = {
    keyword: "unevaluatedProperties",
    type: "object",
    schemaType: ["boolean", "object"],
    trackErrors: !0,
    error: {
      message: "must NOT have unevaluated properties",
      params: ({ params: a }) => (0, e._)`{unevaluatedProperty: ${a.unevaluatedProperty}}`
    },
    code(a) {
      const { gen: s, schema: u, data: l, errsCount: c, it: i } = a;
      if (!c)
        throw new Error("ajv implementation error");
      const { allErrors: f, props: d } = i;
      d instanceof e.Name ? s.if((0, e._)`${d} !== true`, () => s.forIn("key", l, (h) => s.if(v(d, h), () => p(h)))) : d !== !0 && s.forIn("key", l, (h) => d === void 0 ? p(h) : s.if(w(d, h), () => p(h))), i.props = !0, a.ok((0, e._)`${c} === ${n.default.errors}`);
      function p(h) {
        if (u === !1) {
          a.setParams({ unevaluatedProperty: h }), a.error(), f || s.break();
          return;
        }
        if (!(0, t.alwaysValidSchema)(i, u)) {
          const y = s.name("valid");
          a.subschema({
            keyword: "unevaluatedProperties",
            dataProp: h,
            dataPropType: t.Type.Str
          }, y), f || s.if((0, e.not)(y), () => s.break());
        }
      }
      function v(h, y) {
        return (0, e._)`!${h} || !${h}[${y}]`;
      }
      function w(h, y) {
        const m = [];
        for (const g in h)
          h[g] === !0 && m.push((0, e._)`${y} !== ${g}`);
        return (0, e.and)(...m);
      }
    }
  };
  return Pr.default = o, Pr;
}
var Or = {}, Oa;
function Gl() {
  if (Oa) return Or;
  Oa = 1, Object.defineProperty(Or, "__esModule", { value: !0 });
  const e = Z(), t = re(), r = {
    keyword: "unevaluatedItems",
    type: "array",
    schemaType: ["boolean", "object"],
    error: {
      message: ({ params: { len: o } }) => (0, e.str)`must NOT have more than ${o} items`,
      params: ({ params: { len: o } }) => (0, e._)`{limit: ${o}}`
    },
    code(o) {
      const { gen: a, schema: s, data: u, it: l } = o, c = l.items || 0;
      if (c === !0)
        return;
      const i = a.const("len", (0, e._)`${u}.length`);
      if (s === !1)
        o.setParams({ len: c }), o.fail((0, e._)`${i} > ${c}`);
      else if (typeof s == "object" && !(0, t.alwaysValidSchema)(l, s)) {
        const d = a.var("valid", (0, e._)`${i} <= ${c}`);
        a.if((0, e.not)(d), () => f(d, c)), o.ok(d);
      }
      l.items = !0;
      function f(d, p) {
        a.forRange("i", p, i, (v) => {
          o.subschema({ keyword: "unevaluatedItems", dataProp: v, dataPropType: t.Type.Num }, d), l.allErrors || a.if((0, e.not)(d), () => a.break());
        });
      }
    }
  };
  return Or.default = r, Or;
}
var Na;
function xl() {
  if (Na) return Rr;
  Na = 1, Object.defineProperty(Rr, "__esModule", { value: !0 });
  const e = Ul(), t = Gl(), n = [e.default, t.default];
  return Rr.default = n, Rr;
}
var Nr = {}, Ir = {}, Ia;
function Hl() {
  if (Ia) return Ir;
  Ia = 1, Object.defineProperty(Ir, "__esModule", { value: !0 });
  const e = Z(), n = {
    keyword: "format",
    type: ["number", "string"],
    schemaType: "string",
    $data: !0,
    error: {
      message: ({ schemaCode: r }) => (0, e.str)`must match format "${r}"`,
      params: ({ schemaCode: r }) => (0, e._)`{format: ${r}}`
    },
    code(r, o) {
      const { gen: a, data: s, $data: u, schema: l, schemaCode: c, it: i } = r, { opts: f, errSchemaPath: d, schemaEnv: p, self: v } = i;
      if (!f.validateFormats)
        return;
      u ? w() : h();
      function w() {
        const y = a.scopeValue("formats", {
          ref: v.formats,
          code: f.code.formats
        }), m = a.const("fDef", (0, e._)`${y}[${c}]`), g = a.let("fType"), $ = a.let("format");
        a.if((0, e._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`, () => a.assign(g, (0, e._)`${m}.type || "string"`).assign($, (0, e._)`${m}.validate`), () => a.assign(g, (0, e._)`"string"`).assign($, m)), r.fail$data((0, e.or)(_(), E()));
        function _() {
          return f.strictSchema === !1 ? e.nil : (0, e._)`${c} && !${$}`;
        }
        function E() {
          const R = p.$async ? (0, e._)`(${m}.async ? await ${$}(${s}) : ${$}(${s}))` : (0, e._)`${$}(${s})`, O = (0, e._)`(typeof ${$} == "function" ? ${R} : ${$}.test(${s}))`;
          return (0, e._)`${$} && ${$} !== true && ${g} === ${o} && !${O}`;
        }
      }
      function h() {
        const y = v.formats[l];
        if (!y) {
          _();
          return;
        }
        if (y === !0)
          return;
        const [m, g, $] = E(y);
        m === o && r.pass(R());
        function _() {
          if (f.strictSchema === !1) {
            v.logger.warn(O());
            return;
          }
          throw new Error(O());
          function O() {
            return `unknown format "${l}" ignored in schema at path "${d}"`;
          }
        }
        function E(O) {
          const M = O instanceof RegExp ? (0, e.regexpCode)(O) : f.code.formats ? (0, e._)`${f.code.formats}${(0, e.getProperty)(l)}` : void 0, L = a.scopeValue("formats", { key: l, ref: O, code: M });
          return typeof O == "object" && !(O instanceof RegExp) ? [O.type || "string", O.validate, (0, e._)`${L}.validate`] : ["string", O, L];
        }
        function R() {
          if (typeof y == "object" && !(y instanceof RegExp) && y.async) {
            if (!p.$async)
              throw new Error("async format in sync schema");
            return (0, e._)`await ${$}(${s})`;
          }
          return typeof g == "function" ? (0, e._)`${$}(${s})` : (0, e._)`${$}.test(${s})`;
        }
      }
    }
  };
  return Ir.default = n, Ir;
}
var Ta;
function Fc() {
  if (Ta) return Nr;
  Ta = 1, Object.defineProperty(Nr, "__esModule", { value: !0 });
  const t = [Hl().default];
  return Nr.default = t, Nr;
}
var xe = {}, Ca;
function Bc() {
  return Ca || (Ca = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.contentVocabulary = xe.metadataVocabulary = void 0, xe.metadataVocabulary = [
    "title",
    "description",
    "default",
    "deprecated",
    "readOnly",
    "writeOnly",
    "examples"
  ], xe.contentVocabulary = [
    "contentMediaType",
    "contentEncoding",
    "contentSchema"
  ]), xe;
}
var ja;
function Kl() {
  if (ja) return zt;
  ja = 1, Object.defineProperty(zt, "__esModule", { value: !0 });
  const e = Cc(), t = jc(), n = kc(), r = Ml(), o = zl(), a = xl(), s = Fc(), u = Bc(), l = [
    r.default,
    e.default,
    t.default,
    (0, n.default)(!0),
    s.default,
    u.metadataVocabulary,
    u.contentVocabulary,
    o.default,
    a.default
  ];
  return zt.default = l, zt;
}
var Tr = {}, pt = {}, Aa;
function Wl() {
  if (Aa) return pt;
  Aa = 1, Object.defineProperty(pt, "__esModule", { value: !0 }), pt.DiscrError = void 0;
  var e;
  return (function(t) {
    t.Tag = "tag", t.Mapping = "mapping";
  })(e || (pt.DiscrError = e = {})), pt;
}
var Da;
function Vc() {
  if (Da) return Tr;
  Da = 1, Object.defineProperty(Tr, "__esModule", { value: !0 });
  const e = Z(), t = Wl(), n = tn(), r = jt(), o = re(), s = {
    keyword: "discriminator",
    type: "object",
    schemaType: "object",
    error: {
      message: ({ params: { discrError: u, tagName: l } }) => u === t.DiscrError.Tag ? `tag "${l}" must be string` : `value of tag "${l}" must be in oneOf`,
      params: ({ params: { discrError: u, tag: l, tagName: c } }) => (0, e._)`{error: ${u}, tag: ${c}, tagValue: ${l}}`
    },
    code(u) {
      const { gen: l, data: c, schema: i, parentSchema: f, it: d } = u, { oneOf: p } = f;
      if (!d.opts.discriminator)
        throw new Error("discriminator: requires discriminator option");
      const v = i.propertyName;
      if (typeof v != "string")
        throw new Error("discriminator: requires propertyName");
      if (i.mapping)
        throw new Error("discriminator: mapping is not supported");
      if (!p)
        throw new Error("discriminator: requires oneOf keyword");
      const w = l.let("valid", !1), h = l.const("tag", (0, e._)`${c}${(0, e.getProperty)(v)}`);
      l.if((0, e._)`typeof ${h} == "string"`, () => y(), () => u.error(!1, { discrError: t.DiscrError.Tag, tag: h, tagName: v })), u.ok(w);
      function y() {
        const $ = g();
        l.if(!1);
        for (const _ in $)
          l.elseIf((0, e._)`${h} === ${_}`), l.assign(w, m($[_]));
        l.else(), u.error(!1, { discrError: t.DiscrError.Mapping, tag: h, tagName: v }), l.endIf();
      }
      function m($) {
        const _ = l.name("valid"), E = u.subschema({ keyword: "oneOf", schemaProp: $ }, _);
        return u.mergeEvaluated(E, e.Name), _;
      }
      function g() {
        var $;
        const _ = {}, E = O(f);
        let R = !0;
        for (let k = 0; k < p.length; k++) {
          let z = p[k];
          if (z?.$ref && !(0, o.schemaHasRulesButRef)(z, d.self.RULES)) {
            const A = z.$ref;
            if (z = n.resolveRef.call(d.self, d.schemaEnv.root, d.baseId, A), z instanceof n.SchemaEnv && (z = z.schema), z === void 0)
              throw new r.default(d.opts.uriResolver, d.baseId, A);
          }
          const K = ($ = z?.properties) === null || $ === void 0 ? void 0 : $[v];
          if (typeof K != "object")
            throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);
          R = R && (E || O(z)), M(K, k);
        }
        if (!R)
          throw new Error(`discriminator: "${v}" must be required`);
        return _;
        function O({ required: k }) {
          return Array.isArray(k) && k.includes(v);
        }
        function M(k, z) {
          if (k.const)
            L(k.const, z);
          else if (k.enum)
            for (const K of k.enum)
              L(K, z);
          else
            throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`);
        }
        function L(k, z) {
          if (typeof k != "string" || k in _)
            throw new Error(`discriminator: "${v}" values must be unique strings`);
          _[k] = z;
        }
      }
    }
  };
  return Tr.default = s, Tr;
}
var Cr = {};
const Xl = "https://json-schema.org/draft/2020-12/schema", Yl = "https://json-schema.org/draft/2020-12/schema", Jl = { "https://json-schema.org/draft/2020-12/vocab/core": !0, "https://json-schema.org/draft/2020-12/vocab/applicator": !0, "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0, "https://json-schema.org/draft/2020-12/vocab/validation": !0, "https://json-schema.org/draft/2020-12/vocab/meta-data": !0, "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0, "https://json-schema.org/draft/2020-12/vocab/content": !0 }, Zl = "meta", Ql = "Core and Validation specifications meta-schema", ef = [{ $ref: "meta/core" }, { $ref: "meta/applicator" }, { $ref: "meta/unevaluated" }, { $ref: "meta/validation" }, { $ref: "meta/meta-data" }, { $ref: "meta/format-annotation" }, { $ref: "meta/content" }], tf = ["object", "boolean"], rf = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", nf = { definitions: { $comment: '"definitions" has been replaced by "$defs".', type: "object", additionalProperties: { $dynamicRef: "#meta" }, deprecated: !0, default: {} }, dependencies: { $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.', type: "object", additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] }, deprecated: !0, default: {} }, $recursiveAnchor: { $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".', $ref: "meta/core#/$defs/anchorString", deprecated: !0 }, $recursiveRef: { $comment: '"$recursiveRef" has been replaced by "$dynamicRef".', $ref: "meta/core#/$defs/uriReferenceString", deprecated: !0 } }, sf = {
  $schema: Xl,
  $id: Yl,
  $vocabulary: Jl,
  $dynamicAnchor: Zl,
  title: Ql,
  allOf: ef,
  type: tf,
  $comment: rf,
  properties: nf
}, af = "https://json-schema.org/draft/2020-12/schema", of = "https://json-schema.org/draft/2020-12/meta/applicator", cf = { "https://json-schema.org/draft/2020-12/vocab/applicator": !0 }, uf = "meta", lf = "Applicator vocabulary meta-schema", ff = ["object", "boolean"], df = { prefixItems: { $ref: "#/$defs/schemaArray" }, items: { $dynamicRef: "#meta" }, contains: { $dynamicRef: "#meta" }, additionalProperties: { $dynamicRef: "#meta" }, properties: { type: "object", additionalProperties: { $dynamicRef: "#meta" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $dynamicRef: "#meta" }, propertyNames: { format: "regex" }, default: {} }, dependentSchemas: { type: "object", additionalProperties: { $dynamicRef: "#meta" }, default: {} }, propertyNames: { $dynamicRef: "#meta" }, if: { $dynamicRef: "#meta" }, then: { $dynamicRef: "#meta" }, else: { $dynamicRef: "#meta" }, allOf: { $ref: "#/$defs/schemaArray" }, anyOf: { $ref: "#/$defs/schemaArray" }, oneOf: { $ref: "#/$defs/schemaArray" }, not: { $dynamicRef: "#meta" } }, hf = { schemaArray: { type: "array", minItems: 1, items: { $dynamicRef: "#meta" } } }, pf = {
  $schema: af,
  $id: of,
  $vocabulary: cf,
  $dynamicAnchor: uf,
  title: lf,
  type: ff,
  properties: df,
  $defs: hf
}, mf = "https://json-schema.org/draft/2020-12/schema", yf = "https://json-schema.org/draft/2020-12/meta/unevaluated", gf = { "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0 }, vf = "meta", _f = "Unevaluated applicator vocabulary meta-schema", wf = ["object", "boolean"], $f = { unevaluatedItems: { $dynamicRef: "#meta" }, unevaluatedProperties: { $dynamicRef: "#meta" } }, Ef = {
  $schema: mf,
  $id: yf,
  $vocabulary: gf,
  $dynamicAnchor: vf,
  title: _f,
  type: wf,
  properties: $f
}, bf = "https://json-schema.org/draft/2020-12/schema", Sf = "https://json-schema.org/draft/2020-12/meta/content", Rf = { "https://json-schema.org/draft/2020-12/vocab/content": !0 }, Pf = "meta", Of = "Content vocabulary meta-schema", Nf = ["object", "boolean"], If = { contentEncoding: { type: "string" }, contentMediaType: { type: "string" }, contentSchema: { $dynamicRef: "#meta" } }, Tf = {
  $schema: bf,
  $id: Sf,
  $vocabulary: Rf,
  $dynamicAnchor: Pf,
  title: Of,
  type: Nf,
  properties: If
}, Cf = "https://json-schema.org/draft/2020-12/schema", jf = "https://json-schema.org/draft/2020-12/meta/core", Af = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, Df = "meta", qf = "Core vocabulary meta-schema", kf = ["object", "boolean"], Lf = { $id: { $ref: "#/$defs/uriReferenceString", $comment: "Non-empty fragments not allowed.", pattern: "^[^#]*#?$" }, $schema: { $ref: "#/$defs/uriString" }, $ref: { $ref: "#/$defs/uriReferenceString" }, $anchor: { $ref: "#/$defs/anchorString" }, $dynamicRef: { $ref: "#/$defs/uriReferenceString" }, $dynamicAnchor: { $ref: "#/$defs/anchorString" }, $vocabulary: { type: "object", propertyNames: { $ref: "#/$defs/uriString" }, additionalProperties: { type: "boolean" } }, $comment: { type: "string" }, $defs: { type: "object", additionalProperties: { $dynamicRef: "#meta" } } }, Mf = { anchorString: { type: "string", pattern: "^[A-Za-z_][-A-Za-z0-9._]*$" }, uriString: { type: "string", format: "uri" }, uriReferenceString: { type: "string", format: "uri-reference" } }, Ff = {
  $schema: Cf,
  $id: jf,
  $vocabulary: Af,
  $dynamicAnchor: Df,
  title: qf,
  type: kf,
  properties: Lf,
  $defs: Mf
}, Bf = "https://json-schema.org/draft/2020-12/schema", Vf = "https://json-schema.org/draft/2020-12/meta/format-annotation", zf = { "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0 }, Uf = "meta", Gf = "Format vocabulary meta-schema for annotation results", xf = ["object", "boolean"], Hf = { format: { type: "string" } }, Kf = {
  $schema: Bf,
  $id: Vf,
  $vocabulary: zf,
  $dynamicAnchor: Uf,
  title: Gf,
  type: xf,
  properties: Hf
}, Wf = "https://json-schema.org/draft/2020-12/schema", Xf = "https://json-schema.org/draft/2020-12/meta/meta-data", Yf = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 }, Jf = "meta", Zf = "Meta-data vocabulary meta-schema", Qf = ["object", "boolean"], ed = { title: { type: "string" }, description: { type: "string" }, default: !0, deprecated: { type: "boolean", default: !1 }, readOnly: { type: "boolean", default: !1 }, writeOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 } }, td = {
  $schema: Wf,
  $id: Xf,
  $vocabulary: Yf,
  $dynamicAnchor: Jf,
  title: Zf,
  type: Qf,
  properties: ed
}, rd = "https://json-schema.org/draft/2020-12/schema", nd = "https://json-schema.org/draft/2020-12/meta/validation", sd = { "https://json-schema.org/draft/2020-12/vocab/validation": !0 }, id = "meta", ad = "Validation vocabulary meta-schema", od = ["object", "boolean"], cd = { type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, { type: "array", items: { $ref: "#/$defs/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, const: !0, enum: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/$defs/nonNegativeInteger" }, minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, maxItems: { $ref: "#/$defs/nonNegativeInteger" }, minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, maxContains: { $ref: "#/$defs/nonNegativeInteger" }, minContains: { $ref: "#/$defs/nonNegativeInteger", default: 1 }, maxProperties: { $ref: "#/$defs/nonNegativeInteger" }, minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, required: { $ref: "#/$defs/stringArray" }, dependentRequired: { type: "object", additionalProperties: { $ref: "#/$defs/stringArray" } } }, ud = { nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { $ref: "#/$defs/nonNegativeInteger", default: 0 }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, ld = {
  $schema: rd,
  $id: nd,
  $vocabulary: sd,
  $dynamicAnchor: id,
  title: ad,
  type: od,
  properties: cd,
  $defs: ud
};
var qa;
function fd() {
  if (qa) return Cr;
  qa = 1, Object.defineProperty(Cr, "__esModule", { value: !0 });
  const e = sf, t = pf, n = Ef, r = Tf, o = Ff, a = Kf, s = td, u = ld, l = ["/properties"];
  function c(i) {
    return [
      e,
      t,
      n,
      r,
      o,
      f(this, a),
      s,
      f(this, u)
    ].forEach((d) => this.addMetaSchema(d, void 0, !1)), this;
    function f(d, p) {
      return i ? d.$dataMetaSchema(p, l) : p;
    }
  }
  return Cr.default = c, Cr;
}
var ka;
function dd() {
  return ka || (ka = 1, (function(e, t) {
    Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv2020 = void 0;
    const n = Tc(), r = Kl(), o = Vc(), a = fd(), s = "https://json-schema.org/draft/2020-12/schema";
    class u extends n.default {
      constructor(p = {}) {
        super({
          ...p,
          dynamicRef: !0,
          next: !0,
          unevaluated: !0
        });
      }
      _addVocabularies() {
        super._addVocabularies(), r.default.forEach((p) => this.addVocabulary(p)), this.opts.discriminator && this.addKeyword(o.default);
      }
      _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        const { $data: p, meta: v } = this.opts;
        v && (a.default.call(this, p), this.refs["http://json-schema.org/schema"] = s);
      }
      defaultMeta() {
        return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(s) ? s : void 0);
      }
    }
    t.Ajv2020 = u, e.exports = t = u, e.exports.Ajv2020 = u, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = u;
    var l = Ct();
    Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
      return l.KeywordCxt;
    } });
    var c = Z();
    Object.defineProperty(t, "_", { enumerable: !0, get: function() {
      return c._;
    } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
      return c.str;
    } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
      return c.stringify;
    } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
      return c.nil;
    } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
      return c.Name;
    } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
      return c.CodeGen;
    } });
    var i = en();
    Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
      return i.default;
    } });
    var f = jt();
    Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
      return f.default;
    } });
  })(Lt, Lt.exports)), Lt.exports;
}
var hd = dd(), jr = { exports: {} }, Cn = {}, La;
function pd() {
  return La || (La = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.formatNames = e.fastFormats = e.fullFormats = void 0;
    function t(k, z) {
      return { validate: k, compare: z };
    }
    e.fullFormats = {
      // date: http://tools.ietf.org/html/rfc3339#section-5.6
      date: t(a, s),
      // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
      time: t(l(!0), c),
      "date-time": t(d(!0), p),
      "iso-time": t(l(), i),
      "iso-date-time": t(d(), v),
      // duration: https://tools.ietf.org/html/rfc3339#appendix-A
      duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
      uri: y,
      "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
      // uri-template: https://tools.ietf.org/html/rfc6570
      "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
      // For the source: https://gist.github.com/dperini/729294
      // For test cases: https://mathiasbynens.be/demo/url-regex
      url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
      email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
      hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
      // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
      ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
      ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
      regex: L,
      // uuid: http://tools.ietf.org/html/rfc4122
      uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
      // JSON-pointer: https://tools.ietf.org/html/rfc6901
      // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
      "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
      "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
      // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
      "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
      // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
      // byte: https://github.com/miguelmota/is-base64
      byte: g,
      // signed 32 bit integer
      int32: { type: "number", validate: E },
      // signed 64 bit integer
      int64: { type: "number", validate: R },
      // C-type float
      float: { type: "number", validate: O },
      // C-type double
      double: { type: "number", validate: O },
      // hint to the UI to hide input strings
      password: !0,
      // unchecked string payload
      binary: !0
    }, e.fastFormats = {
      ...e.fullFormats,
      date: t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, s),
      time: t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, c),
      "date-time": t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, p),
      "iso-time": t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, i),
      "iso-date-time": t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, v),
      // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
      uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
      "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
      // email (sources from jsen validator):
      // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
      // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
      email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i
    }, e.formatNames = Object.keys(e.fullFormats);
    function n(k) {
      return k % 4 === 0 && (k % 100 !== 0 || k % 400 === 0);
    }
    const r = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, o = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    function a(k) {
      const z = r.exec(k);
      if (!z)
        return !1;
      const K = +z[1], A = +z[2], F = +z[3];
      return A >= 1 && A <= 12 && F >= 1 && F <= (A === 2 && n(K) ? 29 : o[A]);
    }
    function s(k, z) {
      if (k && z)
        return k > z ? 1 : k < z ? -1 : 0;
    }
    const u = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
    function l(k) {
      return function(K) {
        const A = u.exec(K);
        if (!A)
          return !1;
        const F = +A[1], X = +A[2], G = +A[3], x = A[4], H = A[5] === "-" ? -1 : 1, D = +(A[6] || 0), N = +(A[7] || 0);
        if (D > 23 || N > 59 || k && !x)
          return !1;
        if (F <= 23 && X <= 59 && G < 60)
          return !0;
        const j = X - N * H, I = F - D * H - (j < 0 ? 1 : 0);
        return (I === 23 || I === -1) && (j === 59 || j === -1) && G < 61;
      };
    }
    function c(k, z) {
      if (!(k && z))
        return;
      const K = (/* @__PURE__ */ new Date("2020-01-01T" + k)).valueOf(), A = (/* @__PURE__ */ new Date("2020-01-01T" + z)).valueOf();
      if (K && A)
        return K - A;
    }
    function i(k, z) {
      if (!(k && z))
        return;
      const K = u.exec(k), A = u.exec(z);
      if (K && A)
        return k = K[1] + K[2] + K[3], z = A[1] + A[2] + A[3], k > z ? 1 : k < z ? -1 : 0;
    }
    const f = /t|\s/i;
    function d(k) {
      const z = l(k);
      return function(A) {
        const F = A.split(f);
        return F.length === 2 && a(F[0]) && z(F[1]);
      };
    }
    function p(k, z) {
      if (!(k && z))
        return;
      const K = new Date(k).valueOf(), A = new Date(z).valueOf();
      if (K && A)
        return K - A;
    }
    function v(k, z) {
      if (!(k && z))
        return;
      const [K, A] = k.split(f), [F, X] = z.split(f), G = s(K, F);
      if (G !== void 0)
        return G || c(A, X);
    }
    const w = /\/|:/, h = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
    function y(k) {
      return w.test(k) && h.test(k);
    }
    const m = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
    function g(k) {
      return m.lastIndex = 0, m.test(k);
    }
    const $ = -2147483648, _ = 2 ** 31 - 1;
    function E(k) {
      return Number.isInteger(k) && k <= _ && k >= $;
    }
    function R(k) {
      return Number.isInteger(k);
    }
    function O() {
      return !0;
    }
    const M = /[^\\]\\Z/;
    function L(k) {
      if (M.test(k))
        return !1;
      try {
        return new RegExp(k), !0;
      } catch {
        return !1;
      }
    }
  })(Cn)), Cn;
}
var jn = {}, Ar = { exports: {} }, Dr = {}, Ma;
function md() {
  if (Ma) return Dr;
  Ma = 1, Object.defineProperty(Dr, "__esModule", { value: !0 });
  const e = Cc(), t = jc(), n = kc(), r = Fc(), o = Bc(), a = [
    e.default,
    t.default,
    (0, n.default)(),
    r.default,
    o.metadataVocabulary,
    o.contentVocabulary
  ];
  return Dr.default = a, Dr;
}
const yd = "http://json-schema.org/draft-07/schema#", gd = "http://json-schema.org/draft-07/schema#", vd = "Core schema meta-schema", _d = { schemaArray: { type: "array", minItems: 1, items: { $ref: "#" } }, nonNegativeInteger: { type: "integer", minimum: 0 }, nonNegativeIntegerDefault0: { allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] }, simpleTypes: { enum: ["array", "boolean", "integer", "null", "number", "object", "string"] }, stringArray: { type: "array", items: { type: "string" }, uniqueItems: !0, default: [] } }, wd = ["object", "boolean"], $d = { $id: { type: "string", format: "uri-reference" }, $schema: { type: "string", format: "uri" }, $ref: { type: "string", format: "uri-reference" }, $comment: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: !0, readOnly: { type: "boolean", default: !1 }, examples: { type: "array", items: !0 }, multipleOf: { type: "number", exclusiveMinimum: 0 }, maximum: { type: "number" }, exclusiveMaximum: { type: "number" }, minimum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { $ref: "#/definitions/nonNegativeInteger" }, minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, pattern: { type: "string", format: "regex" }, additionalItems: { $ref: "#" }, items: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], default: !0 }, maxItems: { $ref: "#/definitions/nonNegativeInteger" }, minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, uniqueItems: { type: "boolean", default: !1 }, contains: { $ref: "#" }, maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, required: { $ref: "#/definitions/stringArray" }, additionalProperties: { $ref: "#" }, definitions: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, properties: { type: "object", additionalProperties: { $ref: "#" }, default: {} }, patternProperties: { type: "object", additionalProperties: { $ref: "#" }, propertyNames: { format: "regex" }, default: {} }, dependencies: { type: "object", additionalProperties: { anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] } }, propertyNames: { $ref: "#" }, const: !0, enum: { type: "array", items: !0, minItems: 1, uniqueItems: !0 }, type: { anyOf: [{ $ref: "#/definitions/simpleTypes" }, { type: "array", items: { $ref: "#/definitions/simpleTypes" }, minItems: 1, uniqueItems: !0 }] }, format: { type: "string" }, contentMediaType: { type: "string" }, contentEncoding: { type: "string" }, if: { $ref: "#" }, then: { $ref: "#" }, else: { $ref: "#" }, allOf: { $ref: "#/definitions/schemaArray" }, anyOf: { $ref: "#/definitions/schemaArray" }, oneOf: { $ref: "#/definitions/schemaArray" }, not: { $ref: "#" } }, Ed = {
  $schema: yd,
  $id: gd,
  title: vd,
  definitions: _d,
  type: wd,
  properties: $d,
  default: !0
};
var Fa;
function bd() {
  return Fa || (Fa = 1, (function(e, t) {
    Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = t.Ajv = void 0;
    const n = Tc(), r = md(), o = Vc(), a = Ed, s = ["/properties"], u = "http://json-schema.org/draft-07/schema";
    class l extends n.default {
      _addVocabularies() {
        super._addVocabularies(), r.default.forEach((v) => this.addVocabulary(v)), this.opts.discriminator && this.addKeyword(o.default);
      }
      _addDefaultMetaSchema() {
        if (super._addDefaultMetaSchema(), !this.opts.meta)
          return;
        const v = this.opts.$data ? this.$dataMetaSchema(a, s) : a;
        this.addMetaSchema(v, u, !1), this.refs["http://json-schema.org/schema"] = u;
      }
      defaultMeta() {
        return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(u) ? u : void 0);
      }
    }
    t.Ajv = l, e.exports = t = l, e.exports.Ajv = l, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = l;
    var c = Ct();
    Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
      return c.KeywordCxt;
    } });
    var i = Z();
    Object.defineProperty(t, "_", { enumerable: !0, get: function() {
      return i._;
    } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
      return i.str;
    } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
      return i.stringify;
    } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
      return i.nil;
    } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
      return i.Name;
    } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
      return i.CodeGen;
    } });
    var f = en();
    Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
      return f.default;
    } });
    var d = jt();
    Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
      return d.default;
    } });
  })(Ar, Ar.exports)), Ar.exports;
}
var Ba;
function Sd() {
  return Ba || (Ba = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.formatLimitDefinition = void 0;
    const t = bd(), n = Z(), r = n.operators, o = {
      formatMaximum: { okStr: "<=", ok: r.LTE, fail: r.GT },
      formatMinimum: { okStr: ">=", ok: r.GTE, fail: r.LT },
      formatExclusiveMaximum: { okStr: "<", ok: r.LT, fail: r.GTE },
      formatExclusiveMinimum: { okStr: ">", ok: r.GT, fail: r.LTE }
    }, a = {
      message: ({ keyword: u, schemaCode: l }) => (0, n.str)`should be ${o[u].okStr} ${l}`,
      params: ({ keyword: u, schemaCode: l }) => (0, n._)`{comparison: ${o[u].okStr}, limit: ${l}}`
    };
    e.formatLimitDefinition = {
      keyword: Object.keys(o),
      type: "string",
      schemaType: "string",
      $data: !0,
      error: a,
      code(u) {
        const { gen: l, data: c, schemaCode: i, keyword: f, it: d } = u, { opts: p, self: v } = d;
        if (!p.validateFormats)
          return;
        const w = new t.KeywordCxt(d, v.RULES.all.format.definition, "format");
        w.$data ? h() : y();
        function h() {
          const g = l.scopeValue("formats", {
            ref: v.formats,
            code: p.code.formats
          }), $ = l.const("fmt", (0, n._)`${g}[${w.schemaCode}]`);
          u.fail$data((0, n.or)((0, n._)`typeof ${$} != "object"`, (0, n._)`${$} instanceof RegExp`, (0, n._)`typeof ${$}.compare != "function"`, m($)));
        }
        function y() {
          const g = w.schema, $ = v.formats[g];
          if (!$ || $ === !0)
            return;
          if (typeof $ != "object" || $ instanceof RegExp || typeof $.compare != "function")
            throw new Error(`"${f}": format "${g}" does not define "compare" function`);
          const _ = l.scopeValue("formats", {
            key: g,
            ref: $,
            code: p.code.formats ? (0, n._)`${p.code.formats}${(0, n.getProperty)(g)}` : void 0
          });
          u.fail$data(m(_));
        }
        function m(g) {
          return (0, n._)`${g}.compare(${c}, ${i}) ${o[f].fail} 0`;
        }
      },
      dependencies: ["format"]
    };
    const s = (u) => (u.addKeyword(e.formatLimitDefinition), u);
    e.default = s;
  })(jn)), jn;
}
var Va;
function Rd() {
  return Va || (Va = 1, (function(e, t) {
    Object.defineProperty(t, "__esModule", { value: !0 });
    const n = pd(), r = Sd(), o = Z(), a = new o.Name("fullFormats"), s = new o.Name("fastFormats"), u = (c, i = { keywords: !0 }) => {
      if (Array.isArray(i))
        return l(c, i, n.fullFormats, a), c;
      const [f, d] = i.mode === "fast" ? [n.fastFormats, s] : [n.fullFormats, a], p = i.formats || n.formatNames;
      return l(c, p, f, d), i.keywords && (0, r.default)(c), c;
    };
    u.get = (c, i = "full") => {
      const d = (i === "fast" ? n.fastFormats : n.fullFormats)[c];
      if (!d)
        throw new Error(`Unknown format "${c}"`);
      return d;
    };
    function l(c, i, f, d) {
      var p, v;
      (p = (v = c.opts.code).formats) !== null && p !== void 0 || (v.formats = (0, o._)`require("ajv-formats/dist/formats").${d}`);
      for (const w of i)
        c.addFormat(w, f[w]);
    }
    e.exports = t = u, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = u;
  })(jr, jr.exports)), jr.exports;
}
var Pd = Rd();
const Od = /* @__PURE__ */ Yr(Pd), Nd = (e, t, n, r) => {
  if (n === "length" || n === "prototype" || n === "arguments" || n === "caller")
    return;
  const o = Object.getOwnPropertyDescriptor(e, n), a = Object.getOwnPropertyDescriptor(t, n);
  !Id(o, a) && r || Object.defineProperty(e, n, a);
}, Id = function(e, t) {
  return e === void 0 || e.configurable || e.writable === t.writable && e.enumerable === t.enumerable && e.configurable === t.configurable && (e.writable || e.value === t.value);
}, Td = (e, t) => {
  const n = Object.getPrototypeOf(t);
  n !== Object.getPrototypeOf(e) && Object.setPrototypeOf(e, n);
}, Cd = (e, t) => `/* Wrapped ${e}*/
${t}`, jd = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), Ad = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"), Dd = (e, t, n) => {
  const r = n === "" ? "" : `with ${n.trim()}() `, o = Cd.bind(null, r, t.toString());
  Object.defineProperty(o, "name", Ad);
  const { writable: a, enumerable: s, configurable: u } = jd;
  Object.defineProperty(e, "toString", { value: o, writable: a, enumerable: s, configurable: u });
};
function qd(e, t, { ignoreNonConfigurable: n = !1 } = {}) {
  const { name: r } = e;
  for (const o of Reflect.ownKeys(t))
    Nd(e, t, o, n);
  return Td(e, t), Dd(e, t, r), e;
}
const za = (e, t = {}) => {
  if (typeof e != "function")
    throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);
  const {
    wait: n = 0,
    maxWait: r = Number.POSITIVE_INFINITY,
    before: o = !1,
    after: a = !0
  } = t;
  if (n < 0 || r < 0)
    throw new RangeError("`wait` and `maxWait` must not be negative.");
  if (!o && !a)
    throw new Error("Both `before` and `after` are false, function wouldn't be called.");
  let s, u, l;
  const c = function(...i) {
    const f = this, d = () => {
      s = void 0, u && (clearTimeout(u), u = void 0), a && (l = e.apply(f, i));
    }, p = () => {
      u = void 0, s && (clearTimeout(s), s = void 0), a && (l = e.apply(f, i));
    }, v = o && !s;
    return clearTimeout(s), s = setTimeout(d, n), r > 0 && r !== Number.POSITIVE_INFINITY && !u && (u = setTimeout(p, r)), v && (l = e.apply(f, i)), l;
  };
  return qd(c, e), c.cancel = () => {
    s && (clearTimeout(s), s = void 0), u && (clearTimeout(u), u = void 0);
  }, c;
};
var qr = { exports: {} }, An, Ua;
function rn() {
  if (Ua) return An;
  Ua = 1;
  const e = "2.0.0", t = 256, n = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
  9007199254740991, r = 16, o = t - 6;
  return An = {
    MAX_LENGTH: t,
    MAX_SAFE_COMPONENT_LENGTH: r,
    MAX_SAFE_BUILD_LENGTH: o,
    MAX_SAFE_INTEGER: n,
    RELEASE_TYPES: [
      "major",
      "premajor",
      "minor",
      "preminor",
      "patch",
      "prepatch",
      "prerelease"
    ],
    SEMVER_SPEC_VERSION: e,
    FLAG_INCLUDE_PRERELEASE: 1,
    FLAG_LOOSE: 2
  }, An;
}
var Dn, Ga;
function nn() {
  return Ga || (Ga = 1, Dn = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...t) => console.error("SEMVER", ...t) : () => {
  }), Dn;
}
var xa;
function At() {
  return xa || (xa = 1, (function(e, t) {
    const {
      MAX_SAFE_COMPONENT_LENGTH: n,
      MAX_SAFE_BUILD_LENGTH: r,
      MAX_LENGTH: o
    } = rn(), a = nn();
    t = e.exports = {};
    const s = t.re = [], u = t.safeRe = [], l = t.src = [], c = t.safeSrc = [], i = t.t = {};
    let f = 0;
    const d = "[a-zA-Z0-9-]", p = [
      ["\\s", 1],
      ["\\d", o],
      [d, r]
    ], v = (h) => {
      for (const [y, m] of p)
        h = h.split(`${y}*`).join(`${y}{0,${m}}`).split(`${y}+`).join(`${y}{1,${m}}`);
      return h;
    }, w = (h, y, m) => {
      const g = v(y), $ = f++;
      a(h, $, y), i[h] = $, l[$] = y, c[$] = g, s[$] = new RegExp(y, m ? "g" : void 0), u[$] = new RegExp(g, m ? "g" : void 0);
    };
    w("NUMERICIDENTIFIER", "0|[1-9]\\d*"), w("NUMERICIDENTIFIERLOOSE", "\\d+"), w("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), w("MAINVERSION", `(${l[i.NUMERICIDENTIFIER]})\\.(${l[i.NUMERICIDENTIFIER]})\\.(${l[i.NUMERICIDENTIFIER]})`), w("MAINVERSIONLOOSE", `(${l[i.NUMERICIDENTIFIERLOOSE]})\\.(${l[i.NUMERICIDENTIFIERLOOSE]})\\.(${l[i.NUMERICIDENTIFIERLOOSE]})`), w("PRERELEASEIDENTIFIER", `(?:${l[i.NONNUMERICIDENTIFIER]}|${l[i.NUMERICIDENTIFIER]})`), w("PRERELEASEIDENTIFIERLOOSE", `(?:${l[i.NONNUMERICIDENTIFIER]}|${l[i.NUMERICIDENTIFIERLOOSE]})`), w("PRERELEASE", `(?:-(${l[i.PRERELEASEIDENTIFIER]}(?:\\.${l[i.PRERELEASEIDENTIFIER]})*))`), w("PRERELEASELOOSE", `(?:-?(${l[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[i.PRERELEASEIDENTIFIERLOOSE]})*))`), w("BUILDIDENTIFIER", `${d}+`), w("BUILD", `(?:\\+(${l[i.BUILDIDENTIFIER]}(?:\\.${l[i.BUILDIDENTIFIER]})*))`), w("FULLPLAIN", `v?${l[i.MAINVERSION]}${l[i.PRERELEASE]}?${l[i.BUILD]}?`), w("FULL", `^${l[i.FULLPLAIN]}$`), w("LOOSEPLAIN", `[v=\\s]*${l[i.MAINVERSIONLOOSE]}${l[i.PRERELEASELOOSE]}?${l[i.BUILD]}?`), w("LOOSE", `^${l[i.LOOSEPLAIN]}$`), w("GTLT", "((?:<|>)?=?)"), w("XRANGEIDENTIFIERLOOSE", `${l[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), w("XRANGEIDENTIFIER", `${l[i.NUMERICIDENTIFIER]}|x|X|\\*`), w("XRANGEPLAIN", `[v=\\s]*(${l[i.XRANGEIDENTIFIER]})(?:\\.(${l[i.XRANGEIDENTIFIER]})(?:\\.(${l[i.XRANGEIDENTIFIER]})(?:${l[i.PRERELEASE]})?${l[i.BUILD]}?)?)?`), w("XRANGEPLAINLOOSE", `[v=\\s]*(${l[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[i.XRANGEIDENTIFIERLOOSE]})(?:${l[i.PRERELEASELOOSE]})?${l[i.BUILD]}?)?)?`), w("XRANGE", `^${l[i.GTLT]}\\s*${l[i.XRANGEPLAIN]}$`), w("XRANGELOOSE", `^${l[i.GTLT]}\\s*${l[i.XRANGEPLAINLOOSE]}$`), w("COERCEPLAIN", `(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`), w("COERCE", `${l[i.COERCEPLAIN]}(?:$|[^\\d])`), w("COERCEFULL", l[i.COERCEPLAIN] + `(?:${l[i.PRERELEASE]})?(?:${l[i.BUILD]})?(?:$|[^\\d])`), w("COERCERTL", l[i.COERCE], !0), w("COERCERTLFULL", l[i.COERCEFULL], !0), w("LONETILDE", "(?:~>?)"), w("TILDETRIM", `(\\s*)${l[i.LONETILDE]}\\s+`, !0), t.tildeTrimReplace = "$1~", w("TILDE", `^${l[i.LONETILDE]}${l[i.XRANGEPLAIN]}$`), w("TILDELOOSE", `^${l[i.LONETILDE]}${l[i.XRANGEPLAINLOOSE]}$`), w("LONECARET", "(?:\\^)"), w("CARETTRIM", `(\\s*)${l[i.LONECARET]}\\s+`, !0), t.caretTrimReplace = "$1^", w("CARET", `^${l[i.LONECARET]}${l[i.XRANGEPLAIN]}$`), w("CARETLOOSE", `^${l[i.LONECARET]}${l[i.XRANGEPLAINLOOSE]}$`), w("COMPARATORLOOSE", `^${l[i.GTLT]}\\s*(${l[i.LOOSEPLAIN]})$|^$`), w("COMPARATOR", `^${l[i.GTLT]}\\s*(${l[i.FULLPLAIN]})$|^$`), w("COMPARATORTRIM", `(\\s*)${l[i.GTLT]}\\s*(${l[i.LOOSEPLAIN]}|${l[i.XRANGEPLAIN]})`, !0), t.comparatorTrimReplace = "$1$2$3", w("HYPHENRANGE", `^\\s*(${l[i.XRANGEPLAIN]})\\s+-\\s+(${l[i.XRANGEPLAIN]})\\s*$`), w("HYPHENRANGELOOSE", `^\\s*(${l[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[i.XRANGEPLAINLOOSE]})\\s*$`), w("STAR", "(<|>)?=?\\s*\\*"), w("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), w("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
  })(qr, qr.exports)), qr.exports;
}
var qn, Ha;
function Gs() {
  if (Ha) return qn;
  Ha = 1;
  const e = Object.freeze({ loose: !0 }), t = Object.freeze({});
  return qn = (r) => r ? typeof r != "object" ? e : r : t, qn;
}
var kn, Ka;
function zc() {
  if (Ka) return kn;
  Ka = 1;
  const e = /^[0-9]+$/, t = (r, o) => {
    if (typeof r == "number" && typeof o == "number")
      return r === o ? 0 : r < o ? -1 : 1;
    const a = e.test(r), s = e.test(o);
    return a && s && (r = +r, o = +o), r === o ? 0 : a && !s ? -1 : s && !a ? 1 : r < o ? -1 : 1;
  };
  return kn = {
    compareIdentifiers: t,
    rcompareIdentifiers: (r, o) => t(o, r)
  }, kn;
}
var Ln, Wa;
function ve() {
  if (Wa) return Ln;
  Wa = 1;
  const e = nn(), { MAX_LENGTH: t, MAX_SAFE_INTEGER: n } = rn(), { safeRe: r, t: o } = At(), a = Gs(), { compareIdentifiers: s } = zc();
  class u {
    constructor(c, i) {
      if (i = a(i), c instanceof u) {
        if (c.loose === !!i.loose && c.includePrerelease === !!i.includePrerelease)
          return c;
        c = c.version;
      } else if (typeof c != "string")
        throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);
      if (c.length > t)
        throw new TypeError(
          `version is longer than ${t} characters`
        );
      e("SemVer", c, i), this.options = i, this.loose = !!i.loose, this.includePrerelease = !!i.includePrerelease;
      const f = c.trim().match(i.loose ? r[o.LOOSE] : r[o.FULL]);
      if (!f)
        throw new TypeError(`Invalid Version: ${c}`);
      if (this.raw = c, this.major = +f[1], this.minor = +f[2], this.patch = +f[3], this.major > n || this.major < 0)
        throw new TypeError("Invalid major version");
      if (this.minor > n || this.minor < 0)
        throw new TypeError("Invalid minor version");
      if (this.patch > n || this.patch < 0)
        throw new TypeError("Invalid patch version");
      f[4] ? this.prerelease = f[4].split(".").map((d) => {
        if (/^[0-9]+$/.test(d)) {
          const p = +d;
          if (p >= 0 && p < n)
            return p;
        }
        return d;
      }) : this.prerelease = [], this.build = f[5] ? f[5].split(".") : [], this.format();
    }
    format() {
      return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
    }
    toString() {
      return this.version;
    }
    compare(c) {
      if (e("SemVer.compare", this.version, this.options, c), !(c instanceof u)) {
        if (typeof c == "string" && c === this.version)
          return 0;
        c = new u(c, this.options);
      }
      return c.version === this.version ? 0 : this.compareMain(c) || this.comparePre(c);
    }
    compareMain(c) {
      return c instanceof u || (c = new u(c, this.options)), this.major < c.major ? -1 : this.major > c.major ? 1 : this.minor < c.minor ? -1 : this.minor > c.minor ? 1 : this.patch < c.patch ? -1 : this.patch > c.patch ? 1 : 0;
    }
    comparePre(c) {
      if (c instanceof u || (c = new u(c, this.options)), this.prerelease.length && !c.prerelease.length)
        return -1;
      if (!this.prerelease.length && c.prerelease.length)
        return 1;
      if (!this.prerelease.length && !c.prerelease.length)
        return 0;
      let i = 0;
      do {
        const f = this.prerelease[i], d = c.prerelease[i];
        if (e("prerelease compare", i, f, d), f === void 0 && d === void 0)
          return 0;
        if (d === void 0)
          return 1;
        if (f === void 0)
          return -1;
        if (f === d)
          continue;
        return s(f, d);
      } while (++i);
    }
    compareBuild(c) {
      c instanceof u || (c = new u(c, this.options));
      let i = 0;
      do {
        const f = this.build[i], d = c.build[i];
        if (e("build compare", i, f, d), f === void 0 && d === void 0)
          return 0;
        if (d === void 0)
          return 1;
        if (f === void 0)
          return -1;
        if (f === d)
          continue;
        return s(f, d);
      } while (++i);
    }
    // preminor will bump the version up to the next minor release, and immediately
    // down to pre-release. premajor and prepatch work the same way.
    inc(c, i, f) {
      if (c.startsWith("pre")) {
        if (!i && f === !1)
          throw new Error("invalid increment argument: identifier is empty");
        if (i) {
          const d = `-${i}`.match(this.options.loose ? r[o.PRERELEASELOOSE] : r[o.PRERELEASE]);
          if (!d || d[1] !== i)
            throw new Error(`invalid identifier: ${i}`);
        }
      }
      switch (c) {
        case "premajor":
          this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", i, f);
          break;
        case "preminor":
          this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", i, f);
          break;
        case "prepatch":
          this.prerelease.length = 0, this.inc("patch", i, f), this.inc("pre", i, f);
          break;
        // If the input is a non-prerelease version, this acts the same as
        // prepatch.
        case "prerelease":
          this.prerelease.length === 0 && this.inc("patch", i, f), this.inc("pre", i, f);
          break;
        case "release":
          if (this.prerelease.length === 0)
            throw new Error(`version ${this.raw} is not a prerelease`);
          this.prerelease.length = 0;
          break;
        case "major":
          (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
          break;
        case "minor":
          (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
          break;
        case "patch":
          this.prerelease.length === 0 && this.patch++, this.prerelease = [];
          break;
        // This probably shouldn't be used publicly.
        // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
        case "pre": {
          const d = Number(f) ? 1 : 0;
          if (this.prerelease.length === 0)
            this.prerelease = [d];
          else {
            let p = this.prerelease.length;
            for (; --p >= 0; )
              typeof this.prerelease[p] == "number" && (this.prerelease[p]++, p = -2);
            if (p === -1) {
              if (i === this.prerelease.join(".") && f === !1)
                throw new Error("invalid increment argument: identifier already exists");
              this.prerelease.push(d);
            }
          }
          if (i) {
            let p = [i, d];
            f === !1 && (p = [i]), s(this.prerelease[0], i) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = p) : this.prerelease = p;
          }
          break;
        }
        default:
          throw new Error(`invalid increment argument: ${c}`);
      }
      return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
    }
  }
  return Ln = u, Ln;
}
var Mn, Xa;
function ut() {
  if (Xa) return Mn;
  Xa = 1;
  const e = ve();
  return Mn = (n, r, o = !1) => {
    if (n instanceof e)
      return n;
    try {
      return new e(n, r);
    } catch (a) {
      if (!o)
        return null;
      throw a;
    }
  }, Mn;
}
var Fn, Ya;
function kd() {
  if (Ya) return Fn;
  Ya = 1;
  const e = ut();
  return Fn = (n, r) => {
    const o = e(n, r);
    return o ? o.version : null;
  }, Fn;
}
var Bn, Ja;
function Ld() {
  if (Ja) return Bn;
  Ja = 1;
  const e = ut();
  return Bn = (n, r) => {
    const o = e(n.trim().replace(/^[=v]+/, ""), r);
    return o ? o.version : null;
  }, Bn;
}
var Vn, Za;
function Md() {
  if (Za) return Vn;
  Za = 1;
  const e = ve();
  return Vn = (n, r, o, a, s) => {
    typeof o == "string" && (s = a, a = o, o = void 0);
    try {
      return new e(
        n instanceof e ? n.version : n,
        o
      ).inc(r, a, s).version;
    } catch {
      return null;
    }
  }, Vn;
}
var zn, Qa;
function Fd() {
  if (Qa) return zn;
  Qa = 1;
  const e = ut();
  return zn = (n, r) => {
    const o = e(n, null, !0), a = e(r, null, !0), s = o.compare(a);
    if (s === 0)
      return null;
    const u = s > 0, l = u ? o : a, c = u ? a : o, i = !!l.prerelease.length;
    if (!!c.prerelease.length && !i) {
      if (!c.patch && !c.minor)
        return "major";
      if (c.compareMain(l) === 0)
        return c.minor && !c.patch ? "minor" : "patch";
    }
    const d = i ? "pre" : "";
    return o.major !== a.major ? d + "major" : o.minor !== a.minor ? d + "minor" : o.patch !== a.patch ? d + "patch" : "prerelease";
  }, zn;
}
var Un, eo;
function Bd() {
  if (eo) return Un;
  eo = 1;
  const e = ve();
  return Un = (n, r) => new e(n, r).major, Un;
}
var Gn, to;
function Vd() {
  if (to) return Gn;
  to = 1;
  const e = ve();
  return Gn = (n, r) => new e(n, r).minor, Gn;
}
var xn, ro;
function zd() {
  if (ro) return xn;
  ro = 1;
  const e = ve();
  return xn = (n, r) => new e(n, r).patch, xn;
}
var Hn, no;
function Ud() {
  if (no) return Hn;
  no = 1;
  const e = ut();
  return Hn = (n, r) => {
    const o = e(n, r);
    return o && o.prerelease.length ? o.prerelease : null;
  }, Hn;
}
var Kn, so;
function Te() {
  if (so) return Kn;
  so = 1;
  const e = ve();
  return Kn = (n, r, o) => new e(n, o).compare(new e(r, o)), Kn;
}
var Wn, io;
function Gd() {
  if (io) return Wn;
  io = 1;
  const e = Te();
  return Wn = (n, r, o) => e(r, n, o), Wn;
}
var Xn, ao;
function xd() {
  if (ao) return Xn;
  ao = 1;
  const e = Te();
  return Xn = (n, r) => e(n, r, !0), Xn;
}
var Yn, oo;
function xs() {
  if (oo) return Yn;
  oo = 1;
  const e = ve();
  return Yn = (n, r, o) => {
    const a = new e(n, o), s = new e(r, o);
    return a.compare(s) || a.compareBuild(s);
  }, Yn;
}
var Jn, co;
function Hd() {
  if (co) return Jn;
  co = 1;
  const e = xs();
  return Jn = (n, r) => n.sort((o, a) => e(o, a, r)), Jn;
}
var Zn, uo;
function Kd() {
  if (uo) return Zn;
  uo = 1;
  const e = xs();
  return Zn = (n, r) => n.sort((o, a) => e(a, o, r)), Zn;
}
var Qn, lo;
function sn() {
  if (lo) return Qn;
  lo = 1;
  const e = Te();
  return Qn = (n, r, o) => e(n, r, o) > 0, Qn;
}
var es, fo;
function Hs() {
  if (fo) return es;
  fo = 1;
  const e = Te();
  return es = (n, r, o) => e(n, r, o) < 0, es;
}
var ts, ho;
function Uc() {
  if (ho) return ts;
  ho = 1;
  const e = Te();
  return ts = (n, r, o) => e(n, r, o) === 0, ts;
}
var rs, po;
function Gc() {
  if (po) return rs;
  po = 1;
  const e = Te();
  return rs = (n, r, o) => e(n, r, o) !== 0, rs;
}
var ns, mo;
function Ks() {
  if (mo) return ns;
  mo = 1;
  const e = Te();
  return ns = (n, r, o) => e(n, r, o) >= 0, ns;
}
var ss, yo;
function Ws() {
  if (yo) return ss;
  yo = 1;
  const e = Te();
  return ss = (n, r, o) => e(n, r, o) <= 0, ss;
}
var is, go;
function xc() {
  if (go) return is;
  go = 1;
  const e = Uc(), t = Gc(), n = sn(), r = Ks(), o = Hs(), a = Ws();
  return is = (u, l, c, i) => {
    switch (l) {
      case "===":
        return typeof u == "object" && (u = u.version), typeof c == "object" && (c = c.version), u === c;
      case "!==":
        return typeof u == "object" && (u = u.version), typeof c == "object" && (c = c.version), u !== c;
      case "":
      case "=":
      case "==":
        return e(u, c, i);
      case "!=":
        return t(u, c, i);
      case ">":
        return n(u, c, i);
      case ">=":
        return r(u, c, i);
      case "<":
        return o(u, c, i);
      case "<=":
        return a(u, c, i);
      default:
        throw new TypeError(`Invalid operator: ${l}`);
    }
  }, is;
}
var as, vo;
function Wd() {
  if (vo) return as;
  vo = 1;
  const e = ve(), t = ut(), { safeRe: n, t: r } = At();
  return as = (a, s) => {
    if (a instanceof e)
      return a;
    if (typeof a == "number" && (a = String(a)), typeof a != "string")
      return null;
    s = s || {};
    let u = null;
    if (!s.rtl)
      u = a.match(s.includePrerelease ? n[r.COERCEFULL] : n[r.COERCE]);
    else {
      const p = s.includePrerelease ? n[r.COERCERTLFULL] : n[r.COERCERTL];
      let v;
      for (; (v = p.exec(a)) && (!u || u.index + u[0].length !== a.length); )
        (!u || v.index + v[0].length !== u.index + u[0].length) && (u = v), p.lastIndex = v.index + v[1].length + v[2].length;
      p.lastIndex = -1;
    }
    if (u === null)
      return null;
    const l = u[2], c = u[3] || "0", i = u[4] || "0", f = s.includePrerelease && u[5] ? `-${u[5]}` : "", d = s.includePrerelease && u[6] ? `+${u[6]}` : "";
    return t(`${l}.${c}.${i}${f}${d}`, s);
  }, as;
}
var os, _o;
function Xd() {
  if (_o) return os;
  _o = 1;
  class e {
    constructor() {
      this.max = 1e3, this.map = /* @__PURE__ */ new Map();
    }
    get(n) {
      const r = this.map.get(n);
      if (r !== void 0)
        return this.map.delete(n), this.map.set(n, r), r;
    }
    delete(n) {
      return this.map.delete(n);
    }
    set(n, r) {
      if (!this.delete(n) && r !== void 0) {
        if (this.map.size >= this.max) {
          const a = this.map.keys().next().value;
          this.delete(a);
        }
        this.map.set(n, r);
      }
      return this;
    }
  }
  return os = e, os;
}
var cs, wo;
function Ce() {
  if (wo) return cs;
  wo = 1;
  const e = /\s+/g;
  class t {
    constructor(F, X) {
      if (X = o(X), F instanceof t)
        return F.loose === !!X.loose && F.includePrerelease === !!X.includePrerelease ? F : new t(F.raw, X);
      if (F instanceof a)
        return this.raw = F.value, this.set = [[F]], this.formatted = void 0, this;
      if (this.options = X, this.loose = !!X.loose, this.includePrerelease = !!X.includePrerelease, this.raw = F.trim().replace(e, " "), this.set = this.raw.split("||").map((G) => this.parseRange(G.trim())).filter((G) => G.length), !this.set.length)
        throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
      if (this.set.length > 1) {
        const G = this.set[0];
        if (this.set = this.set.filter((x) => !w(x[0])), this.set.length === 0)
          this.set = [G];
        else if (this.set.length > 1) {
          for (const x of this.set)
            if (x.length === 1 && h(x[0])) {
              this.set = [x];
              break;
            }
        }
      }
      this.formatted = void 0;
    }
    get range() {
      if (this.formatted === void 0) {
        this.formatted = "";
        for (let F = 0; F < this.set.length; F++) {
          F > 0 && (this.formatted += "||");
          const X = this.set[F];
          for (let G = 0; G < X.length; G++)
            G > 0 && (this.formatted += " "), this.formatted += X[G].toString().trim();
        }
      }
      return this.formatted;
    }
    format() {
      return this.range;
    }
    toString() {
      return this.range;
    }
    parseRange(F) {
      const G = ((this.options.includePrerelease && p) | (this.options.loose && v)) + ":" + F, x = r.get(G);
      if (x)
        return x;
      const H = this.options.loose, D = H ? l[c.HYPHENRANGELOOSE] : l[c.HYPHENRANGE];
      F = F.replace(D, z(this.options.includePrerelease)), s("hyphen replace", F), F = F.replace(l[c.COMPARATORTRIM], i), s("comparator trim", F), F = F.replace(l[c.TILDETRIM], f), s("tilde trim", F), F = F.replace(l[c.CARETTRIM], d), s("caret trim", F);
      let N = F.split(" ").map((S) => m(S, this.options)).join(" ").split(/\s+/).map((S) => k(S, this.options));
      H && (N = N.filter((S) => (s("loose invalid filter", S, this.options), !!S.match(l[c.COMPARATORLOOSE])))), s("range list", N);
      const j = /* @__PURE__ */ new Map(), I = N.map((S) => new a(S, this.options));
      for (const S of I) {
        if (w(S))
          return [S];
        j.set(S.value, S);
      }
      j.size > 1 && j.has("") && j.delete("");
      const b = [...j.values()];
      return r.set(G, b), b;
    }
    intersects(F, X) {
      if (!(F instanceof t))
        throw new TypeError("a Range is required");
      return this.set.some((G) => y(G, X) && F.set.some((x) => y(x, X) && G.every((H) => x.every((D) => H.intersects(D, X)))));
    }
    // if ANY of the sets match ALL of its comparators, then pass
    test(F) {
      if (!F)
        return !1;
      if (typeof F == "string")
        try {
          F = new u(F, this.options);
        } catch {
          return !1;
        }
      for (let X = 0; X < this.set.length; X++)
        if (K(this.set[X], F, this.options))
          return !0;
      return !1;
    }
  }
  cs = t;
  const n = Xd(), r = new n(), o = Gs(), a = an(), s = nn(), u = ve(), {
    safeRe: l,
    t: c,
    comparatorTrimReplace: i,
    tildeTrimReplace: f,
    caretTrimReplace: d
  } = At(), { FLAG_INCLUDE_PRERELEASE: p, FLAG_LOOSE: v } = rn(), w = (A) => A.value === "<0.0.0-0", h = (A) => A.value === "", y = (A, F) => {
    let X = !0;
    const G = A.slice();
    let x = G.pop();
    for (; X && G.length; )
      X = G.every((H) => x.intersects(H, F)), x = G.pop();
    return X;
  }, m = (A, F) => (A = A.replace(l[c.BUILD], ""), s("comp", A, F), A = E(A, F), s("caret", A), A = $(A, F), s("tildes", A), A = O(A, F), s("xrange", A), A = L(A, F), s("stars", A), A), g = (A) => !A || A.toLowerCase() === "x" || A === "*", $ = (A, F) => A.trim().split(/\s+/).map((X) => _(X, F)).join(" "), _ = (A, F) => {
    const X = F.loose ? l[c.TILDELOOSE] : l[c.TILDE];
    return A.replace(X, (G, x, H, D, N) => {
      s("tilde", A, G, x, H, D, N);
      let j;
      return g(x) ? j = "" : g(H) ? j = `>=${x}.0.0 <${+x + 1}.0.0-0` : g(D) ? j = `>=${x}.${H}.0 <${x}.${+H + 1}.0-0` : N ? (s("replaceTilde pr", N), j = `>=${x}.${H}.${D}-${N} <${x}.${+H + 1}.0-0`) : j = `>=${x}.${H}.${D} <${x}.${+H + 1}.0-0`, s("tilde return", j), j;
    });
  }, E = (A, F) => A.trim().split(/\s+/).map((X) => R(X, F)).join(" "), R = (A, F) => {
    s("caret", A, F);
    const X = F.loose ? l[c.CARETLOOSE] : l[c.CARET], G = F.includePrerelease ? "-0" : "";
    return A.replace(X, (x, H, D, N, j) => {
      s("caret", A, x, H, D, N, j);
      let I;
      return g(H) ? I = "" : g(D) ? I = `>=${H}.0.0${G} <${+H + 1}.0.0-0` : g(N) ? H === "0" ? I = `>=${H}.${D}.0${G} <${H}.${+D + 1}.0-0` : I = `>=${H}.${D}.0${G} <${+H + 1}.0.0-0` : j ? (s("replaceCaret pr", j), H === "0" ? D === "0" ? I = `>=${H}.${D}.${N}-${j} <${H}.${D}.${+N + 1}-0` : I = `>=${H}.${D}.${N}-${j} <${H}.${+D + 1}.0-0` : I = `>=${H}.${D}.${N}-${j} <${+H + 1}.0.0-0`) : (s("no pr"), H === "0" ? D === "0" ? I = `>=${H}.${D}.${N}${G} <${H}.${D}.${+N + 1}-0` : I = `>=${H}.${D}.${N}${G} <${H}.${+D + 1}.0-0` : I = `>=${H}.${D}.${N} <${+H + 1}.0.0-0`), s("caret return", I), I;
    });
  }, O = (A, F) => (s("replaceXRanges", A, F), A.split(/\s+/).map((X) => M(X, F)).join(" ")), M = (A, F) => {
    A = A.trim();
    const X = F.loose ? l[c.XRANGELOOSE] : l[c.XRANGE];
    return A.replace(X, (G, x, H, D, N, j) => {
      s("xRange", A, G, x, H, D, N, j);
      const I = g(H), b = I || g(D), S = b || g(N), C = S;
      return x === "=" && C && (x = ""), j = F.includePrerelease ? "-0" : "", I ? x === ">" || x === "<" ? G = "<0.0.0-0" : G = "*" : x && C ? (b && (D = 0), N = 0, x === ">" ? (x = ">=", b ? (H = +H + 1, D = 0, N = 0) : (D = +D + 1, N = 0)) : x === "<=" && (x = "<", b ? H = +H + 1 : D = +D + 1), x === "<" && (j = "-0"), G = `${x + H}.${D}.${N}${j}`) : b ? G = `>=${H}.0.0${j} <${+H + 1}.0.0-0` : S && (G = `>=${H}.${D}.0${j} <${H}.${+D + 1}.0-0`), s("xRange return", G), G;
    });
  }, L = (A, F) => (s("replaceStars", A, F), A.trim().replace(l[c.STAR], "")), k = (A, F) => (s("replaceGTE0", A, F), A.trim().replace(l[F.includePrerelease ? c.GTE0PRE : c.GTE0], "")), z = (A) => (F, X, G, x, H, D, N, j, I, b, S, C) => (g(G) ? X = "" : g(x) ? X = `>=${G}.0.0${A ? "-0" : ""}` : g(H) ? X = `>=${G}.${x}.0${A ? "-0" : ""}` : D ? X = `>=${X}` : X = `>=${X}${A ? "-0" : ""}`, g(I) ? j = "" : g(b) ? j = `<${+I + 1}.0.0-0` : g(S) ? j = `<${I}.${+b + 1}.0-0` : C ? j = `<=${I}.${b}.${S}-${C}` : A ? j = `<${I}.${b}.${+S + 1}-0` : j = `<=${j}`, `${X} ${j}`.trim()), K = (A, F, X) => {
    for (let G = 0; G < A.length; G++)
      if (!A[G].test(F))
        return !1;
    if (F.prerelease.length && !X.includePrerelease) {
      for (let G = 0; G < A.length; G++)
        if (s(A[G].semver), A[G].semver !== a.ANY && A[G].semver.prerelease.length > 0) {
          const x = A[G].semver;
          if (x.major === F.major && x.minor === F.minor && x.patch === F.patch)
            return !0;
        }
      return !1;
    }
    return !0;
  };
  return cs;
}
var us, $o;
function an() {
  if ($o) return us;
  $o = 1;
  const e = Symbol("SemVer ANY");
  class t {
    static get ANY() {
      return e;
    }
    constructor(i, f) {
      if (f = n(f), i instanceof t) {
        if (i.loose === !!f.loose)
          return i;
        i = i.value;
      }
      i = i.trim().split(/\s+/).join(" "), s("comparator", i, f), this.options = f, this.loose = !!f.loose, this.parse(i), this.semver === e ? this.value = "" : this.value = this.operator + this.semver.version, s("comp", this);
    }
    parse(i) {
      const f = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], d = i.match(f);
      if (!d)
        throw new TypeError(`Invalid comparator: ${i}`);
      this.operator = d[1] !== void 0 ? d[1] : "", this.operator === "=" && (this.operator = ""), d[2] ? this.semver = new u(d[2], this.options.loose) : this.semver = e;
    }
    toString() {
      return this.value;
    }
    test(i) {
      if (s("Comparator.test", i, this.options.loose), this.semver === e || i === e)
        return !0;
      if (typeof i == "string")
        try {
          i = new u(i, this.options);
        } catch {
          return !1;
        }
      return a(i, this.operator, this.semver, this.options);
    }
    intersects(i, f) {
      if (!(i instanceof t))
        throw new TypeError("a Comparator is required");
      return this.operator === "" ? this.value === "" ? !0 : new l(i.value, f).test(this.value) : i.operator === "" ? i.value === "" ? !0 : new l(this.value, f).test(i.semver) : (f = n(f), f.includePrerelease && (this.value === "<0.0.0-0" || i.value === "<0.0.0-0") || !f.includePrerelease && (this.value.startsWith("<0.0.0") || i.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && i.operator.startsWith(">") || this.operator.startsWith("<") && i.operator.startsWith("<") || this.semver.version === i.semver.version && this.operator.includes("=") && i.operator.includes("=") || a(this.semver, "<", i.semver, f) && this.operator.startsWith(">") && i.operator.startsWith("<") || a(this.semver, ">", i.semver, f) && this.operator.startsWith("<") && i.operator.startsWith(">")));
    }
  }
  us = t;
  const n = Gs(), { safeRe: r, t: o } = At(), a = xc(), s = nn(), u = ve(), l = Ce();
  return us;
}
var ls, Eo;
function on() {
  if (Eo) return ls;
  Eo = 1;
  const e = Ce();
  return ls = (n, r, o) => {
    try {
      r = new e(r, o);
    } catch {
      return !1;
    }
    return r.test(n);
  }, ls;
}
var fs, bo;
function Yd() {
  if (bo) return fs;
  bo = 1;
  const e = Ce();
  return fs = (n, r) => new e(n, r).set.map((o) => o.map((a) => a.value).join(" ").trim().split(" ")), fs;
}
var ds, So;
function Jd() {
  if (So) return ds;
  So = 1;
  const e = ve(), t = Ce();
  return ds = (r, o, a) => {
    let s = null, u = null, l = null;
    try {
      l = new t(o, a);
    } catch {
      return null;
    }
    return r.forEach((c) => {
      l.test(c) && (!s || u.compare(c) === -1) && (s = c, u = new e(s, a));
    }), s;
  }, ds;
}
var hs, Ro;
function Zd() {
  if (Ro) return hs;
  Ro = 1;
  const e = ve(), t = Ce();
  return hs = (r, o, a) => {
    let s = null, u = null, l = null;
    try {
      l = new t(o, a);
    } catch {
      return null;
    }
    return r.forEach((c) => {
      l.test(c) && (!s || u.compare(c) === 1) && (s = c, u = new e(s, a));
    }), s;
  }, hs;
}
var ps, Po;
function Qd() {
  if (Po) return ps;
  Po = 1;
  const e = ve(), t = Ce(), n = sn();
  return ps = (o, a) => {
    o = new t(o, a);
    let s = new e("0.0.0");
    if (o.test(s) || (s = new e("0.0.0-0"), o.test(s)))
      return s;
    s = null;
    for (let u = 0; u < o.set.length; ++u) {
      const l = o.set[u];
      let c = null;
      l.forEach((i) => {
        const f = new e(i.semver.version);
        switch (i.operator) {
          case ">":
            f.prerelease.length === 0 ? f.patch++ : f.prerelease.push(0), f.raw = f.format();
          /* fallthrough */
          case "":
          case ">=":
            (!c || n(f, c)) && (c = f);
            break;
          case "<":
          case "<=":
            break;
          /* istanbul ignore next */
          default:
            throw new Error(`Unexpected operation: ${i.operator}`);
        }
      }), c && (!s || n(s, c)) && (s = c);
    }
    return s && o.test(s) ? s : null;
  }, ps;
}
var ms, Oo;
function eh() {
  if (Oo) return ms;
  Oo = 1;
  const e = Ce();
  return ms = (n, r) => {
    try {
      return new e(n, r).range || "*";
    } catch {
      return null;
    }
  }, ms;
}
var ys, No;
function Xs() {
  if (No) return ys;
  No = 1;
  const e = ve(), t = an(), { ANY: n } = t, r = Ce(), o = on(), a = sn(), s = Hs(), u = Ws(), l = Ks();
  return ys = (i, f, d, p) => {
    i = new e(i, p), f = new r(f, p);
    let v, w, h, y, m;
    switch (d) {
      case ">":
        v = a, w = u, h = s, y = ">", m = ">=";
        break;
      case "<":
        v = s, w = l, h = a, y = "<", m = "<=";
        break;
      default:
        throw new TypeError('Must provide a hilo val of "<" or ">"');
    }
    if (o(i, f, p))
      return !1;
    for (let g = 0; g < f.set.length; ++g) {
      const $ = f.set[g];
      let _ = null, E = null;
      if ($.forEach((R) => {
        R.semver === n && (R = new t(">=0.0.0")), _ = _ || R, E = E || R, v(R.semver, _.semver, p) ? _ = R : h(R.semver, E.semver, p) && (E = R);
      }), _.operator === y || _.operator === m || (!E.operator || E.operator === y) && w(i, E.semver))
        return !1;
      if (E.operator === m && h(i, E.semver))
        return !1;
    }
    return !0;
  }, ys;
}
var gs, Io;
function th() {
  if (Io) return gs;
  Io = 1;
  const e = Xs();
  return gs = (n, r, o) => e(n, r, ">", o), gs;
}
var vs, To;
function rh() {
  if (To) return vs;
  To = 1;
  const e = Xs();
  return vs = (n, r, o) => e(n, r, "<", o), vs;
}
var _s, Co;
function nh() {
  if (Co) return _s;
  Co = 1;
  const e = Ce();
  return _s = (n, r, o) => (n = new e(n, o), r = new e(r, o), n.intersects(r, o)), _s;
}
var ws, jo;
function sh() {
  if (jo) return ws;
  jo = 1;
  const e = on(), t = Te();
  return ws = (n, r, o) => {
    const a = [];
    let s = null, u = null;
    const l = n.sort((d, p) => t(d, p, o));
    for (const d of l)
      e(d, r, o) ? (u = d, s || (s = d)) : (u && a.push([s, u]), u = null, s = null);
    s && a.push([s, null]);
    const c = [];
    for (const [d, p] of a)
      d === p ? c.push(d) : !p && d === l[0] ? c.push("*") : p ? d === l[0] ? c.push(`<=${p}`) : c.push(`${d} - ${p}`) : c.push(`>=${d}`);
    const i = c.join(" || "), f = typeof r.raw == "string" ? r.raw : String(r);
    return i.length < f.length ? i : r;
  }, ws;
}
var $s, Ao;
function ih() {
  if (Ao) return $s;
  Ao = 1;
  const e = Ce(), t = an(), { ANY: n } = t, r = on(), o = Te(), a = (f, d, p = {}) => {
    if (f === d)
      return !0;
    f = new e(f, p), d = new e(d, p);
    let v = !1;
    e: for (const w of f.set) {
      for (const h of d.set) {
        const y = l(w, h, p);
        if (v = v || y !== null, y)
          continue e;
      }
      if (v)
        return !1;
    }
    return !0;
  }, s = [new t(">=0.0.0-0")], u = [new t(">=0.0.0")], l = (f, d, p) => {
    if (f === d)
      return !0;
    if (f.length === 1 && f[0].semver === n) {
      if (d.length === 1 && d[0].semver === n)
        return !0;
      p.includePrerelease ? f = s : f = u;
    }
    if (d.length === 1 && d[0].semver === n) {
      if (p.includePrerelease)
        return !0;
      d = u;
    }
    const v = /* @__PURE__ */ new Set();
    let w, h;
    for (const O of f)
      O.operator === ">" || O.operator === ">=" ? w = c(w, O, p) : O.operator === "<" || O.operator === "<=" ? h = i(h, O, p) : v.add(O.semver);
    if (v.size > 1)
      return null;
    let y;
    if (w && h) {
      if (y = o(w.semver, h.semver, p), y > 0)
        return null;
      if (y === 0 && (w.operator !== ">=" || h.operator !== "<="))
        return null;
    }
    for (const O of v) {
      if (w && !r(O, String(w), p) || h && !r(O, String(h), p))
        return null;
      for (const M of d)
        if (!r(O, String(M), p))
          return !1;
      return !0;
    }
    let m, g, $, _, E = h && !p.includePrerelease && h.semver.prerelease.length ? h.semver : !1, R = w && !p.includePrerelease && w.semver.prerelease.length ? w.semver : !1;
    E && E.prerelease.length === 1 && h.operator === "<" && E.prerelease[0] === 0 && (E = !1);
    for (const O of d) {
      if (_ = _ || O.operator === ">" || O.operator === ">=", $ = $ || O.operator === "<" || O.operator === "<=", w) {
        if (R && O.semver.prerelease && O.semver.prerelease.length && O.semver.major === R.major && O.semver.minor === R.minor && O.semver.patch === R.patch && (R = !1), O.operator === ">" || O.operator === ">=") {
          if (m = c(w, O, p), m === O && m !== w)
            return !1;
        } else if (w.operator === ">=" && !r(w.semver, String(O), p))
          return !1;
      }
      if (h) {
        if (E && O.semver.prerelease && O.semver.prerelease.length && O.semver.major === E.major && O.semver.minor === E.minor && O.semver.patch === E.patch && (E = !1), O.operator === "<" || O.operator === "<=") {
          if (g = i(h, O, p), g === O && g !== h)
            return !1;
        } else if (h.operator === "<=" && !r(h.semver, String(O), p))
          return !1;
      }
      if (!O.operator && (h || w) && y !== 0)
        return !1;
    }
    return !(w && $ && !h && y !== 0 || h && _ && !w && y !== 0 || R || E);
  }, c = (f, d, p) => {
    if (!f)
      return d;
    const v = o(f.semver, d.semver, p);
    return v > 0 ? f : v < 0 || d.operator === ">" && f.operator === ">=" ? d : f;
  }, i = (f, d, p) => {
    if (!f)
      return d;
    const v = o(f.semver, d.semver, p);
    return v < 0 ? f : v > 0 || d.operator === "<" && f.operator === "<=" ? d : f;
  };
  return $s = a, $s;
}
var Es, Do;
function ah() {
  if (Do) return Es;
  Do = 1;
  const e = At(), t = rn(), n = ve(), r = zc(), o = ut(), a = kd(), s = Ld(), u = Md(), l = Fd(), c = Bd(), i = Vd(), f = zd(), d = Ud(), p = Te(), v = Gd(), w = xd(), h = xs(), y = Hd(), m = Kd(), g = sn(), $ = Hs(), _ = Uc(), E = Gc(), R = Ks(), O = Ws(), M = xc(), L = Wd(), k = an(), z = Ce(), K = on(), A = Yd(), F = Jd(), X = Zd(), G = Qd(), x = eh(), H = Xs(), D = th(), N = rh(), j = nh(), I = sh(), b = ih();
  return Es = {
    parse: o,
    valid: a,
    clean: s,
    inc: u,
    diff: l,
    major: c,
    minor: i,
    patch: f,
    prerelease: d,
    compare: p,
    rcompare: v,
    compareLoose: w,
    compareBuild: h,
    sort: y,
    rsort: m,
    gt: g,
    lt: $,
    eq: _,
    neq: E,
    gte: R,
    lte: O,
    cmp: M,
    coerce: L,
    Comparator: k,
    Range: z,
    satisfies: K,
    toComparators: A,
    maxSatisfying: F,
    minSatisfying: X,
    minVersion: G,
    validRange: x,
    outside: H,
    gtr: D,
    ltr: N,
    intersects: j,
    simplifyRange: I,
    subset: b,
    SemVer: n,
    re: e.re,
    src: e.src,
    tokens: e.t,
    SEMVER_SPEC_VERSION: t.SEMVER_SPEC_VERSION,
    RELEASE_TYPES: t.RELEASE_TYPES,
    compareIdentifiers: r.compareIdentifiers,
    rcompareIdentifiers: r.rcompareIdentifiers
  }, Es;
}
var oh = ah();
const rt = /* @__PURE__ */ Yr(oh), ch = Object.prototype.toString, uh = "[object Uint8Array]", lh = "[object ArrayBuffer]";
function Hc(e, t, n) {
  return e ? e.constructor === t ? !0 : ch.call(e) === n : !1;
}
function Kc(e) {
  return Hc(e, Uint8Array, uh);
}
function fh(e) {
  return Hc(e, ArrayBuffer, lh);
}
function dh(e) {
  return Kc(e) || fh(e);
}
function hh(e) {
  if (!Kc(e))
    throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``);
}
function ph(e) {
  if (!dh(e))
    throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
}
function qo(e, t) {
  if (e.length === 0)
    return new Uint8Array(0);
  t ??= e.reduce((o, a) => o + a.length, 0);
  const n = new Uint8Array(t);
  let r = 0;
  for (const o of e)
    hh(o), n.set(o, r), r += o.length;
  return n;
}
const ko = {
  utf8: new globalThis.TextDecoder("utf8")
};
function Lo(e, t = "utf8") {
  return ph(e), ko[t] ??= new globalThis.TextDecoder(t), ko[t].decode(e);
}
function mh(e) {
  if (typeof e != "string")
    throw new TypeError(`Expected \`string\`, got \`${typeof e}\``);
}
const yh = new globalThis.TextEncoder();
function bs(e) {
  return mh(e), yh.encode(e);
}
Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
const gh = Od.default, Mo = "aes-256-cbc", nt = () => /* @__PURE__ */ Object.create(null), vh = (e) => e != null, _h = (e, t) => {
  const n = /* @__PURE__ */ new Set([
    "undefined",
    "symbol",
    "function"
  ]), r = typeof t;
  if (n.has(r))
    throw new TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`);
}, Ur = "__internal__", Ss = `${Ur}.migrations.version`;
class wh {
  path;
  events;
  #n;
  #t;
  #e;
  #r = {};
  constructor(t = {}) {
    const n = {
      configName: "config",
      fileExtension: "json",
      projectSuffix: "nodejs",
      clearInvalidConfig: !1,
      accessPropertiesByDotNotation: !0,
      configFileMode: 438,
      ...t
    };
    if (!n.cwd) {
      if (!n.projectName)
        throw new Error("Please specify the `projectName` option.");
      n.cwd = ku(n.projectName, { suffix: n.projectSuffix }).config;
    }
    if (this.#e = n, n.schema ?? n.ajvOptions ?? n.rootSchema) {
      if (n.schema && typeof n.schema != "object")
        throw new TypeError("The `schema` option must be an object.");
      const s = new hd.Ajv2020({
        allErrors: !0,
        useDefaults: !0,
        ...n.ajvOptions
      });
      gh(s);
      const u = {
        ...n.rootSchema,
        type: "object",
        properties: n.schema
      };
      this.#n = s.compile(u);
      for (const [l, c] of Object.entries(n.schema ?? {}))
        c?.default && (this.#r[l] = c.default);
    }
    n.defaults && (this.#r = {
      ...this.#r,
      ...n.defaults
    }), n.serialize && (this._serialize = n.serialize), n.deserialize && (this._deserialize = n.deserialize), this.events = new EventTarget(), this.#t = n.encryptionKey;
    const r = n.fileExtension ? `.${n.fileExtension}` : "";
    this.path = ie.resolve(n.cwd, `${n.configName ?? "config"}${r}`);
    const o = this.store, a = Object.assign(nt(), n.defaults, o);
    if (n.migrations) {
      if (!n.projectVersion)
        throw new Error("Please specify the `projectVersion` option.");
      this._migrate(n.migrations, n.projectVersion, n.beforeEachMigration);
    }
    this._validate(a);
    try {
      cu.deepEqual(o, a);
    } catch {
      this.store = a;
    }
    n.watch && this._watch();
  }
  get(t, n) {
    if (this.#e.accessPropertiesByDotNotation)
      return this._get(t, n);
    const { store: r } = this;
    return t in r ? r[t] : n;
  }
  set(t, n) {
    if (typeof t != "string" && typeof t != "object")
      throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);
    if (typeof t != "object" && n === void 0)
      throw new TypeError("Use `delete()` to clear values");
    if (this._containsReservedKey(t))
      throw new TypeError(`Please don't use the ${Ur} key, as it's used to manage this module internal operations.`);
    const { store: r } = this, o = (a, s) => {
      _h(a, s), this.#e.accessPropertiesByDotNotation ? oi(r, a, s) : r[a] = s;
    };
    if (typeof t == "object") {
      const a = t;
      for (const [s, u] of Object.entries(a))
        o(s, u);
    } else
      o(t, n);
    this.store = r;
  }
  has(t) {
    return this.#e.accessPropertiesByDotNotation ? ju(this.store, t) : t in this.store;
  }
  /**
      Reset items to their default values, as defined by the `defaults` or `schema` option.
  
      @see `clear()` to reset all items.
  
      @param keys - The keys of the items to reset.
      */
  reset(...t) {
    for (const n of t)
      vh(this.#r[n]) && this.set(n, this.#r[n]);
  }
  delete(t) {
    const { store: n } = this;
    this.#e.accessPropertiesByDotNotation ? Cu(n, t) : delete n[t], this.store = n;
  }
  /**
      Delete all items.
  
      This resets known items to their default values, if defined by the `defaults` or `schema` option.
      */
  clear() {
    this.store = nt();
    for (const t of Object.keys(this.#r))
      this.reset(t);
  }
  onDidChange(t, n) {
    if (typeof t != "string")
      throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);
    if (typeof n != "function")
      throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof n}`);
    return this._handleChange(() => this.get(t), n);
  }
  /**
      Watches the whole config object, calling `callback` on any changes.
  
      @param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
      @returns A function, that when called, will unsubscribe.
      */
  onDidAnyChange(t) {
    if (typeof t != "function")
      throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);
    return this._handleChange(() => this.store, t);
  }
  get size() {
    return Object.keys(this.store).length;
  }
  /**
      Get all the config as an object or replace the current config with an object.
  
      @example
      ```
      console.log(config.store);
      //=> {name: 'John', age: 30}
      ```
  
      @example
      ```
      config.store = {
          hello: 'world'
      };
      ```
      */
  get store() {
    try {
      const t = Q.readFileSync(this.path, this.#t ? null : "utf8"), n = this._encryptData(t), r = this._deserialize(n);
      return this._validate(r), Object.assign(nt(), r);
    } catch (t) {
      if (t?.code === "ENOENT")
        return this._ensureDirectory(), nt();
      if (this.#e.clearInvalidConfig && t.name === "SyntaxError")
        return nt();
      throw t;
    }
  }
  set store(t) {
    this._ensureDirectory(), this._validate(t), this._write(t), this.events.dispatchEvent(new Event("change"));
  }
  *[Symbol.iterator]() {
    for (const [t, n] of Object.entries(this.store))
      yield [t, n];
  }
  _encryptData(t) {
    if (!this.#t)
      return typeof t == "string" ? t : Lo(t);
    try {
      const n = t.slice(0, 16), r = ft.pbkdf2Sync(this.#t, n.toString(), 1e4, 32, "sha512"), o = ft.createDecipheriv(Mo, r, n), a = t.slice(17), s = typeof a == "string" ? bs(a) : a;
      return Lo(qo([o.update(s), o.final()]));
    } catch {
    }
    return t.toString();
  }
  _handleChange(t, n) {
    let r = t();
    const o = () => {
      const a = r, s = t();
      ou(s, a) || (r = s, n.call(this, s, a));
    };
    return this.events.addEventListener("change", o), () => {
      this.events.removeEventListener("change", o);
    };
  }
  _deserialize = (t) => JSON.parse(t);
  _serialize = (t) => JSON.stringify(t, void 0, "	");
  _validate(t) {
    if (!this.#n || this.#n(t) || !this.#n.errors)
      return;
    const r = this.#n.errors.map(({ instancePath: o, message: a = "" }) => `\`${o.slice(1)}\` ${a}`);
    throw new Error("Config schema violation: " + r.join("; "));
  }
  _ensureDirectory() {
    Q.mkdirSync(ie.dirname(this.path), { recursive: !0 });
  }
  _write(t) {
    let n = this._serialize(t);
    if (this.#t) {
      const r = ft.randomBytes(16), o = ft.pbkdf2Sync(this.#t, r.toString(), 1e4, 32, "sha512"), a = ft.createCipheriv(Mo, o, r);
      n = qo([r, bs(":"), a.update(bs(n)), a.final()]);
    }
    if (ae.env.SNAP)
      Q.writeFileSync(this.path, n, { mode: this.#e.configFileMode });
    else
      try {
        Rc(this.path, n, { mode: this.#e.configFileMode });
      } catch (r) {
        if (r?.code === "EXDEV") {
          Q.writeFileSync(this.path, n, { mode: this.#e.configFileMode });
          return;
        }
        throw r;
      }
  }
  _watch() {
    this._ensureDirectory(), Q.existsSync(this.path) || this._write(nt()), ae.platform === "win32" ? Q.watch(this.path, { persistent: !1 }, za(() => {
      this.events.dispatchEvent(new Event("change"));
    }, { wait: 100 })) : Q.watchFile(this.path, { persistent: !1 }, za(() => {
      this.events.dispatchEvent(new Event("change"));
    }, { wait: 5e3 }));
  }
  _migrate(t, n, r) {
    let o = this._get(Ss, "0.0.0");
    const a = Object.keys(t).filter((u) => this._shouldPerformMigration(u, o, n));
    let s = { ...this.store };
    for (const u of a)
      try {
        r && r(this, {
          fromVersion: o,
          toVersion: u,
          finalVersion: n,
          versions: a
        });
        const l = t[u];
        l?.(this), this._set(Ss, u), o = u, s = { ...this.store };
      } catch (l) {
        throw this.store = s, new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${l}`);
      }
    (this._isVersionInRangeFormat(o) || !rt.eq(o, n)) && this._set(Ss, n);
  }
  _containsReservedKey(t) {
    return typeof t == "object" && Object.keys(t)[0] === Ur ? !0 : typeof t != "string" ? !1 : this.#e.accessPropertiesByDotNotation ? !!t.startsWith(`${Ur}.`) : !1;
  }
  _isVersionInRangeFormat(t) {
    return rt.clean(t) === null;
  }
  _shouldPerformMigration(t, n, r) {
    return this._isVersionInRangeFormat(t) ? n !== "0.0.0" && rt.satisfies(n, t) ? !1 : rt.satisfies(r, t) : !(rt.lte(t, n) || rt.gt(t, r));
  }
  _get(t, n) {
    return Tu(this.store, t, n);
  }
  _set(t, n) {
    const { store: r } = this;
    oi(r, t, n), this.store = r;
  }
}
const { app: Gr, ipcMain: As, shell: $h } = Wr;
let Fo = !1;
const Bo = () => {
  if (!As || !Gr)
    throw new Error("Electron Store: You need to call `.initRenderer()` from the main process.");
  const e = {
    defaultCwd: Gr.getPath("userData"),
    appVersion: Gr.getVersion()
  };
  return Fo || (As.on("electron-store-get-data", (t) => {
    t.returnValue = e;
  }), Fo = !0), e;
};
class Eh extends wh {
  constructor(t) {
    let n, r;
    if (ae.type === "renderer") {
      const o = Wr.ipcRenderer.sendSync("electron-store-get-data");
      if (!o)
        throw new Error("Electron Store: You need to call `.initRenderer()` from the main process.");
      ({ defaultCwd: n, appVersion: r } = o);
    } else As && Gr && ({ defaultCwd: n, appVersion: r } = Bo());
    t = {
      name: "config",
      ...t
    }, t.projectVersion ||= r, t.cwd ? t.cwd = ie.isAbsolute(t.cwd) ? t.cwd : ie.join(n, t.cwd) : t.cwd = n, t.configName = t.name, delete t.name, super(t);
  }
  static initRenderer() {
    Bo();
  }
  async openInEditor() {
    const t = await $h.openPath(this.path);
    if (t)
      throw new Error(t);
  }
}
var kr = { exports: {} }, Lr = { exports: {} }, Mr = { exports: {} }, Rs, Vo;
function bh() {
  if (Vo) return Rs;
  Vo = 1;
  var e = 1e3, t = e * 60, n = t * 60, r = n * 24, o = r * 365.25;
  Rs = function(c, i) {
    i = i || {};
    var f = typeof c;
    if (f === "string" && c.length > 0)
      return a(c);
    if (f === "number" && isNaN(c) === !1)
      return i.long ? u(c) : s(c);
    throw new Error(
      "val is not a non-empty string or a valid number. val=" + JSON.stringify(c)
    );
  };
  function a(c) {
    if (c = String(c), !(c.length > 100)) {
      var i = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
        c
      );
      if (i) {
        var f = parseFloat(i[1]), d = (i[2] || "ms").toLowerCase();
        switch (d) {
          case "years":
          case "year":
          case "yrs":
          case "yr":
          case "y":
            return f * o;
          case "days":
          case "day":
          case "d":
            return f * r;
          case "hours":
          case "hour":
          case "hrs":
          case "hr":
          case "h":
            return f * n;
          case "minutes":
          case "minute":
          case "mins":
          case "min":
          case "m":
            return f * t;
          case "seconds":
          case "second":
          case "secs":
          case "sec":
          case "s":
            return f * e;
          case "milliseconds":
          case "millisecond":
          case "msecs":
          case "msec":
          case "ms":
            return f;
          default:
            return;
        }
      }
    }
  }
  function s(c) {
    return c >= r ? Math.round(c / r) + "d" : c >= n ? Math.round(c / n) + "h" : c >= t ? Math.round(c / t) + "m" : c >= e ? Math.round(c / e) + "s" : c + "ms";
  }
  function u(c) {
    return l(c, r, "day") || l(c, n, "hour") || l(c, t, "minute") || l(c, e, "second") || c + " ms";
  }
  function l(c, i, f) {
    if (!(c < i))
      return c < i * 1.5 ? Math.floor(c / i) + " " + f : Math.ceil(c / i) + " " + f + "s";
  }
  return Rs;
}
var zo;
function Wc() {
  return zo || (zo = 1, (function(e, t) {
    t = e.exports = o.debug = o.default = o, t.coerce = l, t.disable = s, t.enable = a, t.enabled = u, t.humanize = bh(), t.names = [], t.skips = [], t.formatters = {};
    var n;
    function r(c) {
      var i = 0, f;
      for (f in c)
        i = (i << 5) - i + c.charCodeAt(f), i |= 0;
      return t.colors[Math.abs(i) % t.colors.length];
    }
    function o(c) {
      function i() {
        if (i.enabled) {
          var f = i, d = +/* @__PURE__ */ new Date(), p = d - (n || d);
          f.diff = p, f.prev = n, f.curr = d, n = d;
          for (var v = new Array(arguments.length), w = 0; w < v.length; w++)
            v[w] = arguments[w];
          v[0] = t.coerce(v[0]), typeof v[0] != "string" && v.unshift("%O");
          var h = 0;
          v[0] = v[0].replace(/%([a-zA-Z%])/g, function(m, g) {
            if (m === "%%") return m;
            h++;
            var $ = t.formatters[g];
            if (typeof $ == "function") {
              var _ = v[h];
              m = $.call(f, _), v.splice(h, 1), h--;
            }
            return m;
          }), t.formatArgs.call(f, v);
          var y = i.log || t.log || console.log.bind(console);
          y.apply(f, v);
        }
      }
      return i.namespace = c, i.enabled = t.enabled(c), i.useColors = t.useColors(), i.color = r(c), typeof t.init == "function" && t.init(i), i;
    }
    function a(c) {
      t.save(c), t.names = [], t.skips = [];
      for (var i = (typeof c == "string" ? c : "").split(/[\s,]+/), f = i.length, d = 0; d < f; d++)
        i[d] && (c = i[d].replace(/\*/g, ".*?"), c[0] === "-" ? t.skips.push(new RegExp("^" + c.substr(1) + "$")) : t.names.push(new RegExp("^" + c + "$")));
    }
    function s() {
      t.enable("");
    }
    function u(c) {
      var i, f;
      for (i = 0, f = t.skips.length; i < f; i++)
        if (t.skips[i].test(c))
          return !1;
      for (i = 0, f = t.names.length; i < f; i++)
        if (t.names[i].test(c))
          return !0;
      return !1;
    }
    function l(c) {
      return c instanceof Error ? c.stack || c.message : c;
    }
  })(Mr, Mr.exports)), Mr.exports;
}
var Uo;
function Sh() {
  return Uo || (Uo = 1, (function(e, t) {
    t = e.exports = Wc(), t.log = o, t.formatArgs = r, t.save = a, t.load = s, t.useColors = n, t.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : u(), t.colors = [
      "lightseagreen",
      "forestgreen",
      "goldenrod",
      "dodgerblue",
      "darkorchid",
      "crimson"
    ];
    function n() {
      return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
      typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    t.formatters.j = function(l) {
      try {
        return JSON.stringify(l);
      } catch (c) {
        return "[UnexpectedJSONParseError]: " + c.message;
      }
    };
    function r(l) {
      var c = this.useColors;
      if (l[0] = (c ? "%c" : "") + this.namespace + (c ? " %c" : " ") + l[0] + (c ? "%c " : " ") + "+" + t.humanize(this.diff), !!c) {
        var i = "color: " + this.color;
        l.splice(1, 0, i, "color: inherit");
        var f = 0, d = 0;
        l[0].replace(/%[a-zA-Z%]/g, function(p) {
          p !== "%%" && (f++, p === "%c" && (d = f));
        }), l.splice(d, 0, i);
      }
    }
    function o() {
      return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments);
    }
    function a(l) {
      try {
        l == null ? t.storage.removeItem("debug") : t.storage.debug = l;
      } catch {
      }
    }
    function s() {
      var l;
      try {
        l = t.storage.debug;
      } catch {
      }
      return !l && typeof process < "u" && "env" in process && (l = process.env.DEBUG), l;
    }
    t.enable(s());
    function u() {
      try {
        return window.localStorage;
      } catch {
      }
    }
  })(Lr, Lr.exports)), Lr.exports;
}
var Fr = { exports: {} }, Go;
function Rh() {
  return Go || (Go = 1, (function(e, t) {
    var n = Ls, r = ks;
    t = e.exports = Wc(), t.init = d, t.log = l, t.formatArgs = u, t.save = c, t.load = i, t.useColors = s, t.colors = [6, 2, 3, 4, 5, 1], t.inspectOpts = Object.keys(process.env).filter(function(p) {
      return /^debug_/i.test(p);
    }).reduce(function(p, v) {
      var w = v.substring(6).toLowerCase().replace(/_([a-z])/g, function(y, m) {
        return m.toUpperCase();
      }), h = process.env[v];
      return /^(yes|on|true|enabled)$/i.test(h) ? h = !0 : /^(no|off|false|disabled)$/i.test(h) ? h = !1 : h === "null" ? h = null : h = Number(h), p[w] = h, p;
    }, {});
    var o = parseInt(process.env.DEBUG_FD, 10) || 2;
    o !== 1 && o !== 2 && r.deprecate(function() {
    }, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
    var a = o === 1 ? process.stdout : o === 2 ? process.stderr : f(o);
    function s() {
      return "colors" in t.inspectOpts ? !!t.inspectOpts.colors : n.isatty(o);
    }
    t.formatters.o = function(p) {
      return this.inspectOpts.colors = this.useColors, r.inspect(p, this.inspectOpts).split(`
`).map(function(v) {
        return v.trim();
      }).join(" ");
    }, t.formatters.O = function(p) {
      return this.inspectOpts.colors = this.useColors, r.inspect(p, this.inspectOpts);
    };
    function u(p) {
      var v = this.namespace, w = this.useColors;
      if (w) {
        var h = this.color, y = "  \x1B[3" + h + ";1m" + v + " \x1B[0m";
        p[0] = y + p[0].split(`
`).join(`
` + y), p.push("\x1B[3" + h + "m+" + t.humanize(this.diff) + "\x1B[0m");
      } else
        p[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + v + " " + p[0];
    }
    function l() {
      return a.write(r.format.apply(r, arguments) + `
`);
    }
    function c(p) {
      p == null ? delete process.env.DEBUG : process.env.DEBUG = p;
    }
    function i() {
      return process.env.DEBUG;
    }
    function f(p) {
      var v, w = process.binding("tty_wrap");
      switch (w.guessHandleType(p)) {
        case "TTY":
          v = new n.WriteStream(p), v._type = "tty", v._handle && v._handle.unref && v._handle.unref();
          break;
        case "FILE":
          var h = Xr;
          v = new h.SyncWriteStream(p, { autoClose: !1 }), v._type = "fs";
          break;
        case "PIPE":
        case "TCP":
          var y = Ec;
          v = new y.Socket({
            fd: p,
            readable: !1,
            writable: !0
          }), v.readable = !1, v.read = null, v._type = "pipe", v._handle && v._handle.unref && v._handle.unref();
          break;
        default:
          throw new Error("Implement me. Unknown stream file type!");
      }
      return v.fd = p, v._isStdio = !0, v;
    }
    function d(p) {
      p.inspectOpts = {};
      for (var v = Object.keys(t.inspectOpts), w = 0; w < v.length; w++)
        p.inspectOpts[v[w]] = t.inspectOpts[v[w]];
    }
    t.enable(i());
  })(Fr, Fr.exports)), Fr.exports;
}
var xo;
function Ph() {
  return xo || (xo = 1, typeof process < "u" && process.type === "renderer" ? kr.exports = Sh() : kr.exports = Rh()), kr.exports;
}
var Ps, Ho;
function Oh() {
  if (Ho) return Ps;
  Ho = 1;
  var e = oe, t = lu.spawn, n = Ph()("electron-squirrel-startup"), r = Wr.app, o = function(s, u) {
    var l = e.resolve(e.dirname(process.execPath), "..", "Update.exe");
    n("Spawning `%s` with args `%s`", l, s), t(l, s, {
      detached: !0
    }).on("close", u);
  }, a = function() {
    if (process.platform === "win32") {
      var s = process.argv[1];
      n("processing squirrel command `%s`", s);
      var u = e.basename(process.execPath);
      if (s === "--squirrel-install" || s === "--squirrel-updated")
        return o(["--createShortcut=" + u], r.quit), !0;
      if (s === "--squirrel-uninstall")
        return o(["--removeShortcut=" + u], r.quit), !0;
      if (s === "--squirrel-obsolete")
        return r.quit(), !0;
    }
    return !1;
  };
  return Ps = a(), Ps;
}
var Nh = Oh();
const Ih = /* @__PURE__ */ Yr(Nh), xr = {
  _socket: null,
  _id: 1,
  connect: function(e, t, n, r = !0) {
    return new Promise((o) => {
      try {
        this._socket = Ec.connect({ host: e, port: t }, () => {
          this._socket.setNoDelay(r);
        }), this._socket.on("error", (a) => {
          n.isDestroyed() || n.webContents.send("tcpError", a);
        }), this._socket.on("end", () => {
          n.isDestroyed() || n.webContents.send("tcpEnd");
        }), this._socket.on("data", (a) => {
          n.isDestroyed() || n.webContents.send("tcpData", a);
        }), o({ error: !1, id: this._id++ });
      } catch (a) {
        o({ error: !0, errorMsg: a });
      }
    });
  },
  close: function() {
    this._socket && !this._socket.destroyed && this._socket.end(), this._socket = null;
  },
  send: function(e) {
    return new Promise((t) => {
      this._socket && !this._socket.destroyed ? this._socket.write(Buffer.from(e), () => {
        t({ error: !1, bytesWritten: e.byteLength });
      }) : t({ error: !0, msg: "Socket closed or invalid" });
    });
  }
}, mt = mu.createSocket("udp4"), Os = {
  _id: 1,
  _ip: null,
  _port: null,
  connect: function(e, t, n = !0) {
    return new Promise((r) => {
      try {
        mt.bind(t, () => {
          this._ip = e, this._port = t, r({ error: !1, id: this._id++ });
        }), mt.on("error", (o) => {
          n && typeof n.isDestroyed == "function" && !n.isDestroyed() && n.webContents.send("udpError", o);
        }), mt.on("message", (o, a) => {
          n && typeof n.isDestroyed == "function" && !n.isDestroyed() && n.webContents.send("udpMessage", o);
        });
      } catch (o) {
        r({ error: !0, errorMsg: o });
      }
    });
  },
  close: function() {
    return new Promise((e) => {
      try {
        mt.disconnect(), e({ error: !1 });
      } catch (t) {
        e({ error: !0, msg: t });
      }
    });
  },
  send: function(e) {
    return new Promise((t) => {
      this._ip && this._port && mt.send(Buffer.from(e), this._port, this._ip, (n) => {
        t(n ? { error: !0, msg: n } : { error: !1, bytesWritten: e.byteLength });
      });
    });
  }
};
var He = {}, yt = {}, Ko;
function Th() {
  if (Ko) return yt;
  Ko = 1, Object.defineProperty(yt, "__esModule", { value: !0 }), yt.ByteLengthParser = void 0;
  const e = Se;
  class t extends e.Transform {
    length;
    position;
    buffer;
    constructor(r) {
      if (super(r), typeof r.length != "number")
        throw new TypeError('"length" is not a number');
      if (r.length < 1)
        throw new TypeError('"length" is not greater than 0');
      this.length = r.length, this.position = 0, this.buffer = Buffer.alloc(this.length);
    }
    _transform(r, o, a) {
      let s = 0;
      for (; s < r.length; )
        this.buffer[this.position] = r[s], s++, this.position++, this.position === this.length && (this.push(this.buffer), this.buffer = Buffer.alloc(this.length), this.position = 0);
      a();
    }
    _flush(r) {
      this.push(this.buffer.slice(0, this.position)), this.buffer = Buffer.alloc(this.length), r();
    }
  }
  return yt.ByteLengthParser = t, yt;
}
var gt = {}, Wo;
function Ch() {
  if (Wo) return gt;
  Wo = 1, Object.defineProperty(gt, "__esModule", { value: !0 }), gt.CCTalkParser = void 0;
  const e = Se;
  class t extends e.Transform {
    array;
    cursor;
    lastByteFetchTime;
    maxDelayBetweenBytesMs;
    constructor(r = 50) {
      super(), this.array = [], this.cursor = 0, this.lastByteFetchTime = 0, this.maxDelayBetweenBytesMs = r;
    }
    _transform(r, o, a) {
      if (this.maxDelayBetweenBytesMs > 0) {
        const s = Date.now();
        s - this.lastByteFetchTime > this.maxDelayBetweenBytesMs && (this.array = [], this.cursor = 0), this.lastByteFetchTime = s;
      }
      for (this.cursor += r.length, Array.from(r).map((s) => this.array.push(s)); this.cursor > 1 && this.cursor >= this.array[1] + 5; ) {
        const s = this.array[1] + 5, u = Buffer.from(this.array.slice(0, s));
        this.array = this.array.slice(u.length, this.array.length), this.cursor -= s, this.push(u);
      }
      a();
    }
  }
  return gt.CCTalkParser = t, gt;
}
var vt = {}, Xo;
function Xc() {
  if (Xo) return vt;
  Xo = 1, Object.defineProperty(vt, "__esModule", { value: !0 }), vt.DelimiterParser = void 0;
  const e = Se;
  class t extends e.Transform {
    includeDelimiter;
    delimiter;
    buffer;
    constructor({ delimiter: r, includeDelimiter: o = !1, ...a }) {
      if (super(a), r === void 0)
        throw new TypeError('"delimiter" is not a bufferable object');
      if (r.length === 0)
        throw new TypeError('"delimiter" has a 0 or undefined length');
      this.includeDelimiter = o, this.delimiter = Buffer.from(r), this.buffer = Buffer.alloc(0);
    }
    _transform(r, o, a) {
      let s = Buffer.concat([this.buffer, r]), u;
      for (; (u = s.indexOf(this.delimiter)) !== -1; )
        this.push(s.slice(0, u + (this.includeDelimiter ? this.delimiter.length : 0))), s = s.slice(u + this.delimiter.length);
      this.buffer = s, a();
    }
    _flush(r) {
      this.push(this.buffer), this.buffer = Buffer.alloc(0), r();
    }
  }
  return vt.DelimiterParser = t, vt;
}
var _t = {}, Yo;
function jh() {
  if (Yo) return _t;
  Yo = 1, Object.defineProperty(_t, "__esModule", { value: !0 }), _t.InterByteTimeoutParser = void 0;
  const e = Se;
  class t extends e.Transform {
    maxBufferSize;
    currentPacket;
    interval;
    intervalID;
    constructor({ maxBufferSize: r = 65536, interval: o, ...a }) {
      if (super(a), !o)
        throw new TypeError('"interval" is required');
      if (typeof o != "number" || Number.isNaN(o))
        throw new TypeError('"interval" is not a number');
      if (o < 1)
        throw new TypeError('"interval" is not greater than 0');
      if (typeof r != "number" || Number.isNaN(r))
        throw new TypeError('"maxBufferSize" is not a number');
      if (r < 1)
        throw new TypeError('"maxBufferSize" is not greater than 0');
      this.maxBufferSize = r, this.currentPacket = [], this.interval = o;
    }
    _transform(r, o, a) {
      this.intervalID && clearTimeout(this.intervalID);
      for (let s = 0; s < r.length; s++)
        this.currentPacket.push(r[s]), this.currentPacket.length >= this.maxBufferSize && this.emitPacket();
      this.intervalID = setTimeout(this.emitPacket.bind(this), this.interval), a();
    }
    emitPacket() {
      this.intervalID && clearTimeout(this.intervalID), this.currentPacket.length > 0 && this.push(Buffer.from(this.currentPacket)), this.currentPacket = [];
    }
    _flush(r) {
      this.emitPacket(), r();
    }
  }
  return _t.InterByteTimeoutParser = t, _t;
}
var wt = {}, Jo;
function Ah() {
  if (Jo) return wt;
  Jo = 1, Object.defineProperty(wt, "__esModule", { value: !0 }), wt.PacketLengthParser = void 0;
  const e = Se;
  class t extends e.Transform {
    buffer;
    start;
    opts;
    constructor(r = {}) {
      super(r);
      const { delimiter: o = [170], delimiterBytes: a = 1, packetOverhead: s = 2, lengthBytes: u = 1, lengthOffset: l = 1, maxLen: c = 255 } = r;
      this.opts = {
        delimiter: [].concat(o),
        delimiterBytes: a,
        packetOverhead: s,
        lengthBytes: u,
        lengthOffset: l,
        maxLen: c
      }, this.buffer = Buffer.alloc(0), this.start = !1;
    }
    _transform(r, o, a) {
      for (let s = 0; s < r.length; s++) {
        const u = r[s];
        if (this.start === !0) {
          if (this.buffer = Buffer.concat([this.buffer, Buffer.from([u])]), this.buffer.length >= this.opts.lengthOffset + this.opts.lengthBytes) {
            const l = this.buffer.readUIntLE(this.opts.lengthOffset, this.opts.lengthBytes);
            (this.buffer.length == l + this.opts.packetOverhead || l > this.opts.maxLen) && (this.push(this.buffer), this.buffer = Buffer.alloc(0), this.start = !1);
          }
        } else if (this.buffer = Buffer.concat([Buffer.from([u]), this.buffer]), this.buffer.length === this.opts.delimiterBytes) {
          const l = this.buffer.readUIntLE(0, this.opts.delimiterBytes);
          this.opts.delimiter.includes(l) ? (this.start = !0, this.buffer = Buffer.from([...this.buffer].reverse())) : this.buffer = Buffer.from(this.buffer.subarray(1, this.buffer.length));
        }
      }
      a();
    }
    _flush(r) {
      this.push(this.buffer), this.buffer = Buffer.alloc(0), r();
    }
  }
  return wt.PacketLengthParser = t, wt;
}
var $t = {}, Zo;
function Dh() {
  if (Zo) return $t;
  Zo = 1, Object.defineProperty($t, "__esModule", { value: !0 }), $t.ReadlineParser = void 0;
  const e = Xc();
  class t extends e.DelimiterParser {
    constructor(r) {
      const o = {
        delimiter: Buffer.from(`
`, "utf8"),
        encoding: "utf8",
        ...r
      };
      typeof o.delimiter == "string" && (o.delimiter = Buffer.from(o.delimiter, o.encoding)), super(o);
    }
  }
  return $t.ReadlineParser = t, $t;
}
var Et = {}, Qo;
function qh() {
  if (Qo) return Et;
  Qo = 1, Object.defineProperty(Et, "__esModule", { value: !0 }), Et.ReadyParser = void 0;
  const e = Se;
  class t extends e.Transform {
    delimiter;
    readOffset;
    ready;
    constructor({ delimiter: r, ...o }) {
      if (r === void 0)
        throw new TypeError('"delimiter" is not a bufferable object');
      if (r.length === 0)
        throw new TypeError('"delimiter" has a 0 or undefined length');
      super(o), this.delimiter = Buffer.from(r), this.readOffset = 0, this.ready = !1;
    }
    _transform(r, o, a) {
      if (this.ready)
        return this.push(r), a();
      const s = this.delimiter;
      let u = 0;
      for (; this.readOffset < s.length && u < r.length; )
        s[this.readOffset] === r[u] ? this.readOffset++ : this.readOffset = 0, u++;
      if (this.readOffset === s.length) {
        this.ready = !0, this.emit("ready");
        const l = r.slice(u);
        l.length > 0 && this.push(l);
      }
      a();
    }
  }
  return Et.ReadyParser = t, Et;
}
var bt = {}, ec;
function kh() {
  if (ec) return bt;
  ec = 1, Object.defineProperty(bt, "__esModule", { value: !0 }), bt.RegexParser = void 0;
  const e = Se;
  class t extends e.Transform {
    regex;
    data;
    constructor({ regex: r, ...o }) {
      const a = {
        encoding: "utf8",
        ...o
      };
      if (r === void 0)
        throw new TypeError('"options.regex" must be a regular expression pattern or object');
      r instanceof RegExp || (r = new RegExp(r.toString())), super(a), this.regex = r, this.data = "";
    }
    _transform(r, o, a) {
      const u = (this.data + r).split(this.regex);
      this.data = u.pop() || "", u.forEach((l) => {
        this.push(l);
      }), a();
    }
    _flush(r) {
      this.push(this.data), this.data = "", r();
    }
  }
  return bt.RegexParser = t, bt;
}
var Ke = {}, St = {}, tc;
function Lh() {
  if (tc) return St;
  tc = 1, Object.defineProperty(St, "__esModule", { value: !0 }), St.SlipDecoder = void 0;
  const e = Se;
  class t extends e.Transform {
    opts;
    buffer;
    escape;
    start;
    constructor(r = {}) {
      super(r);
      const { START: o, ESC: a = 219, END: s = 192, ESC_START: u, ESC_END: l = 220, ESC_ESC: c = 221 } = r;
      this.opts = {
        START: o,
        ESC: a,
        END: s,
        ESC_START: u,
        ESC_END: l,
        ESC_ESC: c
      }, this.buffer = Buffer.alloc(0), this.escape = !1, this.start = !1;
    }
    _transform(r, o, a) {
      for (let s = 0; s < r.length; s++) {
        let u = r[s];
        if (u === this.opts.START) {
          this.start = !0;
          continue;
        } else this.opts.START == null && (this.start = !0);
        if (this.escape)
          u === this.opts.ESC_START && this.opts.START ? u = this.opts.START : u === this.opts.ESC_ESC ? u = this.opts.ESC : u === this.opts.ESC_END ? u = this.opts.END : (this.escape = !1, this.push(this.buffer), this.buffer = Buffer.alloc(0));
        else {
          if (u === this.opts.ESC) {
            this.escape = !0;
            continue;
          }
          if (u === this.opts.END) {
            this.push(this.buffer), this.buffer = Buffer.alloc(0), this.escape = !1, this.start = !1;
            continue;
          }
        }
        this.escape = !1, this.start && (this.buffer = Buffer.concat([this.buffer, Buffer.from([u])]));
      }
      a();
    }
    _flush(r) {
      this.push(this.buffer), this.buffer = Buffer.alloc(0), r();
    }
  }
  return St.SlipDecoder = t, St;
}
var Rt = {}, rc;
function Mh() {
  if (rc) return Rt;
  rc = 1, Object.defineProperty(Rt, "__esModule", { value: !0 }), Rt.SlipEncoder = void 0;
  const e = Se;
  class t extends e.Transform {
    opts;
    constructor(r = {}) {
      super(r);
      const { START: o, ESC: a = 219, END: s = 192, ESC_START: u, ESC_END: l = 220, ESC_ESC: c = 221, bluetoothQuirk: i = !1 } = r;
      this.opts = {
        START: o,
        ESC: a,
        END: s,
        ESC_START: u,
        ESC_END: l,
        ESC_ESC: c,
        bluetoothQuirk: i
      };
    }
    _transform(r, o, a) {
      const s = r.length;
      if (this.opts.bluetoothQuirk && s === 0)
        return a();
      const u = Buffer.alloc(s * 2 + 2);
      let l = 0;
      this.opts.bluetoothQuirk == !0 && (u[l++] = this.opts.END), this.opts.START !== void 0 && (u[l++] = this.opts.START);
      for (let c = 0; c < s; c++) {
        let i = r[c];
        i === this.opts.START && this.opts.ESC_START ? (u[l++] = this.opts.ESC, i = this.opts.ESC_START) : i === this.opts.END ? (u[l++] = this.opts.ESC, i = this.opts.ESC_END) : i === this.opts.ESC && (u[l++] = this.opts.ESC, i = this.opts.ESC_ESC), u[l++] = i;
      }
      u[l++] = this.opts.END, a(null, u.slice(0, l));
    }
  }
  return Rt.SlipEncoder = t, Rt;
}
var nc;
function Fh() {
  return nc || (nc = 1, (function(e) {
    var t = Ke && Ke.__createBinding || (Object.create ? (function(r, o, a, s) {
      s === void 0 && (s = a);
      var u = Object.getOwnPropertyDescriptor(o, a);
      (!u || ("get" in u ? !o.__esModule : u.writable || u.configurable)) && (u = { enumerable: !0, get: function() {
        return o[a];
      } }), Object.defineProperty(r, s, u);
    }) : (function(r, o, a, s) {
      s === void 0 && (s = a), r[s] = o[a];
    })), n = Ke && Ke.__exportStar || function(r, o) {
      for (var a in r) a !== "default" && !Object.prototype.hasOwnProperty.call(o, a) && t(o, r, a);
    };
    Object.defineProperty(e, "__esModule", { value: !0 }), n(Lh(), e), n(Mh(), e);
  })(Ke)), Ke;
}
var Pt = {}, Ns = {}, sc;
function Bh() {
  return sc || (sc = 1, (function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 }), e.convertHeaderBufferToObj = e.HEADER_LENGTH = void 0, e.HEADER_LENGTH = 6;
    const t = (r) => {
      let o = Number(r).toString(2);
      for (; o.length < 8; )
        o = `0${o}`;
      return o;
    }, n = (r) => {
      const o = Array.from(r.slice(0, e.HEADER_LENGTH)).reduce((p, v) => `${p}${t(v)}`, ""), s = o.slice(0, 3) === "000" ? 1 : "UNKNOWN_VERSION", u = Number(o[3]), l = Number(o[4]), c = parseInt(o.slice(5, 16), 2), i = parseInt(o.slice(16, 18), 2), f = parseInt(o.slice(18, 32), 2), d = parseInt(o.slice(-16), 2) + 1;
      return {
        versionNumber: s,
        identification: {
          apid: c,
          secondaryHeader: l,
          type: u
        },
        sequenceControl: {
          packetName: f,
          sequenceFlags: i
        },
        dataLength: d
      };
    };
    e.convertHeaderBufferToObj = n;
  })(Ns)), Ns;
}
var ic;
function Vh() {
  if (ic) return Pt;
  ic = 1, Object.defineProperty(Pt, "__esModule", { value: !0 }), Pt.SpacePacketParser = void 0;
  const e = Se, t = Bh();
  class n extends e.Transform {
    timeCodeFieldLength;
    ancillaryDataFieldLength;
    dataBuffer;
    headerBuffer;
    dataLength;
    expectingHeader;
    dataSlice;
    header;
    /**
     * A Transform stream that accepts a stream of octet data and emits object representations of
     * CCSDS Space Packets once a packet has been completely received.
     * @param {Object} [options] Configuration options for the stream
     * @param {Number} options.timeCodeFieldLength The length of the time code field within the data
     * @param {Number} options.ancillaryDataFieldLength The length of the ancillary data field within the data
     */
    constructor(o = {}) {
      super({ ...o, objectMode: !0 }), this.timeCodeFieldLength = o.timeCodeFieldLength || 0, this.ancillaryDataFieldLength = o.ancillaryDataFieldLength || 0, this.dataSlice = this.timeCodeFieldLength + this.ancillaryDataFieldLength, this.dataBuffer = Buffer.alloc(0), this.headerBuffer = Buffer.alloc(0), this.dataLength = 0, this.expectingHeader = !0;
    }
    /**
     * Bundle the header, secondary header if present, and the data into a JavaScript object to emit.
     * If more data has been received past the current packet, begin the process of parsing the next
     * packet(s).
     */
    pushCompletedPacket() {
      if (!this.header)
        throw new Error("Missing header");
      const o = Buffer.from(this.dataBuffer.slice(0, this.timeCodeFieldLength)), a = Buffer.from(this.dataBuffer.slice(this.timeCodeFieldLength, this.timeCodeFieldLength + this.ancillaryDataFieldLength)), s = Buffer.from(this.dataBuffer.slice(this.dataSlice, this.dataLength)), u = {
        header: { ...this.header },
        data: s.toString()
      };
      (o.length > 0 || a.length > 0) && (u.secondaryHeader = {}, o.length && (u.secondaryHeader.timeCode = o.toString()), a.length && (u.secondaryHeader.ancillaryData = a.toString())), this.push(u);
      const l = Buffer.from(this.dataBuffer.slice(this.dataLength));
      l.length >= t.HEADER_LENGTH ? this.extractHeader(l) : (this.headerBuffer = l, this.dataBuffer = Buffer.alloc(0), this.expectingHeader = !0, this.dataLength = 0, this.header = void 0);
    }
    /**
     * Build the Stream's headerBuffer property from the received Buffer chunk; extract data from it
     * if it's complete. If there's more to the chunk than just the header, initiate handling the
     * packet data.
     * @param chunk -  Build the Stream's headerBuffer property from
     */
    extractHeader(o) {
      const a = Buffer.concat([this.headerBuffer, o]), s = a.slice(t.HEADER_LENGTH);
      a.length >= t.HEADER_LENGTH ? (this.header = (0, t.convertHeaderBufferToObj)(a), this.dataLength = this.header.dataLength, this.headerBuffer = Buffer.alloc(0), this.expectingHeader = !1) : this.headerBuffer = a, s.length > 0 && (this.dataBuffer = Buffer.from(s), this.dataBuffer.length >= this.dataLength && this.pushCompletedPacket());
    }
    _transform(o, a, s) {
      this.expectingHeader ? this.extractHeader(o) : (this.dataBuffer = Buffer.concat([this.dataBuffer, o]), this.dataBuffer.length >= this.dataLength && this.pushCompletedPacket()), s();
    }
    _flush(o) {
      const a = Buffer.concat([this.headerBuffer, this.dataBuffer]), s = Array.from(a);
      this.push(s), o();
    }
  }
  return Pt.SpacePacketParser = n, Pt;
}
var Ot = {}, ke = {}, Br = { exports: {} }, Vr = { exports: {} }, Is, ac;
function zh() {
  if (ac) return Is;
  ac = 1;
  var e = 1e3, t = e * 60, n = t * 60, r = n * 24, o = r * 7, a = r * 365.25;
  Is = function(i, f) {
    f = f || {};
    var d = typeof i;
    if (d === "string" && i.length > 0)
      return s(i);
    if (d === "number" && isFinite(i))
      return f.long ? l(i) : u(i);
    throw new Error(
      "val is not a non-empty string or a valid number. val=" + JSON.stringify(i)
    );
  };
  function s(i) {
    if (i = String(i), !(i.length > 100)) {
      var f = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        i
      );
      if (f) {
        var d = parseFloat(f[1]), p = (f[2] || "ms").toLowerCase();
        switch (p) {
          case "years":
          case "year":
          case "yrs":
          case "yr":
          case "y":
            return d * a;
          case "weeks":
          case "week":
          case "w":
            return d * o;
          case "days":
          case "day":
          case "d":
            return d * r;
          case "hours":
          case "hour":
          case "hrs":
          case "hr":
          case "h":
            return d * n;
          case "minutes":
          case "minute":
          case "mins":
          case "min":
          case "m":
            return d * t;
          case "seconds":
          case "second":
          case "secs":
          case "sec":
          case "s":
            return d * e;
          case "milliseconds":
          case "millisecond":
          case "msecs":
          case "msec":
          case "ms":
            return d;
          default:
            return;
        }
      }
    }
  }
  function u(i) {
    var f = Math.abs(i);
    return f >= r ? Math.round(i / r) + "d" : f >= n ? Math.round(i / n) + "h" : f >= t ? Math.round(i / t) + "m" : f >= e ? Math.round(i / e) + "s" : i + "ms";
  }
  function l(i) {
    var f = Math.abs(i);
    return f >= r ? c(i, f, r, "day") : f >= n ? c(i, f, n, "hour") : f >= t ? c(i, f, t, "minute") : f >= e ? c(i, f, e, "second") : i + " ms";
  }
  function c(i, f, d, p) {
    var v = f >= d * 1.5;
    return Math.round(i / d) + " " + p + (v ? "s" : "");
  }
  return Is;
}
var Ts, oc;
function Yc() {
  if (oc) return Ts;
  oc = 1;
  function e(t) {
    r.debug = r, r.default = r, r.coerce = c, r.disable = u, r.enable = a, r.enabled = l, r.humanize = zh(), r.destroy = i, Object.keys(t).forEach((f) => {
      r[f] = t[f];
    }), r.names = [], r.skips = [], r.formatters = {};
    function n(f) {
      let d = 0;
      for (let p = 0; p < f.length; p++)
        d = (d << 5) - d + f.charCodeAt(p), d |= 0;
      return r.colors[Math.abs(d) % r.colors.length];
    }
    r.selectColor = n;
    function r(f) {
      let d, p = null, v, w;
      function h(...y) {
        if (!h.enabled)
          return;
        const m = h, g = Number(/* @__PURE__ */ new Date()), $ = g - (d || g);
        m.diff = $, m.prev = d, m.curr = g, d = g, y[0] = r.coerce(y[0]), typeof y[0] != "string" && y.unshift("%O");
        let _ = 0;
        y[0] = y[0].replace(/%([a-zA-Z%])/g, (R, O) => {
          if (R === "%%")
            return "%";
          _++;
          const M = r.formatters[O];
          if (typeof M == "function") {
            const L = y[_];
            R = M.call(m, L), y.splice(_, 1), _--;
          }
          return R;
        }), r.formatArgs.call(m, y), (m.log || r.log).apply(m, y);
      }
      return h.namespace = f, h.useColors = r.useColors(), h.color = r.selectColor(f), h.extend = o, h.destroy = r.destroy, Object.defineProperty(h, "enabled", {
        enumerable: !0,
        configurable: !1,
        get: () => p !== null ? p : (v !== r.namespaces && (v = r.namespaces, w = r.enabled(f)), w),
        set: (y) => {
          p = y;
        }
      }), typeof r.init == "function" && r.init(h), h;
    }
    function o(f, d) {
      const p = r(this.namespace + (typeof d > "u" ? ":" : d) + f);
      return p.log = this.log, p;
    }
    function a(f) {
      r.save(f), r.namespaces = f, r.names = [], r.skips = [];
      const d = (typeof f == "string" ? f : "").trim().replace(" ", ",").split(",").filter(Boolean);
      for (const p of d)
        p[0] === "-" ? r.skips.push(p.slice(1)) : r.names.push(p);
    }
    function s(f, d) {
      let p = 0, v = 0, w = -1, h = 0;
      for (; p < f.length; )
        if (v < d.length && (d[v] === f[p] || d[v] === "*"))
          d[v] === "*" ? (w = v, h = p, v++) : (p++, v++);
        else if (w !== -1)
          v = w + 1, h++, p = h;
        else
          return !1;
      for (; v < d.length && d[v] === "*"; )
        v++;
      return v === d.length;
    }
    function u() {
      const f = [
        ...r.names,
        ...r.skips.map((d) => "-" + d)
      ].join(",");
      return r.enable(""), f;
    }
    function l(f) {
      for (const d of r.skips)
        if (s(f, d))
          return !1;
      for (const d of r.names)
        if (s(f, d))
          return !0;
      return !1;
    }
    function c(f) {
      return f instanceof Error ? f.stack || f.message : f;
    }
    function i() {
      console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
    }
    return r.enable(r.load()), r;
  }
  return Ts = e, Ts;
}
var cc;
function Uh() {
  return cc || (cc = 1, (function(e, t) {
    t.formatArgs = r, t.save = o, t.load = a, t.useColors = n, t.storage = s(), t.destroy = /* @__PURE__ */ (() => {
      let l = !1;
      return () => {
        l || (l = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
      };
    })(), t.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function n() {
      if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
        return !0;
      if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
        return !1;
      let l;
      return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator < "u" && navigator.userAgent && (l = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(l[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function r(l) {
      if (l[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + l[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
        return;
      const c = "color: " + this.color;
      l.splice(1, 0, c, "color: inherit");
      let i = 0, f = 0;
      l[0].replace(/%[a-zA-Z%]/g, (d) => {
        d !== "%%" && (i++, d === "%c" && (f = i));
      }), l.splice(f, 0, c);
    }
    t.log = console.debug || console.log || (() => {
    });
    function o(l) {
      try {
        l ? t.storage.setItem("debug", l) : t.storage.removeItem("debug");
      } catch {
      }
    }
    function a() {
      let l;
      try {
        l = t.storage.getItem("debug");
      } catch {
      }
      return !l && typeof process < "u" && "env" in process && (l = process.env.DEBUG), l;
    }
    function s() {
      try {
        return localStorage;
      } catch {
      }
    }
    e.exports = Yc()(t);
    const { formatters: u } = e.exports;
    u.j = function(l) {
      try {
        return JSON.stringify(l);
      } catch (c) {
        return "[UnexpectedJSONParseError]: " + c.message;
      }
    };
  })(Vr, Vr.exports)), Vr.exports;
}
var zr = { exports: {} }, Cs, uc;
function Gh() {
  return uc || (uc = 1, Cs = (e, t = process.argv) => {
    const n = e.startsWith("-") ? "" : e.length === 1 ? "-" : "--", r = t.indexOf(n + e), o = t.indexOf("--");
    return r !== -1 && (o === -1 || r < o);
  }), Cs;
}
var js, lc;
function xh() {
  if (lc) return js;
  lc = 1;
  const e = yu, t = Ls, n = Gh(), { env: r } = process;
  let o;
  n("no-color") || n("no-colors") || n("color=false") || n("color=never") ? o = 0 : (n("color") || n("colors") || n("color=true") || n("color=always")) && (o = 1), "FORCE_COLOR" in r && (r.FORCE_COLOR === "true" ? o = 1 : r.FORCE_COLOR === "false" ? o = 0 : o = r.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(r.FORCE_COLOR, 10), 3));
  function a(l) {
    return l === 0 ? !1 : {
      level: l,
      hasBasic: !0,
      has256: l >= 2,
      has16m: l >= 3
    };
  }
  function s(l, c) {
    if (o === 0)
      return 0;
    if (n("color=16m") || n("color=full") || n("color=truecolor"))
      return 3;
    if (n("color=256"))
      return 2;
    if (l && !c && o === void 0)
      return 0;
    const i = o || 0;
    if (r.TERM === "dumb")
      return i;
    if (process.platform === "win32") {
      const f = e.release().split(".");
      return Number(f[0]) >= 10 && Number(f[2]) >= 10586 ? Number(f[2]) >= 14931 ? 3 : 2 : 1;
    }
    if ("CI" in r)
      return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((f) => f in r) || r.CI_NAME === "codeship" ? 1 : i;
    if ("TEAMCITY_VERSION" in r)
      return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION) ? 1 : 0;
    if (r.COLORTERM === "truecolor")
      return 3;
    if ("TERM_PROGRAM" in r) {
      const f = parseInt((r.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
      switch (r.TERM_PROGRAM) {
        case "iTerm.app":
          return f >= 3 ? 3 : 2;
        case "Apple_Terminal":
          return 2;
      }
    }
    return /-256(color)?$/i.test(r.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM) || "COLORTERM" in r ? 1 : i;
  }
  function u(l) {
    const c = s(l, l && l.isTTY);
    return a(c);
  }
  return js = {
    supportsColor: u,
    stdout: a(s(!0, t.isatty(1))),
    stderr: a(s(!0, t.isatty(2)))
  }, js;
}
var fc;
function Hh() {
  return fc || (fc = 1, (function(e, t) {
    const n = Ls, r = ks;
    t.init = i, t.log = u, t.formatArgs = a, t.save = l, t.load = c, t.useColors = o, t.destroy = r.deprecate(
      () => {
      },
      "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
    ), t.colors = [6, 2, 3, 4, 5, 1];
    try {
      const d = xh();
      d && (d.stderr || d).level >= 2 && (t.colors = [
        20,
        21,
        26,
        27,
        32,
        33,
        38,
        39,
        40,
        41,
        42,
        43,
        44,
        45,
        56,
        57,
        62,
        63,
        68,
        69,
        74,
        75,
        76,
        77,
        78,
        79,
        80,
        81,
        92,
        93,
        98,
        99,
        112,
        113,
        128,
        129,
        134,
        135,
        148,
        149,
        160,
        161,
        162,
        163,
        164,
        165,
        166,
        167,
        168,
        169,
        170,
        171,
        172,
        173,
        178,
        179,
        184,
        185,
        196,
        197,
        198,
        199,
        200,
        201,
        202,
        203,
        204,
        205,
        206,
        207,
        208,
        209,
        214,
        215,
        220,
        221
      ]);
    } catch {
    }
    t.inspectOpts = Object.keys(process.env).filter((d) => /^debug_/i.test(d)).reduce((d, p) => {
      const v = p.substring(6).toLowerCase().replace(/_([a-z])/g, (h, y) => y.toUpperCase());
      let w = process.env[p];
      return /^(yes|on|true|enabled)$/i.test(w) ? w = !0 : /^(no|off|false|disabled)$/i.test(w) ? w = !1 : w === "null" ? w = null : w = Number(w), d[v] = w, d;
    }, {});
    function o() {
      return "colors" in t.inspectOpts ? !!t.inspectOpts.colors : n.isatty(process.stderr.fd);
    }
    function a(d) {
      const { namespace: p, useColors: v } = this;
      if (v) {
        const w = this.color, h = "\x1B[3" + (w < 8 ? w : "8;5;" + w), y = `  ${h};1m${p} \x1B[0m`;
        d[0] = y + d[0].split(`
`).join(`
` + y), d.push(h + "m+" + e.exports.humanize(this.diff) + "\x1B[0m");
      } else
        d[0] = s() + p + " " + d[0];
    }
    function s() {
      return t.inspectOpts.hideDate ? "" : (/* @__PURE__ */ new Date()).toISOString() + " ";
    }
    function u(...d) {
      return process.stderr.write(r.formatWithOptions(t.inspectOpts, ...d) + `
`);
    }
    function l(d) {
      d ? process.env.DEBUG = d : delete process.env.DEBUG;
    }
    function c() {
      return process.env.DEBUG;
    }
    function i(d) {
      d.inspectOpts = {};
      const p = Object.keys(t.inspectOpts);
      for (let v = 0; v < p.length; v++)
        d.inspectOpts[p[v]] = t.inspectOpts[p[v]];
    }
    e.exports = Yc()(t);
    const { formatters: f } = e.exports;
    f.o = function(d) {
      return this.inspectOpts.colors = this.useColors, r.inspect(d, this.inspectOpts).split(`
`).map((p) => p.trim()).join(" ");
    }, f.O = function(d) {
      return this.inspectOpts.colors = this.useColors, r.inspect(d, this.inspectOpts);
    };
  })(zr, zr.exports)), zr.exports;
}
var dc;
function Jc() {
  return dc || (dc = 1, typeof process > "u" || process.type === "renderer" || process.browser === !0 || process.__nwjs ? Br.exports = Uh() : Br.exports = Hh()), Br.exports;
}
var hc;
function Ys() {
  if (hc) return ke;
  hc = 1;
  var e = ke && ke.__importDefault || function(l) {
    return l && l.__esModule ? l : { default: l };
  };
  Object.defineProperty(ke, "__esModule", { value: !0 }), ke.SerialPortStream = ke.DisconnectedError = void 0;
  const t = Se, r = (0, e(Jc()).default)("serialport/stream");
  class o extends Error {
    disconnected;
    constructor(c) {
      super(c), this.disconnected = !0;
    }
  }
  ke.DisconnectedError = o;
  const a = {
    brk: !1,
    cts: !1,
    dtr: !0,
    rts: !0
  };
  function s(l) {
    const c = Buffer.allocUnsafe(l);
    return c.used = 0, c;
  }
  class u extends t.Duplex {
    port;
    _pool;
    _kMinPoolSpace;
    opening;
    closing;
    settings;
    /**
     * Create a new serial port object for the `path`. In the case of invalid arguments or invalid options, when constructing a new SerialPort it will throw an error. The port will open automatically by default, which is the equivalent of calling `port.open(openCallback)` in the next tick. You can disable this by setting the option `autoOpen` to `false`.
     * @emits open
     * @emits data
     * @emits close
     * @emits error
     */
    constructor(c, i) {
      const f = {
        autoOpen: !0,
        endOnClose: !1,
        highWaterMark: 65536,
        ...c
      };
      if (super({
        highWaterMark: f.highWaterMark
      }), !f.binding)
        throw new TypeError('"Bindings" is invalid pass it as `options.binding`');
      if (!f.path)
        throw new TypeError(`"path" is not defined: ${f.path}`);
      if (typeof f.baudRate != "number")
        throw new TypeError(`"baudRate" must be a number: ${f.baudRate}`);
      this.settings = f, this.opening = !1, this.closing = !1, this._pool = s(this.settings.highWaterMark), this._kMinPoolSpace = 128, this.settings.autoOpen && this.open(i);
    }
    get path() {
      return this.settings.path;
    }
    get baudRate() {
      return this.settings.baudRate;
    }
    get isOpen() {
      return (this.port?.isOpen ?? !1) && !this.closing;
    }
    _error(c, i) {
      i ? i.call(this, c) : this.emit("error", c);
    }
    _asyncError(c, i) {
      process.nextTick(() => this._error(c, i));
    }
    /**
     * Opens a connection to the given serial port.
     * @param {ErrorCallback=} openCallback - Called after a connection is opened. If this is not provided and an error occurs, it will be emitted on the port's `error` event.
     * @emits open
     */
    open(c) {
      if (this.isOpen)
        return this._asyncError(new Error("Port is already open"), c);
      if (this.opening)
        return this._asyncError(new Error("Port is opening"), c);
      const { highWaterMark: i, binding: f, autoOpen: d, endOnClose: p, ...v } = this.settings;
      this.opening = !0, r("opening", `path: ${this.path}`), this.settings.binding.open(v).then((w) => {
        r("opened", `path: ${this.path}`), this.port = w, this.opening = !1, this.emit("open"), c && c.call(this, null);
      }, (w) => {
        this.opening = !1, r("Binding #open had an error", w), this._error(w, c);
      });
    }
    /**
     * Changes the baud rate for an open port. Emits an error or calls the callback if the baud rate isn't supported.
     * @param {object=} options Only supports `baudRate`.
     * @param {number=} [options.baudRate] The baud rate of the port to be opened. This should match one of the commonly available baud rates, such as 110, 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, or 115200. Custom rates are supported best effort per platform. The device connected to the serial port is not guaranteed to support the requested baud rate, even if the port itself supports that baud rate.
     * @param {ErrorCallback=} [callback] Called once the port's baud rate changes. If `.update` is called without a callback, and there is an error, an error event is emitted.
     * @returns {undefined}
     */
    update(c, i) {
      if (!this.isOpen || !this.port)
        return r("update attempted, but port is not open"), this._asyncError(new Error("Port is not open"), i);
      r("update", `baudRate: ${c.baudRate}`), this.port.update(c).then(() => {
        r("binding.update", "finished"), this.settings.baudRate = c.baudRate, i && i.call(this, null);
      }, (f) => (r("binding.update", "error", f), this._error(f, i)));
    }
    write(c, i, f) {
      return Array.isArray(c) && (c = Buffer.from(c)), typeof i == "function" ? super.write(c, i) : super.write(c, i, f);
    }
    _write(c, i, f) {
      if (!this.isOpen || !this.port) {
        this.once("open", () => {
          this._write(c, i, f);
        });
        return;
      }
      r("_write", `${c.length} bytes of data`), this.port.write(c).then(() => {
        r("binding.write", "write finished"), f(null);
      }, (d) => {
        r("binding.write", "error", d), d.canceled || this._disconnected(d), f(d);
      });
    }
    _writev(c, i) {
      r("_writev", `${c.length} chunks of data`);
      const f = c.map((d) => d.chunk);
      this._write(Buffer.concat(f), "binary", i);
    }
    _read(c) {
      if (!this.isOpen || !this.port) {
        r("_read", "queueing _read for after open"), this.once("open", () => {
          this._read(c);
        });
        return;
      }
      (!this._pool || this._pool.length - this._pool.used < this._kMinPoolSpace) && (r("_read", "discarding the read buffer pool because it is below kMinPoolSpace"), this._pool = s(this.settings.highWaterMark));
      const i = this._pool, f = Math.min(i.length - i.used, c), d = i.used;
      r("_read", "reading", { start: d, toRead: f }), this.port.read(i, d, f).then(({ bytesRead: p }) => {
        if (r("binding.read", "finished", { bytesRead: p }), p === 0) {
          r("binding.read", "Zero bytes read closing readable stream"), this.push(null);
          return;
        }
        i.used += p, this.push(i.slice(d, d + p));
      }, (p) => {
        r("binding.read", "error", p), p.canceled || this._disconnected(p), this._read(c);
      });
    }
    _disconnected(c) {
      if (!this.isOpen) {
        r("disconnected aborted because already closed", c);
        return;
      }
      r("disconnected", c), this.close(void 0, new o(c.message));
    }
    /**
     * Closes an open connection.
     *
     * If there are in progress writes when the port is closed the writes will error.
     * @param {ErrorCallback} callback Called once a connection is closed.
     * @param {Error} disconnectError used internally to propagate a disconnect error
     */
    close(c, i = null) {
      if (!this.isOpen || !this.port)
        return r("close attempted, but port is not open"), this._asyncError(new Error("Port is not open"), c);
      this.closing = !0, r("#close"), this.port.close().then(() => {
        this.closing = !1, r("binding.close", "finished"), this.emit("close", i), this.settings.endOnClose && this.emit("end"), c && c.call(this, i);
      }, (f) => (this.closing = !1, r("binding.close", "had an error", f), this._error(f, c)));
    }
    /**
     * Set control flags on an open port. Uses [`SetCommMask`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363257(v=vs.85).aspx) for Windows and [`ioctl`](http://linux.die.net/man/4/tty_ioctl) for OS X and Linux.
     *
     * All options are operating system default when the port is opened. Every flag is set on each call to the provided or default values. If options isn't provided default options is used.
     */
    set(c, i) {
      if (!this.isOpen || !this.port)
        return r("set attempted, but port is not open"), this._asyncError(new Error("Port is not open"), i);
      const f = { ...a, ...c };
      r("#set", f), this.port.set(f).then(() => {
        r("binding.set", "finished"), i && i.call(this, null);
      }, (d) => (r("binding.set", "had an error", d), this._error(d, i)));
    }
    /**
     * Returns the control flags (CTS, DSR, DCD) on the open port.
     * Uses [`GetCommModemStatus`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363258(v=vs.85).aspx) for Windows and [`ioctl`](http://linux.die.net/man/4/tty_ioctl) for mac and linux.
     */
    get(c) {
      if (!this.isOpen || !this.port)
        return r("get attempted, but port is not open"), this._asyncError(new Error("Port is not open"), c);
      r("#get"), this.port.get().then((i) => {
        r("binding.get", "finished"), c.call(this, null, i);
      }, (i) => (r("binding.get", "had an error", i), this._error(i, c)));
    }
    /**
     * Flush discards data received but not read, and written but not transmitted by the operating system. For more technical details, see [`tcflush(fd, TCIOFLUSH)`](http://linux.die.net/man/3/tcflush) for Mac/Linux and [`FlushFileBuffers`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439) for Windows.
     */
    flush(c) {
      if (!this.isOpen || !this.port)
        return r("flush attempted, but port is not open"), this._asyncError(new Error("Port is not open"), c);
      r("#flush"), this.port.flush().then(() => {
        r("binding.flush", "finished"), c && c.call(this, null);
      }, (i) => (r("binding.flush", "had an error", i), this._error(i, c)));
    }
    /**
       * Waits until all output data is transmitted to the serial port. After any pending write has completed it calls [`tcdrain()`](http://linux.die.net/man/3/tcdrain) or [FlushFileBuffers()](https://msdn.microsoft.com/en-us/library/windows/desktop/aa364439(v=vs.85).aspx) to ensure it has been written to the device.
      * @example
      Write the `data` and wait until it has finished transmitting to the target serial port before calling the callback. This will queue until the port is open and writes are finished.
    
      ```js
      function writeAndDrain (data, callback) {
        port.write(data);
        port.drain(callback);
      }
      ```
      */
    drain(c) {
      if (r("drain"), !this.isOpen || !this.port) {
        r("drain queuing on port open"), this.once("open", () => {
          this.drain(c);
        });
        return;
      }
      this.port.drain().then(() => {
        r("binding.drain", "finished"), c && c.call(this, null);
      }, (i) => (r("binding.drain", "had an error", i), this._error(i, c)));
    }
  }
  return ke.SerialPortStream = u, ke;
}
var st = {}, pc;
function Kh() {
  if (pc) return st;
  pc = 1, Object.defineProperty(st, "__esModule", { value: !0 });
  var e = Jc();
  function t(i) {
    return i && typeof i == "object" && "default" in i ? i : { default: i };
  }
  var n = /* @__PURE__ */ t(e);
  const r = n.default("serialport/binding-mock");
  let o = {}, a = 0;
  function s() {
    return new Promise((i) => process.nextTick(() => i()));
  }
  class u extends Error {
    constructor(f) {
      super(f), this.canceled = !0;
    }
  }
  const l = {
    reset() {
      o = {}, a = 0;
    },
    // Create a mock port
    createPort(i, f = {}) {
      a++;
      const d = Object.assign({ echo: !1, record: !1, manufacturer: "The J5 Robotics Company", vendorId: void 0, productId: void 0, maxReadSize: 1024 }, f);
      o[i] = {
        data: Buffer.alloc(0),
        echo: d.echo,
        record: d.record,
        readyData: d.readyData,
        maxReadSize: d.maxReadSize,
        info: {
          path: i,
          manufacturer: d.manufacturer,
          serialNumber: `${a}`,
          pnpId: void 0,
          locationId: void 0,
          vendorId: d.vendorId,
          productId: d.productId
        }
      }, r(a, "created port", JSON.stringify({ path: i, opt: f }));
    },
    async list() {
      return r(null, "list"), Object.values(o).map((i) => i.info);
    },
    async open(i) {
      var f;
      if (!i || typeof i != "object" || Array.isArray(i))
        throw new TypeError('"options" is not an object');
      if (!i.path)
        throw new TypeError('"path" is not a valid port');
      if (!i.baudRate)
        throw new TypeError('"baudRate" is not a valid baudRate');
      const d = Object.assign({ dataBits: 8, lock: !0, stopBits: 1, parity: "none", rtscts: !1, xon: !1, xoff: !1, xany: !1, hupcl: !0 }, i), { path: p } = d;
      r(null, `open: opening path ${p}`);
      const v = o[p];
      if (await s(), !v)
        throw new Error(`Port does not exist - please call MockBinding.createPort('${p}') first`);
      const w = v.info.serialNumber;
      if (!((f = v.openOpt) === null || f === void 0) && f.lock)
        throw r(w, "open: Port is locked cannot open"), new Error("Port is locked cannot open");
      return r(w, `open: opened path ${p}`), v.openOpt = Object.assign({}, d), new c(v, d);
    }
  };
  class c {
    constructor(f, d) {
      if (this.port = f, this.openOptions = d, this.pendingRead = null, this.isOpen = !0, this.lastWrite = null, this.recording = Buffer.alloc(0), this.writeOperation = null, this.serialNumber = f.info.serialNumber, f.readyData) {
        const p = f.readyData;
        process.nextTick(() => {
          this.isOpen && (r(this.serialNumber, "emitting ready data"), this.emitData(p));
        });
      }
    }
    // Emit data on a mock port
    emitData(f) {
      if (!this.isOpen || !this.port)
        throw new Error("Port must be open to pretend to receive data");
      const d = Buffer.isBuffer(f) ? f : Buffer.from(f);
      r(this.serialNumber, "emitting data - pending read:", !!this.pendingRead), this.port.data = Buffer.concat([this.port.data, d]), this.pendingRead && (process.nextTick(this.pendingRead), this.pendingRead = null);
    }
    async close() {
      if (r(this.serialNumber, "close"), !this.isOpen)
        throw new Error("Port is not open");
      const f = this.port;
      if (!f)
        throw new Error("already closed");
      f.openOpt = void 0, f.data = Buffer.alloc(0), r(this.serialNumber, "port is closed"), this.serialNumber = void 0, this.isOpen = !1, this.pendingRead && this.pendingRead(new u("port is closed"));
    }
    async read(f, d, p) {
      if (!Buffer.isBuffer(f))
        throw new TypeError('"buffer" is not a Buffer');
      if (typeof d != "number" || isNaN(d))
        throw new TypeError(`"offset" is not an integer got "${isNaN(d) ? "NaN" : typeof d}"`);
      if (typeof p != "number" || isNaN(p))
        throw new TypeError(`"length" is not an integer got "${isNaN(p) ? "NaN" : typeof p}"`);
      if (f.length < d + p)
        throw new Error("buffer is too small");
      if (!this.isOpen)
        throw new Error("Port is not open");
      if (r(this.serialNumber, "read", p, "bytes"), await s(), !this.isOpen || !this.port)
        throw new u("Read canceled");
      if (this.port.data.length <= 0)
        return new Promise((y, m) => {
          this.pendingRead = (g) => {
            if (g)
              return m(g);
            this.read(f, d, p).then(y, m);
          };
        });
      const v = this.port.maxReadSize > p ? p : this.port.maxReadSize, h = this.port.data.slice(0, v).copy(f, d);
      return this.port.data = this.port.data.slice(v), r(this.serialNumber, "read", h, "bytes"), { bytesRead: h, buffer: f };
    }
    async write(f) {
      if (!Buffer.isBuffer(f))
        throw new TypeError('"buffer" is not a Buffer');
      if (!this.isOpen || !this.port)
        throw r("write", "error port is not open"), new Error("Port is not open");
      if (r(this.serialNumber, "write", f.length, "bytes"), this.writeOperation)
        throw new Error("Overlapping writes are not supported and should be queued by the serialport object");
      return this.writeOperation = (async () => {
        if (await s(), !this.isOpen || !this.port)
          throw new Error("Write canceled");
        const d = this.lastWrite = Buffer.from(f);
        this.port.record && (this.recording = Buffer.concat([this.recording, d])), this.port.echo && process.nextTick(() => {
          this.isOpen && this.emitData(d);
        }), this.writeOperation = null, r(this.serialNumber, "writing finished");
      })(), this.writeOperation;
    }
    async update(f) {
      if (typeof f != "object")
        throw TypeError('"options" is not an object');
      if (typeof f.baudRate != "number")
        throw new TypeError('"options.baudRate" is not a number');
      if (r(this.serialNumber, "update"), !this.isOpen || !this.port)
        throw new Error("Port is not open");
      await s(), this.port.openOpt && (this.port.openOpt.baudRate = f.baudRate);
    }
    async set(f) {
      if (typeof f != "object")
        throw new TypeError('"options" is not an object');
      if (r(this.serialNumber, "set"), !this.isOpen)
        throw new Error("Port is not open");
      await s();
    }
    async get() {
      if (r(this.serialNumber, "get"), !this.isOpen)
        throw new Error("Port is not open");
      return await s(), {
        cts: !0,
        dsr: !1,
        dcd: !1
      };
    }
    async getBaudRate() {
      var f;
      if (r(this.serialNumber, "getBaudRate"), !this.isOpen || !this.port)
        throw new Error("Port is not open");
      if (await s(), !(!((f = this.port.openOpt) === null || f === void 0) && f.baudRate))
        throw new Error("Internal Error");
      return {
        baudRate: this.port.openOpt.baudRate
      };
    }
    async flush() {
      if (r(this.serialNumber, "flush"), !this.isOpen || !this.port)
        throw new Error("Port is not open");
      await s(), this.port.data = Buffer.alloc(0);
    }
    async drain() {
      if (r(this.serialNumber, "drain"), !this.isOpen)
        throw new Error("Port is not open");
      await this.writeOperation, await s();
    }
  }
  return st.CanceledError = u, st.MockBinding = l, st.MockPortBinding = c, st;
}
var mc;
function Wh() {
  if (mc) return Ot;
  mc = 1, Object.defineProperty(Ot, "__esModule", { value: !0 }), Ot.SerialPortMock = void 0;
  const e = Ys(), t = Kh();
  class n extends e.SerialPortStream {
    static list = t.MockBinding.list;
    static binding = t.MockBinding;
    constructor(o, a) {
      const s = {
        binding: t.MockBinding,
        ...o
      };
      super(s, a);
    }
  }
  return Ot.SerialPortMock = n, Ot;
}
var Nt = {};
const Xh = gu(import.meta.url), Oe = Xh("./node_natives/@serialport/bindings-cpp.native.cjs"), Yh = Oe.__esModule, Zc = Oe.autoDetect, Jh = Oe.DarwinBinding, Zh = Oe.DarwinPortBinding, Qh = Oe.LinuxBinding, ep = Oe.LinuxPortBinding, tp = Oe.WindowsBinding, rp = Oe.WindowsPortBinding, np = Oe.BindingsError, sp = Oe.default || Oe, ip = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BindingsError: np,
  DarwinBinding: Jh,
  DarwinPortBinding: Zh,
  LinuxBinding: Qh,
  LinuxPortBinding: ep,
  WindowsBinding: tp,
  WindowsPortBinding: rp,
  __esModule: Yh,
  autoDetect: Zc,
  default: sp
}, Symbol.toStringTag, { value: "Module" })), ap = /* @__PURE__ */ _u(ip);
var yc;
function op() {
  if (yc) return Nt;
  yc = 1, Object.defineProperty(Nt, "__esModule", { value: !0 }), Nt.SerialPort = void 0;
  const e = Ys(), n = (0, ap.autoDetect)();
  class r extends e.SerialPortStream {
    static list = n.list;
    static binding = n;
    constructor(a, s) {
      const u = {
        binding: n,
        ...a
      };
      super(u, s);
    }
  }
  return Nt.SerialPort = r, Nt;
}
var gc;
function cp() {
  return gc || (gc = 1, (function(e) {
    var t = He && He.__createBinding || (Object.create ? (function(r, o, a, s) {
      s === void 0 && (s = a);
      var u = Object.getOwnPropertyDescriptor(o, a);
      (!u || ("get" in u ? !o.__esModule : u.writable || u.configurable)) && (u = { enumerable: !0, get: function() {
        return o[a];
      } }), Object.defineProperty(r, s, u);
    }) : (function(r, o, a, s) {
      s === void 0 && (s = a), r[s] = o[a];
    })), n = He && He.__exportStar || function(r, o) {
      for (var a in r) a !== "default" && !Object.prototype.hasOwnProperty.call(o, a) && t(o, r, a);
    };
    Object.defineProperty(e, "__esModule", { value: !0 }), n(Th(), e), n(Ch(), e), n(Xc(), e), n(jh(), e), n(Ah(), e), n(Dh(), e), n(qh(), e), n(kh(), e), n(Fh(), e), n(Vh(), e), n(Wh(), e), n(op(), e);
  })(He)), He;
}
var up = cp(), lp = Ys();
const fp = Zc(), It = {
  _serialport: null,
  _id: 1,
  connect: async function(e, t, n) {
    if (this._serialport)
      try {
        const r = this._serialport;
        this._serialport = null, r.removeAllListeners(), r.isOpen && await new Promise((o) => {
          r.close(() => o());
        }), r.destroy(), await new Promise((o) => setTimeout(o, 100));
      } catch (r) {
        console.log("Cleanup error (ignored):", r.message);
      }
    return new Promise((r) => {
      try {
        var o = !1;
        this._serialport = new lp.SerialPortStream({ binding: fp, path: e, baudRate: t.bitrate, autoOpen: !0 }), this._serialport.on("error", (a) => {
          if (console.log("Serial port error:", a.message), n.isDestroyed() || n.webContents.send("serialError", a), this._serialport) {
            const s = this._serialport;
            this._serialport = null, s.removeAllListeners(), s.destroy();
          }
          o || (o = !0, r({ error: !0, msg: a.message || "Serial port error" }));
        }), this._serialport.on("close", () => {
          n.isDestroyed() || n.webContents.send("serialClose");
        }), this._serialport.on("data", (a) => {
          n.isDestroyed() || n.webContents.send("serialData", a);
        }), this._serialport.on("open", () => {
          o = !0, r({ error: !1, id: this._id++ });
        });
      } catch (a) {
        r({ error: !0, errorMsg: a });
      }
    });
  },
  close: function() {
    return new Promise((e) => {
      if (this._serialport && this._serialport.isOpen) {
        const t = this._serialport;
        this._serialport = null, t.close((n) => {
          e(n ? { error: !0, msg: n } : { error: !1 });
        });
      } else if (this._serialport) {
        try {
          this._serialport.destroy();
        } catch {
        }
        this._serialport = null, e({ error: !1 });
      } else
        e({ error: !1 });
    });
  },
  send: function(e) {
    return new Promise((t) => {
      this._serialport && this._serialport.isOpen ? this._serialport.write(Buffer.from(e), (n) => {
        t(n ? { error: !0, msg: `Serial write error: ${n}` } : { error: !1, bytesWritten: e.byteLength });
      }) : t({ error: !0, msg: "Invalid serial port or port closed" });
    });
  },
  getDevices: async function() {
    const e = await up.SerialPort.list();
    var t = [];
    return e.forEach((n) => {
      process.platform == "Linux" ? (n.pnpId || n.path.match(/rfcomm\d*/) || n.path.match(/ttyS[0-5]$/)) && t.push(n.path) : t.push(n.path);
    }), t;
  }
}, Ds = {
  _processes: [],
  start: function(e, t, n, r) {
    var o;
    try {
      o = vu(e, t, n);
    } catch (a) {
      return console.log(a), -1;
    }
    this._processes.push(o), o.stdout.on("data", (a) => {
      r.isDestroyed() || r.webContents.send("onChildProcessStdout", a.toString());
    }), o.stderr.on("data", (a) => {
      r.isDestroyed() || r.webContents.send("onChildProcessStderr", a.toString());
    }), o.on("error", (a) => {
      r.isDestroyed() || r.webContents.send("onChildProcessError", a);
    });
  },
  stop: function() {
    for (const e of this._processes)
      if (e)
        try {
          e.kill();
        } catch (t) {
          console.log(t);
        }
    this._processes = [];
  }
}, ct = oe.dirname(uu(import.meta.url));
function vc() {
  return ce.isPackaged ? oe.join(process.resourcesPath, "sitl") : oe.join(ce.getAppPath(), "resources", "public", "sitl");
}
const _c = [
  { vendorId: 1155, productId: 57105 },
  { vendorId: 11836, productId: 57105 }
];
Ih && ce.quit();
let de = null, Xe = null, Tt = null, We = null;
const it = new Eh();
it.get("disable_3d_acceleration", !1) && ce.disableHardwareAcceleration();
if (!ce.isPackaged) {
  const e = process.env.CDP_PORT ?? "9222";
  ce.commandLine.appendSwitch("remote-debugging-port", e), console.log(`[cdp] Remote debugging enabled on port ${e}`), console.log("   Chrome DevTools: chrome://inspect"), console.log(`   CDP Endpoint: http://localhost:${e}`);
}
function dp() {
  Xe = new qs({
    parent: de,
    width: 410,
    height: 600,
    webPreferences: {
      preload: oe.join(ct, "bt-device-chooser-preload.mjs")
    }
  }), Xe.removeMenu(), Xe.loadFile(oe.join(ct, "../renderer/bt_device_chooser/js/libraries/bluetooth-device-chooser/bt-device-chooser-index.html")), Xe.on("closed", () => {
    Tt = null, We && (We(""), We = null), Xe = null;
  }), ne.on("deviceSelected", (e, t) => {
    We && (We(t), We = null);
  });
}
ce.on("ready", () => {
  const e = "https://github.com/iNavFlight/inav-configurator";
  nu.defaultSession.webRequest.onBeforeSendHeaders(
    { urls: ["https://tile.openstreetmap.org/*", "https://*.tile.openstreetmap.org/*"] },
    (t, n) => {
      t.requestHeaders.Referer = e, t.requestHeaders["User-Agent"] = `INAV-Configurator/${ce.getVersion()} (${e})`, n({ requestHeaders: t.requestHeaders });
    }
  ), Qc();
});
function Qc() {
  let e = Nu({
    defaultWidth: 800,
    defaultHeight: 600
  });
  de = new qs({
    x: e.x,
    y: e.y,
    width: e.width,
    height: e.height,
    autoHideMenuBar: !0,
    icon: "images/inav_icon_128.png",
    webPreferences: {
      preload: oe.join(ct, "preload.mjs"),
      nodeIntegration: !0,
      webSecurity: !1,
      contextIsolation: !0
    }
  }), de.webContents.on("context-menu", (t, n) => {
    const r = new su();
    r.append(new ze({ label: "Undo", role: "undo", accelerator: "CmdOrCtrl+Z", visible: n.isEditable })), r.append(new ze({ label: "Redo", role: "redo", accelerator: "CmdOrCtrl+Y", visible: n.isEditable })), r.append(new ze({ type: "separator", visible: n.isEditable })), r.append(new ze({ label: "Cut", role: "cut", accelerator: "CmdOrCtrl+X", visible: n.isEditable && n.selectionText })), r.append(new ze({ label: "Copy", role: "copy", accelerator: "CmdOrCtrl+C", visible: n.selectionText })), r.append(new ze({ label: "Paste", role: "paste", accelerator: "CmdOrCtrl+V", visible: n.isEditable })), r.append(new ze({ label: "Select all", role: "selectAll", accelerator: "CmdOrCtrl+A", visible: n.isEditable })), r.items.forEach((o) => {
      if (o.visible) {
        r.popup();
        return;
      }
    });
  }), de.webContents.on("select-bluetooth-device", (t, n, r) => {
    t.preventDefault(), We = r, (!Tt || !((a, s) => a.length !== s.length ? !1 : (a.every((u, l) => {
      if (u.deviceId !== s[l].deviceId)
        return !1;
    }), !0))(Tt, n)) && (Tt = [...n], Xe || dp(), Xe.webContents.send("ble-scan", Tt));
  }), de.webContents.session.on("select-usb-device", (t, n, r) => {
    console.log(n.deviceList);
    let o = null;
    n.deviceList && n.deviceList.every((a, s) => {
      if (a.productId == _c[s].productId && a.vendorId == _c[s].vendorId) {
        o = a.deviceId;
        return;
      }
    }), o ? r(o) : r();
  }), de.webContents.session.setDevicePermissionHandler((t) => {
    if (t.deviceType === "usb")
      return !0;
  }), de.webContents.setWindowOpenHandler(({ url: t }) => t.startsWith("https://") ? (wc.openExternal(t), { action: "deny" }) : {
    action: "allow",
    overrideBrowserWindowOptions: {
      autoHideMenuBar: !0
    }
  }), ce.commandLine.appendSwitch("disable-features", "OutOfBlinkCors"), process.platform === "linux" && ce.commandLine.appendSwitch("enable-experimental-web-platform-features", !0), ce.commandLine.appendSwitch("enable-web-bluetooth", !0), de.removeMenu(), de.setMinimumSize(800, 600), de.loadFile(oe.join(ct, "../renderer/main_window/index.html")), e.manage(de), process.env.NODE_ENV === "development" && de.on("ready-to-show", () => {
    de.webContents.openDevTools({ mode: process.env.DEV_TOOLS_MODE });
  });
}
ce.on("before-quit", async () => {
  await xr.close(), await It.close(), Ds.stop();
});
ce.on("window-all-closed", async () => {
  process.platform !== "darwin" && ce.quit(), console.log("We're closing...");
});
ce.whenReady().then(() => {
  ne.handle("listSerialDevices", (e) => It.getDevices()), ne.on("storeGet", (e, t, n) => {
    e.returnValue = it.get(t, n);
  }), ne.on("storeSet", (e, t, n) => {
    it.set(t, n);
  }), ne.on("storeDelete", (e, t) => {
    it.delete(t);
  }), ne.on("appGetPath", (e, t) => {
    e.returnValue = ce.getPath(t);
  }), ne.on("appGetVersion", (e) => {
    e.returnValue = ce.getVersion();
  }), ne.on("appGetLocale", (e) => {
    e.returnValue = ce.getLocale();
  }), ne.handle("dialog.showOpenDialog", (e, t) => Dt.showOpenDialog(t)), ne.handle("dialog.showSaveDialog", async (e, t) => {
    const n = t || {}, r = "lastSaveDirectory", o = it.get(r, null);
    o && n.defaultPath ? (!oe.dirname(n.defaultPath) || oe.dirname(n.defaultPath) === ".") && (n.defaultPath = oe.join(o, n.defaultPath)) : o && !n.defaultPath && (n.defaultPath = o);
    const a = await Dt.showSaveDialog(n);
    if (a && a.filePath && !a.canceled) {
      const s = oe.dirname(a.filePath);
      it.set(r, s);
    }
    return a;
  }), ne.on("dialog.alert", (e, t) => {
    e.returnValue = Dt.showMessageBoxSync({ message: t, icon: oe.join(ct, "inav_icon_128.png") });
  }), ne.handle("dialog.confirm", async (e, t) => (await Dt.showMessageBox({ message: t, icon: oe.join(ct, "inav_icon_128.png"), buttons: ["Yes", "No"] })).response === 0), ne.handle("tcpConnect", (e, t, n) => xr.connect(t, n, de)), ne.handle("tcpSend", (e, t) => xr.send(t)), ne.on("tcpClose", (e) => {
    xr.close();
  }), ne.handle("serialConnect", (e, t, n) => It.connect(t, n, de)), ne.handle("serialSend", (e, t) => It.send(t)), ne.handle("serialClose", (e) => It.close()), ne.handle("udpConnect", (e, t, n) => Os.connect(t, n, de)), ne.handle("udpSend", (e, t) => Os.send(t)), ne.on("udpClose", (e) => {
    Os.close();
  }), ne.handle("writeFile", (e, t, n) => new Promise(async (r) => {
    try {
      await fu(t, n), r(!1);
    } catch (o) {
      r(o);
    }
  })), ne.handle("appendFile", async (e, t, n) => {
    try {
      return await du(t, n), !1;
    } catch (r) {
      throw r;
    }
  }), ne.handle("readFile", (e, t, n) => new Promise(async (r) => {
    try {
      const o = await hu(t, { encoding: n });
      r({ error: !1, data: o });
    } catch (o) {
      r({ error: o });
    }
  })), ne.handle("chmod", (e, t, n) => new Promise((r) => {
    tu(oe.join(vc(), t), n, (o) => {
      r(o ? o.message : !1);
    });
  })), ne.handle("rm", (e, t) => new Promise((n) => {
    ru(t, (r) => {
      n(r ? r.message : !1);
    });
  })), ne.handle("getBackupDir", (e) => {
    const t = oe.join(ce.getPath("userData"), "inav-backups");
    return fn(t) || Qs(t, { recursive: !0 }), t;
  }), ne.handle("openBackupDir", (e) => {
    const t = oe.join(ce.getPath("userData"), "inav-backups");
    return fn(t) || Qs(t, { recursive: !0 }), wc.openPath(t), t;
  }), ne.handle("listBackups", async (e) => {
    const t = oe.join(ce.getPath("userData"), "inav-backups");
    return fn(t) ? (await pu(t)).filter((r) => r.endsWith(".txt") || r.endsWith(".cli")) : [];
  }), ne.on("startChildProcess", (e, t, n, r) => {
    Ds.start(oe.join(vc(), t), n, r, de);
  }), ne.on("killChildProcess", (e) => {
    Ds.stop();
  }), qs.getAllWindows().length === 0 && Qc();
});
