import { useFetch as m } from "./useFetch.js";
import { useMemo as F } from "../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { useStores as f } from "./useStores.js";
import { useConfigContext as p } from "../core/ConfigContext/preact/context.js";
import { EMPTY_OBJECT as u } from "../utils/value/constants.js";
const C = (r, e) => {
  const { payByLinkFilters: t } = p().endpoints, {
    data: s,
    isFetching: o,
    error: i
  } = m(
    F(
      () => ({
        fetchOptions: { enabled: !!t && (e ?? !0), keepPrevData: !0 },
        queryFn: async () => t?.(u)
      }),
      [t, e]
    )
  ), { filteredStores: n, allStores: c, isFetching: a, error: l } = f(r);
  return {
    filters: s,
    stores: n,
    isFetching: a || o,
    allStores: c,
    filterError: i,
    storeError: l
  };
};
export {
  C as default
};
