import { n as __toESM } from "../_runtime.mjs";
import { I as require_jsx_runtime } from "../_libs/@radix-ui/react-alert-dialog+[...].mjs";
import { u as require_react } from "../_libs/@floating-ui/react-dom+[...].mjs";
import { t as QueryClient } from "../_libs/tanstack__query-core.mjs";
import { n as QueryClientProvider } from "../_libs/tanstack__react-query.mjs";
import { t as Toaster } from "../_libs/sonner.mjs";
import { A as redirect, c as HeadContent, d as createRouter, f as Outlet, g as Link, h as createRootRouteWithContext, m as createFileRoute, p as lazyRouteComponent, s as Scripts, v as useRouter } from "../_libs/@tanstack/react-router+[...].mjs";
import { t as Route$20 } from "./upload._division.index-CxdBOqO8.mjs";
import { t as Route$21 } from "./upload._division._aen.index-DOvmEXbR.mjs";
import { t as Route$22 } from "./upload._division._aen._uploadId-BfhsEH2w.mjs";
//#region node_modules/.nitro/vite/services/ssr/assets/router-BF6msNUC.js
var import_react = /* @__PURE__ */ __toESM(require_react());
var import_jsx_runtime = require_jsx_runtime();
var styles_default = "/assets/styles-DxDjR0PL.css";
function reportLovableError(error, context = {}) {
	if (typeof window === "undefined") return;
	window.__lovableEvents?.captureException?.(error, {
		source: "react_error_boundary",
		route: window.location.pathname,
		...context
	}, {
		mechanism: "react_error_boundary",
		handled: false,
		severity: "error"
	});
}
function NotFoundComponent() {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
		className: "flex min-h-screen items-center justify-center bg-background px-4",
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
			className: "max-w-md text-center",
			children: [
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
					className: "text-7xl font-bold text-foreground",
					children: "404"
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
					className: "mt-4 text-xl font-semibold",
					children: "Page not found"
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
					className: "mt-2 text-sm text-muted-foreground",
					children: "The page you're looking for doesn't exist."
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
					to: "/",
					className: "mt-6 inline-flex items-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
					children: "Go home"
				})
			]
		})
	});
}
function ErrorComponent({ error, reset }) {
	const router = useRouter();
	(0, import_react.useEffect)(() => {
		reportLovableError(error, { boundary: "root" });
	}, [error]);
	return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
		className: "flex min-h-screen items-center justify-center bg-background px-4",
		children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
			className: "max-w-md text-center",
			children: [
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
					className: "text-xl font-semibold",
					children: "This page didn't load"
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
					className: "mt-2 text-sm text-muted-foreground",
					children: error.message
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
					onClick: () => {
						router.invalidate();
						reset();
					},
					className: "mt-6 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
					children: "Try again"
				})
			]
		})
	});
}
var Route$19 = createRootRouteWithContext()({
	head: () => ({
		meta: [
			{ charSet: "utf-8" },
			{
				name: "viewport",
				content: "width=device-width, initial-scale=1"
			},
			{ title: "ER-SPRMS — Eastern Railway Safety Performance & Risk Monitoring" },
			{
				name: "description",
				content: "Division-wise, AEN-wise and SSE-wise monitoring of track-maintenance compliance, risk and rankings across Eastern Railway divisions."
			},
			{
				property: "og:title",
				content: "ER-SPRMS — Eastern Railway Safety Performance & Risk Monitoring"
			},
			{
				property: "og:description",
				content: "Real-time compliance, risk and ranking dashboards for track maintenance across Eastern Railway divisions."
			},
			{
				property: "og:type",
				content: "website"
			},
			{
				name: "twitter:card",
				content: "summary_large_image"
			}
		],
		links: [{
			rel: "stylesheet",
			href: styles_default
		}, {
			rel: "icon",
			href: "/favicon.ico",
			type: "image/x-icon"
		}]
	}),
	shellComponent: RootShell,
	component: RootComponent,
	notFoundComponent: NotFoundComponent,
	errorComponent: ErrorComponent
});
function RootShell({ children }) {
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("html", {
		lang: "en",
		children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("head", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadContent, {}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("body", { children: [children, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Scripts, {})] })]
	});
}
function RootComponent() {
	const { queryClient } = Route$19.useRouteContext();
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(QueryClientProvider, {
		client: queryClient,
		children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toaster, {
			position: "top-right",
			richColors: true
		})]
	});
}
var $$splitComponentImporter$17 = () => import("./auth-BaEhufL_.mjs");
var Route$18 = createFileRoute("/auth")({
	head: () => ({ meta: [{ title: "Sign in — ER-SPRMS" }, {
		name: "robots",
		content: "noindex"
	}] }),
	component: lazyRouteComponent($$splitComponentImporter$17, "component")
});
var $$splitComponentImporter$16 = () => import("./route-C6wQVB0r.mjs");
var Route$17 = createFileRoute("/_authenticated")({ component: lazyRouteComponent($$splitComponentImporter$16, "component") });
var Route$16 = createFileRoute("/")({ beforeLoad: () => {
	throw redirect({ to: "/dashboard" });
} });
var $$splitComponentImporter$15 = () => import("./upload-DCuUoBdJ.mjs");
var Route$15 = createFileRoute("/_authenticated/upload")({ component: lazyRouteComponent($$splitComponentImporter$15, "component") });
var $$splitComponentImporter$14 = () => import("./trends-gAXB-Sdg.mjs");
var Route$14 = createFileRoute("/_authenticated/trends")({
	head: () => ({ meta: [{ title: "Trends — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$14, "component")
});
var $$splitComponentImporter$13 = () => import("./sse-performance-Bq_HUhVR.mjs");
var Route$13 = createFileRoute("/_authenticated/sse-performance")({
	head: () => ({ meta: [{ title: "SSE Performance — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$13, "component")
});
var $$splitComponentImporter$12 = () => import("./risk-centre-BVz5Pney.mjs");
var Route$12 = createFileRoute("/_authenticated/risk-centre")({
	head: () => ({ meta: [{ title: "Risk Command Centre — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$12, "component")
});
var $$splitComponentImporter$11 = () => import("./reports-RNK3VnIM.mjs");
var Route$11 = createFileRoute("/_authenticated/reports")({
	head: () => ({ meta: [{ title: "Reports & Exports — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$11, "component")
});
var $$splitComponentImporter$10 = () => import("./rankings-BogjdnzC.mjs");
var Route$10 = createFileRoute("/_authenticated/rankings")({
	head: () => ({ meta: [{ title: "Rankings & Scorecards — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$10, "component")
});
var $$splitComponentImporter$9 = () => import("./item-risk-BepXu-lC.mjs");
var Route$9 = createFileRoute("/_authenticated/item-risk")({
	head: () => ({ meta: [{ title: "Item Risk Dashboard — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$9, "component")
});
var $$splitComponentImporter$8 = () => import("./heat-maps-4mSGqr4U.mjs");
var Route$8 = createFileRoute("/_authenticated/heat-maps")({
	head: () => ({ meta: [{ title: "Heat Maps — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$8, "component")
});
var $$splitComponentImporter$7 = () => import("./division-performance-DmXSTcU4.mjs");
var Route$7 = createFileRoute("/_authenticated/division-performance")({
	head: () => ({ meta: [{ title: "Division Performance — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$7, "component")
});
var $$splitComponentImporter$6 = () => import("./data-sheets-pkNbMuvv.mjs");
var Route$6 = createFileRoute("/_authenticated/data-sheets")({
	head: () => ({ meta: [{ title: "Division Data Sheets — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$6, "component")
});
var $$splitComponentImporter$5 = () => import("./dashboard-DgUzJyX4.mjs");
var Route$5 = createFileRoute("/_authenticated/dashboard")({
	head: () => ({ meta: [{ title: "Executive Dashboard — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$5, "component")
});
var $$splitComponentImporter$4 = () => import("./audit-log-BOLYAD5B.mjs");
var Route$4 = createFileRoute("/_authenticated/audit-log")({
	head: () => ({ meta: [{ title: "Audit Log — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$4, "component")
});
var $$splitComponentImporter$3 = () => import("./alerts-B95cRnI9.mjs");
var Route$3 = createFileRoute("/_authenticated/alerts")({
	head: () => ({ meta: [{ title: "Alerts & Exceptions — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$3, "component")
});
var $$splitComponentImporter$2 = () => import("./aen-performance-Cpse0JhD.mjs");
var Route$2 = createFileRoute("/_authenticated/aen-performance")({
	head: () => ({ meta: [{ title: "AEN Performance — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$2, "component")
});
var $$splitComponentImporter$1 = () => import("./administration-u6pisG7_.mjs");
var Route$1 = createFileRoute("/_authenticated/administration")({
	head: () => ({ meta: [{ title: "Administration — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter$1, "component")
});
var $$splitComponentImporter = () => import("./upload.index-B-YVLwGz.mjs");
var Route = createFileRoute("/_authenticated/upload/")({
	head: () => ({ meta: [{ title: "Data Upload — ER-SPRMS" }] }),
	component: lazyRouteComponent($$splitComponentImporter, "component")
});
var AuthRoute = Route$18.update({
	id: "/auth",
	path: "/auth",
	getParentRoute: () => Route$19
});
var AuthenticatedRouteRoute = Route$17.update({
	id: "/_authenticated",
	getParentRoute: () => Route$19
});
var IndexRoute = Route$16.update({
	id: "/",
	path: "/",
	getParentRoute: () => Route$19
});
var AuthenticatedUploadRoute = Route$15.update({
	id: "/upload",
	path: "/upload",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedTrendsRoute = Route$14.update({
	id: "/trends",
	path: "/trends",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedSsePerformanceRoute = Route$13.update({
	id: "/sse-performance",
	path: "/sse-performance",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedRiskCentreRoute = Route$12.update({
	id: "/risk-centre",
	path: "/risk-centre",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedReportsRoute = Route$11.update({
	id: "/reports",
	path: "/reports",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedRankingsRoute = Route$10.update({
	id: "/rankings",
	path: "/rankings",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedItemRiskRoute = Route$9.update({
	id: "/item-risk",
	path: "/item-risk",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedHeatMapsRoute = Route$8.update({
	id: "/heat-maps",
	path: "/heat-maps",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedDivisionPerformanceRoute = Route$7.update({
	id: "/division-performance",
	path: "/division-performance",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedDataSheetsRoute = Route$6.update({
	id: "/data-sheets",
	path: "/data-sheets",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedDashboardRoute = Route$5.update({
	id: "/dashboard",
	path: "/dashboard",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedAuditLogRoute = Route$4.update({
	id: "/audit-log",
	path: "/audit-log",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedAlertsRoute = Route$3.update({
	id: "/alerts",
	path: "/alerts",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedAenPerformanceRoute = Route$2.update({
	id: "/aen-performance",
	path: "/aen-performance",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedAdministrationRoute = Route$1.update({
	id: "/administration",
	path: "/administration",
	getParentRoute: () => AuthenticatedRouteRoute
});
var AuthenticatedUploadIndexRoute = Route.update({
	id: "/",
	path: "/",
	getParentRoute: () => AuthenticatedUploadRoute
});
var AuthenticatedUploadDivisionIndexRoute = Route$20.update({
	id: "/$division/",
	path: "/$division/",
	getParentRoute: () => AuthenticatedUploadRoute
});
var AuthenticatedUploadDivisionAenIndexRoute = Route$21.update({
	id: "/$division/$aen/",
	path: "/$division/$aen/",
	getParentRoute: () => AuthenticatedUploadRoute
});
var AuthenticatedUploadRouteChildren = {
	AuthenticatedUploadIndexRoute,
	AuthenticatedUploadDivisionIndexRoute,
	AuthenticatedUploadDivisionAenUploadIdRoute: Route$22.update({
		id: "/$division/$aen/$uploadId",
		path: "/$division/$aen/$uploadId",
		getParentRoute: () => AuthenticatedUploadRoute
	}),
	AuthenticatedUploadDivisionAenIndexRoute
};
var AuthenticatedRouteRouteChildren = {
	AuthenticatedAdministrationRoute,
	AuthenticatedAenPerformanceRoute,
	AuthenticatedAlertsRoute,
	AuthenticatedAuditLogRoute,
	AuthenticatedDashboardRoute,
	AuthenticatedDataSheetsRoute,
	AuthenticatedDivisionPerformanceRoute,
	AuthenticatedHeatMapsRoute,
	AuthenticatedItemRiskRoute,
	AuthenticatedRankingsRoute,
	AuthenticatedReportsRoute,
	AuthenticatedRiskCentreRoute,
	AuthenticatedSsePerformanceRoute,
	AuthenticatedTrendsRoute,
	AuthenticatedUploadRoute: AuthenticatedUploadRoute._addFileChildren(AuthenticatedUploadRouteChildren)
};
var rootRouteChildren = {
	IndexRoute,
	AuthenticatedRouteRoute: AuthenticatedRouteRoute._addFileChildren(AuthenticatedRouteRouteChildren),
	AuthRoute
};
var routeTree = Route$19._addFileChildren(rootRouteChildren)._addFileTypes();
var getRouter = () => {
	return createRouter({
		routeTree,
		context: { queryClient: new QueryClient() },
		scrollRestoration: true,
		defaultPreloadStaleTime: 0
	});
};
//#endregion
export { getRouter };
