var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
import { f as figcaptionToggleCssUrl } from "../chunks/chunk._figcaption-toggles.js?v=6.1.1";
import { b as buttonToggleCssUrl } from "../chunks/chunk._button-toggles.js?v=6.1.1";
import { a as loadStyleSheets } from "../chunks/chunk.dcf-utility.js?v=6.1.1";
let UNLFigcaptionToggle = null;
const querySelector = ".dcf-figcaption-toggle:not(.dcf-figcaption-toggle-initialized)", pluginType = "multi", pluginLoadAfterWatch = !1;
let isInitialized = !1, initializationPromise = null;
function getQuerySelector() {
  return querySelector;
}
__name(getQuerySelector, "getQuerySelector");
function getPluginType() {
  return pluginType;
}
__name(getPluginType, "getPluginType");
function getPluginLoadAfterWatch() {
  return pluginLoadAfterWatch;
}
__name(getPluginLoadAfterWatch, "getPluginLoadAfterWatch");
function getIsInitialized() {
  return isInitialized;
}
__name(getIsInitialized, "getIsInitialized");
async function initialize() {
  return isInitialized ? UNLFigcaptionToggle : (initializationPromise !== null || (initializationPromise = (async () => (UNLFigcaptionToggle = (await import("../components/component.figcaption-toggle.js?v=6.1.1")).default, await loadStyleSheets([buttonToggleCssUrl, figcaptionToggleCssUrl]), isInitialized = !0, document.dispatchEvent(new CustomEvent("UNLPluginInitialized", {
    detail: {
      pluginType,
      pluginComponent: UNLFigcaptionToggle,
      styleSheetsLoaded: [
        buttonToggleCssUrl,
        figcaptionToggleCssUrl
      ]
    }
  })), UNLFigcaptionToggle))()), initializationPromise);
}
__name(initialize, "initialize");
async function loadElement(element, options) {
  isInitialized || await initialize();
  const loadedElement = new UNLFigcaptionToggle(element, options);
  return document.dispatchEvent(new CustomEvent("UNLPluginLoadedElement", {
    detail: {
      loadedElement
    }
  })), loadedElement;
}
__name(loadElement, "loadElement");
async function loadElements(elements, options) {
  return await Promise.all(
    Array.from(elements).map((element) => loadElement(element, options))
  );
}
__name(loadElements, "loadElements");
async function loadElementsOnPage(options) {
  const allFigcaptionToggles = document.querySelectorAll(querySelector);
  return await loadElements(allFigcaptionToggles, options);
}
__name(loadElementsOnPage, "loadElementsOnPage");
export {
  getIsInitialized,
  getPluginLoadAfterWatch,
  getPluginType,
  getQuerySelector,
  initialize,
  loadElement,
  loadElements,
  loadElementsOnPage
};
//# sourceMappingURL=plugin.figcaption-toggle.js.map
