var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf,
  __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = ((x) =>
  typeof require < "u"
    ? require
    : typeof Proxy < "u"
    ? new Proxy(x, { get: (a, b) => (typeof require < "u" ? require : a)[b] })
    : x)(function (x) {
  if (typeof require < "u") return require.apply(this, arguments);
  throw new Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) =>
  function () {
    return (
      mod ||
        (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod),
      mod.exports
    );
  };
var __copyProps = (to, from, except, desc) => {
  if ((from && typeof from == "object") || typeof from == "function")
    for (let key of __getOwnPropNames(from))
      !__hasOwnProp.call(to, key) &&
        key !== except &&
        __defProp(to, key, {
          get: () => from[key],
          enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
        });
  return to;
};
var __toESM = (mod, isNodeMode, target) => (
  (target = mod != null ? __create(__getProtoOf(mod)) : {}),
  __copyProps(
    isNodeMode || !mod || !mod.__esModule
      ? __defProp(target, "default", { value: mod, enumerable: !0 })
      : target,
    mod
  )
);
var require_browser_polyfill = __commonJS({
  "node_modules/.pnpm/webextension-polyfill@0.10.0/node_modules/webextension-polyfill/dist/browser-polyfill.js"(
    exports,
    module
  ) {
    (function (global2, factory) {
      if (typeof define == "function" && define.amd)
        define("webextension-polyfill", ["module"], factory);
      else if (typeof exports < "u") factory(module);
      else {
        var mod = { exports: {} };
        factory(mod), (global2.browser = mod.exports);
      }
    })(
      typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : exports,
      function (module2) {
        "use strict";
        if (!globalThis.chrome?.runtime?.id)
          throw new Error(
            "This script should only be loaded in a browser extension."
          );
        if (
          typeof globalThis.browser > "u" ||
          Object.getPrototypeOf(globalThis.browser) !== Object.prototype
        ) {
          let CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE =
              "The message port closed before a response was received.",
            wrapAPIs = (extensionAPIs) => {
              let apiMetadata = {
                alarms: {
                  clear: { minArgs: 0, maxArgs: 1 },
                  clearAll: { minArgs: 0, maxArgs: 0 },
                  get: { minArgs: 0, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                },
                bookmarks: {
                  create: { minArgs: 1, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 1 },
                  getChildren: { minArgs: 1, maxArgs: 1 },
                  getRecent: { minArgs: 1, maxArgs: 1 },
                  getSubTree: { minArgs: 1, maxArgs: 1 },
                  getTree: { minArgs: 0, maxArgs: 0 },
                  move: { minArgs: 2, maxArgs: 2 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeTree: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                browserAction: {
                  disable: { minArgs: 0, maxArgs: 1, fallbackToNoCallback: !0 },
                  enable: { minArgs: 0, maxArgs: 1, fallbackToNoCallback: !0 },
                  getBadgeBackgroundColor: { minArgs: 1, maxArgs: 1 },
                  getBadgeText: { minArgs: 1, maxArgs: 1 },
                  getPopup: { minArgs: 1, maxArgs: 1 },
                  getTitle: { minArgs: 1, maxArgs: 1 },
                  openPopup: { minArgs: 0, maxArgs: 0 },
                  setBadgeBackgroundColor: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setBadgeText: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setIcon: { minArgs: 1, maxArgs: 1 },
                  setPopup: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setTitle: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                },
                browsingData: {
                  remove: { minArgs: 2, maxArgs: 2 },
                  removeCache: { minArgs: 1, maxArgs: 1 },
                  removeCookies: { minArgs: 1, maxArgs: 1 },
                  removeDownloads: { minArgs: 1, maxArgs: 1 },
                  removeFormData: { minArgs: 1, maxArgs: 1 },
                  removeHistory: { minArgs: 1, maxArgs: 1 },
                  removeLocalStorage: { minArgs: 1, maxArgs: 1 },
                  removePasswords: { minArgs: 1, maxArgs: 1 },
                  removePluginData: { minArgs: 1, maxArgs: 1 },
                  settings: { minArgs: 0, maxArgs: 0 },
                },
                commands: { getAll: { minArgs: 0, maxArgs: 0 } },
                contextMenus: {
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeAll: { minArgs: 0, maxArgs: 0 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                cookies: {
                  get: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 1, maxArgs: 1 },
                  getAllCookieStores: { minArgs: 0, maxArgs: 0 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  set: { minArgs: 1, maxArgs: 1 },
                },
                devtools: {
                  inspectedWindow: {
                    eval: { minArgs: 1, maxArgs: 2, singleCallbackArg: !1 },
                  },
                  panels: {
                    create: { minArgs: 3, maxArgs: 3, singleCallbackArg: !0 },
                    elements: { createSidebarPane: { minArgs: 1, maxArgs: 1 } },
                  },
                },
                downloads: {
                  cancel: { minArgs: 1, maxArgs: 1 },
                  download: { minArgs: 1, maxArgs: 1 },
                  erase: { minArgs: 1, maxArgs: 1 },
                  getFileIcon: { minArgs: 1, maxArgs: 2 },
                  open: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                  pause: { minArgs: 1, maxArgs: 1 },
                  removeFile: { minArgs: 1, maxArgs: 1 },
                  resume: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                  show: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                },
                extension: {
                  isAllowedFileSchemeAccess: { minArgs: 0, maxArgs: 0 },
                  isAllowedIncognitoAccess: { minArgs: 0, maxArgs: 0 },
                },
                history: {
                  addUrl: { minArgs: 1, maxArgs: 1 },
                  deleteAll: { minArgs: 0, maxArgs: 0 },
                  deleteRange: { minArgs: 1, maxArgs: 1 },
                  deleteUrl: { minArgs: 1, maxArgs: 1 },
                  getVisits: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                },
                i18n: {
                  detectLanguage: { minArgs: 1, maxArgs: 1 },
                  getAcceptLanguages: { minArgs: 0, maxArgs: 0 },
                },
                identity: { launchWebAuthFlow: { minArgs: 1, maxArgs: 1 } },
                idle: { queryState: { minArgs: 1, maxArgs: 1 } },
                management: {
                  get: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  getSelf: { minArgs: 0, maxArgs: 0 },
                  setEnabled: { minArgs: 2, maxArgs: 2 },
                  uninstallSelf: { minArgs: 0, maxArgs: 1 },
                },
                notifications: {
                  clear: { minArgs: 1, maxArgs: 1 },
                  create: { minArgs: 1, maxArgs: 2 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  getPermissionLevel: { minArgs: 0, maxArgs: 0 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                pageAction: {
                  getPopup: { minArgs: 1, maxArgs: 1 },
                  getTitle: { minArgs: 1, maxArgs: 1 },
                  hide: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                  setIcon: { minArgs: 1, maxArgs: 1 },
                  setPopup: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setTitle: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  show: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                },
                permissions: {
                  contains: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  request: { minArgs: 1, maxArgs: 1 },
                },
                runtime: {
                  getBackgroundPage: { minArgs: 0, maxArgs: 0 },
                  getPlatformInfo: { minArgs: 0, maxArgs: 0 },
                  openOptionsPage: { minArgs: 0, maxArgs: 0 },
                  requestUpdateCheck: { minArgs: 0, maxArgs: 0 },
                  sendMessage: { minArgs: 1, maxArgs: 3 },
                  sendNativeMessage: { minArgs: 2, maxArgs: 2 },
                  setUninstallURL: { minArgs: 1, maxArgs: 1 },
                },
                sessions: {
                  getDevices: { minArgs: 0, maxArgs: 1 },
                  getRecentlyClosed: { minArgs: 0, maxArgs: 1 },
                  restore: { minArgs: 0, maxArgs: 1 },
                },
                storage: {
                  local: {
                    clear: { minArgs: 0, maxArgs: 0 },
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                    remove: { minArgs: 1, maxArgs: 1 },
                    set: { minArgs: 1, maxArgs: 1 },
                  },
                  managed: {
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                  },
                  sync: {
                    clear: { minArgs: 0, maxArgs: 0 },
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                    remove: { minArgs: 1, maxArgs: 1 },
                    set: { minArgs: 1, maxArgs: 1 },
                  },
                },
                tabs: {
                  captureVisibleTab: { minArgs: 0, maxArgs: 2 },
                  create: { minArgs: 1, maxArgs: 1 },
                  detectLanguage: { minArgs: 0, maxArgs: 1 },
                  discard: { minArgs: 0, maxArgs: 1 },
                  duplicate: { minArgs: 1, maxArgs: 1 },
                  executeScript: { minArgs: 1, maxArgs: 2 },
                  get: { minArgs: 1, maxArgs: 1 },
                  getCurrent: { minArgs: 0, maxArgs: 0 },
                  getZoom: { minArgs: 0, maxArgs: 1 },
                  getZoomSettings: { minArgs: 0, maxArgs: 1 },
                  goBack: { minArgs: 0, maxArgs: 1 },
                  goForward: { minArgs: 0, maxArgs: 1 },
                  highlight: { minArgs: 1, maxArgs: 1 },
                  insertCSS: { minArgs: 1, maxArgs: 2 },
                  move: { minArgs: 2, maxArgs: 2 },
                  query: { minArgs: 1, maxArgs: 1 },
                  reload: { minArgs: 0, maxArgs: 2 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeCSS: { minArgs: 1, maxArgs: 2 },
                  sendMessage: { minArgs: 2, maxArgs: 3 },
                  setZoom: { minArgs: 1, maxArgs: 2 },
                  setZoomSettings: { minArgs: 1, maxArgs: 2 },
                  update: { minArgs: 1, maxArgs: 2 },
                },
                topSites: { get: { minArgs: 0, maxArgs: 0 } },
                webNavigation: {
                  getAllFrames: { minArgs: 1, maxArgs: 1 },
                  getFrame: { minArgs: 1, maxArgs: 1 },
                },
                webRequest: {
                  handlerBehaviorChanged: { minArgs: 0, maxArgs: 0 },
                },
                windows: {
                  create: { minArgs: 0, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 2 },
                  getAll: { minArgs: 0, maxArgs: 1 },
                  getCurrent: { minArgs: 0, maxArgs: 1 },
                  getLastFocused: { minArgs: 0, maxArgs: 1 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
              };
              if (Object.keys(apiMetadata).length === 0)
                throw new Error(
                  "api-metadata.json has not been included in browser-polyfill"
                );
              class DefaultWeakMap extends WeakMap {
                constructor(createItem, items = void 0) {
                  super(items), (this.createItem = createItem);
                }
                get(key) {
                  return (
                    this.has(key) || this.set(key, this.createItem(key)),
                    super.get(key)
                  );
                }
              }
              let isThenable = (value) =>
                  value &&
                  typeof value == "object" &&
                  typeof value.then == "function",
                makeCallback =
                  (promise, metadata) =>
                  (...callbackArgs) => {
                    extensionAPIs.runtime.lastError
                      ? promise.reject(
                          new Error(extensionAPIs.runtime.lastError.message)
                        )
                      : metadata.singleCallbackArg ||
                        (callbackArgs.length <= 1 &&
                          metadata.singleCallbackArg !== !1)
                      ? promise.resolve(callbackArgs[0])
                      : promise.resolve(callbackArgs);
                  },
                pluralizeArguments = (numArgs) =>
                  numArgs == 1 ? "argument" : "arguments",
                wrapAsyncFunction = (name, metadata) =>
                  function (target, ...args) {
                    if (args.length < metadata.minArgs)
                      throw new Error(
                        `Expected at least ${
                          metadata.minArgs
                        } ${pluralizeArguments(
                          metadata.minArgs
                        )} for ${name}(), got ${args.length}`
                      );
                    if (args.length > metadata.maxArgs)
                      throw new Error(
                        `Expected at most ${
                          metadata.maxArgs
                        } ${pluralizeArguments(
                          metadata.maxArgs
                        )} for ${name}(), got ${args.length}`
                      );
                    return new Promise((resolve, reject) => {
                      if (metadata.fallbackToNoCallback)
                        try {
                          target[name](
                            ...args,
                            makeCallback({ resolve, reject }, metadata)
                          );
                        } catch (cbError) {
                          console.warn(
                            `${name} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,
                            cbError
                          ),
                            target[name](...args),
                            (metadata.fallbackToNoCallback = !1),
                            (metadata.noCallback = !0),
                            resolve();
                        }
                      else
                        metadata.noCallback
                          ? (target[name](...args), resolve())
                          : target[name](
                              ...args,
                              makeCallback({ resolve, reject }, metadata)
                            );
                    });
                  },
                wrapMethod = (target, method, wrapper) =>
                  new Proxy(method, {
                    apply(targetMethod, thisObj, args) {
                      return wrapper.call(thisObj, target, ...args);
                    },
                  }),
                hasOwnProperty3 = Function.call.bind(
                  Object.prototype.hasOwnProperty
                ),
                wrapObject = (target, wrappers = {}, metadata = {}) => {
                  let cache = Object.create(null),
                    handlers = {
                      has(proxyTarget2, prop) {
                        return prop in target || prop in cache;
                      },
                      get(proxyTarget2, prop, receiver) {
                        if (prop in cache) return cache[prop];
                        if (!(prop in target)) return;
                        let value = target[prop];
                        if (typeof value == "function")
                          if (typeof wrappers[prop] == "function")
                            value = wrapMethod(
                              target,
                              target[prop],
                              wrappers[prop]
                            );
                          else if (hasOwnProperty3(metadata, prop)) {
                            let wrapper = wrapAsyncFunction(
                              prop,
                              metadata[prop]
                            );
                            value = wrapMethod(target, target[prop], wrapper);
                          } else value = value.bind(target);
                        else if (
                          typeof value == "object" &&
                          value !== null &&
                          (hasOwnProperty3(wrappers, prop) ||
                            hasOwnProperty3(metadata, prop))
                        )
                          value = wrapObject(
                            value,
                            wrappers[prop],
                            metadata[prop]
                          );
                        else if (hasOwnProperty3(metadata, "*"))
                          value = wrapObject(
                            value,
                            wrappers[prop],
                            metadata["*"]
                          );
                        else
                          return (
                            Object.defineProperty(cache, prop, {
                              configurable: !0,
                              enumerable: !0,
                              get() {
                                return target[prop];
                              },
                              set(value2) {
                                target[prop] = value2;
                              },
                            }),
                            value
                          );
                        return (cache[prop] = value), value;
                      },
                      set(proxyTarget2, prop, value, receiver) {
                        return (
                          prop in cache
                            ? (cache[prop] = value)
                            : (target[prop] = value),
                          !0
                        );
                      },
                      defineProperty(proxyTarget2, prop, desc) {
                        return Reflect.defineProperty(cache, prop, desc);
                      },
                      deleteProperty(proxyTarget2, prop) {
                        return Reflect.deleteProperty(cache, prop);
                      },
                    },
                    proxyTarget = Object.create(target);
                  return new Proxy(proxyTarget, handlers);
                },
                wrapEvent = (wrapperMap) => ({
                  addListener(target, listener, ...args) {
                    target.addListener(wrapperMap.get(listener), ...args);
                  },
                  hasListener(target, listener) {
                    return target.hasListener(wrapperMap.get(listener));
                  },
                  removeListener(target, listener) {
                    target.removeListener(wrapperMap.get(listener));
                  },
                }),
                onRequestFinishedWrappers = new DefaultWeakMap((listener) =>
                  typeof listener != "function"
                    ? listener
                    : function (req) {
                        let wrappedReq = wrapObject(
                          req,
                          {},
                          { getContent: { minArgs: 0, maxArgs: 0 } }
                        );
                        listener(wrappedReq);
                      }
                ),
                onMessageWrappers = new DefaultWeakMap((listener) =>
                  typeof listener != "function"
                    ? listener
                    : function (message, sender, sendResponse) {
                        let didCallSendResponse = !1,
                          wrappedSendResponse,
                          sendResponsePromise = new Promise((resolve) => {
                            wrappedSendResponse = function (response) {
                              (didCallSendResponse = !0), resolve(response);
                            };
                          }),
                          result;
                        try {
                          result = listener(
                            message,
                            sender,
                            wrappedSendResponse
                          );
                        } catch (err) {
                          result = Promise.reject(err);
                        }
                        let isResultThenable =
                          result !== !0 && isThenable(result);
                        if (
                          result !== !0 &&
                          !isResultThenable &&
                          !didCallSendResponse
                        )
                          return !1;
                        let sendPromisedResult = (promise) => {
                          promise
                            .then(
                              (msg) => {
                                sendResponse(msg);
                              },
                              (error) => {
                                let message2;
                                error &&
                                (error instanceof Error ||
                                  typeof error.message == "string")
                                  ? (message2 = error.message)
                                  : (message2 = "An unexpected error occurred"),
                                  sendResponse({
                                    __mozWebExtensionPolyfillReject__: !0,
                                    message: message2,
                                  });
                              }
                            )
                            .catch((err) => {
                              console.error(
                                "Failed to send onMessage rejected reply",
                                err
                              );
                            });
                        };
                        return (
                          sendPromisedResult(
                            isResultThenable ? result : sendResponsePromise
                          ),
                          !0
                        );
                      }
                ),
                wrappedSendMessageCallback = ({ reject, resolve }, reply) => {
                  extensionAPIs.runtime.lastError
                    ? extensionAPIs.runtime.lastError.message ===
                      CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE
                      ? resolve()
                      : reject(
                          new Error(extensionAPIs.runtime.lastError.message)
                        )
                    : reply && reply.__mozWebExtensionPolyfillReject__
                    ? reject(new Error(reply.message))
                    : resolve(reply);
                },
                wrappedSendMessage = (
                  name,
                  metadata,
                  apiNamespaceObj,
                  ...args
                ) => {
                  if (args.length < metadata.minArgs)
                    throw new Error(
                      `Expected at least ${
                        metadata.minArgs
                      } ${pluralizeArguments(
                        metadata.minArgs
                      )} for ${name}(), got ${args.length}`
                    );
                  if (args.length > metadata.maxArgs)
                    throw new Error(
                      `Expected at most ${
                        metadata.maxArgs
                      } ${pluralizeArguments(
                        metadata.maxArgs
                      )} for ${name}(), got ${args.length}`
                    );
                  return new Promise((resolve, reject) => {
                    let wrappedCb = wrappedSendMessageCallback.bind(null, {
                      resolve,
                      reject,
                    });
                    args.push(wrappedCb), apiNamespaceObj.sendMessage(...args);
                  });
                },
                staticWrappers = {
                  devtools: {
                    network: {
                      onRequestFinished: wrapEvent(onRequestFinishedWrappers),
                    },
                  },
                  runtime: {
                    onMessage: wrapEvent(onMessageWrappers),
                    onMessageExternal: wrapEvent(onMessageWrappers),
                    sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                      minArgs: 1,
                      maxArgs: 3,
                    }),
                  },
                  tabs: {
                    sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                      minArgs: 2,
                      maxArgs: 3,
                    }),
                  },
                },
                settingMetadata = {
                  clear: { minArgs: 1, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 1 },
                  set: { minArgs: 1, maxArgs: 1 },
                };
              return (
                (apiMetadata.privacy = {
                  network: { "*": settingMetadata },
                  services: { "*": settingMetadata },
                  websites: { "*": settingMetadata },
                }),
                wrapObject(extensionAPIs, staticWrappers, apiMetadata)
              );
            };
          module2.exports = wrapAPIs(chrome);
        } else module2.exports = globalThis.browser;
      }
    );
  },
});
var require_browser_polyfill2 = __commonJS({
  "node_modules/.pnpm/webextension-polyfill@0.9.0/node_modules/webextension-polyfill/dist/browser-polyfill.js"(
    exports,
    module
  ) {
    (function (global2, factory) {
      if (typeof define == "function" && define.amd)
        define("webextension-polyfill", ["module"], factory);
      else if (typeof exports < "u") factory(module);
      else {
        var mod = { exports: {} };
        factory(mod), (global2.browser = mod.exports);
      }
    })(
      typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : exports,
      function (module2) {
        "use strict";
        if (
          typeof globalThis != "object" ||
          typeof chrome != "object" ||
          !chrome ||
          !chrome.runtime ||
          !chrome.runtime.id
        )
          throw new Error(
            "This script should only be loaded in a browser extension."
          );
        if (
          typeof globalThis.browser > "u" ||
          Object.getPrototypeOf(globalThis.browser) !== Object.prototype
        ) {
          let CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE =
              "The message port closed before a response was received.",
            SEND_RESPONSE_DEPRECATION_WARNING =
              "Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)",
            wrapAPIs = (extensionAPIs) => {
              let apiMetadata = {
                alarms: {
                  clear: { minArgs: 0, maxArgs: 1 },
                  clearAll: { minArgs: 0, maxArgs: 0 },
                  get: { minArgs: 0, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                },
                bookmarks: {
                  create: { minArgs: 1, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 1 },
                  getChildren: { minArgs: 1, maxArgs: 1 },
                  getRecent: { minArgs: 1, maxArgs: 1 },
                  getSubTree: { minArgs: 1, maxArgs: 1 },
                  getTree: { minArgs: 0, maxArgs: 0 },
                  move: { minArgs: 2, maxArgs: 2 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeTree: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                browserAction: {
                  disable: { minArgs: 0, maxArgs: 1, fallbackToNoCallback: !0 },
                  enable: { minArgs: 0, maxArgs: 1, fallbackToNoCallback: !0 },
                  getBadgeBackgroundColor: { minArgs: 1, maxArgs: 1 },
                  getBadgeText: { minArgs: 1, maxArgs: 1 },
                  getPopup: { minArgs: 1, maxArgs: 1 },
                  getTitle: { minArgs: 1, maxArgs: 1 },
                  openPopup: { minArgs: 0, maxArgs: 0 },
                  setBadgeBackgroundColor: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setBadgeText: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setIcon: { minArgs: 1, maxArgs: 1 },
                  setPopup: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setTitle: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                },
                browsingData: {
                  remove: { minArgs: 2, maxArgs: 2 },
                  removeCache: { minArgs: 1, maxArgs: 1 },
                  removeCookies: { minArgs: 1, maxArgs: 1 },
                  removeDownloads: { minArgs: 1, maxArgs: 1 },
                  removeFormData: { minArgs: 1, maxArgs: 1 },
                  removeHistory: { minArgs: 1, maxArgs: 1 },
                  removeLocalStorage: { minArgs: 1, maxArgs: 1 },
                  removePasswords: { minArgs: 1, maxArgs: 1 },
                  removePluginData: { minArgs: 1, maxArgs: 1 },
                  settings: { minArgs: 0, maxArgs: 0 },
                },
                commands: { getAll: { minArgs: 0, maxArgs: 0 } },
                contextMenus: {
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeAll: { minArgs: 0, maxArgs: 0 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                cookies: {
                  get: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 1, maxArgs: 1 },
                  getAllCookieStores: { minArgs: 0, maxArgs: 0 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  set: { minArgs: 1, maxArgs: 1 },
                },
                devtools: {
                  inspectedWindow: {
                    eval: { minArgs: 1, maxArgs: 2, singleCallbackArg: !1 },
                  },
                  panels: {
                    create: { minArgs: 3, maxArgs: 3, singleCallbackArg: !0 },
                    elements: { createSidebarPane: { minArgs: 1, maxArgs: 1 } },
                  },
                },
                downloads: {
                  cancel: { minArgs: 1, maxArgs: 1 },
                  download: { minArgs: 1, maxArgs: 1 },
                  erase: { minArgs: 1, maxArgs: 1 },
                  getFileIcon: { minArgs: 1, maxArgs: 2 },
                  open: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                  pause: { minArgs: 1, maxArgs: 1 },
                  removeFile: { minArgs: 1, maxArgs: 1 },
                  resume: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                  show: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                },
                extension: {
                  isAllowedFileSchemeAccess: { minArgs: 0, maxArgs: 0 },
                  isAllowedIncognitoAccess: { minArgs: 0, maxArgs: 0 },
                },
                history: {
                  addUrl: { minArgs: 1, maxArgs: 1 },
                  deleteAll: { minArgs: 0, maxArgs: 0 },
                  deleteRange: { minArgs: 1, maxArgs: 1 },
                  deleteUrl: { minArgs: 1, maxArgs: 1 },
                  getVisits: { minArgs: 1, maxArgs: 1 },
                  search: { minArgs: 1, maxArgs: 1 },
                },
                i18n: {
                  detectLanguage: { minArgs: 1, maxArgs: 1 },
                  getAcceptLanguages: { minArgs: 0, maxArgs: 0 },
                },
                identity: { launchWebAuthFlow: { minArgs: 1, maxArgs: 1 } },
                idle: { queryState: { minArgs: 1, maxArgs: 1 } },
                management: {
                  get: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  getSelf: { minArgs: 0, maxArgs: 0 },
                  setEnabled: { minArgs: 2, maxArgs: 2 },
                  uninstallSelf: { minArgs: 0, maxArgs: 1 },
                },
                notifications: {
                  clear: { minArgs: 1, maxArgs: 1 },
                  create: { minArgs: 1, maxArgs: 2 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  getPermissionLevel: { minArgs: 0, maxArgs: 0 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
                pageAction: {
                  getPopup: { minArgs: 1, maxArgs: 1 },
                  getTitle: { minArgs: 1, maxArgs: 1 },
                  hide: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                  setIcon: { minArgs: 1, maxArgs: 1 },
                  setPopup: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  setTitle: {
                    minArgs: 1,
                    maxArgs: 1,
                    fallbackToNoCallback: !0,
                  },
                  show: { minArgs: 1, maxArgs: 1, fallbackToNoCallback: !0 },
                },
                permissions: {
                  contains: { minArgs: 1, maxArgs: 1 },
                  getAll: { minArgs: 0, maxArgs: 0 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  request: { minArgs: 1, maxArgs: 1 },
                },
                runtime: {
                  getBackgroundPage: { minArgs: 0, maxArgs: 0 },
                  getPlatformInfo: { minArgs: 0, maxArgs: 0 },
                  openOptionsPage: { minArgs: 0, maxArgs: 0 },
                  requestUpdateCheck: { minArgs: 0, maxArgs: 0 },
                  sendMessage: { minArgs: 1, maxArgs: 3 },
                  sendNativeMessage: { minArgs: 2, maxArgs: 2 },
                  setUninstallURL: { minArgs: 1, maxArgs: 1 },
                },
                sessions: {
                  getDevices: { minArgs: 0, maxArgs: 1 },
                  getRecentlyClosed: { minArgs: 0, maxArgs: 1 },
                  restore: { minArgs: 0, maxArgs: 1 },
                },
                storage: {
                  local: {
                    clear: { minArgs: 0, maxArgs: 0 },
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                    remove: { minArgs: 1, maxArgs: 1 },
                    set: { minArgs: 1, maxArgs: 1 },
                  },
                  managed: {
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                  },
                  sync: {
                    clear: { minArgs: 0, maxArgs: 0 },
                    get: { minArgs: 0, maxArgs: 1 },
                    getBytesInUse: { minArgs: 0, maxArgs: 1 },
                    remove: { minArgs: 1, maxArgs: 1 },
                    set: { minArgs: 1, maxArgs: 1 },
                  },
                },
                tabs: {
                  captureVisibleTab: { minArgs: 0, maxArgs: 2 },
                  create: { minArgs: 1, maxArgs: 1 },
                  detectLanguage: { minArgs: 0, maxArgs: 1 },
                  discard: { minArgs: 0, maxArgs: 1 },
                  duplicate: { minArgs: 1, maxArgs: 1 },
                  executeScript: { minArgs: 1, maxArgs: 2 },
                  get: { minArgs: 1, maxArgs: 1 },
                  getCurrent: { minArgs: 0, maxArgs: 0 },
                  getZoom: { minArgs: 0, maxArgs: 1 },
                  getZoomSettings: { minArgs: 0, maxArgs: 1 },
                  goBack: { minArgs: 0, maxArgs: 1 },
                  goForward: { minArgs: 0, maxArgs: 1 },
                  highlight: { minArgs: 1, maxArgs: 1 },
                  insertCSS: { minArgs: 1, maxArgs: 2 },
                  move: { minArgs: 2, maxArgs: 2 },
                  query: { minArgs: 1, maxArgs: 1 },
                  reload: { minArgs: 0, maxArgs: 2 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  removeCSS: { minArgs: 1, maxArgs: 2 },
                  sendMessage: { minArgs: 2, maxArgs: 3 },
                  setZoom: { minArgs: 1, maxArgs: 2 },
                  setZoomSettings: { minArgs: 1, maxArgs: 2 },
                  update: { minArgs: 1, maxArgs: 2 },
                },
                topSites: { get: { minArgs: 0, maxArgs: 0 } },
                webNavigation: {
                  getAllFrames: { minArgs: 1, maxArgs: 1 },
                  getFrame: { minArgs: 1, maxArgs: 1 },
                },
                webRequest: {
                  handlerBehaviorChanged: { minArgs: 0, maxArgs: 0 },
                },
                windows: {
                  create: { minArgs: 0, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 2 },
                  getAll: { minArgs: 0, maxArgs: 1 },
                  getCurrent: { minArgs: 0, maxArgs: 1 },
                  getLastFocused: { minArgs: 0, maxArgs: 1 },
                  remove: { minArgs: 1, maxArgs: 1 },
                  update: { minArgs: 2, maxArgs: 2 },
                },
              };
              if (Object.keys(apiMetadata).length === 0)
                throw new Error(
                  "api-metadata.json has not been included in browser-polyfill"
                );
              class DefaultWeakMap extends WeakMap {
                constructor(createItem, items = void 0) {
                  super(items), (this.createItem = createItem);
                }
                get(key) {
                  return (
                    this.has(key) || this.set(key, this.createItem(key)),
                    super.get(key)
                  );
                }
              }
              let isThenable = (value) =>
                  value &&
                  typeof value == "object" &&
                  typeof value.then == "function",
                makeCallback =
                  (promise, metadata) =>
                  (...callbackArgs) => {
                    extensionAPIs.runtime.lastError
                      ? promise.reject(
                          new Error(extensionAPIs.runtime.lastError.message)
                        )
                      : metadata.singleCallbackArg ||
                        (callbackArgs.length <= 1 &&
                          metadata.singleCallbackArg !== !1)
                      ? promise.resolve(callbackArgs[0])
                      : promise.resolve(callbackArgs);
                  },
                pluralizeArguments = (numArgs) =>
                  numArgs == 1 ? "argument" : "arguments",
                wrapAsyncFunction = (name, metadata) =>
                  function (target, ...args) {
                    if (args.length < metadata.minArgs)
                      throw new Error(
                        `Expected at least ${
                          metadata.minArgs
                        } ${pluralizeArguments(
                          metadata.minArgs
                        )} for ${name}(), got ${args.length}`
                      );
                    if (args.length > metadata.maxArgs)
                      throw new Error(
                        `Expected at most ${
                          metadata.maxArgs
                        } ${pluralizeArguments(
                          metadata.maxArgs
                        )} for ${name}(), got ${args.length}`
                      );
                    return new Promise((resolve, reject) => {
                      if (metadata.fallbackToNoCallback)
                        try {
                          target[name](
                            ...args,
                            makeCallback({ resolve, reject }, metadata)
                          );
                        } catch (cbError) {
                          console.warn(
                            `${name} API method doesn't seem to support the callback parameter, falling back to call it without a callback: `,
                            cbError
                          ),
                            target[name](...args),
                            (metadata.fallbackToNoCallback = !1),
                            (metadata.noCallback = !0),
                            resolve();
                        }
                      else
                        metadata.noCallback
                          ? (target[name](...args), resolve())
                          : target[name](
                              ...args,
                              makeCallback({ resolve, reject }, metadata)
                            );
                    });
                  },
                wrapMethod = (target, method, wrapper) =>
                  new Proxy(method, {
                    apply(targetMethod, thisObj, args) {
                      return wrapper.call(thisObj, target, ...args);
                    },
                  }),
                hasOwnProperty3 = Function.call.bind(
                  Object.prototype.hasOwnProperty
                ),
                wrapObject = (target, wrappers = {}, metadata = {}) => {
                  let cache = Object.create(null),
                    handlers = {
                      has(proxyTarget2, prop) {
                        return prop in target || prop in cache;
                      },
                      get(proxyTarget2, prop, receiver) {
                        if (prop in cache) return cache[prop];
                        if (!(prop in target)) return;
                        let value = target[prop];
                        if (typeof value == "function")
                          if (typeof wrappers[prop] == "function")
                            value = wrapMethod(
                              target,
                              target[prop],
                              wrappers[prop]
                            );
                          else if (hasOwnProperty3(metadata, prop)) {
                            let wrapper = wrapAsyncFunction(
                              prop,
                              metadata[prop]
                            );
                            value = wrapMethod(target, target[prop], wrapper);
                          } else value = value.bind(target);
                        else if (
                          typeof value == "object" &&
                          value !== null &&
                          (hasOwnProperty3(wrappers, prop) ||
                            hasOwnProperty3(metadata, prop))
                        )
                          value = wrapObject(
                            value,
                            wrappers[prop],
                            metadata[prop]
                          );
                        else if (hasOwnProperty3(metadata, "*"))
                          value = wrapObject(
                            value,
                            wrappers[prop],
                            metadata["*"]
                          );
                        else
                          return (
                            Object.defineProperty(cache, prop, {
                              configurable: !0,
                              enumerable: !0,
                              get() {
                                return target[prop];
                              },
                              set(value2) {
                                target[prop] = value2;
                              },
                            }),
                            value
                          );
                        return (cache[prop] = value), value;
                      },
                      set(proxyTarget2, prop, value, receiver) {
                        return (
                          prop in cache
                            ? (cache[prop] = value)
                            : (target[prop] = value),
                          !0
                        );
                      },
                      defineProperty(proxyTarget2, prop, desc) {
                        return Reflect.defineProperty(cache, prop, desc);
                      },
                      deleteProperty(proxyTarget2, prop) {
                        return Reflect.deleteProperty(cache, prop);
                      },
                    },
                    proxyTarget = Object.create(target);
                  return new Proxy(proxyTarget, handlers);
                },
                wrapEvent = (wrapperMap) => ({
                  addListener(target, listener, ...args) {
                    target.addListener(wrapperMap.get(listener), ...args);
                  },
                  hasListener(target, listener) {
                    return target.hasListener(wrapperMap.get(listener));
                  },
                  removeListener(target, listener) {
                    target.removeListener(wrapperMap.get(listener));
                  },
                }),
                onRequestFinishedWrappers = new DefaultWeakMap((listener) =>
                  typeof listener != "function"
                    ? listener
                    : function (req) {
                        let wrappedReq = wrapObject(
                          req,
                          {},
                          { getContent: { minArgs: 0, maxArgs: 0 } }
                        );
                        listener(wrappedReq);
                      }
                ),
                loggedSendResponseDeprecationWarning = !1,
                onMessageWrappers = new DefaultWeakMap((listener) =>
                  typeof listener != "function"
                    ? listener
                    : function (message, sender, sendResponse) {
                        let didCallSendResponse = !1,
                          wrappedSendResponse,
                          sendResponsePromise = new Promise((resolve) => {
                            wrappedSendResponse = function (response) {
                              loggedSendResponseDeprecationWarning ||
                                (console.warn(
                                  SEND_RESPONSE_DEPRECATION_WARNING,
                                  new Error().stack
                                ),
                                (loggedSendResponseDeprecationWarning = !0)),
                                (didCallSendResponse = !0),
                                resolve(response);
                            };
                          }),
                          result;
                        try {
                          result = listener(
                            message,
                            sender,
                            wrappedSendResponse
                          );
                        } catch (err) {
                          result = Promise.reject(err);
                        }
                        let isResultThenable =
                          result !== !0 && isThenable(result);
                        if (
                          result !== !0 &&
                          !isResultThenable &&
                          !didCallSendResponse
                        )
                          return !1;
                        let sendPromisedResult = (promise) => {
                          promise
                            .then(
                              (msg) => {
                                sendResponse(msg);
                              },
                              (error) => {
                                let message2;
                                error &&
                                (error instanceof Error ||
                                  typeof error.message == "string")
                                  ? (message2 = error.message)
                                  : (message2 = "An unexpected error occurred"),
                                  sendResponse({
                                    __mozWebExtensionPolyfillReject__: !0,
                                    message: message2,
                                  });
                              }
                            )
                            .catch((err) => {
                              console.error(
                                "Failed to send onMessage rejected reply",
                                err
                              );
                            });
                        };
                        return (
                          sendPromisedResult(
                            isResultThenable ? result : sendResponsePromise
                          ),
                          !0
                        );
                      }
                ),
                wrappedSendMessageCallback = ({ reject, resolve }, reply) => {
                  extensionAPIs.runtime.lastError
                    ? extensionAPIs.runtime.lastError.message ===
                      CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE
                      ? resolve()
                      : reject(
                          new Error(extensionAPIs.runtime.lastError.message)
                        )
                    : reply && reply.__mozWebExtensionPolyfillReject__
                    ? reject(new Error(reply.message))
                    : resolve(reply);
                },
                wrappedSendMessage = (
                  name,
                  metadata,
                  apiNamespaceObj,
                  ...args
                ) => {
                  if (args.length < metadata.minArgs)
                    throw new Error(
                      `Expected at least ${
                        metadata.minArgs
                      } ${pluralizeArguments(
                        metadata.minArgs
                      )} for ${name}(), got ${args.length}`
                    );
                  if (args.length > metadata.maxArgs)
                    throw new Error(
                      `Expected at most ${
                        metadata.maxArgs
                      } ${pluralizeArguments(
                        metadata.maxArgs
                      )} for ${name}(), got ${args.length}`
                    );
                  return new Promise((resolve, reject) => {
                    let wrappedCb = wrappedSendMessageCallback.bind(null, {
                      resolve,
                      reject,
                    });
                    args.push(wrappedCb), apiNamespaceObj.sendMessage(...args);
                  });
                },
                staticWrappers = {
                  devtools: {
                    network: {
                      onRequestFinished: wrapEvent(onRequestFinishedWrappers),
                    },
                  },
                  runtime: {
                    onMessage: wrapEvent(onMessageWrappers),
                    onMessageExternal: wrapEvent(onMessageWrappers),
                    sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                      minArgs: 1,
                      maxArgs: 3,
                    }),
                  },
                  tabs: {
                    sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                      minArgs: 2,
                      maxArgs: 3,
                    }),
                  },
                },
                settingMetadata = {
                  clear: { minArgs: 1, maxArgs: 1 },
                  get: { minArgs: 1, maxArgs: 1 },
                  set: { minArgs: 1, maxArgs: 1 },
                };
              return (
                (apiMetadata.privacy = {
                  network: { "*": settingMetadata },
                  services: { "*": settingMetadata },
                  websites: { "*": settingMetadata },
                }),
                wrapObject(extensionAPIs, staticWrappers, apiMetadata)
              );
            };
          module2.exports = wrapAPIs(chrome);
        } else module2.exports = globalThis.browser;
      }
    );
  },
});
var require_tiny_uid = __commonJS({
  "node_modules/.pnpm/tiny-uid@1.1.2/node_modules/tiny-uid/index.js"(
    exports,
    module
  ) {
    var generator = (base) =>
        typeof crypto < "u" && typeof crypto.getRandomValues == "function"
          ? () => {
              let num = crypto.getRandomValues(new Uint8Array(1))[0];
              return (num >= base ? num % base : num).toString(base);
            }
          : () => Math.floor(Math.random() * base).toString(base),
      uid = (length = 7, hex = !1) =>
        Array.from({ length }, generator(hex ? 16 : 36)).join("");
    module.exports = uid;
    module.exports.default = uid;
  },
});
var require_bignumber = __commonJS({
  "node_modules/.pnpm/bignumber.js@2.4.0/node_modules/bignumber.js/bignumber.js"(
    exports,
    module
  ) {
    (function (globalObj) {
      "use strict";
      var BigNumber,
        cryptoObj,
        parseNumeric,
        isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
        mathceil = Math.ceil,
        mathfloor = Math.floor,
        notBool = " not a boolean or binary digit",
        roundingMode = "rounding mode",
        tooManyDigits = "number type has more than 15 significant digits",
        ALPHABET =
          "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
        BASE = 1e14,
        LOG_BASE = 14,
        MAX_SAFE_INTEGER = 9007199254740991,
        POWS_TEN = [
          1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13,
        ],
        SQRT_BASE = 1e7,
        MAX = 1e9;
      typeof crypto < "u" && (cryptoObj = crypto);
      function constructorFactory(configObj) {
        var div,
          id = 0,
          P = BigNumber2.prototype,
          ONE = new BigNumber2(1),
          DECIMAL_PLACES = 20,
          ROUNDING_MODE = 4,
          TO_EXP_NEG = -7,
          TO_EXP_POS = 21,
          MIN_EXP = -1e7,
          MAX_EXP = 1e7,
          ERRORS = !0,
          isValidInt = intValidatorWithErrors,
          CRYPTO = !1,
          MODULO_MODE = 1,
          POW_PRECISION = 100,
          FORMAT = {
            decimalSeparator: ".",
            groupSeparator: ",",
            groupSize: 3,
            secondaryGroupSize: 0,
            fractionGroupSeparator: "\xA0",
            fractionGroupSize: 0,
          };
        function BigNumber2(n, b) {
          var c,
            e,
            i,
            num,
            len,
            str,
            x = this;
          if (!(x instanceof BigNumber2))
            return (
              ERRORS && raise(26, "constructor call without new", n),
              new BigNumber2(n, b)
            );
          if (b == null || !isValidInt(b, 2, 64, id, "base")) {
            if (n instanceof BigNumber2) {
              (x.s = n.s),
                (x.e = n.e),
                (x.c = (n = n.c) ? n.slice() : n),
                (id = 0);
              return;
            }
            if ((num = typeof n == "number") && n * 0 == 0) {
              if (((x.s = 1 / n < 0 ? ((n = -n), -1) : 1), n === ~~n)) {
                for (e = 0, i = n; i >= 10; i /= 10, e++);
                (x.e = e), (x.c = [n]), (id = 0);
                return;
              }
              str = n + "";
            } else {
              if (!isNumeric.test((str = n + "")))
                return parseNumeric(x, str, num);
              x.s = str.charCodeAt(0) === 45 ? ((str = str.slice(1)), -1) : 1;
            }
          } else {
            if (((b = b | 0), (str = n + ""), b == 10))
              return (
                (x = new BigNumber2(n instanceof BigNumber2 ? n : str)),
                round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE)
              );
            if (
              ((num = typeof n == "number") && n * 0 != 0) ||
              !new RegExp(
                "^-?" +
                  (c = "[" + ALPHABET.slice(0, b) + "]+") +
                  "(?:\\." +
                  c +
                  ")?$",
                b < 37 ? "i" : ""
              ).test(str)
            )
              return parseNumeric(x, str, num, b);
            num
              ? ((x.s = 1 / n < 0 ? ((str = str.slice(1)), -1) : 1),
                ERRORS &&
                  str.replace(/^0\.0*|\./, "").length > 15 &&
                  raise(id, tooManyDigits, n),
                (num = !1))
              : (x.s =
                  str.charCodeAt(0) === 45 ? ((str = str.slice(1)), -1) : 1),
              (str = convertBase(str, 10, b, x.s));
          }
          for (
            (e = str.indexOf(".")) > -1 && (str = str.replace(".", "")),
              (i = str.search(/e/i)) > 0
                ? (e < 0 && (e = i),
                  (e += +str.slice(i + 1)),
                  (str = str.substring(0, i)))
                : e < 0 && (e = str.length),
              i = 0;
            str.charCodeAt(i) === 48;
            i++
          );
          for (len = str.length; str.charCodeAt(--len) === 48; );
          if (((str = str.slice(i, len + 1)), str))
            if (
              ((len = str.length),
              num &&
                ERRORS &&
                len > 15 &&
                (n > MAX_SAFE_INTEGER || n !== mathfloor(n)) &&
                raise(id, tooManyDigits, x.s * n),
              (e = e - i - 1),
              e > MAX_EXP)
            )
              x.c = x.e = null;
            else if (e < MIN_EXP) x.c = [(x.e = 0)];
            else {
              if (
                ((x.e = e),
                (x.c = []),
                (i = (e + 1) % LOG_BASE),
                e < 0 && (i += LOG_BASE),
                i < len)
              ) {
                for (
                  i && x.c.push(+str.slice(0, i)), len -= LOG_BASE;
                  i < len;

                )
                  x.c.push(+str.slice(i, (i += LOG_BASE)));
                (str = str.slice(i)), (i = LOG_BASE - str.length);
              } else i -= len;
              for (; i--; str += "0");
              x.c.push(+str);
            }
          else x.c = [(x.e = 0)];
          id = 0;
        }
        (BigNumber2.another = constructorFactory),
          (BigNumber2.ROUND_UP = 0),
          (BigNumber2.ROUND_DOWN = 1),
          (BigNumber2.ROUND_CEIL = 2),
          (BigNumber2.ROUND_FLOOR = 3),
          (BigNumber2.ROUND_HALF_UP = 4),
          (BigNumber2.ROUND_HALF_DOWN = 5),
          (BigNumber2.ROUND_HALF_EVEN = 6),
          (BigNumber2.ROUND_HALF_CEIL = 7),
          (BigNumber2.ROUND_HALF_FLOOR = 8),
          (BigNumber2.EUCLID = 9),
          (BigNumber2.config = function () {
            var v,
              p,
              i = 0,
              r = {},
              a = arguments,
              o = a[0],
              has2 =
                o && typeof o == "object"
                  ? function () {
                      if (o.hasOwnProperty(p)) return (v = o[p]) != null;
                    }
                  : function () {
                      if (a.length > i) return (v = a[i++]) != null;
                    };
            return (
              has2((p = "DECIMAL_PLACES")) &&
                isValidInt(v, 0, MAX, 2, p) &&
                (DECIMAL_PLACES = v | 0),
              (r[p] = DECIMAL_PLACES),
              has2((p = "ROUNDING_MODE")) &&
                isValidInt(v, 0, 8, 2, p) &&
                (ROUNDING_MODE = v | 0),
              (r[p] = ROUNDING_MODE),
              has2((p = "EXPONENTIAL_AT")) &&
                (isArray2(v)
                  ? isValidInt(v[0], -MAX, 0, 2, p) &&
                    isValidInt(v[1], 0, MAX, 2, p) &&
                    ((TO_EXP_NEG = v[0] | 0), (TO_EXP_POS = v[1] | 0))
                  : isValidInt(v, -MAX, MAX, 2, p) &&
                    (TO_EXP_NEG = -(TO_EXP_POS = (v < 0 ? -v : v) | 0))),
              (r[p] = [TO_EXP_NEG, TO_EXP_POS]),
              has2((p = "RANGE")) &&
                (isArray2(v)
                  ? isValidInt(v[0], -MAX, -1, 2, p) &&
                    isValidInt(v[1], 1, MAX, 2, p) &&
                    ((MIN_EXP = v[0] | 0), (MAX_EXP = v[1] | 0))
                  : isValidInt(v, -MAX, MAX, 2, p) &&
                    (v | 0
                      ? (MIN_EXP = -(MAX_EXP = (v < 0 ? -v : v) | 0))
                      : ERRORS && raise(2, p + " cannot be zero", v))),
              (r[p] = [MIN_EXP, MAX_EXP]),
              has2((p = "ERRORS")) &&
                (v === !!v || v === 1 || v === 0
                  ? ((id = 0),
                    (isValidInt = (ERRORS = !!v)
                      ? intValidatorWithErrors
                      : intValidatorNoErrors))
                  : ERRORS && raise(2, p + notBool, v)),
              (r[p] = ERRORS),
              has2((p = "CRYPTO")) &&
                (v === !!v || v === 1 || v === 0
                  ? ((CRYPTO = !!(v && cryptoObj)),
                    v &&
                      !CRYPTO &&
                      ERRORS &&
                      raise(2, "crypto unavailable", cryptoObj))
                  : ERRORS && raise(2, p + notBool, v)),
              (r[p] = CRYPTO),
              has2((p = "MODULO_MODE")) &&
                isValidInt(v, 0, 9, 2, p) &&
                (MODULO_MODE = v | 0),
              (r[p] = MODULO_MODE),
              has2((p = "POW_PRECISION")) &&
                isValidInt(v, 0, MAX, 2, p) &&
                (POW_PRECISION = v | 0),
              (r[p] = POW_PRECISION),
              has2((p = "FORMAT")) &&
                (typeof v == "object"
                  ? (FORMAT = v)
                  : ERRORS && raise(2, p + " not an object", v)),
              (r[p] = FORMAT),
              r
            );
          }),
          (BigNumber2.max = function () {
            return maxOrMin(arguments, P.lt);
          }),
          (BigNumber2.min = function () {
            return maxOrMin(arguments, P.gt);
          }),
          (BigNumber2.random = (function () {
            var pow2_53 = 9007199254740992,
              random53bitInt =
                (Math.random() * pow2_53) & 2097151
                  ? function () {
                      return mathfloor(Math.random() * pow2_53);
                    }
                  : function () {
                      return (
                        ((Math.random() * 1073741824) | 0) * 8388608 +
                        ((Math.random() * 8388608) | 0)
                      );
                    };
            return function (dp) {
              var a,
                b,
                e,
                k,
                v,
                i = 0,
                c = [],
                rand = new BigNumber2(ONE);
              if (
                ((dp =
                  dp == null || !isValidInt(dp, 0, MAX, 14)
                    ? DECIMAL_PLACES
                    : dp | 0),
                (k = mathceil(dp / LOG_BASE)),
                CRYPTO)
              )
                if (cryptoObj && cryptoObj.getRandomValues) {
                  for (
                    a = cryptoObj.getRandomValues(new Uint32Array((k *= 2)));
                    i < k;

                  )
                    (v = a[i] * 131072 + (a[i + 1] >>> 11)),
                      v >= 9e15
                        ? ((b = cryptoObj.getRandomValues(new Uint32Array(2))),
                          (a[i] = b[0]),
                          (a[i + 1] = b[1]))
                        : (c.push(v % 1e14), (i += 2));
                  i = k / 2;
                } else if (cryptoObj && cryptoObj.randomBytes) {
                  for (a = cryptoObj.randomBytes((k *= 7)); i < k; )
                    (v =
                      (a[i] & 31) * 281474976710656 +
                      a[i + 1] * 1099511627776 +
                      a[i + 2] * 4294967296 +
                      a[i + 3] * 16777216 +
                      (a[i + 4] << 16) +
                      (a[i + 5] << 8) +
                      a[i + 6]),
                      v >= 9e15
                        ? cryptoObj.randomBytes(7).copy(a, i)
                        : (c.push(v % 1e14), (i += 7));
                  i = k / 7;
                } else ERRORS && raise(14, "crypto unavailable", cryptoObj);
              if (!i)
                for (; i < k; )
                  (v = random53bitInt()), v < 9e15 && (c[i++] = v % 1e14);
              for (
                k = c[--i],
                  dp %= LOG_BASE,
                  k &&
                    dp &&
                    ((v = POWS_TEN[LOG_BASE - dp]),
                    (c[i] = mathfloor(k / v) * v));
                c[i] === 0;
                c.pop(), i--
              );
              if (i < 0) c = [(e = 0)];
              else {
                for (e = -1; c[0] === 0; c.shift(), e -= LOG_BASE);
                for (i = 1, v = c[0]; v >= 10; v /= 10, i++);
                i < LOG_BASE && (e -= LOG_BASE - i);
              }
              return (rand.e = e), (rand.c = c), rand;
            };
          })());
        function convertBase(str, baseOut, baseIn, sign) {
          var d,
            e,
            k,
            r,
            x,
            xc,
            y,
            i = str.indexOf("."),
            dp = DECIMAL_PLACES,
            rm = ROUNDING_MODE;
          for (
            baseIn < 37 && (str = str.toLowerCase()),
              i >= 0 &&
                ((k = POW_PRECISION),
                (POW_PRECISION = 0),
                (str = str.replace(".", "")),
                (y = new BigNumber2(baseIn)),
                (x = y.pow(str.length - i)),
                (POW_PRECISION = k),
                (y.c = toBaseOut(
                  toFixedPoint(coeffToString(x.c), x.e),
                  10,
                  baseOut
                )),
                (y.e = y.c.length)),
              xc = toBaseOut(str, baseIn, baseOut),
              e = k = xc.length;
            xc[--k] == 0;
            xc.pop()
          );
          if (!xc[0]) return "0";
          if (
            (i < 0
              ? --e
              : ((x.c = xc),
                (x.e = e),
                (x.s = sign),
                (x = div(x, y, dp, rm, baseOut)),
                (xc = x.c),
                (r = x.r),
                (e = x.e)),
            (d = e + dp + 1),
            (i = xc[d]),
            (k = baseOut / 2),
            (r = r || d < 0 || xc[d + 1] != null),
            (r =
              rm < 4
                ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
                : i > k ||
                  (i == k &&
                    (rm == 4 ||
                      r ||
                      (rm == 6 && xc[d - 1] & 1) ||
                      rm == (x.s < 0 ? 8 : 7)))),
            d < 1 || !xc[0])
          )
            str = r ? toFixedPoint("1", -dp) : "0";
          else {
            if (((xc.length = d), r))
              for (--baseOut; ++xc[--d] > baseOut; )
                (xc[d] = 0), d || (++e, xc.unshift(1));
            for (k = xc.length; !xc[--k]; );
            for (i = 0, str = ""; i <= k; str += ALPHABET.charAt(xc[i++]));
            str = toFixedPoint(str, e);
          }
          return str;
        }
        div = (function () {
          function multiply(x, k, base) {
            var m,
              temp,
              xlo,
              xhi,
              carry = 0,
              i = x.length,
              klo = k % SQRT_BASE,
              khi = (k / SQRT_BASE) | 0;
            for (x = x.slice(); i--; )
              (xlo = x[i] % SQRT_BASE),
                (xhi = (x[i] / SQRT_BASE) | 0),
                (m = khi * xlo + xhi * klo),
                (temp = klo * xlo + (m % SQRT_BASE) * SQRT_BASE + carry),
                (carry =
                  ((temp / base) | 0) + ((m / SQRT_BASE) | 0) + khi * xhi),
                (x[i] = temp % base);
            return carry && x.unshift(carry), x;
          }
          function compare2(a, b, aL, bL) {
            var i, cmp;
            if (aL != bL) cmp = aL > bL ? 1 : -1;
            else
              for (i = cmp = 0; i < aL; i++)
                if (a[i] != b[i]) {
                  cmp = a[i] > b[i] ? 1 : -1;
                  break;
                }
            return cmp;
          }
          function subtract(a, b, aL, base) {
            for (var i = 0; aL--; )
              (a[aL] -= i),
                (i = a[aL] < b[aL] ? 1 : 0),
                (a[aL] = i * base + a[aL] - b[aL]);
            for (; !a[0] && a.length > 1; a.shift());
          }
          return function (x, y, dp, rm, base) {
            var cmp,
              e,
              i,
              more,
              n,
              prod,
              prodL,
              q,
              qc,
              rem,
              remL,
              rem0,
              xi,
              xL,
              yc0,
              yL,
              yz,
              s = x.s == y.s ? 1 : -1,
              xc = x.c,
              yc = y.c;
            if (!xc || !xc[0] || !yc || !yc[0])
              return new BigNumber2(
                !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc)
                  ? NaN
                  : (xc && xc[0] == 0) || !yc
                  ? s * 0
                  : s / 0
              );
            for (
              q = new BigNumber2(s),
                qc = q.c = [],
                e = x.e - y.e,
                s = dp + e + 1,
                base ||
                  ((base = BASE),
                  (e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE)),
                  (s = (s / LOG_BASE) | 0)),
                i = 0;
              yc[i] == (xc[i] || 0);
              i++
            );
            if ((yc[i] > (xc[i] || 0) && e--, s < 0)) qc.push(1), (more = !0);
            else {
              for (
                xL = xc.length,
                  yL = yc.length,
                  i = 0,
                  s += 2,
                  n = mathfloor(base / (yc[0] + 1)),
                  n > 1 &&
                    ((yc = multiply(yc, n, base)),
                    (xc = multiply(xc, n, base)),
                    (yL = yc.length),
                    (xL = xc.length)),
                  xi = yL,
                  rem = xc.slice(0, yL),
                  remL = rem.length;
                remL < yL;
                rem[remL++] = 0
              );
              (yz = yc.slice()),
                yz.unshift(0),
                (yc0 = yc[0]),
                yc[1] >= base / 2 && yc0++;
              do {
                if (((n = 0), (cmp = compare2(yc, rem, yL, remL)), cmp < 0)) {
                  if (
                    ((rem0 = rem[0]),
                    yL != remL && (rem0 = rem0 * base + (rem[1] || 0)),
                    (n = mathfloor(rem0 / yc0)),
                    n > 1)
                  )
                    for (
                      n >= base && (n = base - 1),
                        prod = multiply(yc, n, base),
                        prodL = prod.length,
                        remL = rem.length;
                      compare2(prod, rem, prodL, remL) == 1;

                    )
                      n--,
                        subtract(prod, yL < prodL ? yz : yc, prodL, base),
                        (prodL = prod.length),
                        (cmp = 1);
                  else
                    n == 0 && (cmp = n = 1),
                      (prod = yc.slice()),
                      (prodL = prod.length);
                  if (
                    (prodL < remL && prod.unshift(0),
                    subtract(rem, prod, remL, base),
                    (remL = rem.length),
                    cmp == -1)
                  )
                    for (; compare2(yc, rem, yL, remL) < 1; )
                      n++,
                        subtract(rem, yL < remL ? yz : yc, remL, base),
                        (remL = rem.length);
                } else cmp === 0 && (n++, (rem = [0]));
                (qc[i++] = n),
                  rem[0]
                    ? (rem[remL++] = xc[xi] || 0)
                    : ((rem = [xc[xi]]), (remL = 1));
              } while ((xi++ < xL || rem[0] != null) && s--);
              (more = rem[0] != null), qc[0] || qc.shift();
            }
            if (base == BASE) {
              for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);
              round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
            } else (q.e = e), (q.r = +more);
            return q;
          };
        })();
        function format(n, i, rm, caller) {
          var c0, e, ne, len, str;
          if (
            ((rm =
              rm != null && isValidInt(rm, 0, 8, caller, roundingMode)
                ? rm | 0
                : ROUNDING_MODE),
            !n.c)
          )
            return n.toString();
          if (((c0 = n.c[0]), (ne = n.e), i == null))
            (str = coeffToString(n.c)),
              (str =
                caller == 19 || (caller == 24 && ne <= TO_EXP_NEG)
                  ? toExponential(str, ne)
                  : toFixedPoint(str, ne));
          else if (
            ((n = round(new BigNumber2(n), i, rm)),
            (e = n.e),
            (str = coeffToString(n.c)),
            (len = str.length),
            caller == 19 || (caller == 24 && (i <= e || e <= TO_EXP_NEG)))
          ) {
            for (; len < i; str += "0", len++);
            str = toExponential(str, e);
          } else if (((i -= ne), (str = toFixedPoint(str, e)), e + 1 > len)) {
            if (--i > 0) for (str += "."; i--; str += "0");
          } else if (((i += e - len), i > 0))
            for (e + 1 == len && (str += "."); i--; str += "0");
          return n.s < 0 && c0 ? "-" + str : str;
        }
        function maxOrMin(args, method) {
          var m,
            n,
            i = 0;
          for (
            isArray2(args[0]) && (args = args[0]), m = new BigNumber2(args[0]);
            ++i < args.length;

          )
            if (((n = new BigNumber2(args[i])), n.s))
              method.call(m, n) && (m = n);
            else {
              m = n;
              break;
            }
          return m;
        }
        function intValidatorWithErrors(n, min, max, caller, name) {
          return (
            (n < min || n > max || n != truncate(n)) &&
              raise(
                caller,
                (name || "decimal places") +
                  (n < min || n > max ? " out of range" : " not an integer"),
                n
              ),
            !0
          );
        }
        function normalise(n, c, e) {
          for (var i = 1, j = c.length; !c[--j]; c.pop());
          for (j = c[0]; j >= 10; j /= 10, i++);
          return (
            (e = i + e * LOG_BASE - 1) > MAX_EXP
              ? (n.c = n.e = null)
              : e < MIN_EXP
              ? (n.c = [(n.e = 0)])
              : ((n.e = e), (n.c = c)),
            n
          );
        }
        parseNumeric = (function () {
          var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
            dotAfter = /^([^.]+)\.$/,
            dotBefore = /^\.([^.]+)$/,
            isInfinityOrNaN = /^-?(Infinity|NaN)$/,
            whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
          return function (x, str, num, b) {
            var base,
              s = num ? str : str.replace(whitespaceOrPlus, "");
            if (isInfinityOrNaN.test(s)) x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
            else {
              if (
                !num &&
                ((s = s.replace(basePrefix, function (m, p1, p2) {
                  return (
                    (base =
                      (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8),
                    !b || b == base ? p1 : m
                  );
                })),
                b &&
                  ((base = b),
                  (s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1"))),
                str != s)
              )
                return new BigNumber2(s, base);
              ERRORS &&
                raise(id, "not a" + (b ? " base " + b : "") + " number", str),
                (x.s = null);
            }
            (x.c = x.e = null), (id = 0);
          };
        })();
        function raise(caller, msg, val) {
          var error = new Error(
            [
              "new BigNumber",
              "cmp",
              "config",
              "div",
              "divToInt",
              "eq",
              "gt",
              "gte",
              "lt",
              "lte",
              "minus",
              "mod",
              "plus",
              "precision",
              "random",
              "round",
              "shift",
              "times",
              "toDigits",
              "toExponential",
              "toFixed",
              "toFormat",
              "toFraction",
              "pow",
              "toPrecision",
              "toString",
              "BigNumber",
            ][caller] +
              "() " +
              msg +
              ": " +
              val
          );
          throw ((error.name = "BigNumber Error"), (id = 0), error);
        }
        function round(x, sd, rm, r) {
          var d,
            i,
            j,
            k,
            n,
            ni,
            rd,
            xc = x.c,
            pows10 = POWS_TEN;
          if (xc) {
            out: {
              for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);
              if (((i = sd - d), i < 0))
                (i += LOG_BASE),
                  (j = sd),
                  (n = xc[(ni = 0)]),
                  (rd = (n / pows10[d - j - 1]) % 10 | 0);
              else if (((ni = mathceil((i + 1) / LOG_BASE)), ni >= xc.length))
                if (r) {
                  for (; xc.length <= ni; xc.push(0));
                  (n = rd = 0),
                    (d = 1),
                    (i %= LOG_BASE),
                    (j = i - LOG_BASE + 1);
                } else break out;
              else {
                for (n = k = xc[ni], d = 1; k >= 10; k /= 10, d++);
                (i %= LOG_BASE),
                  (j = i - LOG_BASE + d),
                  (rd = j < 0 ? 0 : (n / pows10[d - j - 1]) % 10 | 0);
              }
              if (
                ((r =
                  r ||
                  sd < 0 ||
                  xc[ni + 1] != null ||
                  (j < 0 ? n : n % pows10[d - j - 1])),
                (r =
                  rm < 4
                    ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
                    : rd > 5 ||
                      (rd == 5 &&
                        (rm == 4 ||
                          r ||
                          (rm == 6 &&
                            (i > 0
                              ? j > 0
                                ? n / pows10[d - j]
                                : 0
                              : xc[ni - 1]) %
                              10 &
                              1) ||
                          rm == (x.s < 0 ? 8 : 7)))),
                sd < 1 || !xc[0])
              )
                return (
                  (xc.length = 0),
                  r
                    ? ((sd -= x.e + 1),
                      (xc[0] = pows10[(LOG_BASE - (sd % LOG_BASE)) % LOG_BASE]),
                      (x.e = -sd || 0))
                    : (xc[0] = x.e = 0),
                  x
                );
              if (
                (i == 0
                  ? ((xc.length = ni), (k = 1), ni--)
                  : ((xc.length = ni + 1),
                    (k = pows10[LOG_BASE - i]),
                    (xc[ni] =
                      j > 0
                        ? mathfloor((n / pows10[d - j]) % pows10[j]) * k
                        : 0)),
                r)
              )
                for (;;)
                  if (ni == 0) {
                    for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);
                    for (j = xc[0] += k, k = 1; j >= 10; j /= 10, k++);
                    i != k && (x.e++, xc[0] == BASE && (xc[0] = 1));
                    break;
                  } else {
                    if (((xc[ni] += k), xc[ni] != BASE)) break;
                    (xc[ni--] = 0), (k = 1);
                  }
              for (i = xc.length; xc[--i] === 0; xc.pop());
            }
            x.e > MAX_EXP
              ? (x.c = x.e = null)
              : x.e < MIN_EXP && (x.c = [(x.e = 0)]);
          }
          return x;
        }
        return (
          (P.absoluteValue = P.abs =
            function () {
              var x = new BigNumber2(this);
              return x.s < 0 && (x.s = 1), x;
            }),
          (P.ceil = function () {
            return round(new BigNumber2(this), this.e + 1, 2);
          }),
          (P.comparedTo = P.cmp =
            function (y, b) {
              return (id = 1), compare(this, new BigNumber2(y, b));
            }),
          (P.decimalPlaces = P.dp =
            function () {
              var n,
                v,
                c = this.c;
              if (!c) return null;
              if (
                ((n =
                  ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) *
                  LOG_BASE),
                (v = c[v]))
              )
                for (; v % 10 == 0; v /= 10, n--);
              return n < 0 && (n = 0), n;
            }),
          (P.dividedBy = P.div =
            function (y, b) {
              return (
                (id = 3),
                div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE)
              );
            }),
          (P.dividedToIntegerBy = P.divToInt =
            function (y, b) {
              return (id = 4), div(this, new BigNumber2(y, b), 0, 1);
            }),
          (P.equals = P.eq =
            function (y, b) {
              return (id = 5), compare(this, new BigNumber2(y, b)) === 0;
            }),
          (P.floor = function () {
            return round(new BigNumber2(this), this.e + 1, 3);
          }),
          (P.greaterThan = P.gt =
            function (y, b) {
              return (id = 6), compare(this, new BigNumber2(y, b)) > 0;
            }),
          (P.greaterThanOrEqualTo = P.gte =
            function (y, b) {
              return (
                (id = 7),
                (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0
              );
            }),
          (P.isFinite = function () {
            return !!this.c;
          }),
          (P.isInteger = P.isInt =
            function () {
              return (
                !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2
              );
            }),
          (P.isNaN = function () {
            return !this.s;
          }),
          (P.isNegative = P.isNeg =
            function () {
              return this.s < 0;
            }),
          (P.isZero = function () {
            return !!this.c && this.c[0] == 0;
          }),
          (P.lessThan = P.lt =
            function (y, b) {
              return (id = 8), compare(this, new BigNumber2(y, b)) < 0;
            }),
          (P.lessThanOrEqualTo = P.lte =
            function (y, b) {
              return (
                (id = 9),
                (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0
              );
            }),
          (P.minus = P.sub =
            function (y, b) {
              var i,
                j,
                t,
                xLTy,
                x = this,
                a = x.s;
              if (((id = 10), (y = new BigNumber2(y, b)), (b = y.s), !a || !b))
                return new BigNumber2(NaN);
              if (a != b) return (y.s = -b), x.plus(y);
              var xe = x.e / LOG_BASE,
                ye = y.e / LOG_BASE,
                xc = x.c,
                yc = y.c;
              if (!xe || !ye) {
                if (!xc || !yc)
                  return xc ? ((y.s = -b), y) : new BigNumber2(yc ? x : NaN);
                if (!xc[0] || !yc[0])
                  return yc[0]
                    ? ((y.s = -b), y)
                    : new BigNumber2(xc[0] ? x : ROUNDING_MODE == 3 ? -0 : 0);
              }
              if (
                ((xe = bitFloor(xe)),
                (ye = bitFloor(ye)),
                (xc = xc.slice()),
                (a = xe - ye))
              ) {
                for (
                  (xLTy = a < 0) ? ((a = -a), (t = xc)) : ((ye = xe), (t = yc)),
                    t.reverse(),
                    b = a;
                  b--;
                  t.push(0)
                );
                t.reverse();
              } else
                for (
                  j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b,
                    a = b = 0;
                  b < j;
                  b++
                )
                  if (xc[b] != yc[b]) {
                    xLTy = xc[b] < yc[b];
                    break;
                  }
              if (
                (xLTy && ((t = xc), (xc = yc), (yc = t), (y.s = -y.s)),
                (b = (j = yc.length) - (i = xc.length)),
                b > 0)
              )
                for (; b--; xc[i++] = 0);
              for (b = BASE - 1; j > a; ) {
                if (xc[--j] < yc[j]) {
                  for (i = j; i && !xc[--i]; xc[i] = b);
                  --xc[i], (xc[j] += BASE);
                }
                xc[j] -= yc[j];
              }
              for (; xc[0] == 0; xc.shift(), --ye);
              return xc[0]
                ? normalise(y, xc, ye)
                : ((y.s = ROUNDING_MODE == 3 ? -1 : 1), (y.c = [(y.e = 0)]), y);
            }),
          (P.modulo = P.mod =
            function (y, b) {
              var q,
                s,
                x = this;
              return (
                (id = 11),
                (y = new BigNumber2(y, b)),
                !x.c || !y.s || (y.c && !y.c[0])
                  ? new BigNumber2(NaN)
                  : !y.c || (x.c && !x.c[0])
                  ? new BigNumber2(x)
                  : (MODULO_MODE == 9
                      ? ((s = y.s),
                        (y.s = 1),
                        (q = div(x, y, 0, 3)),
                        (y.s = s),
                        (q.s *= s))
                      : (q = div(x, y, 0, MODULO_MODE)),
                    x.minus(q.times(y)))
              );
            }),
          (P.negated = P.neg =
            function () {
              var x = new BigNumber2(this);
              return (x.s = -x.s || null), x;
            }),
          (P.plus = P.add =
            function (y, b) {
              var t,
                x = this,
                a = x.s;
              if (((id = 12), (y = new BigNumber2(y, b)), (b = y.s), !a || !b))
                return new BigNumber2(NaN);
              if (a != b) return (y.s = -b), x.minus(y);
              var xe = x.e / LOG_BASE,
                ye = y.e / LOG_BASE,
                xc = x.c,
                yc = y.c;
              if (!xe || !ye) {
                if (!xc || !yc) return new BigNumber2(a / 0);
                if (!xc[0] || !yc[0])
                  return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
              }
              if (
                ((xe = bitFloor(xe)),
                (ye = bitFloor(ye)),
                (xc = xc.slice()),
                (a = xe - ye))
              ) {
                for (
                  a > 0 ? ((ye = xe), (t = yc)) : ((a = -a), (t = xc)),
                    t.reverse();
                  a--;
                  t.push(0)
                );
                t.reverse();
              }
              for (
                a = xc.length,
                  b = yc.length,
                  a - b < 0 && ((t = yc), (yc = xc), (xc = t), (b = a)),
                  a = 0;
                b;

              )
                (a = ((xc[--b] = xc[b] + yc[b] + a) / BASE) | 0),
                  (xc[b] %= BASE);
              return a && (xc.unshift(a), ++ye), normalise(y, xc, ye);
            }),
          (P.precision = P.sd =
            function (z) {
              var n,
                v,
                x = this,
                c = x.c;
              if (
                (z != null &&
                  z !== !!z &&
                  z !== 1 &&
                  z !== 0 &&
                  (ERRORS && raise(13, "argument" + notBool, z),
                  z != !!z && (z = null)),
                !c)
              )
                return null;
              if (((v = c.length - 1), (n = v * LOG_BASE + 1), (v = c[v]))) {
                for (; v % 10 == 0; v /= 10, n--);
                for (v = c[0]; v >= 10; v /= 10, n++);
              }
              return z && x.e + 1 > n && (n = x.e + 1), n;
            }),
          (P.round = function (dp, rm) {
            var n = new BigNumber2(this);
            return (
              (dp == null || isValidInt(dp, 0, MAX, 15)) &&
                round(
                  n,
                  ~~dp + this.e + 1,
                  rm == null || !isValidInt(rm, 0, 8, 15, roundingMode)
                    ? ROUNDING_MODE
                    : rm | 0
                ),
              n
            );
          }),
          (P.shift = function (k) {
            var n = this;
            return isValidInt(
              k,
              -MAX_SAFE_INTEGER,
              MAX_SAFE_INTEGER,
              16,
              "argument"
            )
              ? n.times("1e" + truncate(k))
              : new BigNumber2(
                  n.c &&
                  n.c[0] &&
                  (k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER)
                    ? n.s * (k < 0 ? 0 : 1 / 0)
                    : n
                );
          }),
          (P.squareRoot = P.sqrt =
            function () {
              var m,
                n,
                r,
                rep,
                t,
                x = this,
                c = x.c,
                s = x.s,
                e = x.e,
                dp = DECIMAL_PLACES + 4,
                half = new BigNumber2("0.5");
              if (s !== 1 || !c || !c[0])
                return new BigNumber2(
                  !s || (s < 0 && (!c || c[0])) ? NaN : c ? x : 1 / 0
                );
              if (
                ((s = Math.sqrt(+x)),
                s == 0 || s == 1 / 0
                  ? ((n = coeffToString(c)),
                    (n.length + e) % 2 == 0 && (n += "0"),
                    (s = Math.sqrt(n)),
                    (e = bitFloor((e + 1) / 2) - (e < 0 || e % 2)),
                    s == 1 / 0
                      ? (n = "1e" + e)
                      : ((n = s.toExponential()),
                        (n = n.slice(0, n.indexOf("e") + 1) + e)),
                    (r = new BigNumber2(n)))
                  : (r = new BigNumber2(s + "")),
                r.c[0])
              ) {
                for (e = r.e, s = e + dp, s < 3 && (s = 0); ; )
                  if (
                    ((t = r),
                    (r = half.times(t.plus(div(x, t, dp, 1)))),
                    coeffToString(t.c).slice(0, s) ===
                      (n = coeffToString(r.c)).slice(0, s))
                  )
                    if (
                      (r.e < e && --s,
                      (n = n.slice(s - 3, s + 1)),
                      n == "9999" || (!rep && n == "4999"))
                    ) {
                      if (
                        !rep &&
                        (round(t, t.e + DECIMAL_PLACES + 2, 0),
                        t.times(t).eq(x))
                      ) {
                        r = t;
                        break;
                      }
                      (dp += 4), (s += 4), (rep = 1);
                    } else {
                      (!+n || (!+n.slice(1) && n.charAt(0) == "5")) &&
                        (round(r, r.e + DECIMAL_PLACES + 2, 1),
                        (m = !r.times(r).eq(x)));
                      break;
                    }
              }
              return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
            }),
          (P.times = P.mul =
            function (y, b) {
              var c,
                e,
                i,
                j,
                k,
                m,
                xcL,
                xlo,
                xhi,
                ycL,
                ylo,
                yhi,
                zc,
                base,
                sqrtBase,
                x = this,
                xc = x.c,
                yc = ((id = 17), (y = new BigNumber2(y, b))).c;
              if (!xc || !yc || !xc[0] || !yc[0])
                return (
                  !x.s || !y.s || (xc && !xc[0] && !yc) || (yc && !yc[0] && !xc)
                    ? (y.c = y.e = y.s = null)
                    : ((y.s *= x.s),
                      !xc || !yc
                        ? (y.c = y.e = null)
                        : ((y.c = [0]), (y.e = 0))),
                  y
                );
              for (
                e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE),
                  y.s *= x.s,
                  xcL = xc.length,
                  ycL = yc.length,
                  xcL < ycL &&
                    ((zc = xc),
                    (xc = yc),
                    (yc = zc),
                    (i = xcL),
                    (xcL = ycL),
                    (ycL = i)),
                  i = xcL + ycL,
                  zc = [];
                i--;
                zc.push(0)
              );
              for (base = BASE, sqrtBase = SQRT_BASE, i = ycL; --i >= 0; ) {
                for (
                  c = 0,
                    ylo = yc[i] % sqrtBase,
                    yhi = (yc[i] / sqrtBase) | 0,
                    k = xcL,
                    j = i + k;
                  j > i;

                )
                  (xlo = xc[--k] % sqrtBase),
                    (xhi = (xc[k] / sqrtBase) | 0),
                    (m = yhi * xlo + xhi * ylo),
                    (xlo = ylo * xlo + (m % sqrtBase) * sqrtBase + zc[j] + c),
                    (c = ((xlo / base) | 0) + ((m / sqrtBase) | 0) + yhi * xhi),
                    (zc[j--] = xlo % base);
                zc[j] = c;
              }
              return c ? ++e : zc.shift(), normalise(y, zc, e);
            }),
          (P.toDigits = function (sd, rm) {
            var n = new BigNumber2(this);
            return (
              (sd =
                sd == null || !isValidInt(sd, 1, MAX, 18, "precision")
                  ? null
                  : sd | 0),
              (rm =
                rm == null || !isValidInt(rm, 0, 8, 18, roundingMode)
                  ? ROUNDING_MODE
                  : rm | 0),
              sd ? round(n, sd, rm) : n
            );
          }),
          (P.toExponential = function (dp, rm) {
            return format(
              this,
              dp != null && isValidInt(dp, 0, MAX, 19) ? ~~dp + 1 : null,
              rm,
              19
            );
          }),
          (P.toFixed = function (dp, rm) {
            return format(
              this,
              dp != null && isValidInt(dp, 0, MAX, 20)
                ? ~~dp + this.e + 1
                : null,
              rm,
              20
            );
          }),
          (P.toFormat = function (dp, rm) {
            var str = format(
              this,
              dp != null && isValidInt(dp, 0, MAX, 21)
                ? ~~dp + this.e + 1
                : null,
              rm,
              21
            );
            if (this.c) {
              var i,
                arr = str.split("."),
                g1 = +FORMAT.groupSize,
                g2 = +FORMAT.secondaryGroupSize,
                groupSeparator = FORMAT.groupSeparator,
                intPart = arr[0],
                fractionPart = arr[1],
                isNeg = this.s < 0,
                intDigits = isNeg ? intPart.slice(1) : intPart,
                len = intDigits.length;
              if (
                (g2 && ((i = g1), (g1 = g2), (g2 = i), (len -= i)),
                g1 > 0 && len > 0)
              ) {
                for (
                  i = len % g1 || g1, intPart = intDigits.substr(0, i);
                  i < len;
                  i += g1
                )
                  intPart += groupSeparator + intDigits.substr(i, g1);
                g2 > 0 && (intPart += groupSeparator + intDigits.slice(i)),
                  isNeg && (intPart = "-" + intPart);
              }
              str = fractionPart
                ? intPart +
                  FORMAT.decimalSeparator +
                  ((g2 = +FORMAT.fractionGroupSize)
                    ? fractionPart.replace(
                        new RegExp("\\d{" + g2 + "}\\B", "g"),
                        "$&" + FORMAT.fractionGroupSeparator
                      )
                    : fractionPart)
                : intPart;
            }
            return str;
          }),
          (P.toFraction = function (md) {
            var arr,
              d0,
              d2,
              e,
              exp,
              n,
              n0,
              q,
              s,
              k = ERRORS,
              x = this,
              xc = x.c,
              d = new BigNumber2(ONE),
              n1 = (d0 = new BigNumber2(ONE)),
              d1 = (n0 = new BigNumber2(ONE));
            if (
              (md != null &&
                ((ERRORS = !1),
                (n = new BigNumber2(md)),
                (ERRORS = k),
                (!(k = n.isInt()) || n.lt(ONE)) &&
                  (ERRORS &&
                    raise(
                      22,
                      "max denominator " +
                        (k ? "out of range" : "not an integer"),
                      md
                    ),
                  (md =
                    !k && n.c && round(n, n.e + 1, 1).gte(ONE) ? n : null))),
              !xc)
            )
              return x.toString();
            for (
              s = coeffToString(xc),
                e = d.e = s.length - x.e - 1,
                d.c[0] =
                  POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp],
                md = !md || n.cmp(d) > 0 ? (e > 0 ? d : n1) : n,
                exp = MAX_EXP,
                MAX_EXP = 1 / 0,
                n = new BigNumber2(s),
                n0.c[0] = 0;
              (q = div(n, d, 0, 1)),
                (d2 = d0.plus(q.times(d1))),
                d2.cmp(md) != 1;

            )
              (d0 = d1),
                (d1 = d2),
                (n1 = n0.plus(q.times((d2 = n1)))),
                (n0 = d2),
                (d = n.minus(q.times((d2 = d)))),
                (n = d2);
            return (
              (d2 = div(md.minus(d0), d1, 0, 1)),
              (n0 = n0.plus(d2.times(n1))),
              (d0 = d0.plus(d2.times(d1))),
              (n0.s = n1.s = x.s),
              (e *= 2),
              (arr =
                div(n1, d1, e, ROUNDING_MODE)
                  .minus(x)
                  .abs()
                  .cmp(div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1
                  ? [n1.toString(), d1.toString()]
                  : [n0.toString(), d0.toString()]),
              (MAX_EXP = exp),
              arr
            );
          }),
          (P.toNumber = function () {
            return +this;
          }),
          (P.toPower = P.pow =
            function (n, m) {
              var k,
                y,
                z,
                i = mathfloor(n < 0 ? -n : +n),
                x = this;
              if (
                (m != null && ((id = 23), (m = new BigNumber2(m))),
                (!isValidInt(
                  n,
                  -MAX_SAFE_INTEGER,
                  MAX_SAFE_INTEGER,
                  23,
                  "exponent"
                ) &&
                  (!isFinite(n) ||
                    (i > MAX_SAFE_INTEGER && (n /= 0)) ||
                    (parseFloat(n) != n && !(n = NaN)))) ||
                  n == 0)
              )
                return (k = Math.pow(+x, n)), new BigNumber2(m ? k % m : k);
              for (
                m
                  ? n > 1 && x.gt(ONE) && x.isInt() && m.gt(ONE) && m.isInt()
                    ? (x = x.mod(m))
                    : ((z = m), (m = null))
                  : POW_PRECISION &&
                    (k = mathceil(POW_PRECISION / LOG_BASE + 2)),
                  y = new BigNumber2(ONE);
                ;

              ) {
                if (i % 2) {
                  if (((y = y.times(x)), !y.c)) break;
                  k ? y.c.length > k && (y.c.length = k) : m && (y = y.mod(m));
                }
                if (((i = mathfloor(i / 2)), !i)) break;
                (x = x.times(x)),
                  k
                    ? x.c && x.c.length > k && (x.c.length = k)
                    : m && (x = x.mod(m));
              }
              return m
                ? y
                : (n < 0 && (y = ONE.div(y)),
                  z
                    ? y.mod(z)
                    : k
                    ? round(y, POW_PRECISION, ROUNDING_MODE)
                    : y);
            }),
          (P.toPrecision = function (sd, rm) {
            return format(
              this,
              sd != null && isValidInt(sd, 1, MAX, 24, "precision")
                ? sd | 0
                : null,
              rm,
              24
            );
          }),
          (P.toString = function (b) {
            var str,
              n = this,
              s = n.s,
              e = n.e;
            return (
              e === null
                ? s
                  ? ((str = "Infinity"), s < 0 && (str = "-" + str))
                  : (str = "NaN")
                : ((str = coeffToString(n.c)),
                  b == null || !isValidInt(b, 2, 64, 25, "base")
                    ? (str =
                        e <= TO_EXP_NEG || e >= TO_EXP_POS
                          ? toExponential(str, e)
                          : toFixedPoint(str, e))
                    : (str = convertBase(toFixedPoint(str, e), b | 0, 10, s)),
                  s < 0 && n.c[0] && (str = "-" + str)),
              str
            );
          }),
          (P.truncated = P.trunc =
            function () {
              return round(new BigNumber2(this), this.e + 1, 1);
            }),
          (P.valueOf = P.toJSON =
            function () {
              var str,
                n = this,
                e = n.e;
              return e === null
                ? n.toString()
                : ((str = coeffToString(n.c)),
                  (str =
                    e <= TO_EXP_NEG || e >= TO_EXP_POS
                      ? toExponential(str, e)
                      : toFixedPoint(str, e)),
                  n.s < 0 ? "-" + str : str);
            }),
          configObj != null && BigNumber2.config(configObj),
          BigNumber2
        );
      }
      function bitFloor(n) {
        var i = n | 0;
        return n > 0 || n === i ? i : i - 1;
      }
      function coeffToString(a) {
        for (var s, z, i = 1, j = a.length, r = a[0] + ""; i < j; ) {
          for (s = a[i++] + "", z = LOG_BASE - s.length; z--; s = "0" + s);
          r += s;
        }
        for (j = r.length; r.charCodeAt(--j) === 48; );
        return r.slice(0, j + 1 || 1);
      }
      function compare(x, y) {
        var a,
          b,
          xc = x.c,
          yc = y.c,
          i = x.s,
          j = y.s,
          k = x.e,
          l = y.e;
        if (!i || !j) return null;
        if (((a = xc && !xc[0]), (b = yc && !yc[0]), a || b))
          return a ? (b ? 0 : -j) : i;
        if (i != j) return i;
        if (((a = i < 0), (b = k == l), !xc || !yc))
          return b ? 0 : !xc ^ a ? 1 : -1;
        if (!b) return (k > l) ^ a ? 1 : -1;
        for (j = (k = xc.length) < (l = yc.length) ? k : l, i = 0; i < j; i++)
          if (xc[i] != yc[i]) return (xc[i] > yc[i]) ^ a ? 1 : -1;
        return k == l ? 0 : (k > l) ^ a ? 1 : -1;
      }
      function intValidatorNoErrors(n, min, max) {
        return (n = truncate(n)) >= min && n <= max;
      }
      function isArray2(obj) {
        return Object.prototype.toString.call(obj) == "[object Array]";
      }
      function toBaseOut(str, baseIn, baseOut) {
        for (var j, arr = [0], arrL, i = 0, len = str.length; i < len; ) {
          for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);
          for (
            arr[(j = 0)] += ALPHABET.indexOf(str.charAt(i++));
            j < arr.length;
            j++
          )
            arr[j] > baseOut - 1 &&
              (arr[j + 1] == null && (arr[j + 1] = 0),
              (arr[j + 1] += (arr[j] / baseOut) | 0),
              (arr[j] %= baseOut));
        }
        return arr.reverse();
      }
      function toExponential(str, e) {
        return (
          (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) +
          (e < 0 ? "e" : "e+") +
          e
        );
      }
      function toFixedPoint(str, e) {
        var len, z;
        if (e < 0) {
          for (z = "0."; ++e; z += "0");
          str = z + str;
        } else if (((len = str.length), ++e > len)) {
          for (z = "0", e -= len; --e; z += "0");
          str += z;
        } else e < len && (str = str.slice(0, e) + "." + str.slice(e));
        return str;
      }
      function truncate(n) {
        return (n = parseFloat(n)), n < 0 ? mathceil(n) : mathfloor(n);
      }
      if (
        ((BigNumber = constructorFactory()),
        (BigNumber.default = BigNumber.BigNumber = BigNumber),
        typeof define == "function" && define.amd)
      )
        define(function () {
          return BigNumber;
        });
      else if (typeof module < "u" && module.exports) {
        if (((module.exports = BigNumber), !cryptoObj))
          try {
            cryptoObj = __require("crypto");
          } catch {}
      } else
        globalObj ||
          (globalObj = typeof self < "u" ? self : Function("return this")()),
          (globalObj.BigNumber = BigNumber);
    })(exports);
  },
});
var require_charmap = __commonJS({
  "node_modules/.pnpm/instagram-id-to-url-segment@0.0.0/node_modules/instagram-id-to-url-segment/lib/charmap.json"(
    exports,
    module
  ) {
    module.exports = {
      0: "A",
      1: "B",
      2: "C",
      3: "D",
      4: "E",
      5: "F",
      6: "G",
      7: "H",
      8: "I",
      9: "J",
      a: "K",
      b: "L",
      c: "M",
      d: "N",
      e: "O",
      f: "P",
      g: "Q",
      h: "R",
      i: "S",
      j: "T",
      k: "U",
      l: "V",
      m: "W",
      n: "X",
      o: "Y",
      p: "Z",
      q: "a",
      r: "b",
      s: "c",
      t: "d",
      u: "e",
      v: "f",
      w: "g",
      x: "h",
      y: "i",
      z: "j",
      A: "k",
      B: "l",
      C: "m",
      D: "n",
      E: "o",
      F: "p",
      G: "q",
      H: "r",
      I: "s",
      J: "t",
      K: "u",
      L: "v",
      M: "w",
      N: "x",
      O: "y",
      P: "z",
      Q: "0",
      R: "1",
      S: "2",
      T: "3",
      U: "4",
      V: "5",
      W: "6",
      X: "7",
      Y: "8",
      Z: "9",
      $: "-",
      _: "_",
    };
  },
});
var require_lib = __commonJS({
  "node_modules/.pnpm/instagram-id-to-url-segment@0.0.0/node_modules/instagram-id-to-url-segment/lib/index.js"(
    exports,
    module
  ) {
    (function () {
      var BigNumber,
        i,
        instagramIdToUrlSegment,
        map,
        o,
        reversedMap,
        urlSegmentToInstagramId2;
      (BigNumber = require_bignumber()),
        (map = require_charmap()),
        (reversedMap = {});
      for (i in map) (o = map[i]), (reversedMap[o] = i);
      (instagramIdToUrlSegment = function (id) {
        var char, j, len, urlSegment;
        for (
          id = new BigNumber(id).toString(64),
            urlSegment = "",
            j = 0,
            len = id.length;
          j < len;
          j++
        )
          (char = id[j]), (urlSegment += map[char]);
        return urlSegment;
      }),
        (urlSegmentToInstagramId2 = function (urlSegment) {
          var char, id, j, len;
          for (id = "", j = 0, len = urlSegment.length; j < len; j++)
            (char = urlSegment[j]), (id += reversedMap[char]);
          return (id = new BigNumber(id, 64).toString(10)), id;
        }),
        (module.exports = {
          instagramIdToUrlSegment,
          urlSegmentToInstagramId: urlSegmentToInstagramId2,
        });
    }).call(exports);
  },
});
var import_webextension_polyfill5 = __toESM(require_browser_polyfill());
var createNanoEvents = () => ({
  events: {},
  emit(event, ...args) {
    (this.events[event] || []).forEach((i) => i(...args));
  },
  on(event, cb) {
    return (
      (this.events[event] = this.events[event] || []).push(cb),
      () =>
        (this.events[event] = (this.events[event] || []).filter(
          (i) => i !== cb
        ))
    );
  },
});
var import_webextension_polyfill = __toESM(require_browser_polyfill2(), 1);
var commonProperties = [
    { property: "name", enumerable: !1 },
    { property: "message", enumerable: !1 },
    { property: "stack", enumerable: !1 },
    { property: "code", enumerable: !0 },
  ],
  toJsonWasCalled = Symbol(".toJSON was called"),
  toJSON = (from) => {
    from[toJsonWasCalled] = !0;
    let json = from.toJSON();
    return delete from[toJsonWasCalled], json;
  },
  destroyCircular = ({ from, seen, to_, forceEnumerable, maxDepth, depth }) => {
    let to = to_ || (Array.isArray(from) ? [] : {});
    if ((seen.push(from), depth >= maxDepth)) return to;
    if (typeof from.toJSON == "function" && from[toJsonWasCalled] !== !0)
      return toJSON(from);
    for (let [key, value] of Object.entries(from)) {
      if (typeof Buffer == "function" && Buffer.isBuffer(value)) {
        to[key] = "[object Buffer]";
        continue;
      }
      if (
        value !== null &&
        typeof value == "object" &&
        typeof value.pipe == "function"
      ) {
        to[key] = "[object Stream]";
        continue;
      }
      if (typeof value != "function") {
        if (!value || typeof value != "object") {
          to[key] = value;
          continue;
        }
        if (!seen.includes(from[key])) {
          depth++,
            (to[key] = destroyCircular({
              from: from[key],
              seen: [...seen],
              forceEnumerable,
              maxDepth,
              depth,
            }));
          continue;
        }
        to[key] = "[Circular]";
      }
    }
    for (let { property, enumerable } of commonProperties)
      typeof from[property] == "string" &&
        Object.defineProperty(to, property, {
          value: from[property],
          enumerable: forceEnumerable ? !0 : enumerable,
          configurable: !0,
          writable: !0,
        });
    return to;
  };
function serializeError(value, options = {}) {
  let { maxDepth = Number.POSITIVE_INFINITY } = options;
  return typeof value == "object" && value !== null
    ? destroyCircular({
        from: value,
        seen: [],
        forceEnumerable: !0,
        maxDepth,
        depth: 0,
      })
    : typeof value == "function"
    ? `[Function: ${value.name || "anonymous"}]`
    : value;
}
var import_tiny_uid = __toESM(require_tiny_uid(), 1),
  import_webextension_polyfill2 = __toESM(require_browser_polyfill2(), 1),
  import_tiny_uid2 = __toESM(require_tiny_uid(), 1),
  import_tiny_uid3 = __toESM(require_tiny_uid(), 1);
var ENDPOINT_RE =
    /^((?:background$)|devtools|popup|options|content-script|window)(?:@(\d+)(?:\.(\d+))?)?$/,
  parseEndpoint = (endpoint) => {
    let [, context2, tabId, frameId] = endpoint.match(ENDPOINT_RE) || [];
    return {
      context: context2,
      tabId: +tabId,
      frameId: frameId ? +frameId : void 0,
    };
  };
var hasAPI = (nsps) => import_webextension_polyfill2.default[nsps],
  getBackgroundPageType = () => {
    var _a2, _b, _c;
    let manifest = import_webextension_polyfill2.default.runtime.getManifest();
    if (typeof window > "u") return "background";
    let popupPage =
      ((_a2 = manifest.browser_action) == null ? void 0 : _a2.default_popup) ||
      ((_b = manifest.action) == null ? void 0 : _b.default_popup);
    return popupPage &&
      new URL(import_webextension_polyfill2.default.runtime.getURL(popupPage))
        .pathname === window.location.pathname
      ? "popup"
      : (_c = manifest.options_ui) != null &&
        _c.page &&
        new URL(
          import_webextension_polyfill2.default.runtime.getURL(
            manifest.options_ui.page
          )
        ).pathname === window.location.pathname
      ? "options"
      : "background";
  },
  context = hasAPI("devtools")
    ? "devtools"
    : hasAPI("tabs")
    ? getBackgroundPageType()
    : hasAPI("extension")
    ? "content-script"
    : typeof document < "u"
    ? "window"
    : null,
  runtimeId = (0, import_tiny_uid.default)(),
  openTransactions = new Map(),
  onMessageListeners = new Map(),
  messageQueue = new Set(),
  portMap = new Map(),
  port = null,
  namespace,
  isWindowMessagingAllowed;
initIntercoms();
function initIntercoms() {
  if (context === null)
    throw new Error(
      "Unable to detect runtime context i.e webext-bridge can't figure out what to do"
    );
  if (
    ((context === "window" || context === "content-script") &&
      window.addEventListener("message", handleWindowOnMessage),
    context === "content-script" &&
      top === window &&
      ((port = import_webextension_polyfill.default.runtime.connect()),
      port.onMessage.addListener((message) => {
        routeMessage(message);
      }),
      port.onDisconnect.addListener(() => {
        (port = null), initIntercoms();
      })),
    context === "content-script" &&
      top !== window &&
      ((port = import_webextension_polyfill.default.runtime.connect()),
      port.onMessage.addListener((message) => {
        routeMessage(message);
      }),
      port.onDisconnect.addListener(() => {
        (port = null), initIntercoms();
      })),
    context === "devtools")
  ) {
    let { tabId } =
        import_webextension_polyfill.default.devtools.inspectedWindow,
      name = `devtools@${tabId}`;
    (port = import_webextension_polyfill.default.runtime.connect(void 0, {
      name,
    })),
      port.onMessage.addListener((message) => {
        routeMessage(message);
      }),
      port.onDisconnect.addListener(() => {
        (port = null), initIntercoms();
      });
  }
  if (context === "popup" || context === "options") {
    let name = `${context}`;
    (port = import_webextension_polyfill.default.runtime.connect(void 0, {
      name,
    })),
      port.onMessage.addListener((message) => {
        routeMessage(message);
      }),
      port.onDisconnect.addListener(() => {
        (port = null), initIntercoms();
      });
  }
  context === "background" &&
    import_webextension_polyfill.default.runtime.onConnect.addListener(
      (incomingPort) => {
        let portId =
            incomingPort.name || `content-script@${incomingPort.sender.tab.id}`,
          portFrame = incomingPort.sender.frameId;
        portFrame && (portId = `${portId}.${portFrame}`);
        let {
          context: context2,
          tabId: linkedTabId,
          frameId: linkedFrameId,
        } = parseEndpoint(portId);
        (!linkedTabId && context2 !== "popup" && context2 !== "options") ||
          (portMap.set(portId, incomingPort),
          messageQueue.forEach((queuedMsg) => {
            queuedMsg.resolvedDestination === portId &&
              (incomingPort.postMessage(queuedMsg.message),
              messageQueue.delete(queuedMsg));
          }),
          incomingPort.onDisconnect.addListener(() => {
            portMap.delete(portId);
          }),
          incomingPort.onMessage.addListener((message) => {
            var _a2;
            (_a2 = message?.origin) != null &&
              _a2.context &&
              ((message.origin.tabId = linkedTabId),
              (message.origin.frameId = linkedFrameId),
              routeMessage(message));
          }));
      }
    );
}
function routeMessage(message) {
  let { origin, destination } = message;
  if (
    !message.hops.includes(runtimeId) &&
    (message.hops.push(runtimeId),
    !(
      context === "content-script" &&
      [destination, origin].some(
        (endpoint) => endpoint?.context === "window"
      ) &&
      !isWindowMessagingAllowed
    ))
  ) {
    if (!destination) return handleInboundMessage(message);
    if (destination.context) {
      if (context === "window")
        return routeMessageThroughWindow(window, message);
      if (context === "content-script" && destination.context === "window")
        return (
          (message.destination = null),
          routeMessageThroughWindow(window, message)
        );
      if (["devtools", "content-script", "popup", "options"].includes(context))
        return (
          destination.context === "background" && (message.destination = null),
          port.postMessage(message)
        );
      if (context === "background") {
        let {
            context: destName,
            tabId: destTabId,
            frameId: destFrameId,
          } = destination,
          { tabId: srcTabId } = origin;
        destName !== "window"
          ? (message.destination = null)
          : (message.destination.tabId = null);
        let resolvedDestination = ["popup", "options"].includes(destName)
          ? destName
          : `${destName === "window" ? "content-script" : destName}@${
              destTabId || srcTabId
            }`;
        destFrameId &&
          (resolvedDestination = `${resolvedDestination}.${destFrameId}`);
        let destPort = portMap.get(resolvedDestination);
        destPort
          ? destPort.postMessage(message)
          : messageQueue.add({ resolvedDestination, message });
      }
    }
  }
}
async function handleInboundMessage(message) {
  let { transactionId, messageID, messageType } = message,
    handleReply = () => {
      let transactionP = openTransactions.get(transactionId);
      if (transactionP) {
        let { err, data } = message;
        if (err) {
          let dehydratedErr = err,
            errCtr = self[dehydratedErr.name],
            hydratedErr = new (typeof errCtr == "function" ? errCtr : Error)(
              dehydratedErr.message
            );
          for (let prop in dehydratedErr)
            hydratedErr[prop] = dehydratedErr[prop];
          transactionP.reject(hydratedErr);
        } else transactionP.resolve(data);
        openTransactions.delete(transactionId);
      }
    },
    handleNewMessage = async () => {
      let reply,
        err,
        noHandlerFoundError = !1;
      try {
        let cb = onMessageListeners.get(messageID);
        if (typeof cb == "function")
          reply = await cb({
            sender: message.origin,
            id: messageID,
            data: message.data,
            timestamp: message.timestamp,
          });
        else
          throw (
            ((noHandlerFoundError = !0),
            new Error(
              `[webext-bridge] No handler registered in '${context}' to accept messages with id '${messageID}'`
            ))
          );
      } catch (error) {
        err = error;
      } finally {
        if (
          (err && (message.err = serializeError(err)),
          routeMessage({
            ...message,
            messageType: "reply",
            data: reply,
            origin: { context, tabId: null },
            destination: message.origin,
            hops: [],
          }),
          err && !noHandlerFoundError)
        )
          throw reply;
      }
    };
  switch (messageType) {
    case "reply":
      return handleReply();
    case "message":
      return handleNewMessage();
  }
}
async function handleWindowOnMessage({ data, ports }) {
  if (!(context === "content-script" && !isWindowMessagingAllowed)) {
    if (
      data.cmd === "__crx_bridge_verify_listening" &&
      data.scope === namespace &&
      data.context !== context
    )
      ports[0].postMessage(!0);
    else if (
      data.cmd === "__crx_bridge_route_message" &&
      data.scope === namespace &&
      data.context !== context
    ) {
      let { payload } = data;
      context === "content-script" &&
        (payload.origin = { context: "window", tabId: null }),
        routeMessage(payload);
    }
  }
}
function routeMessageThroughWindow(win, msg) {
  ensureNamespaceSet();
  let channel = new MessageChannel(),
    retry = setTimeout(() => {
      (channel.port1.onmessage = null), routeMessageThroughWindow(win, msg);
    }, 300);
  (channel.port1.onmessage = () => {
    clearTimeout(retry),
      win.postMessage(
        {
          cmd: "__crx_bridge_route_message",
          scope: namespace,
          context,
          payload: msg,
        },
        "*"
      );
  }),
    win.postMessage(
      { cmd: "__crx_bridge_verify_listening", scope: namespace, context },
      "*",
      [channel.port2]
    );
}
function ensureNamespaceSet() {
  if (typeof namespace != "string" || namespace.length === 0)
    throw new Error(
      `webext-bridge uses window.postMessage to talk with other "window"(s), for message routing and stuff,which is global/conflicting operation in case there are other scripts using webext-bridge. Call Bridge#setNamespace(nsps) to isolate your app. Example: setNamespace('com.facebook.react-devtools'). Make sure to use same namespace across all your scripts whereever window.postMessage is likely to be used\``
    );
}
function onMessage(messageID, callback) {
  onMessageListeners.set(messageID, callback);
}
async function sendMessage(messageID, data, destination = "background") {
  let endpoint =
      typeof destination == "string" ? parseEndpoint(destination) : destination,
    errFn = "Bridge#sendMessage ->";
  if (!endpoint.context)
    throw new TypeError(
      `${errFn} Destination must be any one of known destinations`
    );
  if (context === "background") {
    let { context: dest, tabId: destTabId } = endpoint;
    if (dest !== "background" && !destTabId)
      throw new TypeError(
        `${errFn} When sending messages from background page, use @tabId syntax to target specific tab`
      );
  }
  return new Promise((resolve, reject) => {
    let payload = {
      messageID,
      data,
      destination: endpoint,
      messageType: "message",
      transactionId: (0, import_tiny_uid2.default)(),
      origin: { context, tabId: null },
      hops: [],
      timestamp: Date.now(),
    };
    openTransactions.set(payload.transactionId, { resolve, reject }),
      routeMessage(payload);
  });
}
var _Stream = class {
    constructor(t) {
      (this.handleStreamClose = () => {
        this.isClosed ||
          ((this.isClosed = !0),
          this.emitter.emit("closed", !0),
          (this.emitter.events = {}));
      }),
        (this.internalInfo = t),
        (this.emitter = createNanoEvents()),
        (this.isClosed = !1),
        _Stream.initDone ||
          (onMessage("__crx_bridge_stream_transfer__", (msg) => {
            let { streamId, streamTransfer, action } = msg.data,
              stream = _Stream.openStreams.get(streamId);
            stream &&
              !stream.isClosed &&
              (action === "transfer" &&
                stream.emitter.emit("message", streamTransfer),
              action === "close" &&
                (_Stream.openStreams.delete(streamId),
                stream.handleStreamClose()));
          }),
          (_Stream.initDone = !0)),
        _Stream.openStreams.set(t.streamId, this);
    }
    get info() {
      return this.internalInfo;
    }
    send(msg) {
      if (this.isClosed)
        throw new Error(
          "Attempting to send a message over closed stream. Use stream.onClose(<callback>) to keep an eye on stream status"
        );
      sendMessage(
        "__crx_bridge_stream_transfer__",
        {
          streamId: this.internalInfo.streamId,
          streamTransfer: msg,
          action: "transfer",
        },
        this.internalInfo.endpoint
      );
    }
    close(msg) {
      msg && this.send(msg),
        this.handleStreamClose(),
        sendMessage(
          "__crx_bridge_stream_transfer__",
          {
            streamId: this.internalInfo.streamId,
            streamTransfer: null,
            action: "close",
          },
          this.internalInfo.endpoint
        );
    }
    onMessage(callback) {
      return this.getDisposable("message", callback);
    }
    onClose(callback) {
      return this.getDisposable("closed", callback);
    }
    getDisposable(event, callback) {
      let off = this.emitter.on(event, callback);
      return Object.assign(off, { dispose: off, close: off });
    }
  },
  Stream = _Stream;
Stream.initDone = !1;
Stream.openStreams = new Map();
var onOpenStreamCallbacks = new Map(),
  streamyEmitter = createNanoEvents();
onMessage(
  "__crx_bridge_stream_open__",
  (message) =>
    new Promise((resolve) => {
      let { sender, data } = message,
        { channel } = data,
        watching = !1,
        off = () => {},
        readyup = () => {
          let callback = onOpenStreamCallbacks.get(channel);
          typeof callback == "function"
            ? (callback(new Stream({ ...data, endpoint: sender })),
              watching && off(),
              resolve(!0))
            : watching ||
              ((watching = !0),
              (off = streamyEmitter.on(
                "did-change-stream-callbacks",
                readyup
              )));
        };
      readyup();
    })
);
var Website = "https://no1marketing.net/";
function makeMap(str, expectsLowerCase) {
  let map = Object.create(null),
    list = str.split(",");
  for (let i = 0; i < list.length; i++) map[list[i]] = !0;
  return expectsLowerCase
    ? (val) => !!map[val.toLowerCase()]
    : (val) => !!map[val];
}
var specialBooleanAttrs =
  "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";
var isBooleanAttr = makeMap(
  specialBooleanAttrs +
    ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"
);
var NO = () => !1;
var hasOwnProperty = Object.prototype.hasOwnProperty,
  hasOwn = (val, key) => hasOwnProperty.call(val, key),
  isArray = Array.isArray,
  isMap = (val) => toTypeString(val) === "[object Map]";
var isFunction = (val) => typeof val == "function",
  isString = (val) => typeof val == "string",
  isSymbol = (val) => typeof val == "symbol",
  isObject = (val) => val !== null && typeof val == "object",
  isPromise = (val) =>
    isObject(val) && isFunction(val.then) && isFunction(val.catch),
  objectToString = Object.prototype.toString,
  toTypeString = (value) => objectToString.call(value),
  toRawType = (value) => toTypeString(value).slice(8, -1);
var isIntegerKey = (key) =>
  isString(key) &&
  key !== "NaN" &&
  key[0] !== "-" &&
  "" + parseInt(key, 10) === key;
var cacheStringFunction = (fn) => {
    let cache = Object.create(null);
    return (str) => cache[str] || (cache[str] = fn(str));
  },
  camelizeRE = /-(\w)/g,
  camelize = cacheStringFunction((str) =>
    str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ""))
  ),
  hyphenateRE = /\B([A-Z])/g,
  hyphenate = cacheStringFunction((str) =>
    str.replace(hyphenateRE, "-$1").toLowerCase()
  ),
  capitalize = cacheStringFunction(
    (str) => str.charAt(0).toUpperCase() + str.slice(1)
  ),
  toHandlerKey = cacheStringFunction((str) =>
    str ? `on${capitalize(str)}` : ""
  ),
  hasChanged = (value, oldValue) => !Object.is(value, oldValue);
var createDep = (effects) => {
    let dep = new Set(effects);
    return (dep.w = 0), (dep.n = 0), dep;
  },
  wasTracked = (dep) => (dep.w & trackOpBit) > 0,
  newTracked = (dep) => (dep.n & trackOpBit) > 0;
var targetMap = new WeakMap(),
  effectTrackDepth = 0,
  trackOpBit = 1,
  maxMarkerBits = 30,
  activeEffect,
  ITERATE_KEY = Symbol(""),
  MAP_KEY_ITERATE_KEY = Symbol("");
var shouldTrack = !0,
  trackStack = [];
function pauseTracking() {
  trackStack.push(shouldTrack), (shouldTrack = !1);
}
function resetTracking() {
  let last = trackStack.pop();
  shouldTrack = last === void 0 ? !0 : last;
}
function track(target, type, key) {
  if (shouldTrack && activeEffect) {
    let depsMap = targetMap.get(target);
    depsMap || targetMap.set(target, (depsMap = new Map()));
    let dep = depsMap.get(key);
    dep || depsMap.set(key, (dep = createDep())), trackEffects(dep, void 0);
  }
}
function trackEffects(dep, debuggerEventExtraInfo) {
  let shouldTrack2 = !1;
  effectTrackDepth <= maxMarkerBits
    ? newTracked(dep) ||
      ((dep.n |= trackOpBit), (shouldTrack2 = !wasTracked(dep)))
    : (shouldTrack2 = !dep.has(activeEffect)),
    shouldTrack2 && (dep.add(activeEffect), activeEffect.deps.push(dep));
}
function trigger(target, type, key, newValue, oldValue, oldTarget) {
  let depsMap = targetMap.get(target);
  if (!depsMap) return;
  let deps = [];
  if (type === "clear") deps = [...depsMap.values()];
  else if (key === "length" && isArray(target)) {
    let newLength = Number(newValue);
    depsMap.forEach((dep, key2) => {
      (key2 === "length" || key2 >= newLength) && deps.push(dep);
    });
  } else
    switch ((key !== void 0 && deps.push(depsMap.get(key)), type)) {
      case "add":
        isArray(target)
          ? isIntegerKey(key) && deps.push(depsMap.get("length"))
          : (deps.push(depsMap.get(ITERATE_KEY)),
            isMap(target) && deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)));
        break;
      case "delete":
        isArray(target) ||
          (deps.push(depsMap.get(ITERATE_KEY)),
          isMap(target) && deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)));
        break;
      case "set":
        isMap(target) && deps.push(depsMap.get(ITERATE_KEY));
        break;
    }
  let eventInfo = void 0;
  if (deps.length === 1) deps[0] && triggerEffects(deps[0]);
  else {
    let effects = [];
    for (let dep of deps) dep && effects.push(...dep);
    triggerEffects(createDep(effects));
  }
}
function triggerEffects(dep, debuggerEventExtraInfo) {
  let effects = isArray(dep) ? dep : [...dep];
  for (let effect2 of effects)
    effect2.computed && triggerEffect(effect2, debuggerEventExtraInfo);
  for (let effect2 of effects)
    effect2.computed || triggerEffect(effect2, debuggerEventExtraInfo);
}
function triggerEffect(effect2, debuggerEventExtraInfo) {
  (effect2 !== activeEffect || effect2.allowRecurse) &&
    (effect2.scheduler ? effect2.scheduler() : effect2.run());
}
var isNonTrackableKeys = makeMap("__proto__,__v_isRef,__isVue"),
  builtInSymbols = new Set(
    Object.getOwnPropertyNames(Symbol)
      .filter((key) => key !== "arguments" && key !== "caller")
      .map((key) => Symbol[key])
      .filter(isSymbol)
  ),
  get$1 = createGetter();
