/*
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 validation_exports = {};
__export(validation_exports, {
  OBSIDIAN_UNSAFE_FILENAME_CHARS: () => OBSIDIAN_UNSAFE_FILENAME_CHARS,
  UNIX_UNSAFE_PATH_CHARS: () => UNIX_UNSAFE_PATH_CHARS,
  WINDOWS_UNSAFE_PATH_CHARS: () => WINDOWS_UNSAFE_PATH_CHARS,
  getOsAndObsidianUnsafePathCharsRegExp: () => getOsAndObsidianUnsafePathCharsRegExp,
  getOsUnsafePathCharsRegExp: () => getOsUnsafePathCharsRegExp,
  isValidationMessageHolder: () => isValidationMessageHolder
});
module.exports = __toCommonJS(validation_exports);
var import_obsidian = require('obsidian');
var import_reg_exp = require('../reg-exp.cjs');
function isValidationMessageHolder(value) {
  return value.validationMessage !== void 0;
}
const OBSIDIAN_UNSAFE_FILENAME_CHARS = /[#^[\]|]/g;
const WINDOWS_UNSAFE_PATH_CHARS = /[*\\/<>:|?"]/g;
const UNIX_UNSAFE_PATH_CHARS = /[\0/]/g;
function getOsAndObsidianUnsafePathCharsRegExp(isWindows) {
  return (0, import_reg_exp.oneOf)([
    getOsUnsafePathCharsRegExp(isWindows),
    OBSIDIAN_UNSAFE_FILENAME_CHARS
  ]);
}
function getOsUnsafePathCharsRegExp(isWindows) {
  isWindows ??= import_obsidian.Platform.isWin;
  return isWindows ? WINDOWS_UNSAFE_PATH_CHARS : UNIX_UNSAFE_PATH_CHARS;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  OBSIDIAN_UNSAFE_FILENAME_CHARS,
  UNIX_UNSAFE_PATH_CHARS,
  WINDOWS_UNSAFE_PATH_CHARS,
  getOsAndObsidianUnsafePathCharsRegExp,
  getOsUnsafePathCharsRegExp,
  isValidationMessageHolder
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL3ZhbGlkYXRpb24udHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBWYWxpZGF0aW9uIHV0aWxpdGllcy5cbiAqL1xuXG5pbXBvcnQgeyBQbGF0Zm9ybSB9IGZyb20gJ29ic2lkaWFuJztcblxuaW1wb3J0IHsgb25lT2YgfSBmcm9tICcuLi9yZWctZXhwLnRzJztcblxuLyoqXG4gKiBIb2xkcyBhIHZhbGlkYXRpb24gbWVzc2FnZS5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBWYWxpZGF0aW9uTWVzc2FnZUhvbGRlciB7XG4gIC8qKlxuICAgKiBBIHZhbGlkYXRpb24gbWVzc2FnZS5cbiAgICovXG4gIHZhbGlkYXRpb25NZXNzYWdlOiBzdHJpbmc7XG59XG5cbi8qKlxuICogVHlwZSBndWFyZCB0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