import {
  a as N
} from "./chunk-JCASV5LV.js";
import {
  a as i
} from "./chunk-IO47FP3U.js";

// src/shared/universal-store/instances.ts
var se = /* @__PURE__ */ new Map();

// src/shared/universal-store/index.ts
var st = "UNIVERSAL_STORE:", T = {
  PENDING: "PENDING",
  RESOLVED: "RESOLVED",
  REJECTED: "REJECTED"
}, c = class c {
  constructor(e, r) {
    /** Enable debug logs for this store */
    this.debugging = !1;
    // TODO: narrow type of listeners based on event type
    this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
    /** Gets the current state */
    this.getState = /* @__PURE__ */ i(() => (this.debug("getState", { state: this.state }), this.state), "getState");
    /**
     * Subscribes to store events
     *
     * @returns A function to unsubscribe
     */
    this.subscribe = /* @__PURE__ */ i((e, r) => {
      let n = typeof e == "function", o = n ? "*" : e, p = n ? e : r;
      if (this.debug("subscribe", { eventType: o, listener: p }), !p)
        throw new TypeError(
          `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
        );
      return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(p), () => {
        this.debug("unsubscribe", { eventType: o, listener: p }), this.listeners.has(o) && (this.listeners.get(o).delete(p), this.listeners.get(o)?.size === 0 && this.listeners.delete(o));
      };
    }, "subscribe");
    /** Sends a custom event to the other stores */
    this.send = /* @__PURE__ */ i((e) => {
      if (this.debug("send", { event: e }), this.status !== c.Status.READY)
        throw new TypeError(
          N`Cannot send event before store is ready. You can get the current status with store.status,
        or await store.readyPromise to wait for the store to be ready before sending events.
        ${JSON.stringify(
            {
              event: e,
              id: this.id,
              actor: this.actor,
              environment: this.environment
            },
            null,
            2
          )}`
        );
      this.emitToListeners(e, { actor: this.actor }), this.emitToChannel(e, { actor: this.actor });
    }, "send");
    if (this.debugging = e.debug ?? !1, !c.isInternalConstructing)
      throw new TypeError(
        "UniversalStore is not constructable - use UniversalStore.create() instead"
      );
    if (c.isInternalConstructing = !1, this.id = e.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.actorType = e.leader ? c.ActorType.LEADER : c.ActorType.FOLLOWER, this.state = e.initialState, this.channelEventName = `${st}${this.id}`, this.debug("constructor", {
      options: e,
      environmentOverrides: r,
      channelEventName: this.channelEventName
    }), this.actor.type === c.ActorType.LEADER)
      this.syncing = {
        state: T.RESOLVED,
        promise: Promise.resolve()
      };
    else {
      let n, o, p = new Promise((s, y) => {
        n = /* @__PURE__ */ i(() => {
          this.syncing.state === T.PENDING && (this.syncing.state = T.RESOLVED, s());
        }, "syncingResolve"), o = /* @__PURE__ */ i((a) => {
          this.syncing.state === T.PENDING && (this.syncing.state = T.REJECTED, y(a));
        }, "syncingReject");
      });
      this.syncing = {
        state: T.PENDING,
        promise: p,
        resolve: n,
        reject: o
      };
    }
    this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange = this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(this), this.debug = this.debug.bind(this), this.channel = r?.channel ?? c.preparation.channel, this.environment = r?.environment ?? c.preparation.environment, this.channel && this.environment ? (c.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis({ channel: this.channel, environment: this.environment })) : c.preparation.promise.then(this.prepareThis);
  }
  static setupPreparationPromise() {
    let e, r, n = new Promise(
      (o, p) => {
        e = /* @__PURE__ */ i((s) => {
          o(s);
        }, "resolveRef"), r = /* @__PURE__ */ i((...s) => {
          p(s);
        }, "rejectRef");
      }
    );
    c.preparation = {
      resolve: e,
      reject: r,
      promise: n
    };
  }
  /** The actor object representing the store instance with a unique ID and a type */
  get actor() {
    return Object.freeze({
      id: this.actorId,
      type: this.actorType,
      environment: this.environment ?? c.Environment.UNKNOWN
    });
  }
  /**
   * The current state of the store, that signals both if the store is prepared by Storybook and
   * also - in the case of a follower - if the state has been synced with the leader's state.
   */
  get status() {
    if (!this.channel || !this.environment)
      return c.Status.UNPREPARED;
    switch (this.syncing?.state) {
      case T.PENDING:
      case void 0:
        return c.Status.SYNCING;
      case T.REJECTED:
        return c.Status.ERROR;
      case T.RESOLVED:
      default:
        return c.Status.READY;
    }
  }
  /**
   * A promise that resolves when the store is fully ready. A leader will be ready when the store
   * has been prepared by Storybook, which is almost instantly.
   *
   * A follower will be ready when the state has been synced with the leader's state, within a few
   * hundred milliseconds.
   */
  untilReady() {
    return Promise.all([c.preparation.promise, this.syncing?.promise]);
  }
  /** Creates a new instance of UniversalStore */
  static create(e) {
    if (!e || typeof e?.id != "string")
      throw new TypeError("id is required and must be a string, when creating a UniversalStore");
    e.debug && console.debug(
      N`[UniversalStore]
        create`,
      { options: e }
    );
    let r = se.get(e.id);
    if (r)
      return console.warn(N`UniversalStore with id "${e.id}" already exists in this environment, re-using existing.
        You should reuse the existing instance instead of trying to create a new one.`), r;
    c.isInternalConstructing = !0;
    let n = new c(e);
    return se.set(e.id, n), n;
  }
  /**
   * Used by Storybook to set the channel for all instances of UniversalStore in the given
   * environment.
   *
   * @internal
   */
  static __prepare(e, r) {
    c.preparation.channel = e, c.preparation.environment = r, c.preparation.resolve({ channel: e, environment: r });
  }
  /**
   * Updates the store's state
   *
   * Either a new state or a state updater function can be passed to the method.
   */
  setState(e) {
    let r = this.state, n = typeof e == "function" ? e(r) : e;
    if (this.debug("setState", { newState: n, previousState: r, updater: e }), this.status !== c.Status.READY)
      throw new TypeError(
        N`Cannot set state before store is ready. You can get the current status with store.status,
        or await store.readyPromise to wait for the store to be ready before sending events.
        ${JSON.stringify(
          {
            newState: n,
            id: this.id,
            actor: this.actor,
            environment: this.environment
          },
          null,
          2
        )}`
      );
    this.state = n;
    let o = {
      type: c.InternalEventType.SET_STATE,
      payload: {
        state: n,
        previousState: r
      }
    };
    this.emitToChannel(o, { actor: this.actor }), this.emitToListeners(o, { actor: this.actor });
  }
  /**
   * Subscribes to state changes
   *
   * @returns Unsubscribe function
   */
  onStateChange(e) {
    return this.debug("onStateChange", { listener: e }), this.subscribe(
      c.InternalEventType.SET_STATE,
      ({ payload: r }, n) => {
        e(r.state, r.previousState, n);
      }
    );
  }
  emitToChannel(e, r) {
    this.debug("emitToChannel", { event: e, eventInfo: r, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
      event: e,
      eventInfo: r
    });
  }
  prepareThis({
    channel: e,
    environment: r
  }) {
    this.channel = e, this.environment = r, this.debug("prepared", { channel: !!e, environment: r }), this.channel.on(this.channelEventName, this.handleChannelEvents), this.actor.type === c.ActorType.LEADER ? this.emitToChannel(
      { type: c.InternalEventType.LEADER_CREATED },
      { actor: this.actor }
    ) : (this.emitToChannel(
      { type: c.InternalEventType.FOLLOWER_CREATED },
      { actor: this.actor }
    ), this.emitToChannel(
      { type: c.InternalEventType.EXISTING_STATE_REQUEST },
      { actor: this.actor }
    ), setTimeout(() => {
      this.syncing.reject(
        new TypeError(
          `No existing state found for follower with id: '${this.id}'. Make sure a leader with the same id exists before creating a follower.`
        )
      );
    }, 1e3));
  }
  emitToListeners(e, r) {
    let n = this.listeners.get(e.type), o = this.listeners.get("*");
    this.debug("emitToListeners", {
      event: e,
      eventInfo: r,
      eventTypeListeners: n,
      everythingListeners: o
    }), [...n ?? [], ...o ?? []].forEach(
      (p) => p(e, r)
    );
  }
  handleChannelEvents(e) {
    let { event: r, eventInfo: n } = e;
    if ([n.actor.id, n.forwardingActor?.id].includes(this.actor.id)) {
      this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: e });
      return;
    } else if (this.syncing?.state === T.PENDING && r.type !== c.InternalEventType.EXISTING_STATE_RESPONSE) {
      this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: e });
      return;
    }
    if (this.debug("handleChannelEvents", { channelEvent: e }), this.actor.type === c.ActorType.LEADER) {
      let o = !0;
      switch (r.type) {
        case c.InternalEventType.EXISTING_STATE_REQUEST:
          o = !1;
          let p = {
            type: c.InternalEventType.EXISTING_STATE_RESPONSE,
            payload: this.state
          };
          this.debug("handleChannelEvents: responding to existing state request", {
            responseEvent: p
          }), this.emitToChannel(p, { actor: this.actor }), this.emitToListeners(p, { actor: this.actor });
          break;
        case c.InternalEventType.LEADER_CREATED:
          o = !1, this.syncing.state = T.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
            event: r
          }), console.error(
            N`Detected multiple UniversalStore leaders created with the same id "${this.id}".
            Only one leader can exists at a time, your stores are now in an invalid state.
            Leaders detected:
            this: ${JSON.stringify(this.actor, null, 2)}
            other: ${JSON.stringify(n.actor, null, 2)}`
          );
          break;
      }
      o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: e }), this.emitToChannel(r, { actor: n.actor, forwardingActor: this.actor }));
    }
    if (this.actor.type === c.ActorType.FOLLOWER)
      switch (r.type) {
        case c.InternalEventType.EXISTING_STATE_RESPONSE:
          if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
            event: r
          }), this.syncing?.state !== T.PENDING)
            break;
          this.syncing.resolve?.();
          let o = {
            type: c.InternalEventType.SET_STATE,
            payload: {
              state: r.payload,
              previousState: this.state
            }
          };
          this.state = r.payload, this.emitToListeners(o, n);
          break;
      }
    switch (r.type) {
      case c.InternalEventType.SET_STATE:
        this.debug("handleChannelEvents: Setting state", { event: r }), this.state = r.payload.state;
        break;
    }
    this.emitToListeners(r, { actor: n.actor });
  }
  debug(e, r) {
    this.debugging && console.debug(
      N`[UniversalStore::${this.id}::${this.environment ?? c.Environment.UNKNOWN}]
        ${e}`,
      JSON.stringify(
        {
          data: r,
          actor: this.actor,
          state: this.state,
          status: this.status
        },
        null,
        2
      )
    );
  }
  /**
   * Used to reset the static fields of the UniversalStore class when cleaning up tests
   *
   * @internal
   */
  static __reset() {
    c.preparation.reject(new Error("reset")), c.setupPreparationPromise(), c.isInternalConstructing = !1;
  }
};
i(c, "UniversalStore"), /**
 * Defines the possible actor types in the store system
 *
 * @readonly
 */
c.ActorType = {
  LEADER: "LEADER",
  FOLLOWER: "FOLLOWER"
}, /**
 * Defines the possible environments the store can run in
 *
 * @readonly
 */
c.Environment = {
  SERVER: "SERVER",
  MANAGER: "MANAGER",
  PREVIEW: "PREVIEW",
  UNKNOWN: "UNKNOWN",
  MOCK: "MOCK"
}, /**
 * Internal event types used for store synchronization
 *
 * @readonly
 */
c.InternalEventType = {
  EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
  EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
  SET_STATE: "__SET_STATE",
  LEADER_CREATED: "__LEADER_CREATED",
  FOLLOWER_CREATED: "__FOLLOWER_CREATED"
}, c.Status = {
  UNPREPARED: "UNPREPARED",
  SYNCING: "SYNCING",
  READY: "READY",
  ERROR: "ERROR"
}, // This is used to check if constructor was called from the static factory create()
c.isInternalConstructing = !1, c.setupPreparationPromise();
var Se = c;

// ../node_modules/telejson/dist/chunk-EAFQLD22.mjs
var pt = Object.create, Ae = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, Te = Object.getOwnPropertyNames, lt = Object.getPrototypeOf, ut = Object.prototype.hasOwnProperty, l = /* @__PURE__ */ i((t, e) => /* @__PURE__ */ i(function() {
  return e || (0, t[Te(t)[0]])((e = { exports: {} }).exports, e), e.exports;
}, "__require"), "__commonJS"), yt = /* @__PURE__ */ i((t, e, r, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let o of Te(e))
      !ut.call(t, o) && o !== r && Ae(t, o, { get: /* @__PURE__ */ i(() => e[o], "get"), enumerable: !(n = ct(e, o)) || n.enumerable });
  return t;
}, "__copyProps"), te = /* @__PURE__ */ i((t, e, r) => (r = t != null ? pt(lt(t)) : {}, yt(
  // 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.
  e || !t || !t.__esModule ? Ae(r, "default", { value: t, enumerable: !0 }) : r,
  t
)), "__toESM"), ft = [
  "bubbles",
  "cancelBubble",
  "cancelable",
  "composed",
  "currentTarget",
  "defaultPrevented",
  "eventPhase",
  "isTrusted",
  "returnValue",
  "srcElement",
  "target",
  "timeStamp",
  "type"
], dt = ["detail"];
function Pe(t) {
  let e = ft.filter((r) => t[r] !== void 0).reduce((r, n) => (r[n] = t[n], r), {});
  if (t instanceof CustomEvent)
    for (let r of dt.filter(
      (n) => t[n] !== void 0
    ))
      e[r] = t[r];
  return e;
}
i(Pe, "extractEventHiddenProperties");

// ../node_modules/telejson/dist/index.mjs
var je = l({
  "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(t, e) {
    "use strict";
    e.exports = Object;
  }
}), ht = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(t, e) {
    "use strict";
    e.exports = Error;
  }
}), mt = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(t, e) {
    "use strict";
    e.exports = EvalError;
  }
}), gt = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(t, e) {
    "use strict";
    e.exports = RangeError;
  }
}), vt = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(t, e) {
    "use strict";
    e.exports = ReferenceError;
  }
}), _t = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(t, e) {
    "use strict";
    e.exports = SyntaxError;
  }
}), ce = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(t, e) {
    "use strict";
    e.exports = TypeError;
  }
}), bt = l({
  "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(t, e) {
    "use strict";
    e.exports = URIError;
  }
}), Et = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(t, e) {
    "use strict";
    e.exports = Math.abs;
  }
}), St = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(t, e) {
    "use strict";
    e.exports = Math.floor;
  }
}), At = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(t, e) {
    "use strict";
    e.exports = Math.max;
  }
}), Tt = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(t, e) {
    "use strict";
    e.exports = Math.min;
  }
}), Pt = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(t, e) {
    "use strict";
    e.exports = Math.pow;
  }
}), xt = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(t, e) {
    "use strict";
    e.exports = Math.round;
  }
}), Ot = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(t, e) {
    "use strict";
    e.exports = Number.isNaN || /* @__PURE__ */ i(function(n) {
      return n !== n;
    }, "isNaN2");
  }
}), wt = l({
  "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(t, e) {
    "use strict";
    var r = Ot();
    e.exports = /* @__PURE__ */ i(function(o) {
      return r(o) || o === 0 ? o : o < 0 ? -1 : 1;
    }, "sign");
  }
}), It = l({
  "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(t, e) {
    "use strict";
    e.exports = Object.getOwnPropertyDescriptor;
  }
}), le = l({
  "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(t, e) {
    "use strict";
    var r = It();
    if (r)
      try {
        r([], "length");
      } catch {
        r = null;
      }
    e.exports = r;
  }
}), Rt = l({
  "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(t, e) {
    "use strict";
    var r = Object.defineProperty || !1;
    if (r)
      try {
        r({}, "a", { value: 1 });
      } catch {
        r = !1;
      }
    e.exports = r;
  }
}), Ne = l({
  "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(t, e) {
    "use strict";
    e.exports = /* @__PURE__ */ i(function() {
      if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
        return !1;
      if (typeof Symbol.iterator == "symbol")
        return !0;
      var n = {}, o = Symbol("test"), p = Object(o);
      if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(p) !== "[object Symbol]")
        return !1;
      var s = 42;
      n[o] = s;
      for (var y in n)
        return !1;
      if (typeof Object.keys == "function" && Object.keys(n).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(n).length !== 0)
        return !1;
      var a = Object.getOwnPropertySymbols(n);
      if (a.length !== 1 || a[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
        return !1;
      if (typeof Object.getOwnPropertyDescriptor == "function") {
        var u = (
          /** @type {PropertyDescriptor} */
          Object.getOwnPropertyDescriptor(n, o)
        );
        if (u.value !== s || u.enumerable !== !0)
          return !1;
      }
      return !0;
    }, "hasSymbols");
  }
}), Ce = l({
  "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(t, e) {
    "use strict";
    var r = typeof Symbol < "u" && Symbol, n = Ne();
    e.exports = /* @__PURE__ */ i(function() {
      return typeof r != "function" || typeof Symbol != "function" || typeof r("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : n();
    }, "hasNativeSymbols");
  }
}), De = l({
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(t, e) {
    "use strict";
    e.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
  }
}), Fe = l({
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(t, e) {
    "use strict";
    var r = je();
    e.exports = r.getPrototypeOf || null;
  }
}), jt = l({
  "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(t, e) {
    "use strict";
    var r = "Function.prototype.bind called on incompatible ", n = Object.prototype.toString, o = Math.max, p = "[object Function]", s = /* @__PURE__ */ i(function(d, f) {
      for (var h = [], v = 0; v < d.length; v += 1)
        h[v] = d[v];
      for (var m = 0; m < f.length; m += 1)
        h[m + d.length] = f[m];
      return h;
    }, "concatty2"), y = /* @__PURE__ */ i(function(d, f) {
      for (var h = [], v = f || 0, m = 0; v < d.length; v += 1, m += 1)
        h[m] = d[v];
      return h;
    }, "slicy2"), a = /* @__PURE__ */ i(function(u, d) {
      for (var f = "", h = 0; h < u.length; h += 1)
        f += u[h], h + 1 < u.length && (f += d);
      return f;
    }, "joiny");
    e.exports = /* @__PURE__ */ i(function(d) {
      var f = this;
      if (typeof f != "function" || n.apply(f) !== p)
        throw new TypeError(r + f);
      for (var h = y(arguments, 1), v, m = /* @__PURE__ */ i(function() {
        if (this instanceof v) {
          var I = f.apply(
            this,
            s(h, arguments)
          );
          return Object(I) === I ? I : this;
        }
        return f.apply(
          d,
          s(h, arguments)
        );
      }, "binder"), R = o(0, f.length - h.length), C = [], w = 0; w < R; w++)
        C[w] = "$" + w;
      if (v = Function("binder", "return function (" + a(C, ",") + "){ return binder.apply(this,arguments); }")(m), f.prototype) {
        var D = /* @__PURE__ */ i(function() {
        }, "Empty2");
        D.prototype = f.prototype, v.prototype = new D(), D.prototype = null;
      }
      return v;
    }, "bind");
  }
}), re = l({
  "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(t, e) {
    "use strict";
    var r = jt();
    e.exports = Function.prototype.bind || r;
  }
}), ue = l({
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(t, e) {
    "use strict";
    e.exports = Function.prototype.call;
  }
}), $e = l({
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(t, e) {
    "use strict";
    e.exports = Function.prototype.apply;
  }
}), Nt = l({
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(t, e) {
    "use strict";
    e.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
  }
}), Ct = l({
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(t, e) {
    "use strict";
    var r = re(), n = $e(), o = ue(), p = Nt();
    e.exports = p || r.call(o, n);
  }
}), Ue = l({
  "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(t, e) {
    "use strict";
    var r = re(), n = ce(), o = ue(), p = Ct();
    e.exports = /* @__PURE__ */ i(function(y) {
      if (y.length < 1 || typeof y[0] != "function")
        throw new n("a function is required");
      return p(r, o, y);
    }, "callBindBasic");
  }
}), Dt = l({
  "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(t, e) {
    "use strict";
    var r = Ue(), n = le(), o;
    try {
      o = /** @type {{ __proto__?: typeof Array.prototype }} */
      [].__proto__ === Array.prototype;
    } catch (a) {
      if (!a || typeof a != "object" || !("code" in a) || a.code !== "ERR_PROTO_ACCESS")
        throw a;
    }
    var p = !!o && n && n(
      Object.prototype,
      /** @type {keyof typeof Object.prototype} */
      "__proto__"
    ), s = Object, y = s.getPrototypeOf;
    e.exports = p && typeof p.get == "function" ? r([p.get]) : typeof y == "function" ? (
      /** @type {import('./get')} */
      /* @__PURE__ */ i(function(u) {
        return y(u == null ? u : s(u));
      }, "getDunder")
    ) : !1;
  }
}), Ft = l({
  "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(t, e) {
    "use strict";
    var r = De(), n = Fe(), o = Dt();
    e.exports = r ? /* @__PURE__ */ i(function(s) {
      return r(s);
    }, "getProto") : n ? /* @__PURE__ */ i(function(s) {
      if (!s || typeof s != "object" && typeof s != "function")
        throw new TypeError("getProto: not an object");
      return n(s);
    }, "getProto") : o ? /* @__PURE__ */ i(function(s) {
      return o(s);
    }, "getProto") : null;
  }
}), Me = l({
  "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(t, e) {
    "use strict";
    var r = Function.prototype.call, n = Object.prototype.hasOwnProperty, o = re();
    e.exports = o.call(r, n);
  }
}), $t = l({
  "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(t, e) {
    "use strict";
    var r, n = je(), o = ht(), p = mt(), s = gt(), y = vt(), a = _t(), u = ce(), d = bt(), f = Et(), h = St(), v = At(), m = Tt(), R = Pt(), C = xt(), w = wt(), D = Function, I = /* @__PURE__ */ i(function(P) {
      try {
        return D('"use strict"; return (' + P + ").constructor;")();
      } catch {
      }
    }, "getEvalledConstructor"), B = le(), Ye = Rt(), ie = /* @__PURE__ */ i(function() {
      throw new u();
    }, "throwTypeError"), He = B ? function() {
      try {
        return arguments.callee, ie;
      } catch {
        try {
          return B(arguments, "callee").get;
        } catch {
          return ie;
        }
      }
    }() : ie, F = Ce()(), b = Ft(), Ke = Fe(), Xe = De(), ve = $e(), W = ue(), $ = {}, Qe = typeof Uint8Array > "u" || !b ? r : b(Uint8Array), j = {
      __proto__: null,
      "%AggregateError%": typeof AggregateError > "u" ? r : AggregateError,
      "%Array%": Array,
      "%ArrayBuffer%": typeof ArrayBuffer > "u" ? r : ArrayBuffer,
      "%ArrayIteratorPrototype%": F && b ? b([][Symbol.iterator]()) : r,
      "%AsyncFromSyncIteratorPrototype%": r,
      "%AsyncFunction%": $,
      "%AsyncGenerator%": $,
      "%AsyncGeneratorFunction%": $,
      "%AsyncIteratorPrototype%": $,
      "%Atomics%": typeof Atomics > "u" ? r : Atomics,
      "%BigInt%": typeof BigInt > "u" ? r : BigInt,
      "%BigInt64Array%": typeof BigInt64Array > "u" ? r : BigInt64Array,
      "%BigUint64Array%": typeof BigUint64Array > "u" ? r : BigUint64Array,
      "%Boolean%": Boolean,
      "%DataView%": typeof DataView > "u" ? r : DataView,
      "%Date%": Date,
      "%decodeURI%": decodeURI,
      "%decodeURIComponent%": decodeURIComponent,
      "%encodeURI%": encodeURI,
      "%encodeURIComponent%": encodeURIComponent,
      "%Error%": o,
      "%eval%": eval,
      // eslint-disable-line no-eval
      "%EvalError%": p,
      "%Float16Array%": typeof Float16Array > "u" ? r : Float16Array,
      "%Float32Array%": typeof Float32Array > "u" ? r : Float32Array,
      "%Float64Array%": typeof Float64Array > "u" ? r : Float64Array,
      "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? r : FinalizationRegistry,
      "%Function%": D,
      "%GeneratorFunction%": $,
      "%Int8Array%": typeof Int8Array > "u" ? r : Int8Array,
      "%Int16Array%": typeof Int16Array > "u" ? r : Int16Array,
      "%Int32Array%": typeof Int32Array > "u" ? r : Int32Array,
      "%isFinite%": isFinite,
      "%isNaN%": isNaN,
      "%IteratorPrototype%": F && b ? b(b([][Symbol.iterator]())) : r,
      "%JSON%": typeof JSON == "object" ? JSON : r,
      "%Map%": typeof Map > "u" ? r : Map,
      "%MapIteratorPrototype%": typeof Map > "u" || !F || !b ? r : b((/* @__PURE__ */ new Map())[Symbol.iterator]()),
      "%Math%": Math,
      "%Number%": Number,
      "%Object%": n,
      "%Object.getOwnPropertyDescriptor%": B,
      "%parseFloat%": parseFloat,
      "%parseInt%": parseInt,
      "%Promise%": typeof Promise > "u" ? r : Promise,
      "%Proxy%": typeof Proxy > "u" ? r : Proxy,
      "%RangeError%": s,
      "%ReferenceError%": y,
      "%Reflect%": typeof Reflect > "u" ? r : Reflect,
      "%RegExp%": RegExp,
      "%Set%": typeof Set > "u" ? r : Set,
      "%SetIteratorPrototype%": typeof Set > "u" || !F || !b ? r : b((/* @__PURE__ */ new Set())[Symbol.iterator]()),
      "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? r : SharedArrayBuffer,
      "%String%": String,
      "%StringIteratorPrototype%": F && b ? b(""[Symbol.iterator]()) : r,
      "%Symbol%": F ? Symbol : r,
      "%SyntaxError%": a,
      "%ThrowTypeError%": He,
      "%TypedArray%": Qe,
      "%TypeError%": u,
      "%Uint8Array%": typeof Uint8Array > "u" ? r : Uint8Array,
      "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? r : Uint8ClampedArray,
      "%Uint16Array%": typeof Uint16Array > "u" ? r : Uint16Array,
      "%Uint32Array%": typeof Uint32Array > "u" ? r : Uint32Array,
      "%URIError%": d,
      "%WeakMap%": typeof WeakMap > "u" ? r : WeakMap,
      "%WeakRef%": typeof WeakRef > "u" ? r : WeakRef,
      "%WeakSet%": typeof WeakSet > "u" ? r : WeakSet,
      "%Function.prototype.call%": W,
      "%Function.prototype.apply%": ve,
      "%Object.defineProperty%": Ye,
      "%Object.getPrototypeOf%": Ke,
      "%Math.abs%": f,
      "%Math.floor%": h,
      "%Math.max%": v,
      "%Math.min%": m,
      "%Math.pow%": R,
      "%Math.round%": C,
      "%Math.sign%": w,
      "%Reflect.getPrototypeOf%": Xe
    };
    if (b)
      try {
        null.error;
      } catch (P) {
        _e = b(b(P)), j["%Error.prototype%"] = _e;
      }
    var _e, Ze = /* @__PURE__ */ i(function P(g) {
      var E;
      if (g === "%AsyncFunction%")
        E = I("async function () {}");
      else if (g === "%GeneratorFunction%")
        E = I("function* () {}");
      else if (g === "%AsyncGeneratorFunction%")
        E = I("async function* () {}");
      else if (g === "%AsyncGenerator%") {
        var _ = P("%AsyncGeneratorFunction%");
        _ && (E = _.prototype);
      } else if (g === "%AsyncIteratorPrototype%") {
        var S = P("%AsyncGenerator%");
        S && b && (E = b(S.prototype));
      }
      return j[g] = E, E;
    }, "doEval2"), be = {
      __proto__: null,
      "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
      "%ArrayPrototype%": ["Array", "prototype"],
      "%ArrayProto_entries%": ["Array", "prototype", "entries"],
      "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
      "%ArrayProto_keys%": ["Array", "prototype", "keys"],
      "%ArrayProto_values%": ["Array", "prototype", "values"],
      "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
      "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
      "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
      "%BooleanPrototype%": ["Boolean", "prototype"],
      "%DataViewPrototype%": ["DataView", "prototype"],
      "%DatePrototype%": ["Date", "prototype"],
      "%ErrorPrototype%": ["Error", "prototype"],
      "%EvalErrorPrototype%": ["EvalError", "prototype"],
      "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
      "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
      "%FunctionPrototype%": ["Function", "prototype"],
      "%Generator%": ["GeneratorFunction", "prototype"],
      "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
      "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
      "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
      "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
      "%JSONParse%": ["JSON", "parse"],
      "%JSONStringify%": ["JSON", "stringify"],
      "%MapPrototype%": ["Map", "prototype"],
      "%NumberPrototype%": ["Number", "prototype"],
      "%ObjectPrototype%": ["Object", "prototype"],
      "%ObjProto_toString%": ["Object", "prototype", "toString"],
      "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
      "%PromisePrototype%": ["Promise", "prototype"],
      "%PromiseProto_then%": ["Promise", "prototype", "then"],
      "%Promise_all%": ["Promise", "all"],
      "%Promise_reject%": ["Promise", "reject"],
      "%Promise_resolve%": ["Promise", "resolve"],
      "%RangeErrorPrototype%": ["RangeError", "prototype"],
      "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
      "%RegExpPrototype%": ["RegExp", "prototype"],
      "%SetPrototype%": ["Set", "prototype"],
      "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
      "%StringPrototype%": ["String", "prototype"],
      "%SymbolPrototype%": ["Symbol", "prototype"],
      "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
      "%TypedArrayPrototype%": ["TypedArray", "prototype"],
      "%TypeErrorPrototype%": ["TypeError", "prototype"],
      "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
      "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
      "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
      "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
      "%URIErrorPrototype%": ["URIError", "prototype"],
      "%WeakMapPrototype%": ["WeakMap", "prototype"],
      "%WeakSetPrototype%": ["WeakSet", "prototype"]
    }, k = re(), Y = Me(), et = k.call(W, Array.prototype.concat), tt = k.call(ve, Array.prototype.splice), Ee = k.call(W, String.prototype.replace), H = k.call(W, String.prototype.slice), rt = k.call(W, RegExp.prototype.exec), nt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ot = /\\(\\)?/g, it = /* @__PURE__ */ i(function(g) {
      var E = H(g, 0, 1), _ = H(g, -1);
      if (E === "%" && _ !== "%")
        throw new a("invalid intrinsic syntax, expected closing `%`");
      if (_ === "%" && E !== "%")
        throw new a("invalid intrinsic syntax, expected opening `%`");
      var S = [];
      return Ee(g, nt, function(x, U, A, K) {
        S[S.length] = A ? Ee(K, ot, "$1") : U || x;
      }), S;
    }, "stringToPath3"), at = /* @__PURE__ */ i(function(g, E) {
      var _ = g, S;
      if (Y(be, _) && (S = be[_], _ = "%" + S[0] + "%"), Y(j, _)) {
        var x = j[_];
        if (x === $ && (x = Ze(_)), typeof x > "u" && !E)
          throw new u("intrinsic " + g + " exists, but is not available. Please file an issue!");
        return {
          alias: S,
          name: _,
          value: x
        };
      }
      throw new a("intrinsic " + g + " does not exist!");
    }, "getBaseIntrinsic2");
    e.exports = /* @__PURE__ */ i(function(g, E) {
      if (typeof g != "string" || g.length === 0)
        throw new u("intrinsic name must be a non-empty string");
      if (arguments.length > 1 && typeof E != "boolean")
        throw new u('"allowMissing" argument must be a boolean');
      if (rt(/^%?[^%]*%?$/, g) === null)
        throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
      var _ = it(g), S = _.length > 0 ? _[0] : "", x = at("%" + S + "%", E), U = x.name, A = x.value, K = !1, ae = x.alias;
      ae && (S = ae[0], tt(_, et([0, 1], ae)));
      for (var X = 1, J = !0; X < _.length; X += 1) {
        var O = _[X], Q = H(O, 0, 1), Z = H(O, -1);
        if ((Q === '"' || Q === "'" || Q === "`" || Z === '"' || Z === "'" || Z === "`") && Q !== Z)
          throw new a("property names with quotes must have matching quotes");
        if ((O === "constructor" || !J) && (K = !0), S += "." + O, U = "%" + S + "%", Y(j, U))
          A = j[U];
        else if (A != null) {
          if (!(O in A)) {
            if (!E)
              throw new u("base intrinsic for " + g + " exists, but the property is not available.");
            return;
          }
          if (B && X + 1 >= _.length) {
            var ee = B(A, O);
            J = !!ee, J && "get" in ee && !("originalValue" in ee.get) ? A = ee.get : A = A[O];
          } else
            J = Y(A, O), A = A[O];
          J && !K && (j[U] = A);
        }
      }
      return A;
    }, "GetIntrinsic");
  }
}), ye = l({
  "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(t, e) {
    "use strict";
    var r = $t(), n = Ue(), o = n([r("%String.prototype.indexOf%")]);
    e.exports = /* @__PURE__ */ i(function(s, y) {
      var a = (
        /** @type {(this: unknown, ...args: unknown[]) => unknown} */
        r(s, !!y)
      );
      return typeof a == "function" && o(s, ".prototype.") > -1 ? n(
        /** @type {const} */
        [a]
      ) : a;
    }, "callBoundIntrinsic");
  }
}), Ut = l({
  "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(t, e) {
    "use strict";
    var r = Ne();
    e.exports = /* @__PURE__ */ i(function() {
      return r() && !!Symbol.toStringTag;
    }, "hasToStringTagShams");
  }
}), Ge = l({
  "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(t, e) {
    "use strict";
    var r = ye(), n = Ut()(), o = Me(), p = le(), s;
    n ? (y = r("RegExp.prototype.exec"), a = {}, u = /* @__PURE__ */ i(function() {
      throw a;
    }, "throwRegexMarker"), d = {
      toString: u,
      valueOf: u
    }, typeof Symbol.toPrimitive == "symbol" && (d[Symbol.toPrimitive] = u), s = /* @__PURE__ */ i(function(m) {
      if (!m || typeof m != "object")
        return !1;
      var R = (
        /** @type {NonNullable<typeof gOPD>} */
        p(
          /** @type {{ lastIndex?: unknown }} */
          m,
          "lastIndex"
        )
      ), C = R && o(R, "value");
      if (!C)
        return !1;
      try {
        y(
          m,
          /** @type {string} */
          /** @type {unknown} */
          d
        );
      } catch (w) {
        return w === a;
      }
    }, "isRegex")) : (f = r("Object.prototype.toString"), h = "[object RegExp]", s = /* @__PURE__ */ i(function(m) {
      return !m || typeof m != "object" && typeof m != "function" ? !1 : f(m) === h;
    }, "isRegex"));
    var y, a, u, d, f, h;
    e.exports = s;
  }
}), Mt = l({
  "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(t, e) {
    e.exports = n;
    var r = Object.prototype.toString;
    function n(o) {
      if (!o)
        return !1;
      var p = r.call(o);
      return p === "[object Function]" || typeof o == "function" && p !== "[object RegExp]" || typeof window < "u" && // IE8 and below
      (o === window.setTimeout || o === window.alert || o === window.confirm || o === window.prompt);
    }
    i(n, "isFunction3");
  }
}), Gt = l({
  "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(t, e) {
    "use strict";
    var r = ye(), n = Ge(), o = r("RegExp.prototype.exec"), p = ce();
    e.exports = /* @__PURE__ */ i(function(y) {
      if (!n(y))
        throw new p("`regex` must be a RegExp");
      return /* @__PURE__ */ i(function(u) {
        return o(y, u) !== null;
      }, "test");
    }, "regexTester");
  }
}), Lt = l({
  "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(t, e) {
    "use strict";
    var r = ye(), n = r("Object.prototype.toString"), o = Ce()(), p = Gt();
    o ? (s = r("Symbol.prototype.toString"), y = p(/^Symbol\(.*\)$/), a = /* @__PURE__ */ i(function(d) {
      return typeof d.valueOf() != "symbol" ? !1 : y(s(d));
    }, "isRealSymbolObject"), e.exports = /* @__PURE__ */ i(function(d) {
      if (typeof d == "symbol")
        return !0;
      if (!d || typeof d != "object" || n(d) !== "[object Symbol]")
        return !1;
      try {
        return a(d);
      } catch {
        return !1;
      }
    }, "isSymbol3")) : e.exports = /* @__PURE__ */ i(function(d) {
      return !1;
    }, "isSymbol3");
    var s, y, a;
  }
}), qt = te(Ge()), Bt = te(Mt()), Wt = te(Lt());
function kt(t) {
  return t != null && typeof t == "object" && Array.isArray(t) === !1;
}
i(kt, "isObject");
var Jt = typeof global == "object" && global && global.Object === Object && global, Vt = Jt, zt = typeof self == "object" && self && self.Object === Object && self, Yt = Vt || zt || Function("return this")(), fe = Yt, Ht = fe.Symbol, M = Ht, Le = Object.prototype, Kt = Le.hasOwnProperty, Xt = Le.toString, V = M ? M.toStringTag : void 0;
function Qt(t) {
  var e = Kt.call(t, V), r = t[V];
  try {
    t[V] = void 0;
    var n = !0;
  } catch {
  }
  var o = Xt.call(t);
  return n && (e ? t[V] = r : delete t[V]), o;
}
i(Qt, "getRawTag");
var Zt = Qt, er = Object.prototype, tr = er.toString;
function rr(t) {
  return tr.call(t);
}
i(rr, "objectToString");
var nr = rr, or = "[object Null]", ir = "[object Undefined]", xe = M ? M.toStringTag : void 0;
function ar(t) {
  return t == null ? t === void 0 ? ir : or : xe && xe in Object(t) ? Zt(t) : nr(t);
}
i(ar, "baseGetTag");
var qe = ar;
function sr(t) {
  return t != null && typeof t == "object";
}
i(sr, "isObjectLike");
var pr = sr, cr = "[object Symbol]";
function lr(t) {
  return typeof t == "symbol" || pr(t) && qe(t) == cr;
}
i(lr, "isSymbol");
var de = lr;
function ur(t, e) {
  for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
    o[r] = e(t[r], r, t);
  return o;
}
i(ur, "arrayMap");
var yr = ur, fr = Array.isArray, he = fr, dr = 1 / 0, Oe = M ? M.prototype : void 0, we = Oe ? Oe.toString : void 0;
function Be(t) {
  if (typeof t == "string")
    return t;
  if (he(t))
    return yr(t, Be) + "";
  if (de(t))
    return we ? we.call(t) : "";
  var e = t + "";
  return e == "0" && 1 / t == -dr ? "-0" : e;
}
i(Be, "baseToString");
var hr = Be;
function mr(t) {
  var e = typeof t;
  return t != null && (e == "object" || e == "function");
}
i(mr, "isObject2");
var We = mr, gr = "[object AsyncFunction]", vr = "[object Function]", _r = "[object GeneratorFunction]", br = "[object Proxy]";
function Er(t) {
  if (!We(t))
    return !1;
  var e = qe(t);
  return e == vr || e == _r || e == gr || e == br;
}
i(Er, "isFunction");
var Sr = Er, Ar = fe["__core-js_shared__"], pe = Ar, Ie = function() {
  var t = /[^.]+$/.exec(pe && pe.keys && pe.keys.IE_PROTO || "");
  return t ? "Symbol(src)_1." + t : "";
}();
function Tr(t) {
  return !!Ie && Ie in t;
}
i(Tr, "isMasked");
var Pr = Tr, xr = Function.prototype, Or = xr.toString;
function wr(t) {
  if (t != null) {
    try {
      return Or.call(t);
    } catch {
    }
    try {
      return t + "";
    } catch {
    }
  }
  return "";
}
i(wr, "toSource");
var Ir = wr, Rr = /[\\^$.*+?()[\]{}|]/g, jr = /^\[object .+?Constructor\]$/, Nr = Function.prototype, Cr = Object.prototype, Dr = Nr.toString, Fr = Cr.hasOwnProperty, $r = RegExp(
  "^" + Dr.call(Fr).replace(Rr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function Ur(t) {
  if (!We(t) || Pr(t))
    return !1;
  var e = Sr(t) ? $r : jr;
  return e.test(Ir(t));
}
i(Ur, "baseIsNative");
var Mr = Ur;
function Gr(t, e) {
  return t?.[e];
}
i(Gr, "getValue");
var Lr = Gr;
function qr(t, e) {
  var r = Lr(t, e);
  return Mr(r) ? r : void 0;
}
i(qr, "getNative");
var ke = qr;
function Br(t, e) {
  return t === e || t !== t && e !== e;
}
i(Br, "eq");
var Wr = Br, kr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Jr = /^\w*$/;
function Vr(t, e) {
  if (he(t))
    return !1;
  var r = typeof t;
  return r == "number" || r == "symbol" || r == "boolean" || t == null || de(t) ? !0 : Jr.test(t) || !kr.test(t) || e != null && t in Object(e);
}
i(Vr, "isKey");
var zr = Vr, Yr = ke(Object, "create"), z = Yr;
function Hr() {
  this.__data__ = z ? z(null) : {}, this.size = 0;
}
i(Hr, "hashClear");
var Kr = Hr;
function Xr(t) {
  var e = this.has(t) && delete this.__data__[t];
  return this.size -= e ? 1 : 0, e;
}
i(Xr, "hashDelete");
var Qr = Xr, Zr = "__lodash_hash_undefined__", en = Object.prototype, tn = en.hasOwnProperty;
function rn(t) {
  var e = this.__data__;
  if (z) {
    var r = e[t];
    return r === Zr ? void 0 : r;
  }
  return tn.call(e, t) ? e[t] : void 0;
}
i(rn, "hashGet");
var nn = rn, on = Object.prototype, an = on.hasOwnProperty;
function sn(t) {
  var e = this.__data__;
  return z ? e[t] !== void 0 : an.call(e, t);
}
i(sn, "hashHas");
var pn = sn, cn = "__lodash_hash_undefined__";
function ln(t, e) {
  var r = this.__data__;
  return this.size += this.has(t) ? 0 : 1, r[t] = z && e === void 0 ? cn : e, this;
}
i(ln, "hashSet");
var un = ln;
function G(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
i(G, "Hash");
G.prototype.clear = Kr;
G.prototype.delete = Qr;
G.prototype.get = nn;
G.prototype.has = pn;
G.prototype.set = un;
var Re = G;
function yn() {
  this.__data__ = [], this.size = 0;
}
i(yn, "listCacheClear");
var fn = yn;
function dn(t, e) {
  for (var r = t.length; r--; )
    if (Wr(t[r][0], e))
      return r;
  return -1;
}
i(dn, "assocIndexOf");
var ne = dn, hn = Array.prototype, mn = hn.splice;
function gn(t) {
  var e = this.__data__, r = ne(e, t);
  if (r < 0)
    return !1;
  var n = e.length - 1;
  return r == n ? e.pop() : mn.call(e, r, 1), --this.size, !0;
}
i(gn, "listCacheDelete");
var vn = gn;
function _n(t) {
  var e = this.__data__, r = ne(e, t);
  return r < 0 ? void 0 : e[r][1];
}
i(_n, "listCacheGet");
var bn = _n;
function En(t) {
  return ne(this.__data__, t) > -1;
}
i(En, "listCacheHas");
var Sn = En;
function An(t, e) {
  var r = this.__data__, n = ne(r, t);
  return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
}
i(An, "listCacheSet");
var Tn = An;
function L(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
i(L, "ListCache");
L.prototype.clear = fn;
L.prototype.delete = vn;
L.prototype.get = bn;
L.prototype.has = Sn;
L.prototype.set = Tn;
var Pn = L, xn = ke(fe, "Map"), On = xn;
function wn() {
  this.size = 0, this.__data__ = {
    hash: new Re(),
    map: new (On || Pn)(),
    string: new Re()
  };
}
i(wn, "mapCacheClear");
var In = wn;
function Rn(t) {
  var e = typeof t;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
i(Rn, "isKeyable");
var jn = Rn;
function Nn(t, e) {
  var r = t.__data__;
  return jn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
i(Nn, "getMapData");
var oe = Nn;
function Cn(t) {
  var e = oe(this, t).delete(t);
  return this.size -= e ? 1 : 0, e;
}
i(Cn, "mapCacheDelete");
var Dn = Cn;
function Fn(t) {
  return oe(this, t).get(t);
}
i(Fn, "mapCacheGet");
var $n = Fn;
function Un(t) {
  return oe(this, t).has(t);
}
i(Un, "mapCacheHas");
var Mn = Un;
function Gn(t, e) {
  var r = oe(this, t), n = r.size;
  return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
}
i(Gn, "mapCacheSet");
var Ln = Gn;
function q(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
i(q, "MapCache");
q.prototype.clear = In;
q.prototype.delete = Dn;
q.prototype.get = $n;
q.prototype.has = Mn;
q.prototype.set = Ln;
var Je = q, qn = "Expected a function";
function me(t, e) {
  if (typeof t != "function" || e != null && typeof e != "function")
    throw new TypeError(qn);
  var r = /* @__PURE__ */ i(function() {
    var n = arguments, o = e ? e.apply(this, n) : n[0], p = r.cache;
    if (p.has(o))
      return p.get(o);
    var s = t.apply(this, n);
    return r.cache = p.set(o, s) || p, s;
  }, "memoized");
  return r.cache = new (me.Cache || Je)(), r;
}
i(me, "memoize");
me.Cache = Je;
var Bn = me, Wn = 500;
function kn(t) {
  var e = Bn(t, function(n) {
    return r.size === Wn && r.clear(), n;
  }), r = e.cache;
  return e;
}
i(kn, "memoizeCapped");
var Jn = kn, Vn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, zn = /\\(\\)?/g, Yn = Jn(function(t) {
  var e = [];
  return t.charCodeAt(0) === 46 && e.push(""), t.replace(Vn, function(r, n, o, p) {
    e.push(o ? p.replace(zn, "$1") : n || r);
  }), e;
}), Hn = Yn;
function Kn(t) {
  return t == null ? "" : hr(t);
}
i(Kn, "toString");
var Xn = Kn;
function Qn(t, e) {
  return he(t) ? t : zr(t, e) ? [t] : Hn(Xn(t));
}
i(Qn, "castPath");
var Zn = Qn, eo = 1 / 0;
function to(t) {
  if (typeof t == "string" || de(t))
    return t;
  var e = t + "";
  return e == "0" && 1 / t == -eo ? "-0" : e;
}
i(to, "toKey");
var ro = to;
function no(t, e) {
  e = Zn(e, t);
  for (var r = 0, n = e.length; t != null && r < n; )
    t = t[ro(e[r++])];
  return r && r == n ? t : void 0;
}
i(no, "baseGet");
var oo = no;
function io(t, e, r) {
  var n = t == null ? void 0 : oo(t, e);
  return n === void 0 ? r : n;
}
i(io, "get");
var ao = io, ge = kt, so = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, po = /* @__PURE__ */ i((t) => t.match(/^[\[\{\"\}].*[\]\}\"]$/), "isJSON");
function Ve(t) {
  if (!ge(t))
    return t;
  let e = t, r = !1;
  return typeof Event < "u" && t instanceof Event && (e = Pe(e), r = !0), e = Object.keys(e).reduce((n, o) => {
    try {
      e[o] && e[o].toJSON, n[o] = e[o];
    } catch {
      r = !0;
    }
    return n;
  }, {}), r ? e : t;
}
i(Ve, "convertUnconventionalData");
var co = /* @__PURE__ */ i(function(e) {
  let r, n, o, p;
  return /* @__PURE__ */ i(function(y, a) {
    try {
      if (y === "")
        return p = [], r = /* @__PURE__ */ new Map([[a, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], a;
      let u = n.get(this) || this;
      for (; o.length && u !== o[0]; )
        o.shift(), p.pop();
      if (typeof a == "boolean")
        return a;
      if (a === void 0)
        return e.allowUndefined ? "_undefined_" : void 0;
      if (a === null)
        return null;
      if (typeof a == "number")
        return a === Number.NEGATIVE_INFINITY ? "_-Infinity_" : a === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(a) ? "_NaN_" : a;
      if (typeof a == "bigint")
        return `_bigint_${a.toString()}`;
      if (typeof a == "string")
        return so.test(a) ? e.allowDate ? `_date_${a}` : void 0 : a;
      if ((0, qt.default)(a))
        return e.allowRegExp ? `_regexp_${a.flags}|${a.source}` : void 0;
      if ((0, Bt.default)(a))
        return;
      if ((0, Wt.default)(a)) {
        if (!e.allowSymbol)
          return;
        let f = Symbol.keyFor(a);
        return f !== void 0 ? `_gsymbol_${f}` : `_symbol_${a.toString().slice(7, -1)}`;
      }
      if (o.length >= e.maxDepth)
        return Array.isArray(a) ? `[Array(${a.length})]` : "[Object]";
      if (a === this)
        return `_duplicate_${JSON.stringify(p)}`;
      if (a instanceof Error && e.allowError)
        return {
          __isConvertedError__: !0,
          errorProperties: {
            // @ts-expect-error cause is not defined in the current tsconfig target(es2020)
            ...a.cause ? { cause: a.cause } : {},
            ...a,
            name: a.name,
            message: a.message,
            stack: a.stack,
            "_constructor-name_": a.constructor.name
          }
        };
      if (a?.constructor?.name && a.constructor.name !== "Object" && !Array.isArray(a)) {
        let f = r.get(a);
        if (!f) {
          let h = {
            __isClassInstance__: !0,
            __className__: a.constructor.name,
            ...Object.getOwnPropertyNames(a).reduce(
              (v, m) => {
                try {
                  v[m] = a[m];
                } catch {
                }
                return v;
              },
              {}
            )
          };
          return p.push(y), o.unshift(h), r.set(a, JSON.stringify(p)), a !== h && n.set(a, h), h;
        }
        return `_duplicate_${f}`;
      }
      let d = r.get(a);
      if (!d) {
        let f = Array.isArray(a) ? a : Ve(a);
        return p.push(y), o.unshift(f), r.set(a, JSON.stringify(p)), a !== f && n.set(a, f), f;
      }
      return `_duplicate_${d}`;
    } catch {
      return;
    }
  }, "replace");
}, "replacer2"), lo = /* @__PURE__ */ i(function(e) {
  let r = [], n;
  return /* @__PURE__ */ i(function(p, s) {
    if (p === "" && (n = s, r.forEach(({ target: y, container: a, replacement: u }) => {
      let d = po(u) ? JSON.parse(u) : u.split(".");
      d.length === 0 ? a[y] = n : a[y] = ao(n, d);
    })), p === "_constructor-name_")
      return s;
    if (ge(s) && s.__isConvertedError__) {
      let { message: y, ...a } = s.errorProperties, u = new Error(y);
      return Object.assign(u, a), u;
    }
    if (typeof s == "string" && s.startsWith("_regexp_") && e.allowRegExp) {
      let [, y, a] = s.match(/_regexp_([^|]*)\|(.*)/) || [];
      return new RegExp(a, y);
    }
    return typeof s == "string" && s.startsWith("_date_") && e.allowDate ? new Date(s.replace("_date_", "")) : typeof s == "string" && s.startsWith("_duplicate_") ? (r.push({ target: p, container: this, replacement: s.replace(/^_duplicate_/, "") }), null) : typeof s == "string" && s.startsWith("_symbol_") && e.allowSymbol ? Symbol(s.replace("_symbol_", "")) : typeof s == "string" && s.startsWith("_gsymbol_") && e.allowSymbol ? Symbol.for(s.replace("_gsymbol_", "")) : typeof s == "string" && s === "_-Infinity_" ? Number.NEGATIVE_INFINITY : typeof s == "string" && s === "_Infinity_" ? Number.POSITIVE_INFINITY : typeof s == "string" && s === "_NaN_" ? Number.NaN : typeof s == "string" && s.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(s.replace("_bigint_", "")) : s;
  }, "revive");
}, "reviver2"), ze = {
  maxDepth: 10,
  space: void 0,
  allowRegExp: !0,
  allowDate: !0,
  allowError: !0,
  allowUndefined: !0,
  allowSymbol: !0
}, Eo = /* @__PURE__ */ i((t, e = {}) => {
  let r = { ...ze, ...e };
  return JSON.stringify(Ve(t), co(r), e.space);
}, "stringify"), uo = /* @__PURE__ */ i(() => {
  let t = /* @__PURE__ */ new Map();
  return /* @__PURE__ */ i(function e(r) {
    ge(r) && Object.entries(r).forEach(([n, o]) => {
      o === "_undefined_" ? r[n] = void 0 : t.get(o) || (t.set(o, !0), e(o));
    }), Array.isArray(r) && r.forEach((n, o) => {
      n === "_undefined_" ? (t.set(n, !0), r[o] = void 0) : t.get(n) || (t.set(n, !0), e(n));
    });
  }, "mutateUndefined");
}, "mutator"), So = /* @__PURE__ */ i((t, e = {}) => {
  let r = { ...ze, ...e }, n = JSON.parse(t, lo(r));
  return uo()(n), n;
}, "parse");

export {
  Se as a,
  po as b,
  Eo as c,
  So as d
};