var readonlyGet = createGetter(!0);
var arrayInstrumentations = createArrayInstrumentations();
function createArrayInstrumentations() {
  let instrumentations = {};
  return (
    ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
      instrumentations[key] = function (...args) {
        let arr = toRaw(this);
        for (let i = 0, l = this.length; i < l; i++) track(arr, "get", i + "");
        let res = arr[key](...args);
        return res === -1 || res === !1 ? arr[key](...args.map(toRaw)) : res;
      };
    }),
    ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
      instrumentations[key] = function (...args) {
        pauseTracking();
        let res = toRaw(this)[key].apply(this, args);
        return resetTracking(), res;
      };
    }),
    instrumentations
  );
}
function hasOwnProperty2(key) {
  let obj = toRaw(this);
  return track(obj, "has", key), obj.hasOwnProperty(key);
}
function createGetter(isReadonly2 = !1, shallow = !1) {
  return function (target, key, receiver) {
    if (key === "__v_isReactive") return !isReadonly2;
    if (key === "__v_isReadonly") return isReadonly2;
    if (key === "__v_isShallow") return shallow;
    if (
      key === "__v_raw" &&
      receiver ===
        (isReadonly2
          ? shallow
            ? shallowReadonlyMap
            : readonlyMap
          : shallow
          ? shallowReactiveMap
          : reactiveMap
        ).get(target)
    )
      return target;
    let targetIsArray = isArray(target);
    if (!isReadonly2) {
      if (targetIsArray && hasOwn(arrayInstrumentations, key))
        return Reflect.get(arrayInstrumentations, key, receiver);
      if (key === "hasOwnProperty") return hasOwnProperty2;
    }
    let res = Reflect.get(target, key, receiver);
    return (isSymbol(key)
      ? builtInSymbols.has(key)
      : isNonTrackableKeys(key)) ||
      (isReadonly2 || track(target, "get", key), shallow)
      ? res
      : isRef(res)
      ? targetIsArray && isIntegerKey(key)
        ? res
        : res.value
      : isObject(res)
      ? isReadonly2
        ? readonly(res)
        : reactive(res)
      : res;
  };
}
var set$1 = createSetter();
function createSetter(shallow = !1) {
  return function (target, key, value, receiver) {
    let oldValue = target[key];
    if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) return !1;
    if (
      !shallow &&
      (!isShallow(value) &&
        !isReadonly(value) &&
        ((oldValue = toRaw(oldValue)), (value = toRaw(value))),
      !isArray(target) && isRef(oldValue) && !isRef(value))
    )
      return (oldValue.value = value), !0;
    let hadKey =
        isArray(target) && isIntegerKey(key)
          ? Number(key) < target.length
          : hasOwn(target, key),
      result = Reflect.set(target, key, value, receiver);
    return (
      target === toRaw(receiver) &&
        (hadKey
          ? hasChanged(value, oldValue) &&
            trigger(target, "set", key, value, oldValue)
          : trigger(target, "add", key, value)),
      result
    );
  };
}
function deleteProperty(target, key) {
  let hadKey = hasOwn(target, key),
    oldValue = target[key],
    result = Reflect.deleteProperty(target, key);
  return (
    result && hadKey && trigger(target, "delete", key, void 0, oldValue), result
  );
}
function has$1(target, key) {
  let result = Reflect.has(target, key);
  return (
    (!isSymbol(key) || !builtInSymbols.has(key)) && track(target, "has", key),
    result
  );
}
function ownKeys(target) {
  return (
    track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY),
    Reflect.ownKeys(target)
  );
}
var mutableHandlers = {
    get: get$1,
    set: set$1,
    deleteProperty,
    has: has$1,
    ownKeys,
  },
  readonlyHandlers = {
    get: readonlyGet,
    set(target, key) {
      return !0;
    },
    deleteProperty(target, key) {
      return !0;
    },
  };
