var Jt = Object.create;
var xe = Object.defineProperty;
var Qt = Object.getOwnPropertyDescriptor;
var Yt = Object.getOwnPropertyNames;
var Xt = Object.getPrototypeOf, Gt = Object.prototype.hasOwnProperty;
var a = (e, t) => xe(e, "name", { value: t, configurable: !0 }), H = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy <
"u" ? new Proxy(e, {
  get: (t, r) => (typeof require < "u" ? require : t)[r]
}) : e)(function(e) {
  if (typeof require < "u") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + e + '" is not supported');
});
var k = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
var Zt = (e, t, r, n) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let o of Yt(t))
      !Gt.call(e, o) && o !== r && xe(e, o, { get: () => t[o], enumerable: !(n = Qt(t, o)) || n.enumerable });
  return e;
};
var Be = (e, t, r) => (r = e != null ? Jt(Xt(e)) : {}, Zt(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? xe(r, "default", { value: e, enumerable: !0 }) : r,
  e
));

// ../node_modules/memoizerific/memoizerific.js
var ht = k((pt, Re) => {
  (function(e) {
    if (typeof pt == "object" && typeof Re < "u")
      Re.exports = e();
    else if (typeof define == "function" && define.amd)
      define([], e);
    else {
      var t;
      typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = this, t.memoizerific = e();
    }
  })(function() {
    var e, t, r;
    return (/* @__PURE__ */ a(function n(o, i, l) {
      function s(u, h) {
        if (!i[u]) {
          if (!o[u]) {
            var p = typeof H == "function" && H;
            if (!h && p) return p(u, !0);
            if (c) return c(u, !0);
            var d = new Error("Cannot find module '" + u + "'");
            throw d.code = "MODULE_NOT_FOUND", d;
          }
          var m = i[u] = { exports: {} };
          o[u][0].call(m.exports, function(g) {
            var x = o[u][1][g];
            return s(x || g);
          }, m, m.exports, n, o, i, l);
        }
        return i[u].exports;
      }
      a(s, "s");
      for (var c = typeof H == "function" && H, f = 0; f < l.length; f++) s(l[f]);
      return s;
    }, "e"))({ 1: [function(n, o, i) {
      o.exports = function(l) {
        if (typeof Map != "function" || l) {
          var s = n("./similar");
          return new s();
        } else
          return /* @__PURE__ */ new Map();
      };
    }, { "./similar": 2 }], 2: [function(n, o, i) {
      function l() {
        return this.list = [], this.lastItem = void 0, this.size = 0, this;
      }
      a(l, "Similar"), l.prototype.get = function(s) {
        var c;
        if (this.lastItem && this.isEqual(this.lastItem.key, s))
          return this.lastItem.val;
        if (c = this.indexOf(s), c >= 0)
          return this.lastItem = this.list[c], this.list[c].val;
      }, l.prototype.set = function(s, c) {
        var f;
        return this.lastItem && this.isEqual(this.lastItem.key, s) ? (this.lastItem.val = c, this) : (f = this.indexOf(s), f >= 0 ? (this.lastItem =
        this.list[f], this.list[f].val = c, this) : (this.lastItem = { key: s, val: c }, this.list.push(this.lastItem), this.size++, this));
      }, l.prototype.delete = function(s) {
        var c;
        if (this.lastItem && this.isEqual(this.lastItem.key, s) && (this.lastItem = void 0), c = this.indexOf(s), c >= 0)
          return this.size--, this.list.splice(c, 1)[0];
      }, l.prototype.has = function(s) {
        var c;
        return this.lastItem && this.isEqual(this.lastItem.key, s) ? !0 : (c = this.indexOf(s), c >= 0 ? (this.lastItem = this.list[c], !0) :
        !1);
      }, l.prototype.forEach = function(s, c) {
        var f;
        for (f = 0; f < this.size; f++)
          s.call(c || this, this.list[f].val, this.list[f].key, this);
      }, l.prototype.indexOf = function(s) {
        var c;
        for (c = 0; c < this.size; c++)
          if (this.isEqual(this.list[c].key, s))
            return c;
        return -1;
      }, l.prototype.isEqual = function(s, c) {
        return s === c || s !== s && c !== c;
      }, o.exports = l;
    }, {}], 3: [function(n, o, i) {
      var l = n("map-or-similar");
      o.exports = function(u) {
        var h = new l(!1), p = [];
        return function(d) {
          var m = /* @__PURE__ */ a(function() {
            var g = h, x, R, b = arguments.length - 1, v = Array(b + 1), O = !0, N;
            if ((m.numArgs || m.numArgs === 0) && m.numArgs !== b + 1)
              throw new Error("Memoizerific functions should always be called with the same number of arguments");
            for (N = 0; N < b; N++) {
              if (v[N] = {
                cacheItem: g,
                arg: arguments[N]
              }, g.has(arguments[N])) {
                g = g.get(arguments[N]);
                continue;
              }
              O = !1, x = new l(!1), g.set(arguments[N], x), g = x;
            }
            return O && (g.has(arguments[b]) ? R = g.get(arguments[b]) : O = !1), O || (R = d.apply(null, arguments), g.set(arguments[b], R)),
            u > 0 && (v[b] = {
              cacheItem: g,
              arg: arguments[b]
            }, O ? s(p, v) : p.push(v), p.length > u && c(p.shift())), m.wasMemoized = O, m.numArgs = b + 1, R;
          }, "memoizerific");
          return m.limit = u, m.wasMemoized = !1, m.cache = h, m.lru = p, m;
        };
      };
      function s(u, h) {
        var p = u.length, d = h.length, m, g, x;
        for (g = 0; g < p; g++) {
          for (m = !0, x = 0; x < d; x++)
            if (!f(u[g][x].arg, h[x].arg)) {
              m = !1;
              break;
            }
          if (m)
            break;
        }
        u.push(u.splice(g, 1)[0]);
      }
      a(s, "moveToMostRecentLru");
      function c(u) {
        var h = u.length, p = u[h - 1], d, m;
        for (p.cacheItem.delete(p.arg), m = h - 2; m >= 0 && (p = u[m], d = p.cacheItem.get(p.arg), !d || !d.size); m--)
          p.cacheItem.delete(p.arg);
      }
      a(c, "removeCachedResult");
      function f(u, h) {
        return u === h || u !== u && h !== h;
      }
      a(f, "isEqual");
    }, { "map-or-similar": 1 }] }, {}, [3])(3);
  });
});

