/*
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 array_exports = {};
__export(array_exports, {
  filterInPlace: () => filterInPlace,
  unique: () => unique,
  uniqueInPlace: () => uniqueInPlace
});
module.exports = __toCommonJS(array_exports);
function filterInPlace(arr, predicate) {
  const length = arr.length;
  let writeIndex = 0;
  for (let readIndex = 0; readIndex < length; readIndex++) {
    if (!Object.hasOwn(arr, readIndex)) {
      continue;
    }
    const current = arr[readIndex];
    if (predicate(current, readIndex, arr)) {
      arr[writeIndex++] = current;
    }
  }
  arr.length = writeIndex;
}
function unique(arr) {
  const set = /* @__PURE__ */ new Set();
  return arr.filter((value) => {
    if (set.has(value)) {
      return false;
    }
    set.add(value);
    return true;
  });
}
function uniqueInPlace(arr) {
  const set = /* @__PURE__ */ new Set();
  filterInPlace(arr, (value) => {
    if (set.has(value)) {
      return false;
    }
    set.add(value);
    return true;
  });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  filterInPlace,
  unique,
  uniqueInPlace
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2FycmF5LnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQXJyYXkgdXRpbGl0aWVzLlxuICovXG5cbi8qKlxuICogRmlsdGVyIGFuIGFycmF5IGluIHBsYWNlLlxuICpcbiAqIEB0eXBlUGFyYW0gVCAtIFRoZSB0eXBlIG9mIHRoZSBhcnJheSBlbGVtZW50cy5cbiAqIEBwYXJhbSBhcnIgLSBUaGUgYXJyYXkgdG8gZmlsdGVyLlxuICogQHBhcmFtIHByZWRpY2F0ZSAtIFRoZSBwcmVkaWNhdGUgdG8gZmlsdGVyIHRoZSBhcnJheS5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGZpbHRlckluUGxhY2U8VD4oYXJyOiBUW10sIHByZWRpY2F0ZTogKHZhbHVlOiBULCBpbmRleDogbnVtYmVyLCBhcnJheTogVFtdKSA9PiBib29sZWFuKTogdm9pZCB7XG4gIGNvbnN0IGxlbmd0aCA9IGFyci5sZW5ndGg7XG4gIGxldCB3cml0ZUluZGV4ID0gMDtcbiAgZm9yIChsZXQgcmVhZEluZGV4ID0gMDsgcmVhZEluZGV4IDwgbGVuZ3RoOyByZWFkSW5kZXgrKykge1xuICAgIGlmICghT2JqZWN0Lmhhc093bihhcnIsIHJlYWRJbmRleCkpIHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH1cblxuICAgIGNvbnN0IGN1cnJlbnQgPSBhcnJbcmVhZEluZGV4XSBhcyBUO1xuICAgIGlmIChwcmVkaWNhdGUoY3VycmVudCwgcmVhZEluZGV4LCBhcnIpKSB7XG4gICAgICBhcnJbd3JpdGVJbmRleCsrXSA9IGN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