var toShallow = (value) => value,
  getProto = (v) => Reflect.getPrototypeOf(v);
function get(target, key, isReadonly2 = !1, isShallow2 = !1) {
  target = target.__v_raw;
  let rawTarget = toRaw(target),
    rawKey = toRaw(key);
  isReadonly2 ||
    (key !== rawKey && track(rawTarget, "get", key),
    track(rawTarget, "get", rawKey));
  let { has: has2 } = getProto(rawTarget),
    wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  if (has2.call(rawTarget, key)) return wrap(target.get(key));
  if (has2.call(rawTarget, rawKey)) return wrap(target.get(rawKey));
  target !== rawTarget && target.get(key);
}
function has(key, isReadonly2 = !1) {
  let target = this.__v_raw,
    rawTarget = toRaw(target),
    rawKey = toRaw(key);
  return (
    isReadonly2 ||
      (key !== rawKey && track(rawTarget, "has", key),
      track(rawTarget, "has", rawKey)),
    key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey)
  );
}
function size(target, isReadonly2 = !1) {
  return (
    (target = target.__v_raw),
    !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY),
    Reflect.get(target, "size", target)
  );
}
function add(value) {
  value = toRaw(value);
  let target = toRaw(this);
  return (
    getProto(target).has.call(target, value) ||
      (target.add(value), trigger(target, "add", value, value)),
    this
  );
}
function set(key, value) {
  value = toRaw(value);
  let target = toRaw(this),
    { has: has2, get: get2 } = getProto(target),
    hadKey = has2.call(target, key);
  hadKey || ((key = toRaw(key)), (hadKey = has2.call(target, key)));
  let oldValue = get2.call(target, key);
  return (
    target.set(key, value),
    hadKey
      ? hasChanged(value, oldValue) &&
        trigger(target, "set", key, value, oldValue)
      : trigger(target, "add", key, value),
    this
  );
}
function deleteEntry(key) {
  let target = toRaw(this),
    { has: has2, get: get2 } = getProto(target),
    hadKey = has2.call(target, key);
  hadKey || ((key = toRaw(key)), (hadKey = has2.call(target, key)));
  let oldValue = get2 ? get2.call(target, key) : void 0,
    result = target.delete(key);
  return hadKey && trigger(target, "delete", key, void 0, oldValue), result;
}
function clear() {
  let target = toRaw(this),
    hadItems = target.size !== 0,
    oldTarget = void 0,
    result = target.clear();
  return (
    hadItems && trigger(target, "clear", void 0, void 0, oldTarget), result
  );
}
function createForEach(isReadonly2, isShallow2) {
  return function (callback, thisArg) {
    let observed = this,
      target = observed.__v_raw,
      rawTarget = toRaw(target),
      wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    return (
      !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY),
      target.forEach((value, key) =>
        callback.call(thisArg, wrap(value), wrap(key), observed)
      )
    );
  };
}
function createIterableMethod(method, isReadonly2, isShallow2) {
  return function (...args) {
    let target = this.__v_raw,
      rawTarget = toRaw(target),
      targetIsMap = isMap(rawTarget),
      isPair =
        method === "entries" || (method === Symbol.iterator && targetIsMap),
      isKeyOnly = method === "keys" && targetIsMap,
      innerIterator = target[method](...args),
      wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
    return (
      !isReadonly2 &&
        track(
          rawTarget,
          "iterate",
          isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
        ),
      {
        next() {
          let { value, done } = innerIterator.next();
          return done
            ? { value, done }
            : {
                value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
                done,
              };
        },
        [Symbol.iterator]() {
          return this;
        },
      }
    );
  };
}
function createReadonlyMethod(type) {
  return function (...args) {
    return type === "delete" ? !1 : this;
  };
}
function createInstrumentations() {
  let mutableInstrumentations2 = {
      get(key) {
        return get(this, key);
      },
      get size() {
        return size(this);
      },
      has,
      add,
      set,
      delete: deleteEntry,
      clear,
      forEach: createForEach(!1, !1),
    },
    shallowInstrumentations2 = {
      get(key) {
        return get(this, key, !1, !0);
      },
      get size() {
        return size(this);
      },
      has,
      add,
      set,
      delete: deleteEntry,
      clear,
      forEach: createForEach(!1, !0),
    },
    readonlyInstrumentations2 = {
      get(key) {
        return get(this, key, !0);
      },
      get size() {
        return size(this, !0);
      },
      has(key) {
        return has.call(this, key, !0);
      },
      add: createReadonlyMethod("add"),
      set: createReadonlyMethod("set"),
      delete: createReadonlyMethod("delete"),
      clear: createReadonlyMethod("clear"),
      forEach: createForEach(!0, !1),
    },
    shallowReadonlyInstrumentations2 = {
      get(key) {
        return get(this, key, !0, !0);
      },
      get size() {
        return size(this, !0);
      },
      has(key) {
        return has.call(this, key, !0);
      },
      add: createReadonlyMethod("add"),
      set: createReadonlyMethod("set"),
      delete: createReadonlyMethod("delete"),
      clear: createReadonlyMethod("clear"),
      forEach: createForEach(!0, !0),
    };
  return (
    ["keys", "values", "entries", Symbol.iterator].forEach((method) => {
      (mutableInstrumentations2[method] = createIterableMethod(method, !1, !1)),
        (readonlyInstrumentations2[method] = createIterableMethod(
          method,
          !0,
          !1
        )),
        (shallowInstrumentations2[method] = createIterableMethod(
          method,
          !1,
          !0
        )),
        (shallowReadonlyInstrumentations2[method] = createIterableMethod(
          method,
          !0,
          !0
        ));
    }),
    [
      mutableInstrumentations2,
      readonlyInstrumentations2,
      shallowInstrumentations2,
      shallowReadonlyInstrumentations2,
    ]
  );
}
var [
  mutableInstrumentations,
  readonlyInstrumentations,
  shallowInstrumentations,
  shallowReadonlyInstrumentations,
] = createInstrumentations();
function createInstrumentationGetter(isReadonly2, shallow) {
  let instrumentations = shallow
    ? isReadonly2
      ? shallowReadonlyInstrumentations
      : shallowInstrumentations
    : isReadonly2
    ? readonlyInstrumentations
    : mutableInstrumentations;
  return (target, key, receiver) =>
    key === "__v_isReactive"
      ? !isReadonly2
      : key === "__v_isReadonly"
      ? isReadonly2
      : key === "__v_raw"
      ? target
      : Reflect.get(
          hasOwn(instrumentations, key) && key in target
            ? instrumentations
            : target,
          key,
          receiver
        );
}
var mutableCollectionHandlers = { get: createInstrumentationGetter(!1, !1) };
var readonlyCollectionHandlers = { get: createInstrumentationGetter(!0, !1) };
var reactiveMap = new WeakMap(),
  shallowReactiveMap = new WeakMap(),
  readonlyMap = new WeakMap(),
  shallowReadonlyMap = new WeakMap();