// ../node_modules/picoquery/lib/string-util.js
var Pe = k((Ne) => {
  "use strict";
  Object.defineProperty(Ne, "__esModule", { value: !0 });
  Ne.encodeString = tr;
  var T = Array.from({ length: 256 }, (e, t) => "%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase()), er = new Int8Array([
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    0,
    0,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    1,
    0
  ]);
  function tr(e) {
    let t = e.length;
    if (t === 0)
      return "";
    let r = "", n = 0, o = 0;
    e: for (; o < t; o++) {
      let i = e.charCodeAt(o);
      for (; i < 128; ) {
        if (er[i] !== 1 && (n < o && (r += e.slice(n, o)), n = o + 1, r += T[i]), ++o === t)
          break e;
        i = e.charCodeAt(o);
      }
      if (n < o && (r += e.slice(n, o)), i < 2048) {
        n = o + 1, r += T[192 | i >> 6] + T[128 | i & 63];
        continue;
      }
      if (i < 55296 || i >= 57344) {
        n = o + 1, r += T[224 | i >> 12] + T[128 | i >> 6 & 63] + T[128 | i & 63];
        continue;
      }
      if (++o, o >= t)
        throw new Error("URI malformed");
      let l = e.charCodeAt(o) & 1023;
      n = o + 1, i = 65536 + ((i & 1023) << 10 | l), r += T[240 | i >> 18] + T[128 | i >> 12 & 63] + T[128 | i >> 6 & 63] + T[128 | i & 63];
    }
    return n === 0 ? e : n < t ? r + e.slice(n) : r;
  }
  a(tr, "encodeString");
});

// ../node_modules/picoquery/lib/shared.js
var ie = k((L) => {
  "use strict";
  Object.defineProperty(L, "__esModule", { value: !0 });
  L.defaultOptions = L.defaultShouldSerializeObject = L.defaultValueSerializer = void 0;
  var we = Pe(), rr = /* @__PURE__ */ a((e) => {
    switch (typeof e) {
      case "string":
        return (0, we.encodeString)(e);
      case "bigint":
      case "boolean":
        return "" + e;
      case "number":
        if (Number.isFinite(e))
          return e < 1e21 ? "" + e : (0, we.encodeString)("" + e);
        break;
    }
    return e instanceof Date ? (0, we.encodeString)(e.toISOString()) : "";
  }, "defaultValueSerializer");
  L.defaultValueSerializer = rr;
  var nr = /* @__PURE__ */ a((e) => e instanceof Date, "defaultShouldSerializeObject");
  L.defaultShouldSerializeObject = nr;
  var dt = /* @__PURE__ */ a((e) => e, "identityFunc");
  L.defaultOptions = {
    nesting: !0,
    nestingSyntax: "dot",
    arrayRepeat: !1,
    arrayRepeatSyntax: "repeat",
    delimiter: 38,
    valueDeserializer: dt,
    valueSerializer: L.defaultValueSerializer,
    keyDeserializer: dt,
    shouldSerializeObject: L.defaultShouldSerializeObject
  };
});

// ../node_modules/picoquery/lib/object-util.js
var Se = k((se) => {
  "use strict";
  Object.defineProperty(se, "__esModule", { value: !0 });
  se.getDeepObject = ir;
  se.stringifyObject = mt;
  var W = ie(), or = Pe();
  function ar(e) {
    return e === "__proto__" || e === "constructor" || e === "prototype";
  }
  a(ar, "isPrototypeKey");
  function ir(e, t, r, n, o) {
    if (ar(t))
      return e;
    let i = e[t];
    return typeof i == "object" && i !== null ? i : !n && (o || typeof r == "number" || typeof r == "string" && r * 0 === 0 && r.indexOf(".") ===
    -1) ? e[t] = [] : e[t] = {};
  }
  a(ir, "getDeepObject");
  var sr = 20, cr = "[]", lr = "[", ur = "]", fr = ".";
  function mt(e, t, r = 0, n, o) {
    let { nestingSyntax: i = W.defaultOptions.nestingSyntax, arrayRepeat: l = W.defaultOptions.arrayRepeat, arrayRepeatSyntax: s = W.defaultOptions.
    arrayRepeatSyntax, nesting: c = W.defaultOptions.nesting, delimiter: f = W.defaultOptions.delimiter, valueSerializer: u = W.defaultOptions.
    valueSerializer, shouldSerializeObject: h = W.defaultOptions.shouldSerializeObject } = t, p = typeof f == "number" ? String.fromCharCode(
    f) : f, d = o === !0 && l, m = i === "dot" || i === "js" && !o;
    if (r > sr)
      return "";
    let g = "", x = !0, R = !1;
    for (let b in e) {
      let v = e[b], O;
      n ? (O = n, d ? s === "bracket" && (O += cr) : m ? (O += fr, O += b) : (O += lr, O += b, O += ur)) : O = b, x || (g += p), typeof v ==
      "object" && v !== null && !h(v) ? (R = v.pop !== void 0, (c || l && R) && (g += mt(v, t, r + 1, O, R))) : (g += (0, or.encodeString)(O),
      g += "=", g += u(v, b)), x && (x = !1);
    }
    return g;
  }
  a(mt, "stringifyObject");
});

