/*
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 file_component_exports = {};
__export(file_component_exports, {
  FileComponent: () => FileComponent
});
module.exports = __toCommonJS(file_component_exports);
var import_css_class = require('../../css-class.cjs');
var import_typed_text_component = require('./typed-text-component.cjs');
class FileComponent extends import_typed_text_component.TypedTextComponent {
  /**
   * Creates a new file component.
   *
   * @param containerEl - The container element of the component.
   */
  constructor(containerEl) {
    super(containerEl, "file", import_css_class.CssClass.FileComponent);
  }
  /**
   * Gets the value of the component.
   *
   * @returns The value of the component.
   */
  getValue() {
    return this.inputEl.files?.[0] ?? null;
  }
  /**
   * Converts a string to a file.
   *
   * @returns The file.
   */
  valueFromString() {
    return this.getValue();
  }
  /**
   * Converts a file to a string.
   *
   * @param value - The file to convert.
   * @returns The string.
   */
  valueToString(value) {
    return value?.name ?? "";
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FileComponent
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL3NldHRpbmctY29tcG9uZW50cy9maWxlLWNvbXBvbmVudC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIENvbnRhaW5zIGEgY29tcG9uZW50IHRoYXQgZGlzcGxheXMgYW5kIGVkaXRzIGEgZmlsZS5cbiAqL1xuXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLXVudXNlZC12YXJzIC0tIFdlIG5lZWQgdG8gaW1wb3J0IGBpbml0UGx1Z2luQ29udGV4dGAgdG8gdXNlIGl0IGluIHRoZSB0c2RvY3MuXG5pbXBvcnQgdHlwZSB7IGluaXRQbHVnaW5Db250ZXh0IH0gZnJvbSAnLi4vcGx1Z2luL3BsdWdpbi1jb250ZXh0LnRzJztcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnMgLS0gV2UgbmVlZCB0byBpbXBvcnQgYFNldHRpbmdFeGAgdG8gdXNlIGl0IGluIHRoZSB0c2RvY3MuXG5pbXBvcnQgdHlwZSB7IFNldHRpbmdFeCB9IGZyb20gJy4uL3NldHRpbmctZXgudHMnO1xuXG5pbXBvcnQgeyBDc3NDbGFzcyB9IGZyb20gJy4uLy4uL2Nzcy1jbGFzcy50cyc7XG5pbXBvcnQgeyBUeXBlZFRleHRDb21wb25lbnQgfSBmcm9tICcuL3R5cGVkLXRleHQtY29tcG9uZW50LnRzJztcblxuLyoqXG4gKiBBIGNvbXBvbmVudCB0aGF0IGRpc3BsYXlzIGFuZCBlZGl0cyBhIGZpbGUuXG4gKlxuICogWW91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