Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../chunk-BN4qSVkS.cjs");
let react = require("react");
let react_router_dom = require("react-router-dom");
//#region src/hooks/useQueryParams.tsx
function useQueryParams() {
	const { search } = (0, react_router_dom.useLocation)();
	return (0, react.useMemo)(() => new URLSearchParams(search), [search]);
}
function useQueryParamBoolean(param) {
	const queryParams = useQueryParams();
	return (0, react.useMemo)(() => queryParams.get(param) === "1", [queryParams, param]);
}
function useQueryParamBooleans(params) {
	const queryParams = useQueryParams();
	const prevParams = (0, react.useRef)(params);
	const memoizedParams = (0, react.useMemo)(() => {
		if (JSON.stringify(params) !== JSON.stringify(prevParams.current)) prevParams.current = params;
		return prevParams.current;
	}, [params]);
	return (0, react.useMemo)(() => {
		const result = {};
		for (const key in memoizedParams) {
			const param = memoizedParams[key];
			const value = queryParams.get(param);
			if (value === "1" || value === "true") result[key] = true;
			else if (value === "0" || value === "false") result[key] = false;
			else if (value === "") result[key] = true;
			else result[key] = void 0;
		}
		return result;
	}, [queryParams, memoizedParams]);
}
//#endregion
exports.useQueryParamBoolean = useQueryParamBoolean;
exports.useQueryParamBooleans = useQueryParamBooleans;
exports.useQueryParams = useQueryParams;