// ../node_modules/fast-decode-uri-component/index.js
var vt = k((Bn, xt) => {
  "use strict";
  var gt = 12, pr = 0, _e = [
    // The first part of the table maps bytes to character to a transition.
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    2,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    3,
    4,
    4,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    5,
    6,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    8,
    7,
    7,
    10,
    9,
    9,
    9,
    11,
    4,
    4,
    4,
    4,
    4,
    4,
    4,
    4,
    4,
    4,
    4,
    // The second part of the table maps a state to a new state when adding a
    // transition.
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    12,
    0,
    0,
    0,
    0,
    24,
    36,
    48,
    60,
    72,
    84,
    96,
    0,
    12,
    12,
    12,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    24,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    24,
    24,
    24,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    24,
    24,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    48,
    48,
    48,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    48,
    48,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    48,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    // The third part maps the current transition to a mask that needs to apply
    // to the byte.
    127,
    63,
    63,
    63,
    0,
    31,
    15,
    15,
    15,
    7,
    7,
    7
  ];
  function hr(e) {
    var t = e.indexOf("%");
    if (t === -1) return e;
    for (var r = e.length, n = "", o = 0, i = 0, l = t, s = gt; t > -1 && t < r; ) {
      var c = yt(e[t + 1], 4), f = yt(e[t + 2], 0), u = c | f, h = _e[u];
      if (s = _e[256 + s + h], i = i << 6 | u & _e[364 + h], s === gt)
        n += e.slice(o, l), n += i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
          55232 + (i >> 10),
          56320 + (i & 1023)
        ), i = 0, o = t + 3, t = l = e.indexOf("%", o);
      else {
        if (s === pr)
          return null;
        if (t += 3, t < r && e.charCodeAt(t) === 37) continue;
        return null;
      }
    }
    return n + e.slice(o);
  }
  a(hr, "decodeURIComponent");
  var dr = {
    0: 0,
    1: 1,
    2: 2,
    3: 3,
    4: 4,
    5: 5,
    6: 6,
    7: 7,
    8: 8,
    9: 9,
    a: 10,
    A: 10,
    b: 11,
    B: 11,
    c: 12,
    C: 12,
    d: 13,
    D: 13,
    e: 14,
    E: 14,
    f: 15,
    F: 15
  };
  function yt(e, t) {
    var r = dr[e];
    return r === void 0 ? 255 : r << t;
  }
  a(yt, "hexCodeToInt");
  xt.exports = hr;
});

// ../node_modules/picoquery/lib/parse.js
var Rt = k((I) => {
  "use strict";
  var mr = I && I.__importDefault || function(e) {
    return e && e.__esModule ? e : { default: e };
  };
  Object.defineProperty(I, "__esModule", { value: !0 });
  I.numberValueDeserializer = I.numberKeyDeserializer = void 0;
  I.parse = xr;
  var ce = Se(), z = ie(), bt = mr(vt()), gr = /* @__PURE__ */ a((e) => {
    let t = Number(e);
    return Number.isNaN(t) ? e : t;
  }, "numberKeyDeserializer");
  I.numberKeyDeserializer = gr;
  var yr = /* @__PURE__ */ a((e) => {
    let t = Number(e);
    return Number.isNaN(t) ? e : t;
  }, "numberValueDeserializer");
  I.numberValueDeserializer = yr;
  var Ot = /\+/g, Et = /* @__PURE__ */ a(function() {
  }, "Empty");
  Et.prototype = /* @__PURE__ */ Object.create(null);
  function le(e, t, r, n, o) {
    let i = e.substring(t, r);
    return n && (i = i.replace(Ot, " ")), o && (i = (0, bt.default)(i) || i), i;
  }
  a(le, "computeKeySlice");
  function xr(e, t) {
    let { valueDeserializer: r = z.defaultOptions.valueDeserializer, keyDeserializer: n = z.defaultOptions.keyDeserializer, arrayRepeatSyntax: o = z.
    defaultOptions.arrayRepeatSyntax, nesting: i = z.defaultOptions.nesting, arrayRepeat: l = z.defaultOptions.arrayRepeat, nestingSyntax: s = z.
    defaultOptions.nestingSyntax, delimiter: c = z.defaultOptions.delimiter } = t ?? {}, f = typeof c == "string" ? c.charCodeAt(0) : c, u = s ===
    "js", h = new Et();
    if (typeof e != "string")
      return h;
    let p = e.length, d = "", m = -1, g = -1, x = -1, R = h, b, v = "", O = "", N = !1, F = !1, y = !1, E = !1, P = !1, j = !1, S = !1, _ = 0,
    C = -1, D = -1, ye = -1;
    for (let w = 0; w < p + 1; w++) {
      if (_ = w !== p ? e.charCodeAt(w) : f, _ === f) {
        if (S = g > m, S || (g = w), x !== g - 1 && (O = le(e, x + 1, C > -1 ? C : g, y, N), v = n(O), b !== void 0 && (R = (0, ce.getDeepObject)(
        R, b, v, u && P, u && j))), S || v !== "") {
          S && (d = e.slice(g + 1, w), E && (d = d.replace(Ot, " ")), F && (d = (0, bt.default)(d) || d));
          let q = r(d, v);
          if (l) {
            let oe = R[v];
            oe === void 0 ? C > -1 ? R[v] = [q] : R[v] = q : oe.pop ? oe.push(q) : R[v] = [oe, q];
          } else
            R[v] = q;
        }
        d = "", m = w, g = w, N = !1, F = !1, y = !1, E = !1, P = !1, j = !1, C = -1, x = w, R = h, b = void 0, v = "";
      } else _ === 93 ? (l && o === "bracket" && ye === 91 && (C = D), i && (s === "index" || u) && g <= m && (x !== D && (O = le(e, x + 1, w,
      y, N), v = n(O), b !== void 0 && (R = (0, ce.getDeepObject)(R, b, v, void 0, u)), b = v, y = !1, N = !1), x = w, j = !0, P = !1)) : _ ===
      46 ? i && (s === "dot" || u) && g <= m && (x !== D && (O = le(e, x + 1, w, y, N), v = n(O), b !== void 0 && (R = (0, ce.getDeepObject)(
      R, b, v, u)), b = v, y = !1, N = !1), P = !0, j = !1, x = w) : _ === 91 ? i && (s === "index" || u) && g <= m && (x !== D && (O = le(e,
      x + 1, w, y, N), v = n(O), u && b !== void 0 && (R = (0, ce.getDeepObject)(R, b, v, u)), b = v, y = !1, N = !1, P = !1, j = !0), x = w) :
      _ === 61 ? g <= m ? g = w : F = !0 : _ === 43 ? g > m ? E = !0 : y = !0 : _ === 37 && (g > m ? F = !0 : N = !0);
      D = w, ye = _;
    }
    return h;
  }
  a(xr, "parse");
});

