import { create } from "zustand";
//#region src/routes/routeRegistryStore.ts
const useRouteRegistry = create((set) => ({
	currentPath: window.location.pathname,
	routeMap: {},
	isCurrentRouteInitialized: false,
	setPath: (path) => set((state) => ({
		currentPath: path,
		isCurrentRouteInitialized: state.routeMap[path]?.isPublic !== void 0
	})),
	registerRoute: (path, config) => set((state) => {
		const nextRouteMap = {
			...state.routeMap,
			[path]: config
		};
		return {
			routeMap: nextRouteMap,
			isCurrentRouteInitialized: nextRouteMap[state.currentPath]?.isPublic !== void 0
		};
	})
}));
const getRouteConfig = () => {
	const state = useRouteRegistry.getState();
	return state.routeMap[state.currentPath];
};
const getCurrentRouteInitialized = () => {
	return useRouteRegistry.getState().isCurrentRouteInitialized;
};
//#endregion
export { getCurrentRouteInitialized, getRouteConfig, useRouteRegistry };

//# sourceMappingURL=routeRegistryStore.mjs.map