import { jsx as r } from "react/jsx-runtime";
import { createContext as g, use as P, useLayoutEffect as F, useState as f, useMemo as b } from "react";
const s = g(null), d = (l) => {
  const i = P(s);
  return F(() => {
    l && i.configure(l);
  }, []), i;
};
function I({ children: l = void 0, ...i }) {
  const [e, u] = f({
    inFullPage: !1,
    showToggleButton: !1,
    headerVisibleInFullPage: !0,
    footerVisibleInFullPage: !1,
    sidebarVisibleInFullPage: !1
  }), a = () => {
    u((t) => ({ ...t, inFullPage: !t.inFullPage }));
  }, o = b(() => ({
    ...e,
    headerVisible: !e.inFullPage || e.headerVisibleInFullPage,
    footerVisible: !e.inFullPage || e.footerVisibleInFullPage,
    sidebarVisible: !e.inFullPage || e.sidebarVisibleInFullPage,
    toggleFullPage: a,
    configure: (t) => u((n) => ({ ...n, ...t }))
  }), [e]);
  return /* @__PURE__ */ r(s, { value: o, ...i, children: l });
}
export {
  s as FullPageContext,
  I as FullPageProvider,
  d as useFullPage
};