// ../node_modules/picoquery/lib/stringify.js
var Nt = k((je) => {
  "use strict";
  Object.defineProperty(je, "__esModule", { value: !0 });
  je.stringify = br;
  var vr = Se();
  function br(e, t) {
    if (e === null || typeof e != "object")
      return "";
    let r = t ?? {};
    return (0, vr.stringifyObject)(e, r);
  }
  a(br, "stringify");
});

// ../node_modules/picoquery/lib/main.js
var Pt = k((A) => {
  "use strict";
  var Or = A && A.__createBinding || (Object.create ? function(e, t, r, n) {
    n === void 0 && (n = r);
    var o = Object.getOwnPropertyDescriptor(t, r);
    (!o || ("get" in o ? !t.__esModule : o.writable || o.configurable)) && (o = { enumerable: !0, get: /* @__PURE__ */ a(function() {
      return t[r];
    }, "get") }), Object.defineProperty(e, n, o);
  } : function(e, t, r, n) {
    n === void 0 && (n = r), e[n] = t[r];
  }), Er = A && A.__exportStar || function(e, t) {
    for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(t, r) && Or(t, e, r);
  };
  Object.defineProperty(A, "__esModule", { value: !0 });
  A.stringify = A.parse = void 0;
  var Rr = Rt();
  Object.defineProperty(A, "parse", { enumerable: !0, get: /* @__PURE__ */ a(function() {
    return Rr.parse;
  }, "get") });
  var Nr = Nt();
  Object.defineProperty(A, "stringify", { enumerable: !0, get: /* @__PURE__ */ a(function() {
    return Nr.stringify;
  }, "get") });
  Er(ie(), A);
});

// src/router/utils.ts
import { once as Pr } from "storybook/internal/client-logger";

// ../node_modules/es-toolkit/dist/function/noop.mjs
function Ve() {
}
a(Ve, "noop");

// ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
function ve(e) {
  return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
}
a(ve, "getSymbols");

// ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
function be(e) {
  return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
}
a(be, "getTag");

// ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
var We = "[object RegExp]", ze = "[object String]", Fe = "[object Number]", Ue = "[object Boolean]", Oe = "[object Arguments]", $e = "[objec\
t Symbol]", qe = "[object Date]", He = "[object Map]", Ke = "[object Set]", Je = "[object Array]", Qe = "[object Function]", Ye = "[object A\
rrayBuffer]", ae = "[object Object]", Xe = "[object Error]", Ge = "[object DataView]", Ze = "[object Uint8Array]", et = "[object Uint8Clampe\
dArray]", tt = "[object Uint16Array]", rt = "[object Uint32Array]", nt = "[object BigUint64Array]", ot = "[object Int8Array]", at = "[object\
 Int16Array]", it = "[object Int32Array]", st = "[object BigInt64Array]", ct = "[object Float32Array]", lt = "[object Float64Array]";

// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
function M(e) {
  if (!e || typeof e != "object")
    return !1;
  let t = Object.getPrototypeOf(e);
  return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" :
  !1;
}
a(M, "isPlainObject");

// ../node_modules/es-toolkit/dist/compat/util/eq.mjs
function ut(e, t) {
  return e === t || Number.isNaN(e) && Number.isNaN(t);
}
a(ut, "eq");

// ../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
function ft(e, t, r) {
  return K(e, t, void 0, void 0, void 0, void 0, r);
}
a(ft, "isEqualWith");
function K(e, t, r, n, o, i, l) {
  let s = l(e, t, r, n, o, i);
  if (s !== void 0)
    return s;
  if (typeof e == typeof t)
    switch (typeof e) {
      case "bigint":
      case "string":
      case "boolean":
      case "symbol":
      case "undefined":
        return e === t;
      case "number":
        return e === t || Object.is(e, t);
      case "function":
        return e === t;
      case "object":
        return J(e, t, i, l);
    }
  return J(e, t, i, l);
}
a(K, "isEqualWithImpl");
function J(e, t, r, n) {
  if (Object.is(e, t))
    return !0;
  let o = be(e), i = be(t);
  if (o === Oe && (o = ae), i === Oe && (i = ae), o !== i)
    return !1;
  switch (o) {
    case ze:
      return e.toString() === t.toString();
    case Fe: {
      let c = e.valueOf(), f = t.valueOf();
      return ut(c, f);
    }
    case Ue:
    case qe:
    case $e:
      return Object.is(e.valueOf(), t.valueOf());
    case We:
      return e.source === t.source && e.flags === t.flags;
    case Qe:
      return e === t;
  }
  r = r ?? /* @__PURE__ */ new Map();
  let l = r.get(e), s = r.get(t);
  if (l != null && s != null)
    return l === t;
  r.set(e, t), r.set(t, e);
  try {
    switch (o) {
      case He: {
        if (e.size !== t.size)
          return !1;
        for (let [c, f] of e.entries())
          if (!t.has(c) || !K(f, t.get(c), c, e, t, r, n))
            return !1;
        return !0;
      }
      case Ke: {
        if (e.size !== t.size)
          return !1;
        let c = Array.from(e.values()), f = Array.from(t.values());
        for (let u = 0; u < c.length; u++) {
          let h = c[u], p = f.findIndex((d) => K(h, d, void 0, e, t, r, n));
          if (p === -1)
            return !1;
          f.splice(p, 1);
        }
        return !0;
      }
      case Je:
      case Ze:
      case et:
      case tt:
      case rt:
      case nt:
      case ot:
      case at:
      case it:
      case st:
      case ct:
      case lt: {
        if (typeof Buffer < "u" && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length)
          return !1;
        for (let c = 0; c < e.length; c++)
          if (!K(e[c], t[c], c, e, t, r, n))
            return !1;
        return !0;
      }
      case Ye:
        return e.byteLength !== t.byteLength ? !1 : J(new Uint8Array(e), new Uint8Array(t), r, n);
      case Ge:
        return e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset ? !1 : J(new Uint8Array(e), new Uint8Array(t), r, n);
      case Xe:
        return e.name === t.name && e.message === t.message;
      case ae: {
        if (!(J(e.constructor, t.constructor, r, n) || M(e) && M(t)))
          return !1;
        let f = [...Object.keys(e), ...ve(e)], u = [...Object.keys(t), ...ve(t)];
        if (f.length !== u.length)
          return !1;
        for (let h = 0; h < f.length; h++) {
          let p = f[h], d = e[p];
          if (!Object.hasOwn(t, p))
            return !1;
          let m = t[p];
          if (!K(d, m, p, e, t, r, n))
            return !1;
        }
        return !0;
      }
      default:
        return !1;
    }
  } finally {
    r.delete(e), r.delete(t);
  }
}
a(J, "areObjectsEqual");