function targetTypeMap(rawType) {
  switch (rawType) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
function getTargetType(value) {
  return value.__v_skip || !Object.isExtensible(value)
    ? 0
    : targetTypeMap(toRawType(value));
}
function reactive(target) {
  return isReadonly(target)
    ? target
    : createReactiveObject(
        target,
        !1,
        mutableHandlers,
        mutableCollectionHandlers,
        reactiveMap
      );
}
function readonly(target) {
  return createReactiveObject(
    target,
    !0,
    readonlyHandlers,
    readonlyCollectionHandlers,
    readonlyMap
  );
}
function createReactiveObject(
  target,
  isReadonly2,
  baseHandlers,
  collectionHandlers,
  proxyMap
) {
  if (
    !isObject(target) ||
    (target.__v_raw && !(isReadonly2 && target.__v_isReactive))
  )
    return target;
  let existingProxy = proxyMap.get(target);
  if (existingProxy) return existingProxy;
  let targetType = getTargetType(target);
  if (targetType === 0) return target;
  let proxy = new Proxy(
    target,
    targetType === 2 ? collectionHandlers : baseHandlers
  );
  return proxyMap.set(target, proxy), proxy;
}
function isReadonly(value) {
  return !!(value && value.__v_isReadonly);
}
function isShallow(value) {
  return !!(value && value.__v_isShallow);
}
function toRaw(observed) {
  let raw = observed && observed.__v_raw;
  return raw ? toRaw(raw) : observed;
}
var toReactive = (value) => (isObject(value) ? reactive(value) : value),
  toReadonly = (value) => (isObject(value) ? readonly(value) : value);
function trackRefValue(ref2) {
  shouldTrack &&
    activeEffect &&
    ((ref2 = toRaw(ref2)), trackEffects(ref2.dep || (ref2.dep = createDep())));
}
function triggerRefValue(ref2, newVal) {
  ref2 = toRaw(ref2);
  let dep = ref2.dep;
  dep && triggerEffects(dep);
}
function isRef(r) {
  return !!(r && r.__v_isRef === !0);
}
function ref(value) {
  return createRef(value, !1);
}
function createRef(rawValue, shallow) {
  return isRef(rawValue) ? rawValue : new RefImpl(rawValue, shallow);
}
var RefImpl = class {
  constructor(value, __v_isShallow) {
    (this.__v_isShallow = __v_isShallow),
      (this.dep = void 0),
      (this.__v_isRef = !0),
      (this._rawValue = __v_isShallow ? value : toRaw(value)),
      (this._value = __v_isShallow ? value : toReactive(value));
  }
  get value() {
    return trackRefValue(this), this._value;
  }
  set value(newVal) {
    let useDirectValue =
      this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
    (newVal = useDirectValue ? newVal : toRaw(newVal)),
      hasChanged(newVal, this._rawValue) &&
        ((this._rawValue = newVal),
        (this._value = useDirectValue ? newVal : toReactive(newVal)),
        triggerRefValue(this, newVal));
  }
};
var _a$1;
_a$1 = "__v_isReadonly";
var _a;
_a = "__v_isReadonly";
function callWithErrorHandling(fn, instance, type, args) {
  let res;
  try {
    res = args ? fn(...args) : fn();
  } catch (err) {
    handleError(err, instance, type);
  }
  return res;
}
function callWithAsyncErrorHandling(fn, instance, type, args) {
  if (isFunction(fn)) {
    let res = callWithErrorHandling(fn, instance, type, args);
    return (
      res &&
        isPromise(res) &&
        res.catch((err) => {
          handleError(err, instance, type);
        }),
      res
    );
  }
  let values = [];
  for (let i = 0; i < fn.length; i++)
    values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  return values;
}
function handleError(err, instance, type, throwInDev = !0) {
  let contextVNode = instance ? instance.vnode : null;
  if (instance) {
    let cur = instance.parent,
      exposedInstance = instance.proxy,
      errorInfo = type;
    for (; cur; ) {
      let errorCapturedHooks = cur.ec;
      if (errorCapturedHooks) {
        for (let i = 0; i < errorCapturedHooks.length; i++)
          if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === !1)
            return;
      }
      cur = cur.parent;
    }
    let appErrorHandler = instance.appContext.config.errorHandler;
    if (appErrorHandler) {
      callWithErrorHandling(appErrorHandler, null, 10, [
        err,
        exposedInstance,
        errorInfo,
      ]);
      return;
    }
  }
  logError(err, type, contextVNode, throwInDev);
}
function logError(err, type, contextVNode, throwInDev = !0) {
  console.error(err);
}
function injectHook(type, hook, target = currentInstance, prepend = !1) {
  if (target) {
    let hooks = target[type] || (target[type] = []),
      wrappedHook =
        hook.__weh ||
        (hook.__weh = (...args) => {
          if (target.isUnmounted) return;
          pauseTracking(), setCurrentInstance(target);
          let res = callWithAsyncErrorHandling(hook, target, type, args);
          return unsetCurrentInstance(), resetTracking(), res;
        });
    return (
      prepend ? hooks.unshift(wrappedHook) : hooks.push(wrappedHook),
      wrappedHook
    );
  }
}
var createHook =
    (lifecycle) =>
    (hook, target = currentInstance) =>
      (!isInSSRComponentSetup || lifecycle === "sp") &&
      injectHook(lifecycle, (...args) => hook(...args), target),
  onBeforeMount = createHook("bm"),
  onMounted = createHook("m"),
  onBeforeUpdate = createHook("bu"),
  onUpdated = createHook("u"),
  onBeforeUnmount = createHook("bum"),
  onUnmounted = createHook("um"),
  onServerPrefetch = createHook("sp"),
  onRenderTriggered = createHook("rtg"),
  onRenderTracked = createHook("rtc");
