/*
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 dataview_link_exports = {};
__export(dataview_link_exports, {
  fixTitle: () => fixTitle,
  makeLinkWithPath: () => makeLinkWithPath
});
module.exports = __toCommonJS(dataview_link_exports);
var import_path = require('../path.cjs');
var import_file_system = require('./file-system.cjs');
function fixTitle(dv, pathOrFile, isFolderNote) {
  const path = (0, import_file_system.getPath)(dv.app, pathOrFile);
  const ext = (0, import_path.extname)(path);
  const title = isFolderNote ? (0, import_path.basename)((0, import_path.dirname)(path)) : (0, import_path.basename)(path, ext);
  return dv.fileLink(path, false, title);
}
function makeLinkWithPath(link) {
  return `${String(link)} (${link.path})`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  fixTitle,
  makeLinkWithPath
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2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