"use client";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { cache } from "@emotion/css";
import createEmotionServer from "@emotion/server/create-instance";
import NextDocument, {
  Head,
  Html,
  Main,
  NextScript
} from "next/document";
import { StyleTagSSR } from "../runtimes/react/root-style-registry";
class Document extends NextDocument {
  static async getInitialProps(ctx) {
    const initialProps = await NextDocument.getInitialProps(ctx);
    const { extractCritical } = createEmotionServer(cache);
    const { ids, css } = extractCritical(initialProps.html);
    return {
      ...initialProps,
      styles: /* @__PURE__ */ jsxs(Fragment, { children: [
        initialProps.styles,
        /* @__PURE__ */ jsx(StyleTagSSR, { cacheKey: cache.key, classNames: ids, css })
      ] })
    };
  }
  render() {
    return /* @__PURE__ */ jsxs(Html, { children: [
      /* @__PURE__ */ jsx(Head, {}),
      /* @__PURE__ */ jsxs("body", { children: [
        /* @__PURE__ */ jsx(Main, {}),
        /* @__PURE__ */ jsx(NextScript, {})
      ] })
    ] });
  }
}
export {
  Document
};
//# sourceMappingURL=document.js.map