import { jsx as m } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { DataGridContext as d } from "../hooks/useDataGridContext.js";
import { toChildArray as l } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
import { useMemo as f, useCallback as s } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
const c = ({ children: i }) => {
  const t = f(() => /* @__PURE__ */ new Map(), []), o = s(
    ({ column: r, width: e }) => {
      if (t.has(r)) {
        const n = t.get(r);
        e > n && t.set(r, e);
      } else
        t.set(r, e);
    },
    [t]
  ), a = s(
    (r) => t.get(r),
    [t]
  );
  return /* @__PURE__ */ m(d.Provider, { value: { registerCells: o, getMinWidthByColumn: a }, children: l(i) });
};
export {
  c as DataGridProvider
};
