'use client';


const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
let react_intlayer = require("react-intlayer");
let __intlayer_core = require("@intlayer/core");
let react = require("react");
let next_router_js = require("next/router.js");

//#region src/client/useLocalePageRouter.ts
const useLocalePageRouter = () => {
	const { push, pathname, reload } = (0, next_router_js.useRouter)();
	const pathWithoutLocale = (0, react.useMemo)(() => (0, __intlayer_core.getPathWithoutLocale)(pathname), [pathname]);
	return {
		...(0, react_intlayer.useLocale)({ onLocaleChange: (0, react.useCallback)((locale) => {
			push((0, __intlayer_core.getLocalizedUrl)(pathWithoutLocale, locale));
			return reload();
		}, [pathWithoutLocale]) }),
		pathWithoutLocale
	};
};

//#endregion
exports.useLocalePageRouter = useLocalePageRouter;
//# sourceMappingURL=useLocalePageRouter.cjs.map