// ../node_modules/es-toolkit/dist/predicate/isEqual.mjs
function Ee(e, t) {
  return ft(e, t, Ve);
}
a(Ee, "isEqual");

// src/router/utils.ts
var fe = Be(ht(), 1), Q = Be(Pt(), 1);

// ../node_modules/ts-dedent/esm/index.js
function wt(e) {
  for (var t = [], r = 1; r < arguments.length; r++)
    t[r - 1] = arguments[r];
  var n = Array.from(typeof e == "string" ? [e] : e);
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
  var o = n.reduce(function(s, c) {
    var f = c.match(/\n([\t ]+|(?!\s).)/g);
    return f ? s.concat(f.map(function(u) {
      var h, p;
      return (p = (h = u.match(/[\t ]/g)) === null || h === void 0 ? void 0 : h.length) !== null && p !== void 0 ? p : 0;
    })) : s;
  }, []);
  if (o.length) {
    var i = new RegExp(`
[	 ]{` + Math.min.apply(Math, o) + "}", "g");
    n = n.map(function(s) {
      return s.replace(i, `
`);
    });
  }
  n[0] = n[0].replace(/^\r?\n/, "");
  var l = n[0];
  return t.forEach(function(s, c) {
    var f = l.match(/(?:^|\n)( *)$/), u = f ? f[1] : "", h = s;
    typeof s == "string" && s.includes(`
`) && (h = String(s).split(`
`).map(function(p, d) {
      return d === 0 ? p : "" + u + p;
    }).join(`
`)), l += h + n[c + 1];
  }), l;
}
a(wt, "dedent");

// src/router/utils.ts
var wr = /\/([^/]+)\/(?:(.*)_)?([^/]+)?/, _t = (0, fe.default)(1e3)((e) => {
  let t = {
    viewMode: void 0,
    storyId: void 0,
    refId: void 0
  };
  if (e) {
    let [, r, n, o] = e.toLowerCase().match(wr) || [];
    r && Object.assign(t, {
      viewMode: r,
      storyId: o,
      refId: n
    });
  }
  return t;
}), ue = Symbol("Deeply equal"), Ae = /* @__PURE__ */ a((e, t) => {
  if (typeof e != typeof t)
    return t;
  if (Ee(e, t))
    return ue;
  if (Array.isArray(e) && Array.isArray(t)) {
    let r = t.reduce((n, o, i) => {
      let l = Ae(e[i], o);
      return l !== ue && (n[i] = l), n;
    }, new Array(t.length));
    return t.length >= e.length ? r : r.concat(new Array(e.length - t.length).fill(void 0));
  }
  return M(e) && M(t) ? Object.keys({ ...e, ...t }).reduce((r, n) => {
    let o = Ae(e?.[n], t?.[n]);
    return o === ue ? r : Object.assign(r, { [n]: o });
  }, {}) : t;
}, "deepDiff"), St = /^[a-zA-Z0-9 _-]*$/, Sr = /^-?[0-9]+(\.[0-9]+)?$/, jt = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, At = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
De = /* @__PURE__ */ a((e = "", t) => e === null || e === "" || !St.test(e) ? !1 : t == null || t instanceof Date || typeof t == "number" ||
typeof t == "boolean" ? !0 : typeof t == "string" ? St.test(t) || Sr.test(t) || jt.test(t) || At.test(t) : Array.isArray(t) ? t.every((r) => De(
e, r)) : M(t) ? Object.entries(t).every(([r, n]) => De(r, n)) : !1, "validateArgs"), Te = /* @__PURE__ */ a((e) => e === void 0 ? "!undefine\
d" : e === null ? "!null" : typeof e == "string" ? jt.test(e) ? `!hex(${e.slice(1)})` : At.test(e) ? `!${e.replace(/[\s%]/g, "")}` : e : typeof e ==
"boolean" ? `!${e}` : e instanceof Date ? `!date(${e.toISOString()})` : Array.isArray(e) ? e.map(Te) : M(e) ? Object.entries(e).reduce(
  (t, [r, n]) => Object.assign(t, { [r]: Te(n) }),
  {}
) : e, "encodeSpecialValues"), _r = /* @__PURE__ */ a((e) => {
  switch (e) {
    case "%20":
      return "+";
    case "%5B":
      return "[";
    case "%5D":
      return "]";
    case "%2C":
      return ",";
    case "%3A":
      return ":";
  }
  return e;
}, "decodeKnownQueryChar"), jr = /%[0-9A-F]{2}/g, Xn = /* @__PURE__ */ a((e, t) => {
  let r = Ae(e, t);
  if (!r || r === ue)
    return "";
  let n = Object.entries(r).reduce((o, [i, l]) => De(i, l) ? Object.assign(o, { [i]: l }) : (Pr.warn(wt`
      Omitted potentially unsafe URL args.

      More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
    `), o), {});
  return (0, Q.stringify)(Te(n), {
    delimiter: ";",
    // we don't actually create multiple query params
    nesting: !0,
    nestingSyntax: "js"
    // encode objects using dot notation: obj.key=val
  }).replace(jr, _r).split(";").map((o) => o.replace("=", ":")).join(";");
}, "buildArgsParam"), Ar = (0, fe.default)(1e3)((e) => e !== void 0 ? (0, Q.parse)(e) : {}), Dt = /* @__PURE__ */ a((e) => Ar(e.search ? e.search.
slice(1) : ""), "queryFromLocation"), Gn = /* @__PURE__ */ a((e) => {
  let t = (0, Q.stringify)(e);
  return t ? "?" + t : "";
}, "stringifyQuery"), Tt = (0, fe.default)(1e3)((e, t, r = !0) => {
  if (r) {
    if (typeof t != "string")
      throw new Error("startsWith only works with string targets");
    return e && e.startsWith(t) ? { path: e } : null;
  }
  let n = typeof t == "string" && e === t, o = e && t && e.match(t);
  return n || o ? { path: e } : null;
});

