import { jsxs as s, jsx as r } from "@emotion/react/jsx-runtime";
import { createContext as c, useState as d, useCallback as l } from "react";
import { ModalDialog as f } from "../../components/ModalDialog/ModalDialog.js";
const p = c(null);
function x({ children: t }) {
  const [i, e] = d({
    open: !1,
    fullScreen: !1
  }), a = l((o) => {
    e({
      open: !0,
      initialWidth: 300,
      initialHeight: 350,
      ...o,
      isCloseable: o.isCloseable
    });
  }, []), n = l(() => {
    e((o) => ({ ...o, open: !1 }));
  }, []);
  return /* @__PURE__ */ s(
    p.Provider,
    {
      value: {
        ...i,
        openModal: a,
        closeModal: n
      },
      children: [
        t,
        /* @__PURE__ */ r(f, {})
      ]
    }
  );
}
export {
  p as ModalContext,
  x as ModalProvider
};
