"use strict";
const jsxRuntime = require("react/jsx-runtime");
const assert = require("assert");
const React = require("react");
const styles_lib_components_Box_Box_cjs = require("../Box/Box.cjs");
const styles_lib_components_Accordion_Accordion_cjs = require("../Accordion/Accordion.cjs");
const styles_lib_components_Page_Page_css_cjs = require("./Page.css.cjs");
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
const PageContext = React.createContext(false);
const Page = ({
  children,
  footer,
  footerPosition,
  data,
  ...restProps
}) => {
  assert__default.default(
    !React.useContext(PageContext),
    "Page components should not be nested within each other"
  );
  return /* @__PURE__ */ jsxRuntime.jsx(PageContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
    styles_lib_components_Box_Box_cjs.Box,
    {
      display: "flex",
      flexDirection: "column",
      className: styles_lib_components_Page_Page_css_cjs.fullHeight,
      ...styles_lib_components_Accordion_Accordion_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          styles_lib_components_Box_Box_cjs.Box,
          {
            flexGrow: footerPosition !== "belowFold" ? 1 : void 0,
            className: footerPosition === "belowFold" ? styles_lib_components_Page_Page_css_cjs.fullHeight : void 0,
            paddingBottom: "xxxlarge",
            children
          }
        ),
        footer
      ]
    }
  ) });
};
exports.Page = Page;