// src/router/router.tsx
import ne, { useCallback as Zr } from "react";
import { global as en } from "@storybook/global";

// ../node_modules/react-router-dom/index.js
import { useRef as Ur, useState as $r, useLayoutEffect as qr, createElement as Ie, forwardRef as Ut, useCallback as Hr, useMemo as Co } from "react";

// ../node_modules/@babel/runtime/helpers/esm/extends.js
function Y() {
  return Y = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t];
      for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
  }, Y.apply(null, arguments);
}
a(Y, "_extends");

// ../node_modules/history/index.js
var B;
(function(e) {
  e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
})(B || (B = {}));
var Lt = function(e) {
  return Object.freeze(e);
};
function Dr(e, t) {
  if (!e) {
    typeof console < "u" && console.warn(t);
    try {
      throw new Error(t);
    } catch {
    }
  }
}
a(Dr, "warning");
var Ct = "beforeunload";
var Tr = "popstate";
function kt(e) {
  e === void 0 && (e = {});
  var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
  function i() {
    var y = n.location, E = y.pathname, P = y.search, j = y.hash, S = o.state || {};
    return [S.idx, Lt({
      pathname: E,
      search: P,
      hash: j,
      state: S.usr || null,
      key: S.key || "default"
    })];
  }
  a(i, "getIndexAndLocation");
  var l = null;
  function s() {
    if (l)
      d.call(l), l = null;
    else {
      var y = B.Pop, E = i(), P = E[0], j = E[1];
      if (d.length)
        if (P != null) {
          var S = u - P;
          S && (l = {
            action: y,
            location: j,
            retry: /* @__PURE__ */ a(function() {
              N(S * -1);
            }, "retry")
          }, N(S));
        } else
          Dr(
            !1,
            // TODO: Write up a doc that explains our blocking strategy in
            // detail and link to it here so people can understand better what
            // is going on and how to avoid it.
            "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silentl\
y in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) t\
o avoid this situation."
          );
      else
        b(y);
    }
  }
  a(s, "handlePop"), n.addEventListener(Tr, s);
  var c = B.Pop, f = i(), u = f[0], h = f[1], p = It(), d = It();
  u == null && (u = 0, o.replaceState(Y({}, o.state, {
    idx: u
  }), ""));
  function m(y) {
    return typeof y == "string" ? y : pe(y);
  }
  a(m, "createHref");
  function g(y, E) {
    return E === void 0 && (E = null), Lt(Y({
      pathname: h.pathname,
      hash: "",
      search: ""
    }, typeof y == "string" ? U(y) : y, {
      state: E,
      key: Lr()
    }));
  }
  a(g, "getNextLocation");
  function x(y, E) {
    return [{
      usr: y.state,
      key: y.key,
      idx: E
    }, m(y)];
  }
  a(x, "getHistoryStateAndUrl");
  function R(y, E, P) {
    return !d.length || (d.call({
      action: y,
      location: E,
      retry: P
    }), !1);
  }
  a(R, "allowTx");
  function b(y) {
    c = y;
    var E = i();
    u = E[0], h = E[1], p.call({
      action: c,
      location: h
    });
  }
  a(b, "applyTx");
  function v(y, E) {
    var P = B.Push, j = g(y, E);
    function S() {
      v(y, E);
    }
    if (a(S, "retry"), R(P, j, S)) {
      var _ = x(j, u + 1), C = _[0], D = _[1];
      try {
        o.pushState(C, "", D);
      } catch {
        n.location.assign(D);
      }
      b(P);
    }
  }
  a(v, "push");
  function O(y, E) {
    var P = B.Replace, j = g(y, E);
    function S() {
      O(y, E);
    }
    if (a(S, "retry"), R(P, j, S)) {
      var _ = x(j, u), C = _[0], D = _[1];
      o.replaceState(C, "", D), b(P);
    }
  }
  a(O, "replace");
  function N(y) {
    o.go(y);
  }
  a(N, "go");
  var F = {
    get action() {
      return c;
    },
    get location() {
      return h;
    },
    createHref: m,
    push: v,
    replace: O,
    go: N,
    back: /* @__PURE__ */ a(function() {
      N(-1);
    }, "back"),
    forward: /* @__PURE__ */ a(function() {
      N(1);
    }, "forward"),
    listen: /* @__PURE__ */ a(function(E) {
      return p.push(E);
    }, "listen"),
    block: /* @__PURE__ */ a(function(E) {
      var P = d.push(E);
      return d.length === 1 && n.addEventListener(Ct, Mt), function() {
        P(), d.length || n.removeEventListener(Ct, Mt);
      };
    }, "block")
  };
  return F;
}
a(kt, "createBrowserHistory");
function Mt(e) {
  e.preventDefault(), e.returnValue = "";
}
a(Mt, "promptBeforeUnload");
function It() {
  var e = [];
  return {
    get length() {
      return e.length;
    },
    push: /* @__PURE__ */ a(function(r) {
      return e.push(r), function() {
        e = e.filter(function(n) {
          return n !== r;
        });
      };
    }, "push"),
    call: /* @__PURE__ */ a(function(r) {
      e.forEach(function(n) {
        return n && n(r);
      });
    }, "call")
  };
}
a(It, "createEvents");
function Lr() {
  return Math.random().toString(36).substr(2, 8);
}
a(Lr, "createKey");
function pe(e) {
  var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, i = e.hash, l = i === void 0 ? "" : i;
  return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), l && l !== "#" && (r += l.charAt(0) === "#" ? l : "#" + l), r;
}
a(pe, "createPath");
function U(e) {
  var t = {};
  if (e) {
    var r = e.indexOf("#");
    r >= 0 && (t.hash = e.substr(r), e = e.substr(0, r));
    var n = e.indexOf("?");
    n >= 0 && (t.search = e.substr(n), e = e.substr(0, n)), e && (t.pathname = e);
  }
  return t;
}
a(U, "parsePath");

