import './global.css';
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../chunk-BN4qSVkS.cjs");
const require_styles_breakpoints = require("./breakpoints.cjs");
const require_styles_themes = require("./themes.cjs");
const require_styles_common = require("./common.cjs");
const require_styles_constants = require("./constants.cjs");
let react = require("react");
let _emotion_react = require("@emotion/react");
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
require("react-tooltip/dist/react-tooltip.css");
//#region src/styles/global.tsx
const getFontImport = (theme) => {
	let importStr = "";
	const fontStrs = [];
	const interStr = "Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900";
	const manropeStr = "Manrope:wght@200..800";
	const montserratStr = "Montserrat:ital,wght@0,100..900;1,100..900";
	const robotoMonoStr = "Roboto+Mono:ital,wght@0,100..700;1,100..700";
	const suisseIntlStr = "Suisse+Intl:wght@100..900";
	const suisseIntlMonoStr = "Suisse+Intl+Mono:wght@100..900";
	if (theme.typography.fontFamilies.main === "Inter") fontStrs.push(interStr);
	else if (theme.typography.fontFamilies.main === "Manrope") fontStrs.push(manropeStr);
	else if (theme.typography.fontFamilies.main === "Montserrat") fontStrs.push(montserratStr);
	else if (theme.typography.fontFamilies.main === "SuisseIntl") fontStrs.push(suisseIntlStr);
	if (theme.typography.fontFamilies.code === "Roboto Mono") fontStrs.push(robotoMonoStr);
	else if (theme.typography.fontFamilies.code === "SuisseIntl-Mono") fontStrs.push(suisseIntlMonoStr);
	if (fontStrs.length) importStr = `@import url('https://fonts.googleapis.com/css2?family=${fontStrs.join("&family=")}&display=swap');`;
	return importStr;
};
const getFontsBase = () => {
	try {
		return `${{}.env.BASE_URL.replace(/\/$/, "")}/fonts`;
	} catch {
		return "/fonts";
	}
};
const getFontFaces = (theme) => {
	let fontFacesStr = "";
	if (theme.typography.fontFamilies.main === "SuisseIntl") {
		const fontsBase = getFontsBase();
		fontFacesStr += `
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Light.woff2") format("woff2");
        font-weight: 300;
        font-style: normal;
        font-display: swap;
      }
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Regular.woff2") format("woff2");
        font-weight: 400;
        font-style: normal;
        font-display: swap;
      }
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Book.woff2") format("woff2");
        font-weight: 450;
        font-style: normal;
        font-display: swap;
      }
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Medium.woff2") format("woff2");
        font-weight: 500;
        font-style: normal;
        font-display: swap;
      }
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Semibold.woff2") format("woff2");
        font-weight: 600;
        font-style: normal;
        font-display: swap;
      }
      @font-face {
        font-family: "SuisseIntl";
        src: url("${fontsBase}/SuisseIntl-Bold.woff2") format("woff2");
        font-weight: 700;
        font-style: normal;
        font-display: swap;
      }
    `;
	}
	if (theme.typography.fontFamilies.code === "SuisseIntl-Mono") {
		const fontsBase = getFontsBase();
		fontFacesStr += `
      @font-face {
        font-family: "SuisseIntl-Mono";
        src: url("${fontsBase}/SuisseIntlMono-Regular.woff2") format("woff2");
        font-weight: 400;
        font-style: normal;
        font-display: swap;
      }
    `;
	}
	return fontFacesStr;
};
const globalComponentStyles = ({ theme }) => _emotion_react.css`
  ${getFontImport(theme)};
  ${getFontFaces(theme)};

  html {
    font-size: ${require_styles_common.rootFontSizeRems}rem;
    color: ${theme.text};

    /* required for iOS https://bit.ly/3Q8syG8 */
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
  }

  body {
    font-family: ${theme.typography.fontFamilies.main}, sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    &:before {
      position: absolute;
      visibility: hidden;
    }

    ${require_styles_breakpoints.bp.sm(`&:before { content: "sm"; }`)}
    ${require_styles_breakpoints.bp.minSmMaxMd(`&:before { content: "minSmMaxMd"; }`)}
      ${require_styles_breakpoints.bp.minMdMaxLg(`&:before { content: "minMdMaxLg"; }`)}
    ${require_styles_breakpoints.bp.lg(`&:before { content: "lg"; }`)}
  }

  * {
    box-sizing: border-box;
    line-height: ${require_styles_common.standardLineHeightEms}em;
  }

  code {
    font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
      monospace;
  }

  a {
    color: #0d6efd;
    text-decoration: none;
  }

  .pretty-scrollbar {
    scrollbar-width: auto;
    scrollbar-color: #333333 #000000;
  }

  .pretty-scrollbar::-webkit-scrollbar {
    width: 16px;
  }

  .pretty-scrollbar::-webkit-scrollbar-track {
    background: #000000;
  }

  .pretty-scrollbar::-webkit-scrollbar-thumb {
    background-color: #333333;
    border-radius: 10px;
    border: 3px solid #000000;
  }

  *:focus-visible {
    outline: ${theme.hcNeutral} dashed 1px;
  }

  strong {
    font-weight: 700;
  }

  // Recaptcha badge invisibility
  .grecaptcha-badge {
    visibility: hidden;
  }
`;
function GlobalStyles() {
	const theme = (0, _emotion_react.useTheme)();
	const bg = require_styles_themes.useThemeBg();
	(0, react.useEffect)(() => {
		const documentHeight = () => {
			document.documentElement.style.setProperty(require_styles_constants.cssVars.docHeight, `${window.innerHeight}px`);
		};
		window.addEventListener("resize", documentHeight);
		documentHeight();
		return () => window.removeEventListener("resize", documentHeight);
	}, []);
	return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(_emotion_react.Global, { styles: _emotion_react.css`
    ${globalComponentStyles({ theme })}

    :root {
      ${require_styles_constants.cssVars.docHeight}: 100vh;
      --rt-opacity: 1 !important;
      --rt-transition-show-delay: 0.15s !important;
      --rt-transition-closing-delay: 0.2s !important;
    }

    html {
      background: ${bg};
    }

    body {
      height: 100%;
      margin: 0;
      min-height: var(${require_styles_constants.cssVars.docHeight});
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: auto;
    }

    [id="root"] {
      height: 100%;
    }
  ` });
}
//#endregion
exports.GlobalStyles = GlobalStyles;
exports.globalComponentStyles = globalComponentStyles;
