{"version":3,"file":"routeRegistryStore.mjs","names":["create","RouteConfig","isPublic","attemptSilentAuth","RouteRegistryState","currentPath","routeMap","Record","isCurrentRouteInitialized","setPath","path","registerRoute","config","useRouteRegistry","set","window","location","pathname","state","undefined","nextRouteMap","currentRouteConfig","getRouteConfig","getState","getCurrentRouteInitialized"],"sources":["../../src/routes/routeRegistryStore.ts"],"sourcesContent":["import { create } from 'zustand';\n\nexport interface RouteConfig {\n  isPublic: boolean;\n  attemptSilentAuth?: boolean;\n}\n\ninterface RouteRegistryState {\n  currentPath: string;\n  routeMap: Record<string, RouteConfig>;\n  isCurrentRouteInitialized: boolean;\n  setPath: (path: string) => void;\n  registerRoute: (path: string, config: RouteConfig) => void;\n}\n\nexport const useRouteRegistry = create<RouteRegistryState>((set) => ({\n  currentPath: window.location.pathname,\n  routeMap: {},\n  isCurrentRouteInitialized: false,\n\n  setPath: (path) =>\n    set((state) => ({\n      currentPath: path,\n      isCurrentRouteInitialized:\n        state.routeMap[path]?.isPublic !== undefined\n    })),\n\n  registerRoute: (path, config) =>\n    set((state) => {\n      const nextRouteMap = {\n        ...state.routeMap,\n        [path]: config\n      };\n      const currentRouteConfig = nextRouteMap[state.currentPath];\n\n      return {\n        routeMap: nextRouteMap,\n        isCurrentRouteInitialized:\n          currentRouteConfig?.isPublic !== undefined\n      };\n    }),\n}));\n\n// Helper to access state outside of React components (e.g., in Axios/Fetch interceptors)\nexport const getRouteConfig = () => {\n  const state = useRouteRegistry.getState();\n  return state.routeMap[state.currentPath];\n};\n\nexport const getCurrentRouteInitialized = () => {\n  const state = useRouteRegistry.getState();\n  return state.isCurrentRouteInitialized;\n};\n"],"mappings":";;AAeA,MAAaa,mBAAmBb,QAA4Bc,SAAS;CACnET,aAAaU,OAAOC,SAASC;CAC7BX,UAAU,EAAE;CACZE,2BAA2B;CAE3BC,UAAUC,SACRI,KAAKI,WAAW;EACdb,aAAaK;EACbF,2BACEU,MAAMZ,SAASI,OAAOR,aAAaiB,KAAAA;EACtC,EAAE;CAELR,gBAAgBD,MAAME,WACpBE,KAAKI,UAAU;EACb,MAAME,eAAe;GACnB,GAAGF,MAAMZ;IACRI,OAAOE;GACT;AAGD,SAAO;GACLN,UAAUc;GACVZ,2BAJyBY,aAAaF,MAAMb,cAKtBH,aAAaiB,KAAAA;GACpC;GACF;CACJ,EAAE"}