// ../node_modules/react-router/index.js
import { createContext as Ce, useRef as Cr, useState as co, useLayoutEffect as lo, createElement as Bt, useContext as $, useEffect as Mr, useMemo as Le,
useCallback as Ir, Children as uo, isValidElement as fo, Fragment as po } from "react";
function he(e, t) {
  if (!e) throw new Error(t);
}
a(he, "invariant");
function Vt(e, t) {
  if (!e) {
    typeof console < "u" && console.warn(t);
    try {
      throw new Error(t);
    } catch {
    }
  }
}
a(Vt, "warning");
var X = /* @__PURE__ */ Ce(null);
X.displayName = "Navigation";
var G = /* @__PURE__ */ Ce(null);
G.displayName = "Location";
var de = /* @__PURE__ */ Ce({
  outlet: null,
  matches: []
});
de.displayName = "Route";
function Z(e) {
  let {
    basename: t = "/",
    children: r = null,
    location: n,
    navigationType: o = B.Pop,
    navigator: i,
    static: l = !1
  } = e;
  ee() && he(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");
  let s = Wr(t), c = Le(() => ({
    basename: s,
    navigator: i,
    static: l
  }), [s, i, l]);
  typeof n == "string" && (n = U(n));
  let {
    pathname: f = "/",
    search: u = "",
    hash: h = "",
    state: p = null,
    key: d = "default"
  } = n, m = Le(() => {
    let g = Vr(f, s);
    return g == null ? null : {
      pathname: g,
      search: u,
      hash: h,
      state: p,
      key: d
    };
  }, [s, f, u, h, p, d]);
  return Vt(m != null, '<Router basename="' + s + '"> is not able to match the URL ' + ('"' + f + u + h + '" because it does not start with \
the ') + "basename, so the <Router> won't render anything."), m == null ? null : /* @__PURE__ */ Bt(X.Provider, {
    value: c
  }, /* @__PURE__ */ Bt(G.Provider, {
    children: r,
    value: {
      location: m,
      navigationType: o
    }
  }));
}
a(Z, "Router");
function Me(e) {
  ee() || he(
    !1,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useHref() may be used only in the context of a <Router> component."
  );
  let {
    basename: t,
    navigator: r
  } = $(X), {
    hash: n,
    pathname: o,
    search: i
  } = re(e), l = o;
  if (t !== "/") {
    let s = Br(e), c = s != null && s.endsWith("/");
    l = o === "/" ? t + (c ? "/" : "") : Ft([t, o]);
  }
  return r.createHref({
    pathname: l,
    search: i,
    hash: n
  });
}
a(Me, "useHref");
function ee() {
  return $(G) != null;
}
a(ee, "useInRouterContext");
function V() {
  return ee() || he(
    !1,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useLocation() may be used only in the context of a <Router> component."
  ), $(G).location;
}
a(V, "useLocation");
function te() {
  ee() || he(
    !1,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useNavigate() may be used only in the context of a <Router> component."
  );
  let {
    basename: e,
    navigator: t
  } = $(X), {
    matches: r
  } = $(de), {
    pathname: n
  } = V(), o = JSON.stringify(r.map((s) => s.pathnameBase)), i = Cr(!1);
  return Mr(() => {
    i.current = !0;
  }), Ir(function(s, c) {
    if (c === void 0 && (c = {}), Vt(i.current, "You should call navigate() in a React.useEffect(), not when your component is first rendere\
d."), !i.current) return;
    if (typeof s == "number") {
      t.go(s);
      return;
    }
    let f = zt(s, JSON.parse(o), n);
    e !== "/" && (f.pathname = Ft([e, f.pathname])), (c.replace ? t.replace : t.push)(f, c.state);
  }, [e, t, o, n]);
}
a(te, "useNavigate");
function re(e) {
  let {
    matches: t
  } = $(de), {
    pathname: r
  } = V(), n = JSON.stringify(t.map((o) => o.pathnameBase));
  return Le(() => zt(e, JSON.parse(n), r), [e, n, r]);
}
a(re, "useResolvedPath");
function Wt(e, t) {
  t === void 0 && (t = "/");
  let {
    pathname: r,
    search: n = "",
    hash: o = ""
  } = typeof e == "string" ? U(e) : e;
  return {
    pathname: r ? r.startsWith("/") ? r : kr(r, t) : t,
    search: zr(n),
    hash: Fr(o)
  };
}
a(Wt, "resolvePath");
function kr(e, t) {
  let r = t.replace(/\/+$/, "").split("/");
  return e.split("/").forEach((o) => {
    o === ".." ? r.length > 1 && r.pop() : o !== "." && r.push(o);
  }), r.length > 1 ? r.join("/") : "/";
}
a(kr, "resolvePathname");
function zt(e, t, r) {
  let n = typeof e == "string" ? U(e) : e, o = e === "" || n.pathname === "" ? "/" : n.pathname, i;
  if (o == null)
    i = r;
  else {
    let s = t.length - 1;
    if (o.startsWith("..")) {
      let c = o.split("/");
      for (; c[0] === ".."; )
        c.shift(), s -= 1;
      n.pathname = c.join("/");
    }
    i = s >= 0 ? t[s] : "/";
  }
  let l = Wt(n, i);
  return o && o !== "/" && o.endsWith("/") && !l.pathname.endsWith("/") && (l.pathname += "/"), l;
}
a(zt, "resolveTo");
function Br(e) {
  return e === "" || e.pathname === "" ? "/" : typeof e == "string" ? U(e).pathname : e.pathname;
}
a(Br, "getToPathname");
function Vr(e, t) {
  if (t === "/") return e;
  if (!e.toLowerCase().startsWith(t.toLowerCase()))
    return null;
  let r = e.charAt(t.length);
  return r && r !== "/" ? null : e.slice(t.length) || "/";
}
a(Vr, "stripBasename");
var Ft = /* @__PURE__ */ a((e) => e.join("/").replace(/\/\/+/g, "/"), "joinPaths"), Wr = /* @__PURE__ */ a((e) => e.replace(/\/+$/, "").replace(
/^\/*/, "/"), "normalizePathname"), zr = /* @__PURE__ */ a((e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, "normalizeSearch"),
Fr = /* @__PURE__ */ a((e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, "normalizeHash");

// ../node_modules/react-router-dom/index.js
function me() {
  return me = Object.assign || function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t];
      for (var n in r)
        Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
  }, me.apply(this, arguments);
}
a(me, "_extends");
function $t(e, t) {
  if (e == null) return {};
  var r = {}, n = Object.keys(e), o, i;
  for (i = 0; i < n.length; i++)
    o = n[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
  return r;
}
a($t, "_objectWithoutPropertiesLoose");
var Kr = ["onClick", "reloadDocument", "replace", "state", "target", "to"], Jr = ["aria-current", "caseSensitive", "className", "end", "styl\
e", "to"];
function qt(e) {
  let {
    basename: t,
    children: r,
    window: n
  } = e, o = Ur();
  o.current == null && (o.current = kt({
    window: n
  }));
  let i = o.current, [l, s] = $r({
    action: i.action,
    location: i.location
  });
  return qr(() => i.listen(s), [i]), /* @__PURE__ */ Ie(Z, {
    basename: t,
    children: r,
    location: l.location,
    navigationType: l.action,
    navigator: i
  });
}
a(qt, "BrowserRouter");
function Qr(e) {
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
}
a(Qr, "isModifiedEvent");
var ge = /* @__PURE__ */ Ut(/* @__PURE__ */ a(function(t, r) {
  let {
    onClick: n,
    reloadDocument: o,
    replace: i = !1,
    state: l,
    target: s,
    to: c
  } = t, f = $t(t, Kr), u = Me(c), h = Xr(c, {
    replace: i,
    state: l,
    target: s
  });
  function p(d) {
    n && n(d), !d.defaultPrevented && !o && h(d);
  }
  return a(p, "handleClick"), // eslint-disable-next-line jsx-a11y/anchor-has-content
  /* @__PURE__ */ Ie("a", me({}, f, {
    href: u,
    onClick: p,
    ref: r,
    target: s
  }));
}, "LinkWithRef"));
ge.displayName = "Link";
var Yr = /* @__PURE__ */ Ut(/* @__PURE__ */ a(function(t, r) {
  let {
    "aria-current": n = "page",
    caseSensitive: o = !1,
    className: i = "",
    end: l = !1,
    style: s,
    to: c
  } = t, f = $t(t, Jr), u = V(), h = re(c), p = u.pathname, d = h.pathname;
  o || (p = p.toLowerCase(), d = d.toLowerCase());
  let m = p === d || !l && p.startsWith(d) && p.charAt(d.length) === "/", g = m ? n : void 0, x;
  typeof i == "function" ? x = i({
    isActive: m
  }) : x = [i, m ? "active" : null].filter(Boolean).join(" ");
  let R = typeof s == "function" ? s({
    isActive: m
  }) : s;
  return /* @__PURE__ */ Ie(ge, me({}, f, {
    "aria-current": g,
    className: x,
    ref: r,
    style: R,
    to: c
  }));
}, "NavLinkWithRef"));
Yr.displayName = "NavLink";
function Xr(e, t) {
  let {
    target: r,
    replace: n,
    state: o
  } = t === void 0 ? {} : t, i = te(), l = V(), s = re(e);
  return Hr((c) => {
    if (c.button === 0 && // Ignore everything but left clicks
    (!r || r === "_self") && // Let browser handle "target=_blank" etc.
    !Qr(c)) {
      c.preventDefault();
      let f = !!n || pe(l) === pe(s);
      i(e, {
        replace: f,
        state: o
      });
    }
  }, [l, i, s, n, o, r, e]);
}
a(Xr, "useLinkClickHandler");

// src/router/router.tsx
var { document: ke } = en, tn = /* @__PURE__ */ a(() => `${ke.location.pathname}?`, "getBase"), Fo = /* @__PURE__ */ a(() => {
  let e = te();
  return Zr((t, { plain: r, ...n } = {}) => {
    if (typeof t == "string" && t.startsWith("#")) {
      t === "#" ? e(ke.location.search) : ke.location.hash = t;
      return;
    }
    if (typeof t == "string") {
      let o = r ? t : `?path=${t}`;
      return e(o, n);
    }
    if (typeof t == "number")
      return e(t);
  }, []);
}, "useNavigate"), rn = /* @__PURE__ */ a(({ to: e, children: t, ...r }) => /* @__PURE__ */ ne.createElement(ge, { to: `${tn()}path=${e}`, ...r },
t), "Link");
rn.displayName = "QueryLink";
var Ht = /* @__PURE__ */ a(({ children: e }) => {
  let t = V(), { path: r, singleStory: n } = Dt(t), { viewMode: o, storyId: i, refId: l } = _t(r);
  return /* @__PURE__ */ ne.createElement(ne.Fragment, null, e({
    path: r || "/",
    location: t,
    viewMode: o,
    storyId: i,
    refId: l,
    singleStory: n === "true"
  }));
}, "Location");
Ht.displayName = "QueryLocation";
function Kt({
  children: e,
  path: t,
  startsWith: r = !1
}) {
  return /* @__PURE__ */ ne.createElement(Ht, null, ({ path: n, ...o }) => e({
    match: Tt(n, t, r),
    ...o
  }));
}
a(Kt, "Match");
Kt.displayName = "QueryMatch";
function nn(e) {
  let { children: t, ...r } = e;
  return r.startsWith === void 0 && (r.startsWith = !1), /* @__PURE__ */ ne.createElement(Kt, { ...r }, ({ match: o }) => o ? t : null);
}
a(nn, "Route");
nn.displayName = "Route";
var Uo = /* @__PURE__ */ a((...e) => qt(...e), "LocationProvider"), $o = /* @__PURE__ */ a((...e) => Z(...e), "BaseLocationProvider");
export {
  $o as BaseLocationProvider,
  ue as DEEPLY_EQUAL,
  rn as Link,
  Ht as Location,
  Uo as LocationProvider,
  Kt as Match,
  nn as Route,
  Xn as buildArgsParam,
  Ae as deepDiff,
  Tt as getMatch,
  _t as parsePath,
  Dt as queryFromLocation,
  Gn as stringifyQuery,
  Fo as useNavigate
};
