export { t as Toast } from './toastController-7495e3c9.js';
export { l as FileFormatUtils } from './languageUtils-d43f5d69.js';
import { g as getMode } from './index-15028158.js';
import { g as getMode$1 } from './mode-e9fa2ced.js';
import './_commonjsHelpers-8a9f3b18.js';

const loadFonts = async (fontFamilies) => {
  if (window === undefined || document === undefined)
    return;
  const WebFont = await import('./webfontloader-7ddcbc0a.js').then(function (n) { return n.w; });
  let families = fontFamilies;
  if (!families) {
    const mode = getMode(document.documentElement);
    families =
      mode === 'material'
        ? ['Roboto', 'IBM Plex Mono']
        : ['Montserrat:400,600', 'Lato:400,400i,700,700i', 'IBM Plex Mono'];
  }
  WebFont.load({
    google: {
      families,
    },
  });
};

// These version numbers are automatically updated when releasing new versions.
// see `../../scripts/prepare.mjs`
const stencilaThemeVersion = '0.27.1';
const materialThemeVersion = '0.16.1';
// Inject theme CSS variables depending on the `mode` attribute
const injectThemeVariables = () => {
  const mode = getMode$1(document.documentElement);
  const themeName = mode === 'material' ? 'material' : 'stencila';
  const themeVersion = mode === 'material' ? materialThemeVersion : stencilaThemeVersion;
  const themeVariables = document.createElement('link');
  themeVariables.rel = 'stylesheet';
  themeVariables.href = `https://unpkg.com/@stencila/style-${themeName}@${themeVersion !== null && themeVersion !== void 0 ? themeVersion : 'latest'}/dist/variables.css`;
  document.head.prepend(themeVariables);
};

export { injectThemeVariables, loadFonts };

//# sourceMappingURL=index.js.map