/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

(function initCjs() {
  // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
  const globalThisRecord = globalThis;
  globalThisRecord['__name'] ??= name;
  const originalRequire = require;
  if (originalRequire && !originalRequire.__isPatched) {
    // eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
    require = Object.assign(
      (id) => requirePatched(id),
      originalRequire,
      {
        __isPatched: true
      }
    );
  }

  const newFuncs = {
    __extractDefault() {
      return extractDefault;
    },
    process() {
      const browserProcess = {
        browser: true,
        cwd() {
          return '/';
        },
        env: {},
        platform: 'android'
      };
      return browserProcess;
    }
  };

  for (const key of Object.keys(newFuncs)) {
    globalThisRecord[key] ??= newFuncs[key]?.();
  }

  function name(obj) {
    return obj;
  }

  function extractDefault(module) {
    return module && module.__esModule && 'default' in module ? module.default : module;
  }

  const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  'obsidian',
  '@codemirror/autocomplete',
  '@codemirror/collab',
  '@codemirror/commands',
  '@codemirror/language',
  '@codemirror/lint',
  '@codemirror/search',
  '@codemirror/state',
  '@codemirror/text',
  '@codemirror/view',
  '@lezer/common',
  '@lezer/lr',
  '@lezer/highlight'];


  const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  '@codemirror/closebrackets',
  '@codemirror/comment',
  '@codemirror/fold',
  '@codemirror/gutter',
  '@codemirror/highlight',
  '@codemirror/history',
  '@codemirror/matchbrackets',
  '@codemirror/panel',
  '@codemirror/rangeset',
  '@codemirror/rectangular-selection',
  '@codemirror/stream-parser',
  '@codemirror/tooltip'];


  function requirePatched(id) {
    if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
      return originalRequire?.(id);
    }

    // eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this  -- Need access to app. Actively use globalThis.
    if (globalThis.app.isMobile) {
      if (id === 'process' || id === 'node:process') {
        // eslint-disable-next-line no-console -- Valid usage.
        console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
        // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
        return globalThis.process;
      }
    } else {
      const module = originalRequire?.(id);
      if (module) {
        return extractDefault(module);
      }
    }

    // eslint-disable-next-line no-console -- Valid usage.
    console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
    return {};
  }
})();

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var console_debug_component_exports = {};
__export(console_debug_component_exports, {
  ConsoleDebugComponent: () => ConsoleDebugComponent
});
module.exports = __toCommonJS(console_debug_component_exports);
var import_debug = require('../../debug.cjs');
var import_component_ex = require('./component-ex.cjs');
class ConsoleDebugComponent extends import_component_ex.ComponentEx {
  /**
   * Creates a new console debug component.
   *
   * @param pluginId - The plugin ID (used as the debugger namespace).
   */
  constructor(pluginId) {
    super();
    this.pluginId = pluginId;
  }
  pluginId;
  /**
   * Logs a message to the console under the plugin's debugger namespace.
   *
   * @param message - The message to log.
   * @param args - Additional arguments to log.
   */
  consoleDebug(message, ...args) {
    this.ensureLoaded();
    const FRAMES_TO_SKIP = 1;
    const pluginDebugger = (0, import_debug.getDebugger)(this.pluginId, FRAMES_TO_SKIP);
    pluginDebugger(message, ...args);
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ConsoleDebugComponent
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2NvbXBvbmVudHMvY29uc29sZS1kZWJ1Zy1jb21wb25lbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBDb21wb25lbnQgdGhhdCBwcm92aWRlcyBuYW1lc3BhY2VkIGNvbnNvbGUgZGVidWcgbG9nZ2luZy5cbiAqL1xuXG5pbXBvcnQgeyBnZXREZWJ1Z2dlciB9IGZyb20gJy4uLy4uL2RlYnVnLnRzJztcbmltcG9ydCB7IENvbXBvbmVudEV4IH0gZnJvbSAnLi9jb21wb25lbnQtZXgudHMnO1xuXG4vKipcbiAqIFByb3ZpZGVzIGEgbmFtZXNwYWNlZCBgY29uc29sZURlYnVnKClgIG1ldGhvZCBmb3IgbG9nZ2luZy5cbiAqXG4gKiBNZXNzYWdlcyBhcmUgbm90IHNob3duIGJ5IGRlZmF1bHQgXHUyMDE0IGVuYWJsZSB0aGUgcGx1Z2luJ3MgZGVidWdnZXIgbmFtZXNwYWNlIHRvIHNlZSB0aGVtLlxuICpcbiAqIEBzZWUge0BsaW5rIGh0dHBzOi8vZ2l0aHViLmNvbS9tbmFvdW1vdi9vYnNpZGlhbi1kZXYtdXRpbHMvYmxvYi9tYWluL2RvY3MvZGVidWdnaW5nLm1kfSBmb3IgbW9yZSBpbmZvcm1hdGlvbi5cbiAqL1xuZXhwb3J0IGNsYXNzIENvbnNvbGVEZWJ1Z0NvbXBvbmVudCBleHRlbmRzIENvbXBvbmVudEV4IHtcbiAgLyoqXG4gICAqIENyZWF0ZXMgYSBuZXcgY29uc29sZSBkZWJ1ZyBjb21wb25lbnQuXG4gICAqXG4gICAqIEBwYXJhbSBwbH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