{
  "version": 3,
  "sources": ["../../src/routing/types.ts", "../../src/routing/NavigateRouteEvent.ts", "../../src/errors.ts", "../../src/routing/NavigationHistory.ts", "../../src/routing/routeTargetRegistry.ts", "../../src/routing/routeMatching.ts", "../../src/routing/RouteLink.ts", "../../src/routing/RoutingTarget.ts", "../../src/routing/navigation.ts"],
  "sourcesContent": ["/** @internal */\r\ntype WebComponentConstructor = new (...args: any[]) => HTMLElement;\r\n\r\nexport enum GuardResult {\r\n    /**\r\n     * Handle route without checking more guards.\r\n     */\r\n    Allow,\r\n\r\n    /**\r\n     * Throw a RouteGuardError.\r\n     */\r\n    Deny,\r\n\r\n    /**\r\n     * Resume and check other guards.\r\n     */\r\n    Continue,\r\n\r\n    /**\r\n     * Do not invoke the rooute nor other guards.\r\n     */\r\n    Stop\r\n}\r\n\r\nexport interface RouteGuard {\r\n    check(route: RouteMatchResult): GuardResult;\r\n}\r\n\r\nexport interface Route {\r\n    name?: string;\r\n    target?: string;\r\n    path: string;\r\n\r\n    /**\r\n     * HTML file name (without extension).\r\n     *\r\n     * Define for instance if you have a route that requires a more limited layout. The library\r\n     * will automatically load that HTML file and rewrite URL history so that the correct url is displayed.\r\n     */\r\n    layout?: string;\r\n\r\n    /**\r\n     * Name of the tag for your web component.\r\n     */\r\n    componentTagName?: string;\r\n\r\n    /**\r\n     * Guards used to check if this route can be visited.\r\n     */\r\n    guards?: RouteGuard[];\r\n\r\n    component?: WebComponentConstructor;\r\n}\r\n\r\nexport type RouteParamType = string | number;\r\nexport type RouteData = Record<string, RouteParamType>;\r\n\r\n/**\r\n * Implement to receive typed route parameters via a `routeData` property.\r\n * RouteTarget assigns `routeData` after element creation but before DOM insertion.\r\n * Optional since it's not available at construction time.\r\n *\r\n * For convention-based usage without undefined checks, skip the interface\r\n * and declare `routeData` directly on your component.\r\n *\r\n * @example\r\n * class UserProfile extends HTMLElement implements Routable<{ userName: string }> {\r\n *     routeData?: { userName: string };\r\n * }\r\n */\r\nexport interface Routable<T extends RouteData = RouteData> {\r\n    routeData?: T;\r\n}\r\n\r\n/**\r\n * Implement to run async initialization before the component is added to the DOM.\r\n * RouteTarget calls `loadRoute()` and awaits it before inserting the element.\r\n *\r\n * @example\r\n * class OrderDetail extends HTMLElement implements LoadRoute<{ orderId: number }> {\r\n *     async loadRoute(data: { orderId: number }) {\r\n *         this.order = await fetchOrder(data.orderId);\r\n *     }\r\n * }\r\n */\r\nexport interface LoadRoute<T extends RouteData = RouteData> {\r\n    loadRoute(data: T): void | Promise<void>;\r\n}\r\n\r\n/**\r\n * Result from route matching operations.\r\n * Contains all information needed for navigation and rendering.\r\n */\r\nexport type RouteMatchResult = {\r\n    /**\r\n     * Matched route configuration\r\n     */\r\n    route: Route;\r\n\r\n    /**\r\n     * URL segments used for history state\r\n     */\r\n    urlSegments: string[];\r\n\r\n    /**\r\n     * Extracted and type-converted parameters\r\n     */\r\n    params: RouteData;\r\n\r\n    /**\r\n     * URL fragment without the leading `#`, or `undefined` when the URL had none.\r\n     *\r\n     * Kept separate from `params` because a fragment is an opaque string with no\r\n     * name. Unlike the query string it is never sent to the server, which is why\r\n     * activation and password reset links sometimes carry their token here.\r\n     */\r\n    fragment?: string;\r\n};\r\n\r\n/**\r\n * Supported types of route segments\r\n */\r\nexport type RouteSegmentType = 'string' | 'number' | 'path' | 'regex';\r\n\r\n/**\r\n * Strongly typed route segment value\r\n */\r\nexport interface RouteValue {\r\n    /**\r\n     * Type of parameter for validation\r\n     */\r\n    type: RouteSegmentType;\r\n\r\n    /**\r\n     * Actual parameter value\r\n     */\r\n    value: any;\r\n}\r\n\r\nexport class RouteError extends Error {}\r\nexport class RouteGuardError extends RouteError {\r\n    isGuard = true;\r\n}\r\n\r\nexport interface NavigateOptions {\r\n    /**\r\n     * Optional parameters when using route name\r\n     */\r\n    params?: Record<string, string | number>;\r\n\r\n    /**\r\n     * override for route's default target\r\n     */\r\n    target?: string;\r\n\r\n    /**\r\n     * When you want to override routes from the globally registered ones.\r\n     */\r\n    routes?: Route[];\r\n\r\n    /**\r\n     * URL fragment (without `#`) to hand to the component.\r\n     *\r\n     * Rarely set by hand. The router fills it in when it replays a navigation\r\n     * that crossed a layout switch.\r\n     */\r\n    fragment?: string;\r\n}\r\n", "import type { Route, RouteData } from './types';\r\n\r\n/**\r\n * Event sent to routing targets when a new route should be displayed.\r\n */\r\nexport class NavigateRouteEvent extends Event {\r\n    static NAME: string = 'rlx.navigateRoute';\r\n\r\n    /**\r\n     * Identifies the entry in the target's NavigationHistory and in\r\n     * `history.state.entryId`. Set by `navigate()` for every navigation.\r\n     * Optional only so old call-sites that constructed events manually keep\r\n     * compiling.\r\n     */\r\n    entryId?: number;\r\n\r\n    /**\r\n     * `true` when the event is a replay of a previously recorded navigation\r\n     * (e.g. triggered by browser back/forward or `navigateBack`/`navigateForward`).\r\n     * Tells the target registry to move its index instead of recording a new entry.\r\n     */\r\n    isReplay: boolean = false;\r\n\r\n    /**\r\n     * URL fragment without the leading `#`, or `undefined` when the URL had none.\r\n     *\r\n     * Survives a layout switch, so a component can rely on it even when the\r\n     * route loaded a different HTML file on the way in.\r\n     *\r\n     * @example\r\n     * document.addEventListener('rlx.navigateRoute', (e) => {\r\n     *     const resetToken = e.fragment;\r\n     * });\r\n     */\r\n    fragment?: string;\r\n\r\n    constructor(\r\n        /**\r\n         * Matched route.\r\n         */\r\n        public route: Route,\r\n\r\n        /**\r\n         * The generated url sements which can be used to push the url into the browser history.\r\n         */\r\n        public urlSegments: string[],\r\n\r\n        /**\r\n         * Data supplied to the route.\r\n         */\r\n        public routeData?: RouteData,\r\n\r\n        /**\r\n         * The target can differ from the default target that is defined in the route.\r\n         *\r\n         * undefined means that the default (unnamed) target should be used.\r\n         */\r\n        public routeTarget?: string,\r\n\r\n        eventInit?: EventInit\r\n    ) {\r\n        super(NavigateRouteEvent.NAME, eventInit);\r\n    }\r\n}\r\n\r\ndeclare global {\r\n    interface HTMLElementEventMap {\r\n        'rlx.navigateRoute': NavigateRouteEvent;\r\n    }\r\n    interface DocumentEventMap {\r\n        'rlx.navigateRoute': NavigateRouteEvent;\r\n    }\r\n}\r\n", "/**\r\n * Global error handling for Relaxjs.\r\n * Register a handler with `onError()` to intercept errors before they throw.\r\n * Call `ctx.suppress()` in the handler to prevent the error from being thrown.\r\n *\r\n * @example\r\n * import { onError } from 'relaxjs';\r\n *\r\n * onError((error, ctx) => {\r\n *     logToService(error.message, error.context);\r\n *     showToast(error.message);\r\n *     ctx.suppress();\r\n * });\r\n */\r\n\r\n/**\r\n * Passed to error handlers to control error behavior.\r\n * Call `suppress()` to prevent the error from being thrown.\r\n */\r\nexport interface ErrorContext {\r\n    suppress(): void;\r\n}\r\n\r\n/**\r\n * Error with structured context for debugging.\r\n * The `context` record contains details like route name, component tag, route data.\r\n *\r\n * @example\r\n * onError((error, ctx) => {\r\n *     console.log(error.context.route);\r\n *     console.log(error.context.componentTagName);\r\n * });\r\n */\r\nexport class RelaxError extends Error {\r\n    constructor(\r\n        message: string,\r\n        public context: Record<string, unknown>,\r\n    ) {\r\n        super(message);\r\n    }\r\n}\r\n\r\n/** @internal */\r\ntype ErrorHandler = (error: RelaxError, ctx: ErrorContext) => void;\r\n\r\nlet handler: ErrorHandler | null = null;\r\n\r\n/**\r\n * Registers a global error handler for Relaxjs errors.\r\n * The handler receives the error and an `ErrorContext`.\r\n * Call `ctx.suppress()` to prevent the error from being thrown.\r\n * Only one handler can be active at a time; subsequent calls replace the previous handler.\r\n *\r\n * @example\r\n * onError((error, ctx) => {\r\n *     if (error.context.route === 'optional-panel') {\r\n *         ctx.suppress();\r\n *         return;\r\n *     }\r\n *     showErrorDialog(error.message);\r\n * });\r\n */\r\nexport function onError(fn: ErrorHandler) {\r\n    handler = fn;\r\n}\r\n\r\n/**\r\n * Reports an error through the global handler.\r\n * Returns the `RelaxError` if it should be thrown, or `null` if the handler suppressed it.\r\n * The caller is responsible for throwing the returned error.\r\n *\r\n * @param message - Human-readable error description\r\n * @param context - Structured data for debugging (route, component, params, cause, etc.)\r\n * @returns The error to throw, or `null` if suppressed\r\n *\r\n * @example\r\n * const error = reportError('Failed to load route component', {\r\n *     route: 'user',\r\n *     componentTagName: 'user-profile',\r\n *     routeData: { id: 123 },\r\n * });\r\n * if (error) throw error;\r\n */\r\nexport function reportError(message: string, context: Record<string, unknown>): RelaxError | null {\r\n    const error = new RelaxError(message, context);\r\n    if (handler) {\r\n        let suppressed = false;\r\n        const ctx: ErrorContext = {\r\n            suppress() { suppressed = true; },\r\n        };\r\n        handler(error, ctx);\r\n        if (suppressed) {\r\n            return null;\r\n        }\r\n    }\r\n    return error;\r\n}\r\n\r\n/**\r\n * Wraps an async function into a synchronous callback suitable for addEventListener.\r\n * Catches promise rejections and reports them through the global error handler.\r\n *\r\n * @param fn - Async function to wrap\r\n * @returns Synchronous function that can be passed to addEventListener\r\n *\r\n * @example\r\n * button.addEventListener('click', asyncHandler(async (e) => {\r\n *     await saveData();\r\n * }));\r\n *\r\n * @example\r\n * form.addEventListener('submit', asyncHandler(async (e) => {\r\n *     e.preventDefault();\r\n *     await submitForm();\r\n * }));\r\n */\r\nexport function asyncHandler<TArgs extends unknown[]>(\r\n    fn: (...args: TArgs) => Promise<void>,\r\n): (...args: TArgs) => void {\r\n    return function (this: any, ...args: TArgs) {\r\n        fn.call(this, ...args).catch((cause: unknown) => {\r\n            const error = reportError('Async callback failed', { cause });\r\n            if (error) throw error;\r\n        });\r\n    };\r\n}\r\n", "import type { RouteData } from './types';\n\n/**\n * Single recorded navigation. Each `<r-route-target>` stores a stack of these\n * so it can replay previously rendered routes when the user navigates back\n * or forward.\n *\n * `entryId` correlates the entry with `history.state.entryId`, so the popstate\n * handler can find the right entry when the user clicks the browser's\n * back/forward buttons.\n */\nexport interface NavigationEntry {\n    routeName: string;\n    params: RouteData;\n    target?: string;\n    urlSegments: string[];\n    entryId: number;\n    fragment?: string;\n}\n\n/**\n * Encapsulated back/forward history for a single route target.\n * Behaves like the browser's own history stack: pushing a new entry while\n * the index sits in the middle of the stack truncates the forward entries.\n *\n * @example\n * const history = new NavigationHistory();\n * history.record({ routeName: 'home', params: {}, urlSegments: [''], entryId: 1 });\n * history.record({ routeName: 'user', params: { id: 'a' }, urlSegments: ['users', 'a'], entryId: 2 });\n * history.canGoBack();        // true\n * history.back();             // returns the 'home' entry\n * history.canGoForward();     // true\n */\nexport class NavigationHistory {\n    private entries: NavigationEntry[] = [];\n    private currentIndex = -1;\n\n    record(entry: NavigationEntry): void {\n        if (this.currentIndex < this.entries.length - 1) {\n            this.entries.length = this.currentIndex + 1;\n        }\n        this.entries.push(entry);\n        this.currentIndex = this.entries.length - 1;\n    }\n\n    canGoBack(): boolean {\n        return this.currentIndex > 0;\n    }\n\n    canGoForward(): boolean {\n        return this.currentIndex >= 0 && this.currentIndex < this.entries.length - 1;\n    }\n\n    back(): NavigationEntry | undefined {\n        if (!this.canGoBack()) return undefined;\n        this.currentIndex--;\n        return this.entries[this.currentIndex];\n    }\n\n    forward(): NavigationEntry | undefined {\n        if (!this.canGoForward()) return undefined;\n        this.currentIndex++;\n        return this.entries[this.currentIndex];\n    }\n\n    /**\n     * Move the index to the entry with the given `entryId`. Used by the\n     * popstate handler to keep the per-target index in sync with the\n     * browser's global history position.\n     */\n    setIndexById(entryId: number): NavigationEntry | undefined {\n        const found = this.entries.findIndex((e) => e.entryId === entryId);\n        if (found < 0) return undefined;\n        this.currentIndex = found;\n        return this.entries[found];\n    }\n\n    current(): NavigationEntry | undefined {\n        if (this.currentIndex < 0) return undefined;\n        return this.entries[this.currentIndex];\n    }\n\n    /** @internal Used by tests. */\n    size(): number {\n        return this.entries.length;\n    }\n}\n", "import { reportError } from '../errors';\nimport { NavigateRouteEvent } from './NavigateRouteEvent';\nimport { NavigationHistory, type NavigationEntry } from './NavigationHistory';\n\n/** @internal */\ntype RouteTargetHandler = (evt: NavigateRouteEvent) => void;\n\n/** @internal */\ninterface TargetRegistration {\n    handler: RouteTargetHandler;\n    history: NavigationHistory;\n}\n\nconst targets = new Map<string | undefined, TargetRegistration>();\nconst pendingEvents = new Map<string | undefined, NavigateRouteEvent>();\nconst detachedHistories = new Map<string | undefined, NavigationHistory>();\n\n/**\n * Registers a route target handler.\n * When a navigation event targets this name, the handler is called directly.\n * If a pending event exists for this target, it is replayed immediately.\n *\n * Each target owns a NavigationHistory that records every navigation it\n * handles. When a target reconnects after being removed (e.g. layout change),\n * its previous history is restored so back/forward keep working.\n *\n * @param name - Target name, or `undefined` for the default (unnamed) target\n * @param handler - Callback that receives the `NavigateRouteEvent`\n *\n * @example\n * registerRouteTarget('sidebar', (evt) => renderComponent(evt));\n */\nexport function registerRouteTarget(\n    name: string | undefined,\n    handler: RouteTargetHandler,\n) {\n    initRouteTargetListener();\n    if (targets.has(name)) {\n        const error = reportError('Duplicate route target', {\n            target: name ?? 'default',\n        });\n        if (error) throw error;\n        return;\n    }\n\n    const restoredHistory = detachedHistories.get(name);\n    const history = restoredHistory ?? new NavigationHistory();\n    detachedHistories.delete(name);\n    targets.set(name, { handler, history });\n\n    if (window.relaxDebug?.routing) {\n        console.log('[relaxjs:routing] target registered', name ?? 'default', {\n            historyRestored: restoredHistory !== undefined,\n        });\n    }\n\n    const pending = pendingEvents.get(name);\n    if (pending) {\n        pendingEvents.delete(name);\n        if (window.relaxDebug?.routing) {\n            console.log(\n                '[relaxjs:routing] replaying parked navigation into target',\n                name ?? 'default',\n                pending.route.name\n            );\n        }\n        dispatchToTarget(pending);\n    }\n}\n\n/**\n * Unregisters a previously registered route target handler.\n * The target's history is kept aside so it can be restored if a new target\n * with the same name reconnects later.\n *\n * @param name - Target name that was passed to `registerRouteTarget`\n */\nexport function unregisterRouteTarget(name: string | undefined) {\n    const reg = targets.get(name);\n    if (reg) {\n        detachedHistories.set(name, reg.history);\n    }\n    targets.delete(name);\n}\n\n/**\n * Returns the NavigationHistory for a named target, or `undefined` if no\n * target with that name is currently registered.\n *\n * Used by `navigateBack` / `navigateForward` / `canGoBack` / `canGoForward`\n * to read or walk a target's encapsulated stack.\n */\nexport function getTargetHistory(name?: string): NavigationHistory | undefined {\n    return targets.get(name)?.history;\n}\n\nexport function clearPendingNavigations() {\n    pendingEvents.clear();\n    targets.clear();\n    detachedHistories.clear();\n}\n\nfunction entryFromEvent(evt: NavigateRouteEvent): NavigationEntry | undefined {\n    if (evt.entryId === undefined) return undefined;\n    if (!evt.route.name) return undefined;\n    return {\n        routeName: evt.route.name,\n        params: evt.routeData ?? {},\n        target: evt.routeTarget,\n        urlSegments: evt.urlSegments,\n        entryId: evt.entryId,\n        fragment: evt.fragment,\n    };\n}\n\nfunction dispatchToTarget(evt: NavigateRouteEvent) {\n    const reg = targets.get(evt.routeTarget);\n    if (!reg) {\n        if (window.relaxDebug?.routing) {\n            console.log(\n                '[relaxjs:routing] no target registered, navigation parked',\n                evt.routeTarget ?? 'default',\n                evt.route.name,\n                {\n                    replacedParkedNavigation: pendingEvents.has(evt.routeTarget),\n                    registeredTargets: Array.from(targets.keys(), (name) => name ?? 'default'),\n                }\n            );\n        }\n        pendingEvents.set(evt.routeTarget, evt);\n        return;\n    }\n\n    if (evt.isReplay) {\n        if (evt.entryId !== undefined) {\n            reg.history.setIndexById(evt.entryId);\n        }\n    } else {\n        const entry = entryFromEvent(evt);\n        if (entry) {\n            reg.history.record(entry);\n        }\n    }\n\n    reg.handler(evt);\n}\n\nlet listenerAttached = false;\n\nexport function initRouteTargetListener() {\n    if (listenerAttached) return;\n    listenerAttached = true;\n    document.addEventListener(NavigateRouteEvent.NAME, (evt) => {\n        dispatchToTarget(evt as NavigateRouteEvent);\n    });\n}\n", "import type { Route, RouteData, RouteParamType, RouteMatchResult } from './types';\r\n\r\n/**\r\n * Route segment matcher interface.\r\n * Each segment type (string, number, path) implements this\r\n * for parameter extraction and validation.\r\n */\r\ninterface RouteSegment {\r\n    /**\r\n     * Parameter name when segment is dynamic (:name or ;id)\r\n     */\r\n    paramName?: string;\r\n\r\n    /**\r\n     * Validates if URL segment matches pattern\r\n     * @param value Segment from URL to validate\r\n     */\r\n    isMatch(value: string): boolean;\r\n\r\n    /**\r\n     * Converts URL segment to typed parameter\r\n     * @param pathValue Raw value from URL\r\n     */\r\n    getValue(pathValue: string): RouteParamType;\r\n}\r\n\r\n/**\r\n * Number parameter segment matcher.\r\n * Used for ;id style parameters that must be numbers.\r\n */\r\nclass NumberRouteSegment implements RouteSegment {\r\n    constructor(public paramName: string) {}\r\n    isMatch(value: string): boolean {\r\n        if (/^\\d+$/.test(value)) {\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    getValue(pathValue: string): RouteParamType {\r\n        if (/^\\d+$/.test(pathValue) === false) {\r\n            throw new Error(\r\n                `Path is not a number, parameter name '${this.paramName}', value: '${pathValue}'.`\r\n            );\r\n        }\r\n        return parseInt(pathValue);\r\n    }\r\n}\r\n\r\n/**\r\n * String parameter segment matcher.\r\n * Used for :name style parameters.\r\n */\r\nclass StringRouteSegment implements RouteSegment {\r\n    constructor(public paramName: string) {}\r\n    isMatch(_value: string): boolean {\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     *\r\n     * @param pathValue the route data (for route by name) or segment extracted from the url (for url routing).\r\n     * @returns\r\n     */\r\n    getValue(pathValue: string): RouteParamType {\r\n        return pathValue;\r\n    }\r\n}\r\n\r\n/**\r\n * Static path segment matcher.\r\n * Used for fixed URL parts like 'users' in /users/:id\r\n */\r\nclass PathRouteSegment implements RouteSegment {\r\n    constructor(public value: string) {}\r\n    isMatch(value: string): boolean {\r\n        return value == this.value;\r\n    }\r\n\r\n    getValue(_pathValue: string): RouteParamType {\r\n        return this.value;\r\n    }\r\n}\r\n\r\n/**\r\n * Internal route implementation that handles segment matching\r\n * and parameter extraction.\r\n */\r\nclass RouteImp {\r\n    constructor(public route: Route, private segments: RouteSegment[]) {}\r\n\r\n    /**\r\n     * Attempts to match URL segments against route pattern\r\n     * @param segments URL parts to match\r\n     * @returns Match result with parameters if successful\r\n     */\r\n    match(segments: string[]): RouteMatchResult | null {\r\n        if (segments.length != this.segments.length) {\r\n            return null;\r\n        }\r\n\r\n        const generatedSegments: string[] = [];\r\n        var params: RouteData = {};\r\n        for (let index = 0; index < segments.length; index++) {\r\n            const urlSegment = segments[index];\r\n            const ourSegment = this.segments[index];\r\n\r\n            if (!ourSegment.isMatch(urlSegment)) {\r\n                return null;\r\n            }\r\n\r\n            if (ourSegment.paramName) {\r\n                const value = ourSegment.getValue(urlSegment);\r\n                params[ourSegment.paramName] = value;\r\n                generatedSegments.push(value.toString());\r\n            } else {\r\n                generatedSegments.push(urlSegment);\r\n            }\r\n        }\r\n\r\n        return { route: this.route, params, urlSegments: generatedSegments };\r\n    }\r\n\r\n    /**\r\n     * Routing by name and route data, so generate the url segments.\r\n     * @param routeData Data to use in the URL.\r\n     * @returns Match result with parameters if successful\r\n     */\r\n    buildUrl(routeData: RouteData): RouteMatchResult | null {\r\n        const urlSegments: string[] = [];\r\n        const params: RouteData = {};\r\n\r\n        const lowerIndex: Record<string, string> = {};\r\n        for (const key of Object.keys(routeData)) {\r\n            lowerIndex[key.toLowerCase()] = key;\r\n        }\r\n\r\n        for (let index = 0; index < this.segments.length; index++) {\r\n            const ourSegment = this.segments[index];\r\n            if (ourSegment.paramName) {\r\n                let value = routeData[ourSegment.paramName];\r\n                if (value === undefined) {\r\n                    const matched = lowerIndex[ourSegment.paramName.toLowerCase()];\r\n                    if (matched !== undefined) {\r\n                        value = routeData[matched];\r\n                    }\r\n                }\r\n                if (!value) {\r\n                    throw new Error(\r\n                        `Route \"${\r\n                            this.route.name\r\n                        }\" did not get value for parameter \"${\r\n                            ourSegment.paramName\r\n                        }\" from the provided routeData: \"${JSON.stringify(\r\n                            routeData\r\n                        )}\".`\r\n                    );\r\n                }\r\n\r\n                params[ourSegment.paramName] = value;\r\n                urlSegments.push(value.toString());\r\n            } else {\r\n                urlSegments.push(ourSegment.getValue('').toString());\r\n            }\r\n        }\r\n\r\n        return { route: this.route, params, urlSegments };\r\n    }\r\n\r\n}\r\n\r\n/**\r\n * Match route by either name or URL pattern\r\n * @param routes Available routes\r\n * @param routeNameOrUrl Route name or URL to match\r\n * @param routeData Optional parameters for named routes\r\n */\r\nexport function matchRoute(\r\n    routes: Route[],\r\n    routeNameOrUrl: string,\r\n    routeData?: Record<string, string | any>\r\n): RouteMatchResult | null {\r\n    if (routeNameOrUrl === '' || routeNameOrUrl.indexOf('/') >= 0) {\r\n        return findRouteByUrl(routes, routeNameOrUrl || '/');\r\n    } else {\r\n        return findRouteByName(routes, routeNameOrUrl, routeData!);\r\n    }\r\n}\r\n\r\n/**\r\n * Find route by name and apply parameters\r\n * @param routes Available routes\r\n * @param name Route name to find\r\n * @param routeData Parameters to apply\r\n */\r\nexport function findRouteByName(\r\n    routes: Route[],\r\n    name: string,\r\n    routeData?: Record<string, string | any>\r\n): RouteMatchResult | null {\r\n    var route = routes.find((x) => x.name === name);\r\n    if (!route) {\r\n        return null;\r\n    }\r\n\r\n    var imp = generateRouteImp(route);\r\n    var result = imp.buildUrl(routeData ?? {});\r\n    return result;\r\n}\r\n\r\n/**\r\n * Find route matching URL pattern\r\n * @param routes Available routes\r\n * @param path URL to match\r\n */\r\nexport function findRouteByUrl(\r\n    routes: Route[],\r\n    path: string\r\n): RouteMatchResult | null {\r\n    const urlSegments = path.replace(/^\\/|\\/$/g, '').split('/');\r\n    const routeImps = generateRouteImps(routes);\r\n\r\n    for (let index = 0; index < routeImps.length; index++) {\r\n        const element = routeImps[index];\r\n        const m = element.match(urlSegments);\r\n        if (m) {\r\n            return m;\r\n        }\r\n    }\r\n\r\n    if (window.relaxDebug?.routing) {\r\n        console.log('[relaxjs:routing] no route matched url', path, {\r\n            urlSegments,\r\n            tried: routes.map((route) => ({\r\n                name: route.name,\r\n                path: route.path,\r\n                segmentCount: route.path.replace(/^\\/|\\/$/g, '').split('/').length,\r\n            })),\r\n        });\r\n    }\r\n\r\n    return null;\r\n}\r\n\r\n/**\r\n * Generate implementations for all routes\r\n */\r\nfunction generateRouteImps(routes: Route[]) {\r\n    const routeImps: RouteImp[] = [];\r\n    routes.forEach((route) => {\r\n        var imp = generateRouteImp(route);\r\n        routeImps.push(imp);\r\n    });\r\n\r\n    return routeImps;\r\n}\r\n\r\n/**\r\n * Generate implementation for single route\r\n * Parses URL pattern into segment matchers\r\n */\r\nfunction generateRouteImp(route: Route): RouteImp {\r\n    var impSegments: RouteSegment[] = [];\r\n    const segments = route.path.replace(/^\\/|\\/$/g, '').split('/');\r\n    segments.forEach((segment) => {\r\n        if (segment.substring(0, 1) == ':') {\r\n            impSegments.push(new StringRouteSegment(segment.substring(1)));\r\n        } else if (segment.substring(0, 1) === ';') {\r\n            impSegments.push(new NumberRouteSegment(segment.substring(1)));\r\n        } else {\r\n            impSegments.push(new PathRouteSegment(segment));\r\n        }\r\n    });\r\n\r\n    var imp = new RouteImp(route, impSegments);\r\n    return imp;\r\n}\r\n", "import {\n    navigate,\n    navigateBack,\n    navigateForward,\n    canGoBack,\n    canGoForward,\n} from './navigation';\nimport { RelaxError, reportError } from '../errors';\n\n/**\n * Direction values accepted by the `direction` attribute on `<r-link>`.\n * When set, the link triggers back/forward in the named target's history\n * instead of navigating to a route by name.\n */\nexport type RouteLinkDirection = 'back' | 'forward';\n\nexport class RouteLink extends HTMLElement {\n    static get observedAttributes() {\n        return ['name', 'target', 'params', 'direction'];\n    }\n\n    constructor() {\n        super();\n        this.addEventListener('click', e => this.handleClick(e));\n    }\n\n    private handleClick(e: MouseEvent)  {\n        e.preventDefault();\n\n        const direction = this.getAttribute('direction') as RouteLinkDirection | null;\n        if (direction === 'back' || direction === 'forward') {\n            this.handleDirectionClick(direction);\n            return;\n        }\n\n        const name = this.getAttribute('name');\n        if (!name) return;\n\n        const params: Record<string, string> = {};\n        for (const attr of Array.from(this.attributes)) {\n            if (attr.name.startsWith('param-')) {\n                const raw = attr.name.substring(6);\n                const paramName = raw.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());\n                params[paramName] = attr.value;\n            }\n        }\n\n        const paramsAttr = this.getAttribute('params');\n        let additionalParams: Record<string, string | number> | undefined;\n        if (paramsAttr) {\n            try {\n                const parsed = JSON.parse(paramsAttr);\n                additionalParams = parsed as Record<string, string | number>;\n            } catch (error) {\n                const err = reportError('Failed to parse route params', {\n                    element: 'r-link',\n                    params: paramsAttr,\n                    cause: error,\n                });\n                if (err) throw err;\n            }\n        }\n\n        const target = this.getAttribute('target');\n        if (additionalParams){\n            Object.assign(params, additionalParams);\n        }\n\n        try {\n            navigate(name, { params, target: target || undefined });\n        } catch (error) {\n            if (error instanceof RelaxError) throw error;\n            const reported = reportError('Navigation failed', {\n                element: 'r-link',\n                route: name,\n                params,\n                target,\n                cause: error,\n            });\n            if (reported) throw reported;\n        }\n    }\n\n    private handleDirectionClick(direction: RouteLinkDirection) {\n        const target = this.getAttribute('target') || undefined;\n        if (direction === 'back') {\n            if (!canGoBack(target)) return;\n            navigateBack(target);\n        } else {\n            if (!canGoForward(target)) return;\n            navigateForward(target);\n        }\n    }\n\n    connectedCallback() {\n        if (!this.hasAttribute('tabindex')) {\n            this.setAttribute('tabindex', '0');\n        }\n\n        this.style.cursor = 'pointer';\n        this.role = 'link';\n        this.updateDirectionState();\n    }\n\n    attributeChangedCallback(name: string) {\n        if (name === 'direction' || name === 'target') {\n            this.updateDirectionState();\n        }\n    }\n\n    /**\n     * Keeps `aria-disabled` in sync with whether the linked target has\n     * history to walk. Lets CSS react via `[aria-disabled=\"true\"]`.\n     */\n    private updateDirectionState() {\n        const direction = this.getAttribute('direction') as RouteLinkDirection | null;\n        if (direction !== 'back' && direction !== 'forward') {\n            this.removeAttribute('aria-disabled');\n            return;\n        }\n        const target = this.getAttribute('target') || undefined;\n        const available = direction === 'back' ? canGoBack(target) : canGoForward(target);\n        if (available) {\n            this.removeAttribute('aria-disabled');\n        } else {\n            this.setAttribute('aria-disabled', 'true');\n        }\n    }\n\n    disconnectedCallback() {\n        this.removeEventListener('click', this.handleClick);\n    }\n}\n", "import { registerRouteTarget, unregisterRouteTarget } from './routeTargetRegistry';\r\nimport type { NavigateRouteEvent } from './NavigateRouteEvent';\r\nimport type { RouteData, LoadRoute } from './types';\r\nimport { RelaxError, reportError } from '../errors';\r\n\r\n/**\r\n * How long a route waits for its component to appear in `customElements`\r\n * before saying so.\r\n *\r\n * A component behind a dynamic import may legitimately take a moment, so the\r\n * route keeps waiting after the warning rather than failing the navigation.\r\n */\r\nconst COMPONENT_REGISTRATION_WARNING_MS = 5000;\r\n\r\n/**\r\n * WebComponent that listens on the `NavigateRouteEvent` event to be able to switch route.\r\n *\r\n * Use the \"name\" attribute to make this non-default target.\r\n * Use the \"dialog\" attribute to render routes inside a native `<dialog>` element\r\n * with built-in focus trapping, backdrop, and Escape-to-close.\r\n *\r\n * @example\r\n * <r-route-target></r-route-target>\r\n * <r-route-target name=\"modal\" dialog></r-route-target>\r\n */\r\nexport class RouteTarget extends HTMLElement {\r\n    name?: string = undefined;\r\n    private dialog?: HTMLDialogElement;\r\n\r\n    connectedCallback() {\r\n        this.name = this.getAttribute('name') ?? undefined;\r\n\r\n        if (this.hasAttribute('dialog')) {\r\n            this.dialog = document.createElement('dialog');\r\n            this.dialog.addEventListener('close', () => {\r\n                this.dialog!.replaceChildren();\r\n            });\r\n            this.appendChild(this.dialog);\r\n        }\r\n\r\n        registerRouteTarget(this.name, (evt) => this.onNavigate(evt));\r\n    }\r\n\r\n    disconnectedCallback() {\r\n        unregisterRouteTarget(this.name);\r\n    }\r\n\r\n    private onNavigate(evt: NavigateRouteEvent) {\r\n        this.loadComponent(evt).catch((error) => {\r\n            if (!(error instanceof RelaxError)) {\r\n                error = reportError('Route navigation failed', {\r\n                    route: evt.route.name,\r\n                    routeTarget: evt.routeTarget,\r\n                    cause: error,\r\n                });\r\n            }\r\n            if (error) {\r\n                console.error(error);\r\n            }\r\n        });\r\n    }\r\n\r\n    private async loadComponent(evt: NavigateRouteEvent) {\r\n        const tagName = evt.route.componentTagName\r\n            ?? (evt.route.component ? customElements.getName(evt.route.component) : null);\r\n\r\n        if (!tagName) {\r\n            const error = reportError('Failed to find component for route', {\r\n                route: evt.route.name,\r\n                componentTagName: evt.route.componentTagName,\r\n                component: evt.route.component?.name,\r\n                routeData: evt.routeData,\r\n            });\r\n            if (error) throw error;\r\n            return;\r\n        }\r\n\r\n        await this.whenComponentRegistered(tagName, evt);\r\n        const element = document.createElement(tagName);\r\n\r\n        await this.applyRouteData(element, evt.routeData);\r\n\r\n        if (this.dialog) {\r\n            this.dialog.replaceChildren(element);\r\n            if (!this.dialog.open) {\r\n                this.dialog.showModal();\r\n            }\r\n            return;\r\n        }\r\n\r\n        await this.showPage(element);\r\n    }\r\n\r\n    /**\r\n     * Waits for the route's component to be registered.\r\n     *\r\n     * `customElements.whenDefined` never rejects, so a tag name that is never\r\n     * registered leaves the route waiting with nothing on screen and nothing in\r\n     * the console. The warning breaks that silence without giving up on a\r\n     * component that is merely slow to arrive.\r\n     */\r\n    private async whenComponentRegistered(tagName: string, evt: NavigateRouteEvent) {\r\n        if (customElements.get(tagName)) {\r\n            return;\r\n        }\r\n\r\n        const stillWaiting = setTimeout(() => {\r\n            console.warn(\r\n                `[relaxjs:routing] Route '${evt.route.name}' is waiting for <${tagName}> to be registered with customElements, and cannot render until it is. Check the tag name for typos, and that the module defining the component is imported.`\r\n            );\r\n        }, COMPONENT_REGISTRATION_WARNING_MS);\r\n\r\n        try {\r\n            await customElements.whenDefined(tagName);\r\n        } finally {\r\n            clearTimeout(stillWaiting);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Puts the page on screen, animated with a view transition when the browser supports one.\r\n     *\r\n     * The browser drops the animation when the tab is hidden or when the visitor navigates again\r\n     * before it has finished. That is normal browsing, not a failed navigation, so the dropped\r\n     * animation is not reported. The visitor must still get the new page, so the swap is done\r\n     * directly when the browser gave up before running it.\r\n     */\r\n    private async showPage(element: Element) {\r\n        if (!document.startViewTransition) {\r\n            this.replaceChildren(element);\r\n            return;\r\n        }\r\n\r\n        const transition = document.startViewTransition(() => this.replaceChildren(element));\r\n        transition.ready.catch(() => undefined);\r\n        transition.finished.catch(() => undefined);\r\n\r\n        try {\r\n            await transition.updateCallbackDone;\r\n        } catch {\r\n            this.replaceChildren(element);\r\n        }\r\n    }\r\n\r\n    /** Closes the dialog (only applies to dialog targets). */\r\n    close() {\r\n        this.dialog?.close();\r\n    }\r\n\r\n    private async applyRouteData(element: Element, data?: RouteData) {\r\n        if ('loadRoute' in element) {\r\n            if (!data) {\r\n                console.warn(\r\n                    `[relaxjs:routing] <${element.tagName.toLowerCase()}> has loadRoute(), but the route carries no parameters to hand it. Add parameters to the route path, or drop loadRoute() from the component.`\r\n                );\r\n            }\r\n            const routeData = data\r\n                ?? { r_error: 'loadRoute function without mapped route data in the routes' };\r\n            await (element as unknown as LoadRoute).loadRoute(routeData);\r\n        }\r\n\r\n        if (data) {\r\n            (element as any).routeData = data;\r\n        }\r\n    }\r\n}\r\n", "/**\r\n * Single Page Application routing system with multiple target support.\r\n * Designed for scenarios where you need:\r\n * - Multiple navigation targets (main content, modals, sidebars)\r\n * - Strongly typed route parameters\r\n * - History management with back/forward support\r\n *\r\n * @example\r\n * // Configure routes\r\n * const routes = [\r\n *   { name: 'user', path: '/users/:id' },          // String parameter\r\n *   { name: 'order', path: '/orders/;orderId' },   // Number parameter\r\n *   { name: 'modal', path: '/detail/:id', target: 'modal' }  // Custom target\r\n * ];\r\n */\r\n\r\nimport { reportError } from '../errors';\r\nimport {\r\n    GuardResult,\r\n    RouteError,\r\n    RouteGuardError,\r\n    type Route,\r\n    type RouteData,\r\n    type RouteParamType,\r\n    type RouteMatchResult,\r\n    type NavigateOptions,\r\n} from './types';\r\nimport { NavigateRouteEvent } from './NavigateRouteEvent';\r\nimport { matchRoute, findRouteByName, findRouteByUrl } from './routeMatching';\r\nimport { initRouteTargetListener, getTargetHistory } from './routeTargetRegistry';\r\nimport { RouteLink } from './RouteLink';\r\nimport { RouteTarget } from './RoutingTarget';\r\nimport type { NavigationEntry } from './NavigationHistory';\r\n\r\n/**\r\n * State stored in `history.pushState` / `history.replaceState`.\r\n * Contains everything the popstate handler needs to replay a navigation\r\n * into the correct route target.\r\n */\r\ninterface NavigationState {\r\n    target?: string;\r\n    routeName?: string;\r\n    params: RouteData;\r\n    urlSegments: string[];\r\n    entryId: number;\r\n    fragment?: string;\r\n}\r\n\r\n/**\r\n * Fragment the router puts on the URL when it reloads the page to switch layout.\r\n *\r\n * It is namespaced so the router can tell its own marker apart from a fragment\r\n * that belongs to the application. Everything not matching this is left alone.\r\n */\r\nconst LAYOUT_SENTINEL = '#rlx-layout';\r\n\r\nlet nextEntryId = 1;\r\nlet popstateAttached = false;\r\n\r\n/**\r\n * Application fragment of the current URL, without the leading `#`.\r\n *\r\n * Returns `undefined` for the router's own layout marker, so an app never sees\r\n * an internal value it did not put there.\r\n */\r\nfunction readAppFragment(): string | undefined {\r\n    const hash = window.location.hash;\r\n    if (!hash || hash === LAYOUT_SENTINEL) {\r\n        return undefined;\r\n    }\r\n\r\n    return hash.slice(1);\r\n}\r\n\r\nfunction allocEntryId(): number {\r\n    return nextEntryId++;\r\n}\r\n\r\n/**\r\n * Used to keep track of current main HTML file,\r\n * used when different layouts are supported.\r\n *\r\n * The default page is ALWAYS loaded initially,\r\n * which means that we need to switch layout page\r\n * if someone else is configured for the route.\r\n */\r\nvar currentLayout: string | undefined;\r\n\r\nfunction getCurrentLayout(): string {\r\n    if (currentLayout === undefined) {\r\n        currentLayout = getLayout() ?? 'default';\r\n    }\r\n    return currentLayout;\r\n}\r\n\r\nfunction getLayout() {\r\n    const path = window.location.pathname;\r\n    if (path == '/index.html') {\r\n        return 'default';\r\n    }\r\n\r\n    return path.endsWith('.html') ? path.slice(1, -5) : null;\r\n}\r\n\r\nexport const internalRoutes: Route[] = [];\r\n\r\nexport const MyData = {\r\n    routes: []\r\n};\r\n\r\n/**\r\n * Debug helper to print all registered routes to console.\r\n */\r\nexport function printRoutes() {\r\n    console.log(internalRoutes);\r\n}\r\n\r\n/**\r\n * Registers application routes with the router.\r\n * Call this at application startup before routing begins.\r\n *\r\n * @param appRoutes - Array of route configurations\r\n * @throws Error if referenced components are not registered\r\n *\r\n * @example\r\n * const routes: Route[] = [\r\n *     { name: 'home', path: '/', componentTagName: 'app-home' },\r\n *     { name: 'user', path: '/users/:id', componentTagName: 'user-profile' },\r\n *     { name: 'login', path: '/auth/', componentTagName: 'login-form', layout: 'noauth' }\r\n * ];\r\n * defineRoutes(routes);\r\n */\r\nexport function defineRoutes(appRoutes: Route[]) {\r\n    initRouteTargetListener();\r\n    if (!customElements.get('r-route-target')) {\r\n        customElements.define('r-route-target', RouteTarget);\r\n    }\r\n    if (!customElements.get('r-link')) {\r\n        customElements.define('r-link', RouteLink);\r\n    }\r\n    internalRoutes.length = 0;\r\n    internalRoutes.push(...appRoutes);\r\n\r\n    if (window.relaxDebug?.routing) {\r\n        console.log('[relaxjs:routing] routes defined', appRoutes);\r\n    }\r\n\r\n    var errs: string[] = [];\r\n    appRoutes.forEach((route) => {\r\n        if (\r\n            route.componentTagName &&\r\n            !customElements.get(route.componentTagName)\r\n        ) {\r\n            errs.push(\r\n                `Component with tagName '${route.componentTagName}' is not defined in customElements.`\r\n            );\r\n        }\r\n        if (route.component && !customElements.getName(route.component)) {\r\n            errs.push(\r\n                `Component '${route.component.name}' is not defined in customElements. Used in route '${JSON.stringify(route)}'.`\r\n            );\r\n        }\r\n        const bracedSegments = route.path\r\n            .replace(/^\\/|\\/$/g, '')\r\n            .split('/')\r\n            .filter((segment) => segment.startsWith('{'));\r\n        if (bracedSegments.length > 0) {\r\n            errs.push(\r\n                `Route '${route.name}' uses ${bracedSegments.join(', ')} in path '${route.path}'. Relaxjs writes parameters as ':name' for text and ';name' for a number.`\r\n            );\r\n        }\r\n        if (route.layout === '') {\r\n            console.warn(\r\n                `[relaxjs:routing] Route '${route.name}' has an empty layout name, which is being treated as \"no layout\". Leave layout undefined instead.`,\r\n                route\r\n            );\r\n            route.layout = undefined;\r\n        }\r\n    });\r\n\r\n    if (errs.length > 0) {\r\n        throw new Error(errs.join('\\n'));\r\n    }\r\n}\r\n\r\n/**\r\n * Initializes routing and navigates to the current URL.\r\n * Call this after DOM is ready and routes are defined.\r\n *\r\n * @example\r\n * // In your main application component\r\n * connectedCallback() {\r\n *     defineRoutes(routes);\r\n *     startRouting();\r\n * }\r\n */\r\nexport function startRouting() {\r\n    if (getCurrentLayout() == '') {\r\n        const path = window.location.pathname;\r\n        const match = path.match(/\\/([^\\/]+)\\.html$/);\r\n        if (match && match[1] !== '') {\r\n            if (window.relaxDebug?.routing) {\r\n                console.log('[relaxjs:routing] current layout taken from URL', match[1], path);\r\n            }\r\n            currentLayout = match[1];\r\n        } else {\r\n            if (window.relaxDebug?.routing) {\r\n                console.log('[relaxjs:routing] current layout defaulted to \"default\"', path);\r\n            }\r\n            currentLayout = 'default';\r\n        }\r\n    }\r\n\r\n    if (tryLoadRouteFromLayoutNavigation()) {\r\n        return;\r\n    }\r\n\r\n    const currentUrl = window.location.pathname || '/';\r\n    const routeResult = findRoute(currentUrl, {});\r\n\r\n    const searchParams = new URLSearchParams(window.location.search);\r\n    if (searchParams.size > 0) {\r\n        routeResult.params ??= {};\r\n        searchParams.forEach((value, key) => {\r\n            routeResult.params[key] = value;\r\n        });\r\n    }\r\n\r\n    routeResult.fragment = readAppFragment();\r\n\r\n    if (navigateToLayout(routeResult)) {\r\n        return;\r\n    }\r\n\r\n    attachPopstateListener();\r\n\r\n    const target = routeResult.route.target;\r\n    const entryId = allocEntryId();\r\n    const state: NavigationState = {\r\n        target,\r\n        routeName: routeResult.route.name,\r\n        params: routeResult.params,\r\n        urlSegments: routeResult.urlSegments,\r\n        entryId,\r\n        fragment: routeResult.fragment,\r\n    };\r\n    history.replaceState(state, '', '/' + routeResult.urlSegments.join('/'));\r\n\r\n    const e = new NavigateRouteEvent(\r\n        routeResult.route,\r\n        routeResult.urlSegments,\r\n        routeResult.params,\r\n        target\r\n    );\r\n    e.entryId = entryId;\r\n    e.fragment = routeResult.fragment;\r\n    document.dispatchEvent(e);\r\n}\r\n\r\n/**\r\n * Navigates to a route by name or URL.\r\n * Updates browser history and dispatches navigation events.\r\n *\r\n * @param routeNameOrUrl - Route name or URL path to navigate to\r\n * @param options - Navigation options including params and target\r\n *\r\n * @example\r\n * // Navigate by route name\r\n * navigate('user', { params: { id: '123' } });\r\n *\r\n * // Navigate by URL\r\n * navigate('/users/123');\r\n *\r\n * // Navigate to specific target\r\n * navigate('detail', { params: { id: '42' }, target: 'modal' });\r\n */\r\nexport function navigate(routeNameOrUrl: string, options?: NavigateOptions) {\r\n    if (window.relaxDebug?.routing) {\r\n        console.log('[relaxjs:routing] navigate', routeNameOrUrl, options);\r\n    }\r\n    const routeResult = findRoute(routeNameOrUrl, options);\r\n    routeResult.fragment = options?.fragment;\r\n    if (navigateToLayout(routeResult)) {\r\n        return;\r\n    }\r\n\r\n    attachPopstateListener();\r\n\r\n    const target = options?.target ?? routeResult.route.target;\r\n    const entryId = allocEntryId();\r\n    const ourUrl = routeResult.urlSegments.join('/');\r\n    const currentUrl = window.location.pathname.replace(/^\\/|\\/$/g, '');\r\n    const state: NavigationState = {\r\n        target,\r\n        routeName: routeResult.route.name,\r\n        params: routeResult.params,\r\n        urlSegments: routeResult.urlSegments,\r\n        entryId,\r\n        fragment: routeResult.fragment,\r\n    };\r\n    if (currentUrl != ourUrl) {\r\n        history.pushState(state, '', '/' + routeResult.urlSegments.join('/'));\r\n    }\r\n    const e = new NavigateRouteEvent(\r\n        routeResult.route,\r\n        routeResult.urlSegments,\r\n        routeResult.params,\r\n        target\r\n    );\r\n    e.entryId = entryId;\r\n    e.fragment = routeResult.fragment;\r\n    document.dispatchEvent(e);\r\n}\r\n\r\n/**\r\n * Returns `true` when the named target has a previous navigation it can\r\n * step back to. Pass `undefined` (or omit) for the default unnamed target.\r\n *\r\n * @example\r\n * if (canGoBack()) navigateBack();\r\n */\r\nexport function canGoBack(target?: string): boolean {\r\n    return getTargetHistory(target)?.canGoBack() ?? false;\r\n}\r\n\r\n/**\r\n * Returns `true` when the named target was stepped back and can be stepped\r\n * forward again. Pass `undefined` for the default unnamed target.\r\n */\r\nexport function canGoForward(target?: string): boolean {\r\n    return getTargetHistory(target)?.canGoForward() ?? false;\r\n}\r\n\r\n/**\r\n * Replays the previous navigation in the named target's history.\r\n * Updates the browser URL bar via `pushState`. Does nothing if the target\r\n * has no prior entry.\r\n *\r\n * @param target - Target name. Omit for the default unnamed target.\r\n *\r\n * @example\r\n * navigateBack();          // step the default target back\r\n * navigateBack('modal');   // step the modal target back independently\r\n */\r\nexport function navigateBack(target?: string): void {\r\n    const history = getTargetHistory(target);\r\n    const entry = history?.back();\r\n    if (entry) replayEntry(entry);\r\n}\r\n\r\n/**\r\n * Replays the next navigation in the named target's history (after a back).\r\n * Does nothing if the target has no forward entry.\r\n */\r\nexport function navigateForward(target?: string): void {\r\n    const history = getTargetHistory(target);\r\n    const entry = history?.forward();\r\n    if (entry) replayEntry(entry);\r\n}\r\n\r\nfunction replayEntry(entry: NavigationEntry): void {\r\n    const routeResult = findRouteByName(internalRoutes, entry.routeName, entry.params);\r\n    if (!routeResult) {\r\n        const error = reportError('Cannot replay navigation entry', {\r\n            routeName: entry.routeName,\r\n            target: entry.target,\r\n        });\r\n        if (error) throw error;\r\n        return;\r\n    }\r\n    const state: NavigationState = {\r\n        target: entry.target,\r\n        routeName: entry.routeName,\r\n        params: entry.params,\r\n        urlSegments: entry.urlSegments,\r\n        entryId: entry.entryId,\r\n    };\r\n    window.history.pushState(state, '', '/' + entry.urlSegments.join('/'));\r\n    dispatchReplay(routeResult.route, entry);\r\n}\r\n\r\nfunction dispatchReplay(route: Route, entry: NavigationEntry): void {\r\n    const evt = new NavigateRouteEvent(\r\n        route,\r\n        entry.urlSegments,\r\n        entry.params,\r\n        entry.target\r\n    );\r\n    evt.isReplay = true;\r\n    evt.entryId = entry.entryId;\r\n    evt.fragment = entry.fragment;\r\n    document.dispatchEvent(evt);\r\n}\r\n\r\nfunction attachPopstateListener(): void {\r\n    if (popstateAttached) return;\r\n    popstateAttached = true;\r\n    window.addEventListener('popstate', onPopState);\r\n}\r\n\r\nfunction onPopState(e: PopStateEvent): void {\r\n    const state = e.state as NavigationState | null;\r\n    if (!state || typeof state !== 'object' || !('entryId' in state)) return;\r\n\r\n    let routeResult: RouteMatchResult | null = null;\r\n    if (state.routeName) {\r\n        routeResult = findRouteByName(internalRoutes, state.routeName, state.params);\r\n    }\r\n    if (!routeResult) {\r\n        routeResult = findRouteByUrl(internalRoutes, '/' + state.urlSegments.join('/'));\r\n    }\r\n    if (!routeResult) return;\r\n\r\n    const entry: NavigationEntry = {\r\n        routeName: state.routeName ?? routeResult.route.name ?? '',\r\n        params: state.params,\r\n        target: state.target,\r\n        urlSegments: state.urlSegments,\r\n        entryId: state.entryId,\r\n        fragment: state.fragment,\r\n    };\r\n    dispatchReplay(routeResult.route, entry);\r\n}\r\n\r\nfunction findRoute(routeNameOrUrl: string, options?: NavigateOptions) {\r\n    const theRoutes = options?.routes ?? internalRoutes;\r\n    const params = options?.params;\r\n\r\n    const routeResult = matchRoute(theRoutes, routeNameOrUrl, params);\r\n    if (!routeResult) {\r\n        const errorMsg = generateErrorMessage(\r\n            routeNameOrUrl,\r\n            params,\r\n            theRoutes\r\n        );\r\n        console.error(errorMsg);\r\n        throw new RouteError(errorMsg);\r\n    }\r\n\r\n    if (!checkRouteGuards(routeResult)) {\r\n        throw new RouteGuardError('Route guards stopped navigation for route ' + routeNameOrUrl);\r\n    }\r\n\r\n    return routeResult;\r\n}\r\n\r\nfunction navigateToLayout(routeResult: RouteMatchResult): boolean {\r\n    if (!routeResult) {\r\n        console.error('Route result is null, cannot navigate to layout.');\r\n    }\r\n\r\n    const wantedLayout = (routeResult.route.layout ?? 'default').replace(\r\n        /\\.html?$/,\r\n        ''\r\n    );\r\n    if (wantedLayout === getCurrentLayout()) {\r\n        return false;\r\n    }\r\n\r\n    // Our own marker means that we attempted to redirect to the same layout once,\r\n    // so if it's there and another redirect is requsted, something is wrong.\r\n    //\r\n    // Because the push history should remove it if everything worked out.\r\n    // Only our namespaced marker counts, any other fragment belongs to the app.\r\n    if (window.location.hash === LAYOUT_SENTINEL) {\r\n        throw Error(\r\n            `A redirect failed. Wanted layout '${wantedLayout}' for route '${routeResult.route.name}', but after reloading ${window.location.pathname} the current layout is still '${getCurrentLayout()}'. Does the layout page exist?`\r\n        );\r\n    }\r\n\r\n    if (window.relaxDebug?.routing) {\r\n        console.log(\r\n            `[relaxjs:routing] layout switch required, from '${getCurrentLayout()}' to '${wantedLayout}'`,\r\n            routeResult.route.name\r\n        );\r\n    }\r\n    // The fragment travels in session storage instead of on the new URL, so a\r\n    // token carried there is not repeated in the address bar of the layout page.\r\n    const navigationState = {\r\n        routeName: routeResult.route.name,\r\n        params: routeResult.params || {},\r\n        fragment: routeResult.fragment\r\n    };\r\n\r\n    sessionStorage.setItem('layoutNavigation', JSON.stringify(navigationState));\r\n    const layoutUrl =\r\n        wantedLayout.indexOf('.htm') > -1\r\n            ? `/${wantedLayout}${LAYOUT_SENTINEL}`\r\n            : `/${wantedLayout}.html${LAYOUT_SENTINEL}`;\r\n    if (window.relaxDebug?.routing) {\r\n        console.log('[relaxjs:routing] reloading page to switch layout', layoutUrl, navigationState);\r\n    }\r\n    window.location.href = layoutUrl;\r\n    return true;\r\n}\r\n/**\r\n * Checks session storage for route information and initiates proper navigation\r\n * Should be called when page loads to handle layout transitions\r\n *\r\n * @returns Whether navigation was initiated from session storage\r\n *\r\n * @example\r\n * // Call on page load\r\n * document.addEventListener('DOMContentLoaded', () => {\r\n *   if (handleLayoutNavigation()) {\r\n *     console.log('Navigation handled from session storage');\r\n *   }\r\n * });\r\n */\r\nfunction tryLoadRouteFromLayoutNavigation(): boolean {\r\n    try {\r\n        const navigationStateJson = sessionStorage.getItem('layoutNavigation');\r\n        if (!navigationStateJson) {\r\n            return false;\r\n        }\r\n\r\n        const navigationState = JSON.parse(navigationStateJson);\r\n        sessionStorage.removeItem('layoutNavigation');\r\n        if (window.relaxDebug?.routing) {\r\n            console.log('[relaxjs:routing] resuming navigation after layout switch', navigationState);\r\n        }\r\n        navigate(navigationState.routeName, {\r\n            params: navigationState.params,\r\n            fragment: navigationState.fragment\r\n        });\r\n\r\n        return true;\r\n    } catch (error) {\r\n        sessionStorage.removeItem('layoutNavigation');\r\n        reportError('Failed to navigate from session storage', {\r\n            cause: error,\r\n        });\r\n        return false;\r\n    }\r\n}\r\n\r\nfunction generateErrorMessage(\r\n    routeNameOrUrl: string,\r\n    routeParams: Record<string, RouteParamType> | undefined,\r\n    allRoutes: Route[]\r\n): string {\r\n    var routeData = '';\r\n    if (routeParams) {\r\n        routeData += Object.entries(routeParams)\r\n            .map(([key, value]) => `${key}=${value}`)\r\n            .join(', ');\r\n    } else {\r\n        routeData = '.';\r\n    }\r\n\r\n    var routesStr = allRoutes.map(\r\n        (x) =>\r\n            ` * Name: '${x.name}', path: '${x.path}', target: ${\r\n                x.target ?? 'default'\r\n            }\\n`\r\n    );\r\n    return `No route matched '${routeNameOrUrl}${routeData}'. Available routes:\\n${routesStr}`;\r\n}\r\n\r\nfunction checkRouteGuards(routeResult: RouteMatchResult): boolean {\r\n    if (\r\n        !routeResult ||\r\n        !routeResult.route.guards ||\r\n        routeResult.route.guards.length == 0\r\n    ) {\r\n        return true;\r\n    }\r\n\r\n    for (let index = 0; index < routeResult.route.guards.length; index++) {\r\n        const element = routeResult.route.guards[index];\r\n        var result = element.check(routeResult);\r\n        if (result == GuardResult.Allow) {\r\n            return true;\r\n        }\r\n\r\n        if (result == GuardResult.Stop) {\r\n            return false;\r\n        }\r\n\r\n        if (result == GuardResult.Deny) {\r\n            throw new RouteGuardError(\r\n                `Guard ${element.constructor.name} said 'Deny' for ${routeResult.route.name}`\r\n            );\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n"],
  "mappings": "AAGO,IAAKA,OAIRA,IAAA,iBAKAA,IAAA,eAKAA,IAAA,uBAKAA,IAAA,eAnBQA,OAAA,IAyICC,EAAN,cAAyB,KAAM,CAAC,EAC1BC,EAAN,cAA8BD,CAAW,CAAzC,k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EAC9C,IAAIE,EAASD,EAAQ,MAAMpD,CAAW,EACtC,GAAIqD,GAAU,EACV,MAAO,GAGX,GAAIA,GAAU,EACV,MAAO,GAGX,GAAIA,GAAU,EACV,MAAM,IAAIb,EACN,SAASY,EAAQ,YAAY,IAAI,oBAAoBpD,EAAY,MAAM,IAAI,EAC/E,CAER,CAEA,MAAO,EACX",
  "names": ["GuardResult", "RouteError", "RouteGuardError", "NavigateRouteEvent", "_NavigateRouteEvent", "route", "urlSegments", "routeData", "routeTarget", "eventInit", "RelaxError", "message", "context", "handler", "reportError", "message", "context", "error", "RelaxError", "handler", "suppressed", "NavigationHistory", "entry", "entryId", "found", "e", "targets", "pendingEvents", "detachedHistories", "registerRouteTarget", "name", "handler", "initRouteTargetListener", "error", "reportError", "restoredHistory", "history", "NavigationHistory", "pending", "dispatchToTarget", "unregisterRouteTarget", "reg", "getTargetHistory", "clearPendingNavigations", "entryFromEvent", "evt", "entry", "listenerAttached", "NavigateRouteEvent", "NumberRouteSegment", "paramName", "value", "pathValue", "StringRouteSegment", "_value", "PathRouteSegment", "_pathValue", "RouteImp", "route", "segments", "generatedSegments", "params", "index", "urlSegment", "ourSegment", "routeData", "urlSegments", "lowerIndex", "key", "matched", "matchRoute", "routes", "routeNameOrUrl", "findRouteByUrl", "findRouteByName", "name", "x", "imp", "generateRouteImp", "result", "path", "routeImps", "generateRouteImps", "m", "impSegments", "segment", "RouteLink", "e", "direction", "name", "params", "attr", "paramName", "_", "c", "paramsAttr", "additionalParams", "error", "err", "reportError", "target", "navigate", "RelaxError", "reported", "canGoBack", "navigateBack", "canGoForward", "navigateForward", "COMPONENT_REGISTRATION_WARNING_MS", "RouteTarget", "registerRouteTarget", "evt", "unregisterRouteTarget", "error", "RelaxError", "reportError", "tagName", "element", "stillWaiting", "transition", "data", "routeData", "LAYOUT_SENTINEL", "nextEntryId", "popstateAttached", "readAppFragment", "hash", "allocEntryId", "currentLayout", "getCurrentLayout", "getLayout", "path", "internalRoutes", "printRoutes", "internalRoutes", "defineRoutes", "appRoutes", "initRouteTargetListener", "RouteTarget", "RouteLink", "errs", "route", "bracedSegments", "segment", "startRouting", "getCurrentLayout", "path", "match", "currentLayout", "tryLoadRouteFromLayoutNavigation", "currentUrl", "routeResult", "findRoute", "searchParams", "value", "key", "readAppFragment", "navigateToLayout", "attachPopstateListener", "target", "entryId", "allocEntryId", "state", "e", "NavigateRouteEvent", "navigate", "routeNameOrUrl", "options", "ourUrl", "canGoBack", "getTargetHistory", "canGoForward", "navigateBack", "entry", "replayEntry", "navigateForward", "findRouteByName", "error", "reportError", "dispatchReplay", "evt", "popstateAttached", "onPopState", "findRouteByUrl", "theRoutes", "params", "matchRoute", "errorMsg", "generateErrorMessage", "RouteError", "checkRouteGuards", "RouteGuardError", "wantedLayout", "LAYOUT_SENTINEL", "navigationState", "layoutUrl", "navigationStateJson", "routeParams", "allRoutes", "routeData", "routesStr", "x", "index", "element", "result"]
}