var NULL_DYNAMIC_COMPONENT = Symbol();
function createAppContext() {
  return {
    app: null,
    config: {
      isNativeTag: NO,
      performance: !1,
      globalProperties: {},
      optionMergeStrategies: {},
      errorHandler: void 0,
      warnHandler: void 0,
      compilerOptions: {},
    },
    mixins: [],
    components: {},
    directives: {},
    provides: Object.create(null),
    optionsCache: new WeakMap(),
    propsCache: new WeakMap(),
    emitsCache: new WeakMap(),
  };
}
var Fragment = Symbol(void 0),
  Text = Symbol(void 0),
  Comment = Symbol(void 0),
  Static = Symbol(void 0);
var emptyAppContext = createAppContext();
var currentInstance = null;
var setCurrentInstance = (instance) => {
    (currentInstance = instance), instance.scope.on();
  },
  unsetCurrentInstance = () => {
    currentInstance && currentInstance.scope.off(), (currentInstance = null);
  };
var isInSSRComponentSetup = !1;
var ssrContextKey = Symbol("");
var import_webextension_polyfill3 = __toESM(require_browser_polyfill()),
  IS_READY = !1;
async function bootstrap() {
  let res = await import_webextension_polyfill3.default.cookies.get({
    url: "https://www.instagram.com",
    name: "ds_user_id",
  });
  if (!res) {
    IS_READY = !1;
    return;
  }
  let uid = res.value,
    { value: csrftoken } =
      await import_webextension_polyfill3.default.cookies.get({
        url: "https://www.instagram.com",
        name: "csrftoken",
      });
  await import_webextension_polyfill3.default.storage.local.set({
    uid,
    csrftoken,
  }),
    (IS_READY = !0);
}
var isReady = () => IS_READY;
var import_webextension_polyfill4 = __toESM(require_browser_polyfill());
var import_instagram_id_to_url_segment = __toESM(require_lib());
var insReady = ref(!0);
function useInstagram() {
  async function boot() {
    return await bootstrap(), (insReady.value = isReady()), insReady.value;
  }
  return { insReady, boot };
}
var EVENT = {
  TAB_REQ: "FOX_IG_GROWTH_TAB_REQ",
  TAB_RESP: "FOX_IG_GROWTH_TAB_RESP",
  INJECT_REQ: "FOX_IG_GROWTH_INJECT_REQ",
  INJECT_RESP: "FOX_IG_GROWTH_INJECT_RESP",
  BOOT: "BOOT",
  START: "START",
  STOP: "STOP",
  PROGRESS: "PROGRESS",
  SHOW_PAGE: "SHOW_PAGE",
  CHANGE_QUOTA: "CHANGE_QUOTA",
  CHANGE_QUEUE: "CHANGE_QUEUE",
  CHANGE_SETIING: "CHANGE_SETIING",
  FETCH_STATUS: "FETCH_STATUS",
  WORKER_STATUS: "WORKER_STATUS",
  NEW_HISTORY: "NEW_HISTORY",
  NEW_LOG: "NEW_LOG",
};
import_webextension_polyfill5.default.runtime.onInstalled.addListener(
  (details) => {
    if (details.reason === "install") {
      let feedbackUrl = `${Website}feedback`;
      import_webextension_polyfill5.default.runtime.setUninstallURL(
        feedbackUrl
      );
    }
  }
);
onMessage(EVENT.BOOT, async () => {
  let { boot } = useInstagram();
  return { insReady: await boot() };
});
/*! Bundled license information:

bignumber.js/bignumber.js:
  (*! bignumber.js v2.4.0 https://github.com/MikeMcl/bignumber.js/LICENCE *)
*/
