import { useMemo as u, useCallback as S } from "../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { selectionOptionsFor as b } from "./utils.js";
import { listFrom as k } from "../../../../../../utils/collection/main.js";
const C = ({
  filterParam: o,
  filterValues: n,
  filters: s,
  defaultFilters: c,
  updateFilters: t,
  mapFilterOptionName: e
}) => {
  const p = u(() => k(s?.[o] ?? c?.[o] ?? ""), [c, s, o]), i = u(
    () => n && b(n, e),
    [n, e]
  ), m = S(
    ({ target: M }) => {
      t?.({ [o]: M?.value || "" });
    },
    [t, o]
  );
  return { selection: p, selectionOptions: i, updateSelection: m };
};
export {
  C as default,
  C as useMultiSelectionFilter
};
