ui5-lib-guard-router 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Router-dbg.js","names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","GuardPipeline","__GuardPipeline","isPromiseLike","isPromiseResolver","LOG_COMPONENT","isRecord","___GuardConfig","parseGuardRouterConfig","createLazyGuards","___GuardModules","loadGuardModules","byRouteDepth","___PatternTree","expandForNewRoute","expandToDescendants","RouteMetaStore","__RouteMetaStore","EMPTY_META","HistoryDirection","coreLibrary","routing","withoutGuardRouter","config","hidden","key","Proxy","get","target","receiver","undefined","Reflect","has","ownKeys","filter","getOwnPropertyDescriptor","isRouteGuardConfig","guard","lastStep","undoneHref","window","navigation","addEventListener","event","href","location","entry","currentEntry","navigationType","offset","index","from","IDLE","kind","MAX_REDIRECT_DEPTH","Router","MobileRouter","extend","constructor","_constructor","routes","owner","rest","isRecordConfig","guardRouter","MobileRouter.prototype.constructor.apply","_pipeline","_currentRoute","_currentHash","_phase","_parseGeneration","_suppressedHash","_undo","_reportedHash","_lastReport","_reportOutdated","_rootHashChanger","_stoppedRoute","_settlementResolvers","_lastSettlement","_sourceDescriptors","_manifestGuards","_destroyed","_nativeMatching","_matchWaiters","_blockLoad","_ownerComponent","_routeNames","_greedyRouteNames","_mirrorMatchingProcess","componentNamespace","appConfig","getManifestEntry","id","parsed","_options","options","_meta","routeMeta","inheritance","_collectRoutePatterns","_pendingGuardDescriptors","guards","guardLoading","uniquePaths","Set","map","d","modulePath","sap","ui","require","Object","defineProperty","_isMatching","set","matching","postponed","attachRouteMatched","_attachRouteMatched","oData","fnFunction","oListener","isInitialized","push","MobileRouter.prototype.attachRouteMatched.call","_settleMatchWaiters","waiters","resolve","initialize","_initialize","bIgnoreInitialHash","start","ignoreInitialHash","length","_start","descriptors","source","expandedDescriptors","_registerLazyGuards","blockLoad","then","results","descriptor","fn","_registerManifestGuard","starting","getHashChanger","attachEvent","_onHashReported","HashChanger","getInstance","_onRootHashChanged","MobileRouter.prototype.initialize.call","shownHash","getHash","newHash","getParameter","shown","oldHash","hashChanger","_completeUndo","detachEvent","queueMicrotask","undo","first","fullHash","awaitsReport","_replaceFullHash","addRoute","_addRoute","oConfig","oParent","MobileRouter.prototype.addRoute.call","name","includes","greedy","invalidate","patterns","declared","Map","r","pattern","rankOf","findIndex","rank","next","route","type","toSorted","a","b","addGuard","_addGuard","_isFn","addGlobalGuard","removeGuard","_removeGuard","removeGlobalGuard","addRouteGuard","_addRouteGuard","routeName","_handleUnknownRouteRegistration","hasHandler","beforeEnter","addEnterGuard","beforeLeave","addLeaveGuard","Log","info","removeRouteGuard","_removeRouteGuard","removeLeaveGuard","removeEnterGuard","_addLeaveGuard","_resolveNavToArgs","componentTargetInfoOrReplace","replaceOrOptions","replace","guardOptions","componentTargetInfo","value","method","detail","warning","methodName","kept","getRoute","unknownRouteRegistration","Error","_removeLeaveGuard","getRouteMeta","_getRouteMeta","setRouteMeta","_setRouteMeta","meta","navigationSettled","_navigationSettled","Promise","status","Committed","hash","attachNavigationSettled","_attachNavigationSettled","detachNavigationSettled","_detachNavigationSettled","_flushSettlement","result","debug","resolvers","fireEvent","error","String","navTo","_navTo","parameters","origin","MobileRouter.prototype.navTo.call","_cancelPendingNavigation","targetHash","getURL","routeInfo","_matchRoute","toRoute","skipGuards","navToPreflight","attempt","restoreHash","_pendingRestoresHash","_navigateAllowed","_startAttempt","generation","context","_createGuardContext","controller","signal","decision","_evaluateGuards","_applyWhenDecided","_applyPreflightDecision","bag","bReplace","writtenOver","_commitAfterNavTo","_blockNavigation","action","_startRedirectChain","_errorNavigation","parse","_parse","MobileRouter.prototype.parse.call","reported","started","_finishRestore","phase","commit","_commitNavigation","currentHash","pendingUndo","undoing","_describeUndo","direction","History","getDirection","_applyDecision","stop","_stop","_detachHashListeners","MobileRouter.prototype.stop.call","pendingRestoresHash","abort","_settleUncommitted","Cancelled","AbortController","apply","attemptedHash","lastSettlement","_alignTitleHistory","NewEntry","Forwards","Backwards","titles","getTitleHistory","left","at","replaced","isHome","title","splice","wasRedirect","Redirected","Bypassed","keys","_redirect","chain","targetName","targetRoute","visited","join","size","add","_applyRedirectDecision","hashShown","getRouteInfoByHash","arguments","_greedyMatches","firstMatch","match","redirectHop","evaluate","skipLeaveGuards","alsoLeaving","fromHash","fromRoute","alsoEntering","toHash","toArguments","toMeta","fromMeta","ownerComponent","Blocked","whenBack","loadDefaultRoute","_undoHashChange","_restoreHash","pending","step","rootHash","history","go","replaceHash","Unknown","suppressParse","getPattern","guardFn","before","err","destroy","_destroy","clear","MobileRouter.prototype.destroy.call"],"sourceRoot":"./","sources":["Router.ts"],"sourcesContent":["import MobileRouter from \"sap/m/routing/Router\";\nimport Log from \"sap/base/Log\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport HashChanger from \"sap/ui/core/routing/HashChanger\";\nimport History from \"sap/ui/core/routing/History\";\nimport type { HashChangerBase$HashChangedEvent } from \"sap/ui/core/routing/HashChangerBase\";\nimport type { ComponentTargetParameters, RouteInfo, Router$RouteMatchedEvent } from \"sap/ui/core/routing/Router\";\nimport type Route from \"sap/ui/core/routing/Route\";\nimport type { $RouteSettings } from \"sap/ui/core/routing/Route\";\nimport type UIComponent from \"sap/ui/core/UIComponent\";\nimport type {\n\tGuardFn,\n\tGuardContext,\n\tGuardNavToOptions,\n\tGuardRedirect,\n\tGuardRouter,\n\tGuardRouterConfig,\n\tLeaveGuardFn,\n\tNavigationResult,\n\tRouter$NavigationSettledEvent,\n\tRouteGuardConfig,\n} from \"./types\";\nimport NavigationOutcome from \"./NavigationOutcome\";\nimport GuardPipeline, { type GuardDecision, isPromiseLike, isPromiseResolver, LOG_COMPONENT } from \"./GuardPipeline\";\nimport { type GuardDescriptor, isRecord, parseGuardRouterConfig, type ResolvedGuardRouterOptions } from \"./GuardConfig\";\nimport { createLazyGuards, loadGuardModules } from \"./GuardModules\";\nimport { byRouteDepth, expandForNewRoute, expandToDescendants, type RoutePattern } from \"./PatternTree\";\nimport RouteMetaStore, { EMPTY_META } from \"./RouteMeta\";\n\nconst HistoryDirection = coreLibrary.routing.HistoryDirection;\ntype Direction = ReturnType<History[\"getDirection\"]>;\n\n/**\n * The router config as UI5 gets it: the caller's object without `guardRouter`. It is a view and\n * not a copy, because UIComponent adds `targetParent` (the ID of the root view) to its config\n * object after it has constructed the router, and the native router reads it from that object.\n */\nfunction withoutGuardRouter(config: object): object {\n\tconst hidden = (key: PropertyKey): boolean => key === \"guardRouter\";\n\treturn new Proxy(config, {\n\t\tget: (target, key, receiver): unknown => (hidden(key) ? undefined : Reflect.get(target, key, receiver)),\n\t\thas: (target, key) => !hidden(key) && Reflect.has(target, key),\n\t\townKeys: (target) => Reflect.ownKeys(target).filter((key) => !hidden(key)),\n\t\tgetOwnPropertyDescriptor: (target, key) =>\n\t\t\thidden(key) ? undefined : Reflect.getOwnPropertyDescriptor(target, key),\n\t});\n}\n\nfunction isRouteGuardConfig(guard: GuardFn | RouteGuardConfig): guard is RouteGuardConfig {\n\treturn typeof guard === \"object\" && guard !== null;\n}\n\n/** A step through the browser history (back, forward): how far it went, and the URL it arrived at. */\ninterface HistoryStep {\n\treadonly offset: number;\n\treadonly href: string;\n}\n\n/** The step through the browser history that brought the browser to the URL it shows, if a step did. */\nlet lastStep: HistoryStep | null = null;\n/** The URL of a step that a router is taking back, until the browser reports the next URL change. */\nlet undoneHref: string | null = null;\n\n// The Navigation API tells how far a step through the history went, before UI5 learns of the\n// hash change. UI5's History only infers it, and wrongly once an entry lacks its state. Without\n// the API (Firefox before 147, Safari before 26.2) no step is known and the entry is replaced.\nwindow.navigation?.addEventListener(\"currententrychange\", (event) => {\n\tconst href = window.location.href;\n\tif (undoneHref !== href) undoneHref = null;\n\tconst entry = window.navigation.currentEntry;\n\tif (entry && event.navigationType === \"traverse\") {\n\t\tlastStep = { offset: entry.index - event.from.index, href };\n\t} else if (lastStep?.href !== href) {\n\t\t// Not an entry whose state alone is replaced, as UI5's History does after a step.\n\t\tlastStep = null;\n\t}\n});\n\n/** What it takes to undo the hash change that an uncommitted navigation arrived with. */\ninterface HashChangeUndo {\n\t/** The hash of the root hash changer after the first change that this takes back. */\n\treadonly first: string;\n\t/**\n\t * The hash of the root hash changer before that change, with the hashes of nested routers.\n\t * The root hash changer reports it with the change, after the routers have parsed their part.\n\t */\n\tfullHash: string | undefined;\n\t/** The hash of the root hash changer after the change. */\n\treadonly shown: string;\n\t/** Whether the router has started to put the URL back, and the hash change that does it is still to come. */\n\tstarted: boolean;\n\t/** The step through the browser history that the change was, if it was one. */\n\treadonly step: HistoryStep | null;\n}\n\n/** A manifest guard entry of a route, with the declared entry it stems from: itself, or the entry of an ancestor route. */\ninterface ManifestGuardDescriptor extends GuardDescriptor {\n\treadonly source: GuardDescriptor;\n}\n\n/** Snapshot of an in-flight navigation being evaluated by the guard pipeline. */\ninterface NavigationAttempt {\n\treadonly hash: string;\n\treadonly controller: AbortController;\n\treadonly generation: number;\n\t/** Whether the URL shows a hash that never committed, so that it must be restored unless this attempt moves it. */\n\treadonly restoreHash: boolean;\n\t/** How the browser got to the hash that started the navigation; `undefined` after `navTo()` or `parse()`. */\n\treadonly direction: Direction | undefined;\n}\n\ninterface PhaseIdle {\n\treadonly kind: \"idle\";\n}\n\ninterface PhaseEvaluating {\n\treadonly kind: \"evaluating\";\n\treadonly attempt: NavigationAttempt;\n\t/** Whether the navigation waits for async guards: the native router would be matching its route by now. */\n\treadonly postponed?: true;\n}\n\ninterface PhaseCommitting {\n\treadonly kind: \"committing\";\n\treadonly route: string;\n\t/** The hash of the route: `parse()` commits the navigation when it receives this hash. */\n\treadonly hash: string;\n\treadonly origin: \"preflight\" | \"redirect\" | \"parse\";\n\t/** How the browser got to the history entry that the route replaces (see {@link RedirectChainContext.direction}). */\n\treadonly direction?: Direction;\n\t/** Whether the URL showed a hash that never committed when `navTo()` wrote the hash (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** What the root hash changer showed before `navTo()` wrote the hash: the write is undone with it. */\n\treadonly writtenOver?: string;\n}\n\n/**\n * An allowed navigation waits for UI5 to write its hash. With component targets UI5 does that\n * once the nested components are loaded, and never if one of them fails to load.\n */\ninterface PhaseAwaitingHash {\n\treadonly kind: \"awaitingHash\";\n\t/** The phase that commits the navigation when `parse()` receives its hash. */\n\treadonly commit: PhaseCommitting;\n}\n\n/** A navigation that did not commit waits for the URL to be back before it settles. */\ninterface PhaseRestoring {\n\treadonly kind: \"restoring\";\n\treadonly result: NavigationResult;\n\t/** Whether the previous hash is written once UI5 has reported the hash change to every router. */\n\treadonly awaitsReport?: true;\n\t/** What a redirect to the route that is shown still has to do once the navigation has settled. */\n\treadonly whenBack?: () => void;\n}\n\ntype RouterPhase = PhaseIdle | PhaseEvaluating | PhaseCommitting | PhaseAwaitingHash | PhaseRestoring;\n\nconst IDLE: PhaseIdle = { kind: \"idle\" };\n\n/** Maximum number of hops in a redirect chain before it is treated as a loop. */\nconst MAX_REDIRECT_DEPTH = 10;\n\n/** State threaded through a redirect chain. */\ninterface RedirectChainContext {\n\t/** Hashes whose guards have been evaluated in this chain (mutated via .add()). */\n\tvisited: Set<string>;\n\t/** Hash of the originally attempted navigation (for settlement / hash restore). */\n\treadonly attemptedHash: string | undefined;\n\t/** Whether to restore the hash on block (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** Original source route (the route the user occupies). */\n\treadonly fromRoute: string;\n\t/** Original source hash (the hash the user occupies). */\n\treadonly fromHash: string;\n\t/** Whether the target replaces the current history entry: as the `navTo()` call asked, always after a hash change. */\n\treadonly replace: boolean | undefined;\n\t/**\n\t * How the browser got to the history entry that the target replaces, for the title history\n\t * of UI5 (see {@link Router._alignTitleHistory}); `undefined` after `navTo()` or `parse()`.\n\t */\n\treadonly direction: Direction | undefined;\n\t/** Shared AbortSignal from the original navigation. */\n\treadonly signal: AbortSignal;\n\t/** Shared generation counter from the original navigation. */\n\treadonly generation: number;\n\t/** Shared bag from the original navigation's guard context. */\n\treadonly bag: Map<string, unknown>;\n}\n\n/**\n * Router with navigation guard support.\n *\n * Extends `sap.m.routing.Router` with a shared guard pipeline that\n * evaluates registered guard functions before route matching, target\n * loading, or event firing occurs.\n *\n * Two entry points feed the same pipeline:\n * - `navTo()` runs guards as a preflight check. A blocked navigation\n * never changes the hash; a redirected one only writes its final target.\n * - `parse()` runs guards as a fallback for browser back/forward, URL\n * bar entry, and direct hash changes where the hash has already changed\n * before guards can intercept.\n *\n * Key assumptions (see docs/reference/architecture.md for full rationale):\n * - `parse()` is intentionally NOT async. Sync guards execute in the\n * same tick; async guards fall back to a deferred path.\n * - `replaceHash` fires `hashChanged` synchronously (validated by test).\n * - `setHash` (via `super.navTo`) fires `hashChanged` synchronously (validated by test).\n * - Redirect targets are evaluated by the guard pipeline with loop detection.\n *\n * @namespace ui5.guard.router\n * @extends sap.m.routing.Router\n */\nexport default class Router extends MobileRouter implements GuardRouter {\n\tprivate _options: ResolvedGuardRouterOptions;\n\tprivate _pipeline = new GuardPipeline();\n\tprivate _currentRoute = \"\";\n\tprivate _currentHash: string | null = null;\n\tprivate _phase: RouterPhase = IDLE;\n\tprivate _parseGeneration = 0;\n\tprivate _suppressedHash: string | null = null;\n\t/** How to undo the hash change of the pending navigation (see {@link _undoHashChange}). */\n\tprivate _undo: HashChangeUndo | null = null;\n\t/** The hash that the hash changer of this router is reporting, until `parse()` receives it. */\n\tprivate _reportedHash: unknown = null;\n\t/** The hash that the hash changer of this router reported last, reports that are out of date aside. */\n\tprivate _lastReport: unknown = null;\n\t/** Whether the hash changer shows a later hash than the one it is reporting (see {@link _onHashReported}). */\n\tprivate _reportOutdated = false;\n\t/** The global hash changer that {@link _onRootHashChanged} is attached to, behind the listener of UI5 that informs the routers. */\n\tprivate _rootHashChanger: HashChanger | null = null;\n\t/** The route that was current when the router stopped: `initialize(true)` resumes it, as UI5 does. */\n\tprivate _stoppedRoute = \"\";\n\tprivate _settlementResolvers: ((result: NavigationResult) => void)[] = [];\n\tprivate _lastSettlement: NavigationResult | null = null;\n\tprivate _pendingGuardDescriptors: GuardDescriptor[];\n\tprivate _sourceDescriptors: ManifestGuardDescriptor[] = [];\n\t/** The manifest guards registered for a route, by which `addRoute()` places the guards a route inherits then. */\n\tprivate _manifestGuards: { descriptor: ManifestGuardDescriptor; fn: GuardFn }[] = [];\n\tprivate _destroyed = false;\n\t/** What UI5 itself wrote to `_bMatchingProcessStarted` (see {@link _mirrorMatchingProcess}). */\n\tprivate _nativeMatching = false;\n\t/** Promises that wait for the `routeMatched` of a match that has not started (see {@link attachRouteMatched}). */\n\tprivate _matchWaiters: (() => void)[] = [];\n\t/**\n\t * Set while block-mode guard modules load; `start` says whether to initialize once they have,\n\t * `ignoreInitialHash` is the argument of the `initialize()` call that asked for it.\n\t */\n\tprivate _blockLoad: { start: boolean; ignoreInitialHash?: boolean } | null = null;\n\tprivate _meta: RouteMetaStore;\n\t/** Recorded by `addRoute()`, which the UI5 constructor calls before field setup; `declare` keeps field setup from resetting it. */\n\tdeclare private _routeNames: string[];\n\t/** Routes that also match when an earlier route has matched the hash (`greedy: true`). */\n\tdeclare private _greedyRouteNames: string[];\n\tprivate readonly _ownerComponent: UIComponent | undefined;\n\n\tconstructor(routes?: object | object[], config?: GuardRouterConfig, owner?: UIComponent, targetsConfig?: object);\n\tconstructor(\n\t\troutes?: object | object[],\n\t\tconfig?: GuardRouterConfig,\n\t\towner?: UIComponent,\n\t\t...rest: [targetsConfig?: object]\n\t) {\n\t\tconst isRecordConfig = isRecord(config);\n\t\tconst guardRouter = isRecordConfig ? config.guardRouter : undefined;\n\t\t// UI5 passes more than its types declare: after the targets config comes the\n\t\t// hash changer of a component that is loaded as a routing target.\n\t\tsuper(routes, isRecordConfig ? withoutGuardRouter(config) : config, owner, ...rest);\n\t\tthis._ownerComponent = owner;\n\t\t// A config without routes has made no addRoute() call.\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tthis._mirrorMatchingProcess();\n\t\tlet componentNamespace = \"\";\n\t\tconst appConfig: unknown = owner?.getManifestEntry(\"sap.app\");\n\t\tif (isRecord(appConfig) && typeof appConfig.id === \"string\") {\n\t\t\tcomponentNamespace = appConfig.id;\n\t\t}\n\t\tconst parsed = parseGuardRouterConfig(guardRouter, componentNamespace);\n\t\tthis._options = parsed.options;\n\t\tthis._meta = new RouteMetaStore(\n\t\t\tparsed.routeMeta,\n\t\t\tthis._options.inheritance === \"pattern-tree\" ? () => this._collectRoutePatterns() : null,\n\t\t);\n\t\tthis._pendingGuardDescriptors = parsed.guards;\n\n\t\t// Fire-and-forget preload hint: a module cached by initialize()\n\t\t// needs no async load on navigation (see _registerLazyGuards).\n\t\t// Block mode loads modules itself in initialize().\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tconst uniquePaths = [...new Set(this._pendingGuardDescriptors.map((d) => d.modulePath))];\n\t\t\t// A failed preload is reported when the guard runs: its lazy load warns\n\t\t\t// and the navigation settles as Error.\n\t\t\tsap.ui.require(uniquePaths, undefined, () => {});\n\t\t}\n\t}\n\n\t/**\n\t * Report a navigation that waits for async guards as a route match in progress, through the\n\t * UI5-private member `_bMatchingProcessStarted` of `sap.ui.core.routing.Router`. UI5 reads it\n\t * to tell whether the router of a nested component is still matching; without this, a parent\n\t * route would count the component as displayed before its first route matched. The router does\n\t * not write the member: it replaces it with an accessor that keeps what UI5 writes in\n\t * {@link _nativeMatching} and also reads `true` while a navigation is postponed.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t */\n\tprivate _mirrorMatchingProcess(): void {\n\t\tObject.defineProperty(this, \"_bMatchingProcessStarted\", {\n\t\t\tget: () => this._isMatching(),\n\t\t\tset: (matching: boolean) => {\n\t\t\t\tthis._nativeMatching = matching;\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Whether a route match is in progress: in UI5, or postponed until async guards have decided. */\n\tprivate _isMatching(): boolean {\n\t\treturn this._nativeMatching || (this._phase.kind === \"evaluating\" && this._phase.postponed === true);\n\t}\n\n\t/**\n\t * Attach an event handler for the `routeMatched` event, as the native router does. In addition,\n\t * remember a Promise resolve function ({@link isPromiseResolver}) that is subscribed while the\n\t * router is not initialized or a match is in progress: that is how a UI5 component target\n\t * waits for this router. UI5 relies on a match always ending in `routeMatched`, which a\n\t * navigation that guards block, fail or cancel never fires, so {@link _settleMatchWaiters}\n\t * resolves the Promise then. Application code that subscribes a Promise resolve function under\n\t * the same condition is treated alike.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t *\n\t * @override sap.ui.core.routing.Router#attachRouteMatched\n\t * @since 1.7.0\n\t */\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this;\n\toverride attachRouteMatched(fnFunction: (evt: Router$RouteMatchedEvent) => void, oListener?: object): this;\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\tif (isPromiseResolver(oData) && (!this.isInitialized() || this._isMatching())) {\n\t\t\tthis._matchWaiters.push(oData);\n\t\t}\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn super.attachRouteMatched(oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Decide what becomes of the Promises that wait for a `routeMatched`\n\t * (see {@link attachRouteMatched}). Runs in a microtask after a settlement, so that a commit\n\t * has reached `super.parse()` and a navigation that supersedes the settled one has started:\n\t * - A navigation waits for async guards: the Promises keep waiting, for its settlement.\n\t * - UI5 is matching a route: the Promises are forgotten, the `routeMatched` of that match\n\t * resolves them. If UI5 never fires it, because the display of a target fails, they wait\n\t * forever, as with the native router.\n\t * - Otherwise no match is coming, and the Promises are resolved.\n\t *\n\t * A navigation that starts after this microtask is not waited for. A Promise that is resolved\n\t * here stays subscribed, and UI5 calls it again with the next `routeMatched`, which has no\n\t * effect on a Promise.\n\t */\n\tprivate _settleMatchWaiters(): void {\n\t\tif (this._phase.kind === \"evaluating\" && this._phase.postponed) return;\n\t\tconst waiters = this._matchWaiters;\n\t\tthis._matchWaiters = [];\n\t\tif (this._nativeMatching) return;\n\t\tfor (const resolve of waiters) resolve();\n\t}\n\n\t/**\n\t * Initialize the router. When manifest guards are declared and\n\t * `guardLoading` is `\"block\"`, module loading starts and\n\t * `super.initialize()` is deferred until all modules are loaded.\n\t * In `\"lazy\"` mode, lazy wrappers are registered synchronously\n\t * and `super.initialize()` is called immediately.\n\t *\n\t * While block-mode modules load, the router is not initialized yet:\n\t * calling `initialize()` again changes nothing, and `stop()` cancels\n\t * the pending start until `initialize()` is called again.\n\t *\n\t * @param bIgnoreInitialHash - Whether the current hash is left unparsed, as in the native router (since 1.7.0).\n\t * @override sap.ui.core.routing.Router#initialize\n\t * @since 1.0.1\n\t */\n\toverride initialize(bIgnoreInitialHash?: boolean): this {\n\t\tif (this._blockLoad) {\n\t\t\tif (!this._blockLoad.start) {\n\t\t\t\tthis._blockLoad.start = true;\n\t\t\t\tthis._blockLoad.ignoreInitialHash = bIgnoreInitialHash;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (this._pendingGuardDescriptors.length === 0) {\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\tconst descriptors = this._pendingGuardDescriptors.map((source) => ({ ...source, source }));\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = descriptors;\n\n\t\tconst expandedDescriptors =\n\t\t\tthis._options.inheritance === \"pattern-tree\"\n\t\t\t\t? expandToDescendants(descriptors, this._collectRoutePatterns())\n\t\t\t\t: descriptors;\n\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tthis._registerLazyGuards(expandedDescriptors);\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\t// \"block\" mode: load all modules, then register their guards in declaration order\n\t\t// and initialize. Load and registration failures are logged per module and never\n\t\t// reject. A router destroyed while modules load stays destroyed.\n\t\tconst blockLoad = { start: true, ignoreInitialHash: bIgnoreInitialHash };\n\t\tthis._blockLoad = blockLoad;\n\t\tvoid loadGuardModules(expandedDescriptors).then((results) => {\n\t\t\tthis._blockLoad = null;\n\t\t\tif (this._destroyed) return;\n\t\t\tfor (const { descriptor, guards } of results) {\n\t\t\t\tfor (const fn of guards) this._registerManifestGuard(descriptor, fn);\n\t\t\t}\n\t\t\tif (blockLoad.start) this._start(blockLoad.ignoreInitialHash);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Start the native router. With `ignoreInitialHash` it parses nothing and resumes the route\n\t * that was displayed when the router stopped. That route is the current one again, on the hash\n\t * that the URL shows now, so that its leave guards run and a blocked hash change returns to it.\n\t */\n\tprivate _start(ignoreInitialHash?: boolean): this {\n\t\t// UI5 only warns about a router that is initialized already.\n\t\tconst starting = !this.isInitialized();\n\t\tif (starting) {\n\t\t\t// Before the listener of UI5 that calls parse(), which initialize() attaches.\n\t\t\tthis.getHashChanger().attachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t\t// After the listener of UI5 that informs the routers, which is attached with the hash\n\t\t\t// changer of the first router: UI5 has reported a hash change to every router when\n\t\t\t// this one runs.\n\t\t\tthis._rootHashChanger = HashChanger.getInstance();\n\t\t\tthis._rootHashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\t}\n\t\tsuper.initialize(ignoreInitialHash);\n\t\tif (starting && ignoreInitialHash) {\n\t\t\t// UI5 has reset the hash of the hash changer if a target was displayed without a route.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tthis._currentRoute = this._stoppedRoute;\n\t\t\tthis._currentHash = shownHash ?? null;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * The hash changer of this router reports a hash change: `parse()` is called with it next.\n\t *\n\t * The report is out of date if the hash changer shows a later hash by now, one that it has\n\t * reported to this router already. That happens to a router that shares its hash changer, as\n\t * the routers of all components that are not routing targets do: a router that is informed\n\t * first redirects the hash, UI5 reports the target to every router, and only then the hash\n\t * that was redirected to the routers that are informed later. A hash changer that reports\n\t * while a parent router collects the hashes of a navigation shows no hash at all.\n\t */\n\tprivate _onHashReported(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\tconst shown: unknown = this.getHashChanger().getHash();\n\t\tthis._reportedHash = newHash;\n\t\tthis._reportOutdated = shown !== newHash && shown === this._lastReport;\n\t\tif (!this._reportOutdated) this._lastReport = newHash;\n\t}\n\n\t/**\n\t * UI5 has reported a hash change to every router. The event tells what the URL showed before\n\t * the change, which is what undoes it. A snapshot of the URL taken at any other time would not\n\t * do: the URL also changes without an event, as when the Fiori launchpad puts it back after\n\t * a cross-app navigation that the user cancelled. A navigation that waited for this to put\n\t * the URL back does so now (see {@link _undoHashChange}).\n\t */\n\tprivate _onRootHashChanged(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\t// Only the first hash change that the page reports has no previous hash.\n\t\tconst oldHash = event.getParameter(\"oldHash\") ?? \"\";\n\t\tconst hashChanger = HashChanger.getInstance();\n\t\tif (hashChanger === this._rootHashChanger) {\n\t\t\tthis._completeUndo(newHash, oldHash);\n\t\t\treturn;\n\t\t}\n\t\t// The global hash changer was replaced (HashChanger.replaceHashChanger(), as the shell of\n\t\t// the Fiori launchpad does). UI5 has moved this listener to the new one, in front of its\n\t\t// listener that informs the routers. From the next hash change on it runs behind again;\n\t\t// for this one, the routers are informed once this listener has returned.\n\t\thashChanger.detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\thashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = hashChanger;\n\t\tqueueMicrotask(() => this._completeUndo(newHash, oldHash));\n\t}\n\n\t/**\n\t * Tell the undo of the pending navigation what the URL showed before the hash change\n\t * `newHash`, and put the URL back if the navigation waited for that.\n\t */\n\tprivate _completeUndo(newHash: unknown, oldHash: string): void {\n\t\tconst undo = this._undo;\n\t\tif (!undo || undo.first !== newHash) return;\n\t\tundo.fullHash ??= oldHash;\n\t\tif (this._phase.kind === \"restoring\" && this._phase.awaitsReport) this._replaceFullHash(undo.fullHash);\n\t}\n\n\t/**\n\t * Add a route dynamically and integrate it into pattern-tree inheritance.\n\t *\n\t * Appends the route name to the internal route list so that\n\t * `_collectRoutePatterns()` includes it in subsequent inheritance\n\t * lookups, clears the metadata cache, and registers any inherited\n\t * manifest guards when `inheritance` is `\"pattern-tree\"`: on every\n\t * route, ancestor guards still run before descendant guards.\n\t *\n\t * @param oConfig - Route configuration object as defined by `sap.ui.core.routing.Route`.\n\t * @param oParent - Optional parent route, forwarded to the parent `addRoute`.\n\t * @override sap.ui.core.routing.Router#addRoute\n\t * @since 1.6.0\n\t */\n\toverride addRoute(oConfig: $RouteSettings, oParent?: Route): void {\n\t\tsuper.addRoute(oConfig, oParent);\n\n\t\tconst name = oConfig.name;\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tif (this._routeNames.includes(name)) return;\n\n\t\tthis._routeNames.push(name);\n\t\tif (oConfig.greedy) this._greedyRouteNames.push(name);\n\t\t// The UI5 constructor adds the routes of the config before this constructor sets up the rest.\n\t\tif (!this._meta) return;\n\t\tthis._meta.invalidate();\n\n\t\tif (this._options.inheritance !== \"pattern-tree\") return;\n\n\t\tconst patterns = this._collectRoutePatterns();\n\t\tconst declared = byRouteDepth(this._sourceDescriptors, new Map(patterns.map((r) => [r.name, r.pattern])));\n\t\tconst rankOf = (descriptor: ManifestGuardDescriptor): number =>\n\t\t\tdeclared.findIndex((entry) => entry.source === descriptor.source);\n\n\t\t// Always use lazy registration: if the module was loaded during\n\t\t// initialize() (block mode), the sync cache probe succeeds immediately.\n\t\t// This avoids an async gap between addRoute() and the first navigation.\n\t\tfor (const descriptor of expandForNewRoute(this._sourceDescriptors, name, patterns)) {\n\t\t\t// Ancestor guards run first: the new guards go before the manifest guards of the route\n\t\t\t// that stem from an entry of a deeper route, or from a later entry of the same depth.\n\t\t\tconst rank = rankOf(descriptor);\n\t\t\tconst next = this._manifestGuards\n\t\t\t\t.filter(\n\t\t\t\t\t(guard) =>\n\t\t\t\t\t\tguard.descriptor.route === descriptor.route &&\n\t\t\t\t\t\tguard.descriptor.type === descriptor.type &&\n\t\t\t\t\t\trankOf(guard.descriptor) > rank,\n\t\t\t\t)\n\t\t\t\t.toSorted((a, b) => rankOf(a.descriptor) - rankOf(b.descriptor))[0];\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn, next?.fn);\n\t\t}\n\t}\n\n\t/**\n\t * Register a global guard that runs for every navigation.\n\t *\n\t * @param guard - Guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"addGuard\")) return this;\n\t\tthis._pipeline.addGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a previously registered global guard.\n\t *\n\t * @param guard - Guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"removeGuard\")) return this;\n\t\tthis._pipeline.removeGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a guard for a specific route.\n\t *\n\t * Accepts either a guard function (registered as an enter guard) or a\n\t * configuration object with `beforeEnter` and/or `beforeLeave` guards.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Guard function or {@link RouteGuardConfig} object.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\t\tlet hasHandler = false;\n\n\t\t\tif (guard.beforeEnter !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeEnter, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addEnterGuard(routeName, guard.beforeEnter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (guard.beforeLeave !== undefined) {\n\t\t\t\thasHandler = true;\n\t\t\t\tif (this._isFn(guard.beforeLeave, \"addRouteGuard\", routeName)) {\n\t\t\t\t\tthis._pipeline.addLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!hasHandler) {\n\t\t\t\tLog.info(\"addRouteGuard: config has no beforeEnter or beforeLeave\", routeName, LOG_COMPONENT);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"addRouteGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\tthis._pipeline.addEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a guard from a specific route.\n\t *\n\t * Accepts the same forms as `addRouteGuard`: a guard function removes\n\t * an enter guard; a configuration object removes `beforeEnter` and/or\n\t * `beforeLeave` by reference.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function or {@link RouteGuardConfig} object to remove by reference.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tif (typeof guard.beforeEnter === \"function\") {\n\t\t\t\tthis.removeRouteGuard(routeName, guard.beforeEnter);\n\t\t\t}\n\t\t\tif (typeof guard.beforeLeave === \"function\") {\n\t\t\t\tthis.removeLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"removeRouteGuard\", routeName)) return this;\n\t\tthis._pipeline.removeEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Leave guards run when navigating **away from** the route, before any\n\t * enter guards for the target route. They answer the binary question\n\t * \"can I leave?\" and return only a boolean (no redirects).\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Leave guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"addLeaveGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addLeaveGuard\");\n\t\tthis._pipeline.addLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Disambiguate the `navTo()` overload shapes into resolved arguments.\n\t *\n\t * UI5's native `navTo` has two signatures where the third parameter is either\n\t * `componentTargetInfo` (object) or `bReplace` (boolean). This method normalizes\n\t * both forms so the rest of `navTo` can work with a single set of variables.\n\t * The options follow `bReplace`, or take its place when it is left out.\n\t */\n\tprivate _resolveNavToArgs(\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): {\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>;\n\t\treplace?: boolean;\n\t\tguardOptions?: GuardNavToOptions;\n\t} {\n\t\tif (typeof componentTargetInfoOrReplace === \"boolean\") {\n\t\t\t// Short form: navTo(name, params, replace, options?)\n\t\t\treturn {\n\t\t\t\treplace: componentTargetInfoOrReplace,\n\t\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : undefined,\n\t\t\t};\n\t\t}\n\t\t// Long form: navTo(name, params, componentTargetInfo, replace, options?)\n\t\treturn {\n\t\t\tcomponentTargetInfo: componentTargetInfoOrReplace,\n\t\t\treplace: typeof replaceOrOptions === \"boolean\" ? replaceOrOptions : undefined,\n\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : options,\n\t\t};\n\t}\n\n\t/** Return `true` when the value is a function; otherwise log a warning. */\n\tprivate _isFn(value: unknown, method: string, detail?: string): boolean {\n\t\tif (typeof value === \"function\") return true;\n\t\tLog.warning(`${method}: not a function, ignoring`, detail, LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/** Apply the `unknownRouteRegistration` policy: warn or throw when the route is unknown. */\n\tprivate _handleUnknownRouteRegistration(routeName: string, methodName: string, kept = \"guard registered\"): void {\n\t\tif (this.getRoute(routeName)) return;\n\n\t\tswitch (this._options.unknownRouteRegistration) {\n\t\t\tcase \"ignore\":\n\t\t\t\treturn;\n\t\t\tcase \"throw\":\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${methodName} called for unknown route \"${routeName}\". ` +\n\t\t\t\t\t\t`Set guardRouter.unknownRouteRegistration to \"warn\" or \"ignore\" to allow this.`,\n\t\t\t\t);\n\t\t\tcase \"warn\":\n\t\t\t\tLog.warning(`${methodName}: unknown route, ${kept} anyway`, routeName, LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Remove a leave guard from a specific route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Leave guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"removeLeaveGuard\", routeName)) return this;\n\t\tthis._pipeline.removeLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return the resolved metadata for a route.\n\t *\n\t * When `inheritance` is `\"pattern-tree\"`, walks the ancestor chain and\n\t * shallow-merges metadata shallowest-first (child values win on conflict).\n\t * Both manifest and runtime metadata participate in inheritance.\n\t * The router caches results; {@link setRouteMeta} and `addRoute()` clear the cache.\n\t *\n\t * Logs a warning for unknown non-empty route names and returns an empty\n\t * frozen object. The empty string `\"\"` is treated as a valid root route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @returns Frozen record of metadata key-value pairs, or an empty frozen object if the route has no metadata.\n\t * @since 1.6.0\n\t */\n\tgetRouteMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\t// Empty string is a valid root route name (initial state before first navigation)\n\t\tif (routeName !== \"\" && !this.getRoute(routeName)) {\n\t\t\tLog.warning(\"getRouteMeta: unknown route, returning empty metadata\", routeName, LOG_COMPONENT);\n\t\t\treturn EMPTY_META;\n\t\t}\n\t\treturn this._meta.get(routeName);\n\t}\n\n\t/**\n\t * Set runtime metadata for a route.\n\t *\n\t * Runtime metadata is merged on top of any manifest-declared metadata\n\t * when retrieved via {@link getRouteMeta}. When `inheritance` is\n\t * `\"pattern-tree\"`, descendant routes also see the updated values.\n\t * Invalidates the resolved-metadata cache. Non-object values are\n\t * ignored with a warning. Subject to the `unknownRouteRegistration` policy.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param meta - Plain object of metadata key-value pairs.\n\t * @returns `this` for chaining.\n\t * @since 1.6.0\n\t */\n\tsetRouteMeta(routeName: string, meta: Record<string, unknown>): this {\n\t\tif (!isRecord(meta)) {\n\t\t\tLog.warning(\"setRouteMeta: expected object, ignoring\", routeName, LOG_COMPONENT);\n\t\t\treturn this;\n\t\t}\n\t\tif (routeName !== \"\") this._handleUnknownRouteRegistration(routeName, \"setRouteMeta\", \"metadata stored\");\n\t\tthis._meta.set(routeName, meta);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return a Promise that settles when the current guard pipeline finishes.\n\t *\n\t * If a navigation is pending, the Promise resolves when that pipeline settles.\n\t * If no navigation is pending, it resolves immediately with the most recent\n\t * settlement result. Before any navigation has settled, it falls back to a\n\t * synthetic `Committed` result derived from the router's current route/hash\n\t * state. After `stop()`, that idle fallback reports empty route/hash values\n\t * until a new navigation settles, or `initialize(true)` resumes the route.\n\t *\n\t * @returns Promise that resolves with a {@link NavigationResult} once the pipeline settles.\n\t * @since 1.2.0\n\t */\n\tnavigationSettled(): Promise<NavigationResult> {\n\t\tif (this._phase.kind === \"idle\" || this._phase.kind === \"committing\") {\n\t\t\treturn Promise.resolve(\n\t\t\t\tthis._lastSettlement ?? {\n\t\t\t\t\tstatus: NavigationOutcome.Committed,\n\t\t\t\t\troute: this._currentRoute,\n\t\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis._settlementResolvers.push(resolve);\n\t\t});\n\t}\n\n\t/**\n\t * Attach an event handler for the `navigationSettled` event.\n\t *\n\t * Fires synchronously after every guard pipeline settlement with\n\t * a {@link NavigationResult} payload. Unlike the one-shot\n\t * `navigationSettled()` Promise, this event fires for every\n\t * navigation outcome without re-registration.\n\t *\n\t * @param oData - Application-specific payload passed to the handler as second argument.\n\t * @param fnFunction - The function to be called when the event occurs.\n\t * @param oListener - Context object to call the event handler with. Defaults to this Router.\n\t * @since 1.3.0\n\t */\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this;\n\tattachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this;\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn this.attachEvent(\"navigationSettled\", oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Detach a previously attached `navigationSettled` event handler.\n\t *\n\t * The passed parameters must match those used for registration with\n\t * {@link #attachNavigationSettled} beforehand.\n\t *\n\t * @param fnFunction - The handler function to detach.\n\t * @param oListener - Context object on which the given function had to be called.\n\t * @since 1.3.0\n\t */\n\tdetachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this {\n\t\tthis.detachEvent(\"navigationSettled\", fnFunction, oListener);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Drain all settlement resolvers with the given result and fire\n\t * the `navigationSettled` event.\n\t */\n\tprivate _flushSettlement(result: NavigationResult): void {\n\t\tthis._lastSettlement = result;\n\t\tLog.debug(`Navigation settled: ${result.status}`, result.hash, LOG_COMPONENT);\n\t\t// After the call that settled: by then a commit has reached super.parse(), and a navigation\n\t\t// that supersedes this one has started.\n\t\tqueueMicrotask(() => this._settleMatchWaiters());\n\t\tconst resolvers = this._settlementResolvers;\n\t\tthis._settlementResolvers = [];\n\t\tfor (const resolve of resolvers) {\n\t\t\tresolve(result);\n\t\t}\n\t\ttry {\n\t\t\tthis.fireEvent(\"navigationSettled\", result);\n\t\t} catch (error) {\n\t\t\t// A handler must not keep the router from finishing the navigation it reports.\n\t\t\tLog.error(\"A navigationSettled handler threw\", String(error), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Navigate to a route with preflight guard evaluation.\n\t *\n\t * For programmatic navigation, guards run BEFORE the hash changes.\n\t * This prevents history pollution: blocked navigations never push a\n\t * history entry, and redirected navigations go directly to the final\n\t * target, which is written the way this call asked for (`bReplace`).\n\t *\n\t * A `navTo()` to the committed hash changes no route of this router, so\n\t * no guard runs: any pending navigation is cancelled and the call goes\n\t * to the native `navTo()`, which sets or resets the hashes of nested\n\t * components (`componentTargetInfo`). If the target matches the\n\t * in-flight attempt's hash, the in-flight preflight continues undisturbed.\n\t *\n\t * When all guards are synchronous, the decision and the resulting\n\t * hash change happen in the same tick. When any guard returns a\n\t * Promise, `navTo()` returns `this` immediately and defers the\n\t * hash change to when the guard resolves.\n\t *\n\t * Assumes `super.navTo()` calls `HashChanger.setHash()` which fires\n\t * `hashChanged` synchronously, causing `parse()` to re-enter in the\n\t * same call stack (validated by test). If the hash changer refuses the\n\t * hash change, as the Fiori launchpad's navigation filter does when its\n\t * dirty-state check stops it, nothing is committed and the navigation\n\t * settles as `Blocked`.\n\t *\n\t * With component targets (`componentTargetInfo`) UI5 writes the hash\n\t * later, once the nested components are loaded. The navigation commits\n\t * and settles when `parse()` receives that hash. Until then it is\n\t * pending: a navigation that supersedes it, `stop()` or `destroy()`\n\t * settles it as `Cancelled`. That also ends a navigation whose hash UI5\n\t * never writes, because a nested component failed to load or the router\n\t * is not async.\n\t *\n\t * On a router that is not initialized (before `initialize()`, while\n\t * block-mode guard modules load, after `stop()`) the call goes straight\n\t * to the native `navTo()`, which only sets the hash or does nothing when\n\t * stopped. The guards run when the router starts and parses the hash.\n\t *\n\t * @override sap.ui.core.routing.Router#navTo\n\t * @since 1.0.1\n\t */\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean, options?: GuardNavToOptions): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t\toptions?: GuardNavToOptions,\n\t): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): this {\n\t\tconst { componentTargetInfo, replace, guardOptions } = this._resolveNavToArgs(\n\t\t\tcomponentTargetInfoOrReplace,\n\t\t\treplaceOrOptions,\n\t\t\toptions,\n\t\t);\n\n\t\t// Redirect path: _redirect() calls this.navTo() while in committing/redirect phase.\n\t\t// Bypass preflight -- parse() will commit directly via the committing phase.\n\t\tif (this._phase.kind === \"committing\" && this._phase.origin === \"redirect\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// A router that does not listen to hash changes (not initialized, loading block-mode\n\t\t// guards, or stopped) navigates like the native one: the guards run once it parses the hash.\n\t\tif (!this.isInitialized()) {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst route = this.getRoute(routeName);\n\t\tif (!route) {\n\t\t\t// Unknown route -- let the parent handle it (it logs a warning).\n\t\t\t// Cancel any pending async navigation so settlement resolvers drain\n\t\t\t// and the stale pipeline does not commit a superseded navigation.\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst targetHash = route.getURL(parameters ?? {});\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// Same hash: no route of this router changes, so there is nothing to guard. Cancel any\n\t\t// pending navigation and navigate natively: UI5 still sets the hashes of nested\n\t\t// components (componentTargetInfo), or resets them when none are given.\n\t\tif (targetHash === this._currentHash) {\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\t// A navigationSettled handler of the cancelled navigation may have navigated on.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tif (shownHash === undefined || shownHash === targetHash) {\n\t\t\t\t// If UI5 has reset the hash of the hash changer, after a target was displayed without\n\t\t\t\t// a route, it reports the hash again, and parse() lets the route match again.\n\t\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tconst skipGuards = guardOptions?.skipGuards === true || this._options.navToPreflight === \"bypass\";\n\n\t\t// Pending-hash dedup: if an async preflight for this exact hash is\n\t\t// already running, don't cancel and restart it. A navigation that skips\n\t\t// the guards does not wait for them.\n\t\tif (!skipGuards && this._phase.kind === \"evaluating\" && targetHash === this._phase.attempt.hash) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// parse() evaluates the guards once the hash has changed. It supersedes a pending\n\t\t// navigation then, and undoes the hash change of that navigation with its own.\n\t\tif (!skipGuards && this._options.navToPreflight === \"off\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// Cancel any pending navigation (including previous async preflight).\n\t\t// A superseded hash-change navigation leaves its hash in the URL: restore it\n\t\t// unless this navigation moves the URL.\n\t\tconst restoreHash = this._pendingRestoresHash();\n\t\tthis._cancelPendingNavigation();\n\n\t\tif (skipGuards) {\n\t\t\tthis._navigateAllowed(\n\t\t\t\trouteName,\n\t\t\t\tparameters,\n\t\t\t\tcomponentTargetInfo,\n\t\t\t\treplace,\n\t\t\t\ttargetHash,\n\t\t\t\ttoRoute,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst attempt = this._startAttempt(targetHash, restoreHash);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async preflight result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyPreflightDecision(\n\t\t\t\t\t\td,\n\t\t\t\t\t\trouteName,\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\treplace,\n\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\ttoRoute,\n\t\t\t\t\t\tcontext.bag,\n\t\t\t\t\t\tattempt,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\ttargetHash,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tthis._applyPreflightDecision(\n\t\t\tdecision,\n\t\t\trouteName,\n\t\t\tparameters,\n\t\t\tcomponentTargetInfo,\n\t\t\treplace,\n\t\t\ttargetHash,\n\t\t\ttoRoute,\n\t\t\tcontext.bag,\n\t\t\tattempt,\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Navigate to a `navTo()` target that needs no guards (allowed or bypassed) and commit it,\n\t * or block it if the hash change was refused (see {@link _commitAfterNavTo}).\n\t */\n\tprivate _navigateAllowed(\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tthis._phase = {\n\t\t\tkind: \"committing\",\n\t\t\troute: toRoute,\n\t\t\thash: targetHash,\n\t\t\torigin: \"preflight\",\n\t\t\trestoreHash,\n\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t};\n\t\ttry {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, bReplace);\n\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\tthis._blockNavigation(targetHash, restoreHash);\n\t\t\t}\n\t\t} finally {\n\t\t\t// A failed hash change must not leave the next one to be committed without guards.\n\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\tthis._phase = IDLE;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Apply a preflight guard decision. For \"allow\", enter the committing\n\t * phase and call super.navTo(). For \"block\", flush settlement; the hash is\n\t * only touched to restore it after a superseded hash-change navigation.\n\t * For \"redirect\", start a redirect chain.\n\t * For \"error\", flush Error settlement with the guard's error.\n\t */\n\tprivate _applyPreflightDecision(\n\t\tdecision: GuardDecision,\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._navigateAllowed(\n\t\t\t\t\trouteName,\n\t\t\t\t\tparameters,\n\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\tbReplace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\ttoRoute,\n\t\t\t\t\tattempt.restoreHash,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._startRedirectChain(decision.target, targetHash, bag, attempt, bReplace);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Intercept hash changes and run the guard pipeline before route matching.\n\t *\n\t * Called by the HashChanger on every `hashChanged` event. Runs leave guards\n\t * (current route), then global + route-specific enter guards (target route).\n\t * Stays synchronous when all guards return plain values; falls back to async\n\t * when a guard returns a Promise. A generation counter discards stale results\n\t * when navigations overlap.\n\t *\n\t * @param newHash - The new hash fragment from the URL.\n\t * @override sap.ui.core.routing.Router#parse\n\t * @since 1.0.1\n\t */\n\toverride parse(newHash: string): void {\n\t\tif (this._destroyed) {\n\t\t\t// The base router only warns about a hash change that reaches a destroyed router.\n\t\t\tsuper.parse(newHash);\n\t\t\treturn;\n\t\t}\n\t\tconst reported = this._reportedHash === newHash;\n\t\tthis._reportedHash = null;\n\t\t// The URL shows a later hash, which this router has parsed.\n\t\tif (reported && this._reportOutdated) return;\n\t\t// The hash that _restoreHash() is writing.\n\t\tif (newHash === this._suppressedHash) return;\n\n\t\tconst undo = this._undo;\n\t\tif (undo?.started && undo.fullHash === HashChanger.getInstance().getHash()) {\n\t\t\t// The URL is back where the router has put it (see _undoHashChange), so nothing is\n\t\t\t// evaluated. What the hash changer reports now is the hash of the route that is shown.\n\t\t\tthis._undo = null;\n\t\t\tthis._currentHash = newHash;\n\t\t\tthis._finishRestore(newHash);\n\t\t\treturn;\n\t\t}\n\n\t\tconst phase = this._phase;\n\t\tconst commit = phase.kind === \"awaitingHash\" ? phase.commit : phase.kind === \"committing\" ? phase : null;\n\t\tif (commit?.hash === newHash) {\n\t\t\tthis._phase = commit;\n\t\t\tthis._commitNavigation(newHash, commit.route);\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentHash = this._currentHash;\n\t\tif (newHash === currentHash) {\n\t\t\tif (this._pendingRestoresHash()) {\n\t\t\t\t// The URL is back on the committed hash, whose route was never left. That ends the\n\t\t\t\t// navigation that had moved it away; one that waits for UI5 to write its hash goes on.\n\t\t\t\tif (this._phase.kind === \"evaluating\") this._cancelPendingNavigation();\n\t\t\t\telse this._undo = null;\n\t\t\t} else {\n\t\t\t\t// The committed hash is reported again, and its route matches again as it does\n\t\t\t\t// natively: UI5 has written the hash of a navigation with component targets, or has\n\t\t\t\t// reset the hash of the hash changer after a target was displayed without a route,\n\t\t\t\t// or parse() was called directly.\n\t\t\t\tsuper.parse(newHash);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst routeInfo = this._matchRoute(newHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// A pending navigation that has moved the URL as well leaves this one to undo both changes.\n\t\tconst pendingUndo = this._pendingRestoresHash() ? undo : null;\n\t\t// The router is putting the URL back and gets another hash: that one is not undone as a\n\t\t// whole, so that an undo cannot cause the next one.\n\t\tconst undoing = this._phase.kind === \"restoring\";\n\t\tthis._cancelPendingNavigation();\n\t\t// A navigationSettled handler that navigated on the cancellation has moved the URL on.\n\t\tif (this._currentHash !== currentHash) return;\n\t\tthis._undo = undoing ? null : this._describeUndo(pendingUndo, reported);\n\t\t// Another listener of the hash change that navTo() caused has replaced the hash, before\n\t\t// this router received it: undoing this hash change undoes the one of navTo() as well.\n\t\tif (this._undo && commit === phase && !commit.restoreHash) this._undo.fullHash = commit.writtenOver;\n\n\t\tconst direction = reported ? History.getInstance().getDirection() : undefined;\n\t\tconst attempt = this._startAttempt(newHash, true, direction);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, newHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async guard result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\tnewHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyDecision(d, newHash, toRoute, context.bag, attempt);\n\t\t\t\t},\n\t\t\t\tnewHash,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyDecision(decision, newHash, toRoute, context.bag, attempt);\n\t}\n\n\t/**\n\t * Stop listening to hash changes and reset guard state.\n\t *\n\t * Resets `_currentRoute` and `_currentHash` so that a subsequent\n\t * `initialize()` re-parses the current hash and fires `routeMatched`,\n\t * matching the native `sap.m.routing.Router` behavior. The route is\n\t * kept for `initialize(true)`, which resumes it instead.\n\t *\n\t * @override sap.ui.core.routing.Router#stop\n\t * @since 1.0.1\n\t */\n\toverride stop(): this {\n\t\tif (this._blockLoad) this._blockLoad.start = false;\n\t\t// Cancel first so in-flight navigationSettled() resolvers receive the\n\t\t// Cancelled result before _lastSettlement is cleared below.\n\t\tthis._cancelPendingNavigation();\n\t\t// A hash change that was to put the URL back does not reach a stopped router.\n\t\tthis._undo = null;\n\t\t// Nothing is committed on a router that is stopped already, or stops before its first navigation settles.\n\t\tif (this._currentHash !== null) this._stoppedRoute = this._currentRoute;\n\t\tthis._currentRoute = \"\";\n\t\tthis._currentHash = null;\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tsuper.stop();\n\t\treturn this;\n\t}\n\n\t/** Detach what {@link _start} has attached. */\n\tprivate _detachHashListeners(): void {\n\t\tthis.getHashChanger().detachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t// UI5 moves the listener along when the global hash changer is replaced.\n\t\tHashChanger.getInstance().detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = null;\n\t}\n\n\t/**\n\t * Invalidate any in-flight async guard work. Bumps the generation counter\n\t * so pending `.then()` callbacks see they are stale, aborts the signal,\n\t * and transitions to idle. A navigation that waits for its guards or for\n\t * its hash settles as `Cancelled`. With `restoreHash`, a cancelled hash-change\n\t * navigation also gets its hash restored: `navTo()` passes it when the\n\t * call itself will not move the URL.\n\t */\n\tprivate _cancelPendingNavigation(restoreHash = false): void {\n\t\t++this._parseGeneration;\n\t\tconst phase = this._phase;\n\t\tconst pendingRestoresHash = this._pendingRestoresHash();\n\t\t// Idle before the settlement fires, so that a handler can navigate.\n\t\tthis._phase = IDLE;\n\t\t// A navigation that is committing ends with the navigation that supersedes it.\n\t\tif (phase.kind === \"idle\" || phase.kind === \"committing\") return;\n\t\tif (phase.kind === \"restoring\") {\n\t\t\t// A navigation that waits for the URL to be back has ended already: it settles as it ended.\n\t\t\tthis._flushSettlement(phase.result);\n\t\t\treturn;\n\t\t}\n\t\tif (phase.kind === \"evaluating\") phase.attempt.controller.abort();\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Cancelled, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tphase.kind === \"evaluating\" ? phase.attempt.hash : phase.commit.hash,\n\t\t\trestoreHash && pendingRestoresHash,\n\t\t);\n\t}\n\n\t/**\n\t * Whether the pending navigation leaves a hash in the URL that never committed, the one of a\n\t * hash-change navigation: it must be restored unless a navigation moves the URL.\n\t */\n\tprivate _pendingRestoresHash(): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind === \"evaluating\") return phase.attempt.restoreHash;\n\t\tif (phase.kind === \"committing\") return phase.restoreHash;\n\t\treturn phase.kind === \"awaitingHash\" && phase.commit.restoreHash;\n\t}\n\n\t/**\n\t * Start evaluating a navigation. Its generation is its own, so the result of any earlier\n\t * attempt is stale: also one that a navigationSettled handler started while this\n\t * navigation cancelled its predecessor, which is aborted here without a settlement.\n\t */\n\tprivate _startAttempt(hash: string, restoreHash: boolean, direction?: Direction): NavigationAttempt {\n\t\tif (this._phase.kind === \"evaluating\") this._phase.attempt.controller.abort();\n\t\tconst attempt: NavigationAttempt = {\n\t\t\thash,\n\t\t\tcontroller: new AbortController(),\n\t\t\tgeneration: ++this._parseGeneration,\n\t\t\trestoreHash,\n\t\t\tdirection,\n\t\t};\n\t\tthis._phase = { kind: \"evaluating\", attempt };\n\t\treturn attempt;\n\t}\n\n\t/**\n\t * Apply the decision of async guards once it is there. Until then the navigation is postponed,\n\t * which UI5 sees as a route match in progress (see {@link _mirrorMatchingProcess}). The pipeline\n\t * turns a failing guard into an error decision, so an error thrown here comes from applying the\n\t * decision, which has no caller to throw to: it is logged, and fails the navigation unless that\n\t * has settled.\n\t */\n\tprivate _applyWhenDecided(\n\t\tdecision: PromiseLike<GuardDecision>,\n\t\tapply: (decision: GuardDecision) => void,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tif (this._phase.kind === \"evaluating\") this._phase = { ...this._phase, postponed: true };\n\t\tdecision.then((d) => {\n\t\t\tconst lastSettlement = this._lastSettlement;\n\t\t\ttry {\n\t\t\t\tapply(d);\n\t\t\t} catch (error) {\n\t\t\t\tLog.error(\n\t\t\t\t\t\"Navigation failed after its guards had settled\",\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tif (this._lastSettlement === lastSettlement) {\n\t\t\t\t\tthis._errorNavigation(error, attemptedHash, restoreHash);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Apply a guard decision for the parse() fallback path.\n\t */\n\tprivate _applyDecision(\n\t\tdecision: GuardDecision,\n\t\thash: string,\n\t\troute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._phase = { kind: \"committing\", route, hash, origin: \"parse\", restoreHash: false };\n\t\t\t\tthis._commitNavigation(hash, route);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(hash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\t// The hash that redirects has reached the browser: the target takes its history entry.\n\t\t\t\tthis._startRedirectChain(decision.target, hash, bag, attempt, true);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, hash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Leave the title history of UI5 (`getTitleHistory()`) as after the native equivalent of a\n\t * redirected hash change: the hash change, then `navTo(target, ..., true)`. The route of the\n\t * hash change never matched, so UI5 has not handled its title:\n\t * - A new entry or a step forward would have added a title, which the title of the target\n\t * replaces: UI5 must not remove the title of the route before it.\n\t * - A step back would have removed the title of the route that was left, so that the target\n\t * replaces the title of the entry the step arrived at: UI5 removes the first for the\n\t * replaced hash, the router removes the second, under the condition of UI5 for a step back.\n\t */\n\tprivate _alignTitleHistory(direction: Direction | undefined): void {\n\t\tif (direction === HistoryDirection.NewEntry || direction === HistoryDirection.Forwards) {\n\t\t\tReflect.set(this, \"_bLastHashReplaced\", false);\n\t\t} else if (direction === HistoryDirection.Backwards) {\n\t\t\tconst titles: unknown[] = this.getTitleHistory();\n\t\t\tconst left = titles.at(-1);\n\t\t\tconst replaced = titles.at(-2);\n\t\t\tif (isRecord(left) && isRecord(replaced) && !left.isHome && left.title !== replaced.title) {\n\t\t\t\ttitles.splice(-2, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Delegate to the parent router and update internal state.\n\t *\n\t * State is updated BEFORE calling parse to ensure that if event handlers\n\t * (e.g., routeMatched) trigger nested navigation, the leave guards will\n\t * run for the correct (new) route rather than the old one. The settlement\n\t * fires before parse as well, so the settlements of such nested navigations\n\t * follow it.\n\t */\n\tprivate _commitNavigation(hash: string, route: string): void {\n\t\tconst wasRedirect = this._phase.kind === \"committing\" && this._phase.origin === \"redirect\";\n\t\tif (this._phase.kind === \"committing\") this._alignTitleHistory(this._phase.direction);\n\t\t// The URL has moved on: a hash change that was to put it back is not awaited any more.\n\t\tthis._undo = null;\n\t\tthis._currentHash = hash;\n\t\tthis._currentRoute = route;\n\t\t// Transition to idle before super.parse so that routeMatched/patternMatched\n\t\t// handlers that call navTo() go through the full guard pipeline.\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: wasRedirect\n\t\t\t\t? NavigationOutcome.Redirected\n\t\t\t\t: this._currentRoute === \"\"\n\t\t\t\t\t? NavigationOutcome.Bypassed\n\t\t\t\t\t: NavigationOutcome.Committed,\n\t\t\troute: this._currentRoute,\n\t\t\thash,\n\t\t});\n\t\t// A navigationSettled handler that navigated on has committed its own hash.\n\t\tif (this._currentHash !== hash) return;\n\t\tsuper.parse(hash);\n\t}\n\n\t/**\n\t * Commit the navigation of the committing phase after `super.navTo()` unless `parse()` has\n\t * committed it. Returns whether the navigation takes place:\n\t * - The hash changer shows the target hash: the route matches here.\n\t * - UI5 writes the hash later, which it does with component targets, once the nested\n\t * components are loaded. The navigation waits for it: it commits, and the route matches,\n\t * when `parse()` gets that hash, as the route does natively. Committed here, the router\n\t * would be on a route that UI5 does not display if the hash is never written.\n\t * - Otherwise the hash changer has refused the hash change, as the Fiori launchpad does while\n\t * it asks the user about unsaved data. Nothing changed, so nothing is committed.\n\t */\n\tprivate _commitAfterNavTo(componentTargetInfo: Record<string, ComponentTargetParameters> | undefined): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"committing\") return true;\n\t\tif (this.getHashChanger().getHash() === phase.hash) {\n\t\t\tthis._commitNavigation(phase.hash, phase.route);\n\t\t\treturn true;\n\t\t}\n\t\tif (!componentTargetInfo || Object.keys(componentTargetInfo).length === 0) return false;\n\t\tthis._phase = { kind: \"awaitingHash\", commit: phase };\n\t\treturn true;\n\t}\n\n\t/**\n\t * Evaluate guards on a redirect target and apply the resulting decision.\n\t *\n\t * Handles the unknown-route block, loop detection (visited-hash set +\n\t * depth cap), sync/async guard evaluation, and recursive chaining when\n\t * the target's guard itself returns a redirect. All hops in a chain\n\t * share the same AbortSignal and generation counter from the original\n\t * navigation so that a superseding navigation correctly discards\n\t * in-flight redirect work.\n\t *\n\t * @param target - Redirect target: a route name string or {@link GuardRedirect} with parameters.\n\t * @param chain - Mutable context threaded through the redirect chain (visited set, signals, etc.).\n\t */\n\tprivate _redirect(target: string | GuardRedirect, chain: RedirectChainContext): void {\n\t\tconst targetName = typeof target === \"string\" ? target : target.route;\n\t\tconst targetRoute = this.getRoute(targetName);\n\t\tif (!targetRoute) {\n\t\t\tLog.warning(\n\t\t\t\t`Guard redirect target \"${targetName}\" is not a known route, treating as blocked`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tlet targetHash: string;\n\t\ttry {\n\t\t\ttargetHash = targetRoute.getURL(typeof target === \"string\" ? {} : (target.parameters ?? {}));\n\t\t} catch (error) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect target \"${targetName}\" has no valid hash, navigation failed`,\n\t\t\t\tString(error),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._errorNavigation(error, chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\n\t\tif (chain.visited.has(targetHash)) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect loop detected: ${[...chain.visited, targetHash].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tif (chain.visited.size > MAX_REDIRECT_DEPTH) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect chain exceeded maximum depth (${MAX_REDIRECT_DEPTH}): ${[...chain.visited].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tchain.visited.add(targetHash);\n\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, chain.signal, chain);\n\n\t\tconst decision = this._evaluateGuards(context, true);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => this._applyRedirectDecision(d, target, targetHash, toRoute, chain),\n\t\t\t\tchain.attemptedHash,\n\t\t\t\tchain.restoreHash,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyRedirectDecision(decision, target, targetHash, toRoute, chain);\n\t}\n\n\t/**\n\t * Apply a guard decision within a redirect chain. For \"allow\", enter\n\t * committing phase and delegate to navTo (which hits the existing bypass);\n\t * if that does not reach parse(), commit the target directly. A target that\n\t * is displayed already settles the navigation without a commit.\n\t * For \"block\", block the entire chain. For \"redirect\", recurse.\n\t *\n\t * @param decision - Normalized guard pipeline result for this hop.\n\t * @param target - The redirect target (route name or {@link GuardRedirect}).\n\t * @param targetHash - Resolved hash for the redirect target.\n\t * @param toRoute - Route that matches the hash, as in the hop's guard context: the route UI5 displays.\n\t * @param chain - Shared redirect chain context with visited set, signals, etc.\n\t */\n\tprivate _applyRedirectDecision(\n\t\tdecision: GuardDecision,\n\t\ttarget: string | GuardRedirect,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tchain: RedirectChainContext,\n\t): void {\n\t\t// Superseded while the hop's guards ran: by a newer navigation, or by a guard that navigated.\n\t\tif (chain.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\": {\n\t\t\t\tconst componentTargetInfo = typeof target === \"string\" ? undefined : target.componentTargetInfo;\n\t\t\t\tif (targetHash === this._currentHash) {\n\t\t\t\t\t// The target is displayed already, so no route matches again, as for a navTo() to\n\t\t\t\t\t// the committed hash: the URL is put back and UI5 sets the hashes of nested components.\n\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\tthis._settleUncommitted(\n\t\t\t\t\t\t{ status: NavigationOutcome.Redirected, route: this._currentRoute, hash: targetHash },\n\t\t\t\t\t\tchain.attemptedHash,\n\t\t\t\t\t\tchain.restoreHash,\n\t\t\t\t\t\ttypeof target !== \"string\" && componentTargetInfo\n\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t// Unless a settlement handler has moved the URL on.\n\t\t\t\t\t\t\t\t\tif (this.getHashChanger().getHash() !== targetHash) return;\n\t\t\t\t\t\t\t\t\tsuper.navTo(\n\t\t\t\t\t\t\t\t\t\ttarget.route,\n\t\t\t\t\t\t\t\t\t\ttarget.parameters ?? {},\n\t\t\t\t\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\t\t\t\t\tchain.replace,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis._phase = {\n\t\t\t\t\tkind: \"committing\",\n\t\t\t\t\troute: toRoute,\n\t\t\t\t\thash: targetHash,\n\t\t\t\t\torigin: \"redirect\",\n\t\t\t\t\tdirection: chain.direction,\n\t\t\t\t\trestoreHash: chain.restoreHash,\n\t\t\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\t// Writing the hash the URL already shows changes nothing, except that a nested\n\t\t\t\t\t// router would add its prefix for an empty hash (see _restoreHash).\n\t\t\t\t\tconst hashShown = this.getHashChanger().getHash() === targetHash;\n\t\t\t\t\tif (typeof target === \"string\") {\n\t\t\t\t\t\tif (!hashShown) this.navTo(target, {}, {}, chain.replace);\n\t\t\t\t\t} else if (!hashShown || componentTargetInfo) {\n\t\t\t\t\t\tthis.navTo(target.route, target.parameters ?? {}, componentTargetInfo, chain.replace);\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._redirect(decision.target, chain);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The route that matches a hash, and its arguments. For a hash that no route matches: no route (`\"\"`), no arguments. */\n\tprivate _matchRoute(hash: string): RouteInfo {\n\t\tconst info = this.getRouteInfoByHash(hash);\n\t\treturn { name: info?.name ?? \"\", arguments: info?.arguments ?? {} };\n\t}\n\n\t/**\n\t * The greedy routes that match `hash` in addition to `firstMatch`, the first route that\n\t * matches it. UI5 matches them as well and fires their events.\n\t */\n\tprivate _greedyMatches(hash: string, firstMatch: string): string[] {\n\t\treturn this._greedyRouteNames.filter((name) => name !== firstMatch && this.getRoute(name)?.match(hash));\n\t}\n\n\t/**\n\t * Evaluate the guards of a navigation: of the routes in its context, and of the greedy routes\n\t * that are left and entered with them. A hop of a redirect chain leaves no route.\n\t */\n\tprivate _evaluateGuards(context: GuardContext, redirectHop = false): GuardDecision | Promise<GuardDecision> {\n\t\treturn this._pipeline.evaluate(context, {\n\t\t\tskipLeaveGuards: redirectHop,\n\t\t\talsoLeaving: this._greedyMatches(context.fromHash, context.fromRoute),\n\t\t\talsoEntering: this._greedyMatches(context.toHash, context.toRoute),\n\t\t});\n\t}\n\n\t/**\n\t * Build the guard context of a navigation to `routeInfo`. A hop of a redirect chain passes the\n\t * chain, whose source route, source hash and bag are those of the original navigation.\n\t */\n\tprivate _createGuardContext(\n\t\trouteInfo: RouteInfo,\n\t\ttoHash: string,\n\t\tsignal: AbortSignal,\n\t\tchain?: RedirectChainContext,\n\t): GuardContext {\n\t\tconst fromRoute = chain ? chain.fromRoute : this._currentRoute;\n\t\treturn {\n\t\t\ttoRoute: routeInfo.name,\n\t\t\ttoHash,\n\t\t\ttoArguments: routeInfo.arguments,\n\t\t\tfromRoute,\n\t\t\tfromHash: chain ? chain.fromHash : (this._currentHash ?? \"\"),\n\t\t\tsignal,\n\t\t\tbag: chain ? chain.bag : new Map<string, unknown>(),\n\t\t\ttoMeta: this.getRouteMeta(routeInfo.name),\n\t\t\tfromMeta: this.getRouteMeta(fromRoute),\n\t\t\townerComponent: this._ownerComponent,\n\t\t};\n\t}\n\n\t/**\n\t * Start a new redirect chain for the given evaluating attempt.\n\t * Called by {@link _applyPreflightDecision} and {@link _applyDecision}\n\t * when a guard returns a redirect. Delegates to {@link _redirect} with\n\t * a fresh {@link RedirectChainContext}.\n\t */\n\tprivate _startRedirectChain(\n\t\ttarget: string | GuardRedirect,\n\t\thash: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t\treplace: boolean | undefined,\n\t): void {\n\t\tconst visited = new Set<string>();\n\t\tvisited.add(hash);\n\t\tthis._redirect(target, {\n\t\t\tvisited,\n\t\t\tattemptedHash: hash,\n\t\t\trestoreHash: attempt.restoreHash,\n\t\t\treplace,\n\t\t\tdirection: attempt.direction,\n\t\t\tfromRoute: this._currentRoute,\n\t\t\tfromHash: this._currentHash ?? \"\",\n\t\t\tsignal: attempt.controller.signal,\n\t\t\tgeneration: attempt.generation,\n\t\t\tbag,\n\t\t});\n\t}\n\n\t/**\n\t * Settle as Blocked. With `restoreHash` (default), the hash change of the navigation is\n\t * undone first (see {@link _settleUncommitted}). Preflight callers pass false unless they\n\t * superseded a hash-change navigation: otherwise the hash was never changed.\n\t */\n\tprivate _blockNavigation(attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Blocked, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Clear pending state and flush an Error settlement.\n\t * Same structure as {@link _blockNavigation} but with `NavigationOutcome.Error`\n\t * and the error that caused the failure.\n\t */\n\tprivate _errorNavigation(error: unknown, attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Error, route: this._currentRoute, hash: this._currentHash ?? \"\", error },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Settle a navigation that did not commit. With `restoreHash`, the hash it left in the URL\n\t * is restored first, so that settlement handlers run on the final URL and a hash they set\n\t * is not overwritten. The exception is a first navigation: nothing is committed yet, so the\n\t * empty hash is restored after the settlement and parsed as a navigation of its own.\n\t * `whenBack` runs after the settlement.\n\t */\n\tprivate _settleUncommitted(\n\t\tresult: NavigationResult,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t\twhenBack?: () => void,\n\t): void {\n\t\tconst loadDefaultRoute = restoreHash && this._currentHash === null && !!attemptedHash;\n\t\t// It settles once the URL is back.\n\t\tif (restoreHash && !loadDefaultRoute && !this._undoHashChange(result, whenBack)) return;\n\t\tthis._flushSettlement(result);\n\t\twhenBack?.();\n\t\t// Unless a handler navigated and committed in the meantime.\n\t\tif (loadDefaultRoute && this._currentHash === null) this._restoreHash(\"\", false);\n\t}\n\n\t/**\n\t * Describe how to undo the hash change that the navigation starts with. After `pending`, the\n\t * undo of a navigation that this one supersedes, it takes back both changes. A `parse()` that\n\t * is not `reported` by the hash changer comes with no hash change.\n\t */\n\tprivate _describeUndo(pending: HashChangeUndo | null, reported: boolean): HashChangeUndo | null {\n\t\tif (!reported) return pending;\n\t\tconst shown = HashChanger.getInstance().getHash();\n\t\tconst step = lastStep;\n\t\tif (!pending) return { first: shown, fullHash: undefined, shown, step, started: false };\n\t\tconst offset = pending.step && step ? pending.step.offset + step.offset : 0;\n\t\treturn {\n\t\t\tfirst: pending.first,\n\t\t\tfullHash: pending.fullHash,\n\t\t\tshown,\n\t\t\tstep: step && offset ? { offset, href: step.href } : null,\n\t\t\tstarted: false,\n\t\t};\n\t}\n\n\t/**\n\t * Put the URL back after a navigation that did not commit. Returns whether it is back;\n\t * otherwise `result` settles when it is.\n\t *\n\t * While the URL still shows the hash change that started the navigation, that change is undone\n\t * as a whole, so that the hashes of nested routers are back as well:\n\t * - A step through the browser history is taken back, which leaves the history as it was.\n\t * The browser does that asynchronously.\n\t * - Any other change (a new entry, or a step the browser does not report) has its entry replaced with\n\t * the full previous hash, once UI5 has reported the change to every router. Nested routers\n\t * have received their part of the refused hash by then; they receive the previous one next.\n\t *\n\t * `parse()` ends the wait when the hash change arrives that shows the full previous hash.\n\t *\n\t * If the URL has moved on since, only the hash of this router is restored. So it is while\n\t * no navigation has committed: the URL before the change showed no route of this router either.\n\t */\n\tprivate _undoHashChange(result: NavigationResult, whenBack?: () => void): boolean {\n\t\tconst undo = this._undo;\n\t\tconst hash = this._currentHash;\n\t\tconst rootHash = HashChanger.getInstance().getHash();\n\t\tif (undo === null || hash === null || undo.shown !== rootHash || undo.fullHash === rootHash) {\n\t\t\tthis._restoreHash(hash ?? \"\");\n\t\t\treturn true;\n\t\t}\n\t\tconst href = window.location.href;\n\t\tundo.started = true;\n\t\tthis._phase = { kind: \"restoring\", result, whenBack };\n\t\tif (undoneHref === href) {\n\t\t\t// Another router is taking the step back.\n\t\t} else if (undo.step) {\n\t\t\tundoneHref = href;\n\t\t\twindow.history.go(-undo.step.offset);\n\t\t} else if (undo.fullHash === undefined) {\n\t\t\t// UI5 is still reporting the change to the nested routers.\n\t\t\tthis._phase = { ...this._phase, awaitsReport: true };\n\t\t} else {\n\t\t\tthis._replaceFullHash(undo.fullHash);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Replace the hash of the root hash changer with the full previous hash, and settle the\n\t * navigation that waits for it unless `parse()` has done so.\n\t */\n\tprivate _replaceFullHash(fullHash: string): void {\n\t\tHashChanger.getInstance().replaceHash(fullHash, HistoryDirection.Unknown);\n\t\tthis._finishRestore();\n\t}\n\n\t/**\n\t * Settle the navigation that waited for the URL to be back: on `hash`, if the hash changer\n\t * has reported one with the URL.\n\t */\n\tprivate _finishRestore(hash?: string): void {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"restoring\") return;\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement(hash === undefined ? phase.result : { ...phase.result, hash });\n\t\tphase.whenBack?.();\n\t}\n\n\t/**\n\t * Restore the previous hash of this router without creating a history entry\n\t * (see {@link _undoHashChange} for the hash change of a navigation).\n\t * Assumes replaceHash fires hashChanged synchronously (validated by test).\n\t * `_currentRoute` stays unchanged because the navigation never\n\t * committed. The user remains on the same logical route.\n\t *\n\t * A hash that the hash changer already shows is not written again: the navigation never\n\t * moved it. For a nested router, writing its empty hash would add its prefix to the browser\n\t * hash (`shell` becomes `shell&/child/`).\n\t */\n\tprivate _restoreHash(hash: string, suppressParse = true): void {\n\t\tconst hashChanger = this.getHashChanger();\n\t\tif (hashChanger.getHash() === hash) return;\n\t\tthis._suppressedHash = suppressParse ? hash : null;\n\t\tvoid hashChanger.replaceHash(hash, HistoryDirection.Unknown);\n\t\tthis._suppressedHash = null;\n\t}\n\n\t/**\n\t * Collect all route names and their patterns from the router.\n\t * Skips routes whose pattern is undefined (no pattern configured).\n\t */\n\tprivate _collectRoutePatterns(): RoutePattern[] {\n\t\tconst result: RoutePattern[] = [];\n\t\tfor (const name of this._routeNames) {\n\t\t\tconst pattern = this.getRoute(name)?.getPattern();\n\t\t\tif (pattern !== undefined) result.push({ name, pattern });\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Register one manifest guard: as the last guard of its route, or in front of the guard\n\t * `before`. A registration error (`unknownRouteRegistration: \"throw\"` for an unknown route)\n\t * is logged and skips the guard: no caller of the manifest config could catch it, and it\n\t * must not keep the router from starting.\n\t */\n\tprivate _registerManifestGuard(descriptor: ManifestGuardDescriptor, guardFn: GuardFn, before?: GuardFn): void {\n\t\ttry {\n\t\t\tif (descriptor.route === \"*\") {\n\t\t\t\tthis.addGuard(guardFn);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (descriptor.type === \"leave\") {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addLeaveGuard\");\n\t\t\t\tthis._pipeline.addLeaveGuard(descriptor.route, guardFn, before);\n\t\t\t} else {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addRouteGuard\");\n\t\t\t\tthis._pipeline.addEnterGuard(descriptor.route, guardFn, before);\n\t\t\t}\n\t\t\tthis._manifestGuards.push({ descriptor, fn: guardFn });\n\t\t} catch (err: unknown) {\n\t\t\tLog.error(`guardRouter.guards: failed to register \"${descriptor.modulePath}\"`, String(err), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/** Register the guards of each descriptor, loading their modules on first use (see `createLazyGuards`). */\n\tprivate _registerLazyGuards(descriptors: ManifestGuardDescriptor[]): void {\n\t\tfor (const descriptor of descriptors) {\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn);\n\t\t}\n\t}\n\n\t/**\n\t * Clean up guards on destroy. Bumps generation to discard pending async results.\n\t * A second call does nothing, like `sap.ui.core.routing.Router#destroy`.\n\t *\n\t * @since 1.0.1\n\t */\n\toverride destroy(): this {\n\t\tif (this._destroyed) return this;\n\t\tthis._destroyed = true;\n\t\tthis._pipeline.clear();\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = [];\n\t\tthis._manifestGuards = [];\n\t\tthis._cancelPendingNavigation();\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tthis._meta.clear();\n\t\tsuper.destroy();\n\t\treturn this;\n\t}\n}\n"],"mappings":";;;;;;QAsBOA,iBAAiB,GAAAC,sBAAA,CAAAC,mBAAA;EAAA,MACjBC,aAAa,GAAAF,sBAAA,CAAAG,eAAA;EAAA,MAAwBC,aAAa,GAAAD,eAAA;EAAA,MAAEE,iBAAiB,GAAAF,eAAA;EAAA,MAAEG,aAAa,GAAAH,eAAA;EAAA,MAC5DI,QAAQ,GAAAC,cAAA;EAAA,MA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AAC2C,IAAI,CAAC;UAAEmB,UAAU;UAAEC,EAAE,EAAEsO;QAAQ,CAAC,CAAC;MACvD,CAAC,CAAC,OAAOE,GAAY,EAAE;QACtBxK,GAAG,CAAC2C,KAAK,CAAC,2CAA2C5G,UAAU,CAACnC,UAAU,GAAG,EAAEgJ,MAAM,CAAC4H,GAAG,CAAC,EAAEnX,aAAa,CAAC;MAC3G;IACD,CAAC;IAED,2GACQsI,mBAAmB,WAAAA,oBAACH,WAAsC,EAAQ;MACzE,KAAK,MAAMO,UAAU,IAAIP,WAAW,EAAE;QACrC,KAAK,MAAMQ,EAAE,IAAIvI,gBAAgB,CAACsI,UAAU,CAAC,EAAE,IAAI,CAACE,sBAAsB,CAACF,UAAU,EAAEC,EAAE,CAAC;MAC3F;IACD,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;IACUyO,OAAO,WAAAC,SAAA,EAAS;MACxB,IAAI,IAAI,CAACxS,UAAU,EAAE,OAAO,IAAI;MAChC,IAAI,CAACA,UAAU,GAAG,IAAI;MACtB,IAAI,CAAChB,SAAS,CAACyT,KAAK,CAAC,CAAC;MACtB,IAAI,CAACtR,wBAAwB,GAAG,EAAE;MAClC,IAAI,CAACrB,kBAAkB,GAAG,EAAE;MAC5B,IAAI,CAACC,eAAe,GAAG,EAAE;MACzB,IAAI,CAACiL,wBAAwB,CAAC,CAAC;MAC/B,IAAI,CAACnL,eAAe,GAAG,IAAI;MAC3B,IAAI,CAACoO,oBAAoB,CAAC,CAAC;MAC3B,IAAI,CAAClN,KAAK,CAAC0R,KAAK,CAAC,CAAC;MAClBC,mCAAA;MACA,OAAO,IAAI;IACZ;EAAC;EAAA,OAnuDmBrU,MAAM;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"Router-dbg.js","names":["NavigationOutcome","_interopRequireDefault","__NavigationOutcome","GuardPipeline","__GuardPipeline","isPromiseLike","isPromiseResolver","LOG_COMPONENT","isRecord","___GuardConfig","parseGuardRouterConfig","createLazyGuards","___GuardModules","loadGuardModules","byRouteDepth","___PatternTree","expandForNewRoute","expandToDescendants","RouteMetaStore","__RouteMetaStore","EMPTY_META","HistoryDirection","coreLibrary","routing","withoutGuardRouter","config","hidden","key","Proxy","get","target","receiver","undefined","Reflect","has","ownKeys","filter","getOwnPropertyDescriptor","isRouteGuardConfig","guard","lastStep","undoneHref","window","navigation","addEventListener","event","href","location","entry","currentEntry","navigationType","offset","index","from","IDLE","kind","MAX_REDIRECT_DEPTH","Router","MobileRouter","extend","constructor","_constructor","routes","owner","rest","isRecordConfig","guardRouter","MobileRouter.prototype.constructor.apply","_pipeline","_currentRoute","_currentHash","_phase","_parseGeneration","_suppressedHash","_undo","_reportedHash","_lastReport","_reportOutdated","_rootHashChanger","_stoppedRoute","_settlementResolvers","_lastSettlement","_sourceDescriptors","_manifestGuards","_destroyed","_nativeMatching","_matchWaiters","_blockLoad","_ownerComponent","_routeNames","_greedyRouteNames","_mirrorMatchingProcess","componentNamespace","appConfig","getManifestEntry","id","parsed","_options","options","_meta","routeMeta","inheritance","_collectRoutePatterns","_pendingGuardDescriptors","guards","guardLoading","uniquePaths","Set","map","d","modulePath","sap","ui","require","Object","defineProperty","_isMatching","set","matching","postponed","attachRouteMatched","_attachRouteMatched","oData","fnFunction","oListener","isInitialized","push","MobileRouter.prototype.attachRouteMatched.call","_settleMatchWaiters","waiters","resolve","initialize","_initialize","bIgnoreInitialHash","start","ignoreInitialHash","length","_start","descriptors","source","expandedDescriptors","_registerLazyGuards","blockLoad","then","results","descriptor","fn","_registerManifestGuard","starting","getHashChanger","attachEvent","_onHashReported","HashChanger","getInstance","_onRootHashChanged","MobileRouter.prototype.initialize.call","shownHash","getHash","newHash","getParameter","shown","oldHash","hashChanger","_completeUndo","detachEvent","queueMicrotask","undo","first","fullHash","awaitsReport","_replaceFullHash","addRoute","_addRoute","oConfig","oParent","MobileRouter.prototype.addRoute.call","name","includes","greedy","invalidate","patterns","declared","Map","r","pattern","rankOf","findIndex","rank","next","route","type","toSorted","a","b","addGuard","_addGuard","_isFn","addGlobalGuard","removeGuard","_removeGuard","removeGlobalGuard","addRouteGuard","_addRouteGuard","routeName","beforeEnter","beforeLeave","Log","info","enter","leave","_handleUnknownRouteRegistration","addEnterGuard","addLeaveGuard","removeRouteGuard","_removeRouteGuard","removeLeaveGuard","removeEnterGuard","_addLeaveGuard","_resolveNavToArgs","componentTargetInfoOrReplace","replaceOrOptions","replace","guardOptions","componentTargetInfo","value","method","detail","warning","methodName","kept","getRoute","unknownRouteRegistration","Error","_removeLeaveGuard","getRouteMeta","_getRouteMeta","setRouteMeta","_setRouteMeta","meta","navigationSettled","_navigationSettled","Promise","status","Committed","hash","attachNavigationSettled","_attachNavigationSettled","detachNavigationSettled","_detachNavigationSettled","_flushSettlement","result","debug","resolvers","fireEvent","error","String","navTo","_navTo","parameters","origin","MobileRouter.prototype.navTo.call","_cancelPendingNavigation","targetHash","getURL","routeInfo","_matchRoute","toRoute","skipGuards","navToPreflight","attempt","restoreHash","_pendingRestoresHash","_navigateAllowed","_startAttempt","generation","context","_createGuardContext","controller","signal","decision","_evaluateGuards","_applyWhenDecided","_applyPreflightDecision","bag","bReplace","writtenOver","_commitAfterNavTo","_blockNavigation","action","_startRedirectChain","_errorNavigation","parse","_parse","MobileRouter.prototype.parse.call","reported","started","_finishRestore","phase","commit","_commitNavigation","currentHash","pendingUndo","undoing","_describeUndo","direction","History","getDirection","_applyDecision","stop","_stop","_detachHashListeners","MobileRouter.prototype.stop.call","pendingRestoresHash","abort","_settleUncommitted","Cancelled","AbortController","apply","attemptedHash","lastSettlement","_alignTitleHistory","NewEntry","Forwards","Backwards","titles","getTitleHistory","left","at","replaced","isHome","title","splice","wasRedirect","Redirected","Bypassed","keys","_redirect","chain","targetName","targetRoute","visited","join","size","add","_applyRedirectDecision","hashShown","getRouteInfoByHash","arguments","_greedyMatches","firstMatch","match","redirectHop","evaluate","skipLeaveGuards","alsoLeaving","fromHash","fromRoute","alsoEntering","toHash","toArguments","toMeta","fromMeta","ownerComponent","Blocked","whenBack","loadDefaultRoute","_undoHashChange","_restoreHash","pending","step","rootHash","history","go","replaceHash","Unknown","suppressParse","getPattern","guardFn","before","err","destroy","_destroy","clear","MobileRouter.prototype.destroy.call"],"sourceRoot":"./","sources":["Router.ts"],"sourcesContent":["import MobileRouter from \"sap/m/routing/Router\";\nimport Log from \"sap/base/Log\";\nimport coreLibrary from \"sap/ui/core/library\";\nimport HashChanger from \"sap/ui/core/routing/HashChanger\";\nimport History from \"sap/ui/core/routing/History\";\nimport type { HashChangerBase$HashChangedEvent } from \"sap/ui/core/routing/HashChangerBase\";\nimport type { ComponentTargetParameters, RouteInfo, Router$RouteMatchedEvent } from \"sap/ui/core/routing/Router\";\nimport type Route from \"sap/ui/core/routing/Route\";\nimport type { $RouteSettings } from \"sap/ui/core/routing/Route\";\nimport type UIComponent from \"sap/ui/core/UIComponent\";\nimport type {\n\tGuardFn,\n\tGuardContext,\n\tGuardNavToOptions,\n\tGuardRedirect,\n\tGuardRouter,\n\tGuardRouterConfig,\n\tLeaveGuardFn,\n\tNavigationResult,\n\tRouter$NavigationSettledEvent,\n\tRouteGuardConfig,\n} from \"./types\";\nimport NavigationOutcome from \"./NavigationOutcome\";\nimport GuardPipeline, { type GuardDecision, isPromiseLike, isPromiseResolver, LOG_COMPONENT } from \"./GuardPipeline\";\nimport { type GuardDescriptor, isRecord, parseGuardRouterConfig, type ResolvedGuardRouterOptions } from \"./GuardConfig\";\nimport { createLazyGuards, loadGuardModules } from \"./GuardModules\";\nimport { byRouteDepth, expandForNewRoute, expandToDescendants, type RoutePattern } from \"./PatternTree\";\nimport RouteMetaStore, { EMPTY_META } from \"./RouteMeta\";\n\nconst HistoryDirection = coreLibrary.routing.HistoryDirection;\ntype Direction = ReturnType<History[\"getDirection\"]>;\n\n/**\n * The router config as UI5 gets it: the caller's object without `guardRouter`. It is a view and\n * not a copy, because UIComponent adds `targetParent` (the ID of the root view) to its config\n * object after it has constructed the router, and the native router reads it from that object.\n */\nfunction withoutGuardRouter(config: object): object {\n\tconst hidden = (key: PropertyKey): boolean => key === \"guardRouter\";\n\treturn new Proxy(config, {\n\t\tget: (target, key, receiver): unknown => (hidden(key) ? undefined : Reflect.get(target, key, receiver)),\n\t\thas: (target, key) => !hidden(key) && Reflect.has(target, key),\n\t\townKeys: (target) => Reflect.ownKeys(target).filter((key) => !hidden(key)),\n\t\tgetOwnPropertyDescriptor: (target, key) =>\n\t\t\thidden(key) ? undefined : Reflect.getOwnPropertyDescriptor(target, key),\n\t});\n}\n\nfunction isRouteGuardConfig(guard: GuardFn | RouteGuardConfig): guard is RouteGuardConfig {\n\treturn typeof guard === \"object\" && guard !== null;\n}\n\n/** A step through the browser history (back, forward): how far it went, and the URL it arrived at. */\ninterface HistoryStep {\n\treadonly offset: number;\n\treadonly href: string;\n}\n\n/** The step through the browser history that brought the browser to the URL it shows, if a step did. */\nlet lastStep: HistoryStep | null = null;\n/** The URL of a step that a router is taking back, until the browser reports the next URL change. */\nlet undoneHref: string | null = null;\n\n// The Navigation API tells how far a step through the history went, before UI5 learns of the\n// hash change. UI5's History only infers it, and wrongly once an entry lacks its state. Without\n// the API (Firefox before 147, Safari before 26.2) no step is known and the entry is replaced.\nwindow.navigation?.addEventListener(\"currententrychange\", (event) => {\n\tconst href = window.location.href;\n\tif (undoneHref !== href) undoneHref = null;\n\tconst entry = window.navigation.currentEntry;\n\tif (entry && event.navigationType === \"traverse\") {\n\t\tlastStep = { offset: entry.index - event.from.index, href };\n\t} else if (lastStep?.href !== href) {\n\t\t// Not an entry whose state alone is replaced, as UI5's History does after a step.\n\t\tlastStep = null;\n\t}\n});\n\n/** What it takes to undo the hash change that an uncommitted navigation arrived with. */\ninterface HashChangeUndo {\n\t/** The hash of the root hash changer after the first change that this takes back. */\n\treadonly first: string;\n\t/**\n\t * The hash of the root hash changer before that change, with the hashes of nested routers.\n\t * The root hash changer reports it with the change, after the routers have parsed their part.\n\t */\n\tfullHash: string | undefined;\n\t/** The hash of the root hash changer after the change. */\n\treadonly shown: string;\n\t/** Whether the router has started to put the URL back, and the hash change that does it is still to come. */\n\tstarted: boolean;\n\t/** The step through the browser history that the change was, if it was one. */\n\treadonly step: HistoryStep | null;\n}\n\n/** A manifest guard entry of a route, with the declared entry it stems from: itself, or the entry of an ancestor route. */\ninterface ManifestGuardDescriptor extends GuardDescriptor {\n\treadonly source: GuardDescriptor;\n}\n\n/** Snapshot of an in-flight navigation being evaluated by the guard pipeline. */\ninterface NavigationAttempt {\n\treadonly hash: string;\n\treadonly controller: AbortController;\n\treadonly generation: number;\n\t/** Whether the URL shows a hash that never committed, so that it must be restored unless this attempt moves it. */\n\treadonly restoreHash: boolean;\n\t/** How the browser got to the hash that started the navigation; `undefined` after `navTo()` or `parse()`. */\n\treadonly direction: Direction | undefined;\n}\n\ninterface PhaseIdle {\n\treadonly kind: \"idle\";\n}\n\ninterface PhaseEvaluating {\n\treadonly kind: \"evaluating\";\n\treadonly attempt: NavigationAttempt;\n\t/** Whether the navigation waits for async guards: the native router would be matching its route by now. */\n\treadonly postponed?: true;\n}\n\ninterface PhaseCommitting {\n\treadonly kind: \"committing\";\n\treadonly route: string;\n\t/** The hash of the route: `parse()` commits the navigation when it receives this hash. */\n\treadonly hash: string;\n\treadonly origin: \"preflight\" | \"redirect\" | \"parse\";\n\t/** How the browser got to the history entry that the route replaces (see {@link RedirectChainContext.direction}). */\n\treadonly direction?: Direction;\n\t/** Whether the URL showed a hash that never committed when `navTo()` wrote the hash (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** What the root hash changer showed before `navTo()` wrote the hash: the write is undone with it. */\n\treadonly writtenOver?: string;\n}\n\n/**\n * An allowed navigation waits for UI5 to write its hash. With component targets UI5 does that\n * once the nested components are loaded, and never if one of them fails to load.\n */\ninterface PhaseAwaitingHash {\n\treadonly kind: \"awaitingHash\";\n\t/** The phase that commits the navigation when `parse()` receives its hash. */\n\treadonly commit: PhaseCommitting;\n}\n\n/** A navigation that did not commit waits for the URL to be back before it settles. */\ninterface PhaseRestoring {\n\treadonly kind: \"restoring\";\n\treadonly result: NavigationResult;\n\t/** Whether the previous hash is written once UI5 has reported the hash change to every router. */\n\treadonly awaitsReport?: true;\n\t/** What a redirect to the route that is shown still has to do once the navigation has settled. */\n\treadonly whenBack?: () => void;\n}\n\ntype RouterPhase = PhaseIdle | PhaseEvaluating | PhaseCommitting | PhaseAwaitingHash | PhaseRestoring;\n\nconst IDLE: PhaseIdle = { kind: \"idle\" };\n\n/** Maximum number of hops in a redirect chain before it is treated as a loop. */\nconst MAX_REDIRECT_DEPTH = 10;\n\n/** State threaded through a redirect chain. */\ninterface RedirectChainContext {\n\t/** Hashes whose guards have been evaluated in this chain (mutated via .add()). */\n\tvisited: Set<string>;\n\t/** Hash of the originally attempted navigation (for settlement / hash restore). */\n\treadonly attemptedHash: string | undefined;\n\t/** Whether to restore the hash on block (see {@link NavigationAttempt.restoreHash}). */\n\treadonly restoreHash: boolean;\n\t/** Original source route (the route the user occupies). */\n\treadonly fromRoute: string;\n\t/** Original source hash (the hash the user occupies). */\n\treadonly fromHash: string;\n\t/** Whether the target replaces the current history entry: as the `navTo()` call asked, always after a hash change. */\n\treadonly replace: boolean | undefined;\n\t/**\n\t * How the browser got to the history entry that the target replaces, for the title history\n\t * of UI5 (see {@link Router._alignTitleHistory}); `undefined` after `navTo()` or `parse()`.\n\t */\n\treadonly direction: Direction | undefined;\n\t/** Shared AbortSignal from the original navigation. */\n\treadonly signal: AbortSignal;\n\t/** Shared generation counter from the original navigation. */\n\treadonly generation: number;\n\t/** Shared bag from the original navigation's guard context. */\n\treadonly bag: Map<string, unknown>;\n}\n\n/**\n * Router with navigation guard support.\n *\n * Extends `sap.m.routing.Router` with a shared guard pipeline that\n * evaluates registered guard functions before route matching, target\n * loading, or event firing occurs.\n *\n * Two entry points feed the same pipeline:\n * - `navTo()` runs guards as a preflight check. A blocked navigation\n * never changes the hash; a redirected one only writes its final target.\n * - `parse()` runs guards as a fallback for browser back/forward, URL\n * bar entry, and direct hash changes where the hash has already changed\n * before guards can intercept.\n *\n * Key assumptions (see docs/reference/architecture.md for full rationale):\n * - `parse()` is intentionally NOT async. Sync guards execute in the\n * same tick; async guards fall back to a deferred path.\n * - `replaceHash` fires `hashChanged` synchronously (validated by test).\n * - `setHash` (via `super.navTo`) fires `hashChanged` synchronously (validated by test).\n * - Redirect targets are evaluated by the guard pipeline with loop detection.\n *\n * @namespace ui5.guard.router\n * @extends sap.m.routing.Router\n */\nexport default class Router extends MobileRouter implements GuardRouter {\n\tprivate _options: ResolvedGuardRouterOptions;\n\tprivate _pipeline = new GuardPipeline();\n\tprivate _currentRoute = \"\";\n\tprivate _currentHash: string | null = null;\n\tprivate _phase: RouterPhase = IDLE;\n\tprivate _parseGeneration = 0;\n\tprivate _suppressedHash: string | null = null;\n\t/** How to undo the hash change of the pending navigation (see {@link _undoHashChange}). */\n\tprivate _undo: HashChangeUndo | null = null;\n\t/** The hash that the hash changer of this router is reporting, until `parse()` receives it. */\n\tprivate _reportedHash: unknown = null;\n\t/** The hash that the hash changer of this router reported last, reports that are out of date aside. */\n\tprivate _lastReport: unknown = null;\n\t/** Whether the hash changer shows a later hash than the one it is reporting (see {@link _onHashReported}). */\n\tprivate _reportOutdated = false;\n\t/** The global hash changer that {@link _onRootHashChanged} is attached to, behind the listener of UI5 that informs the routers. */\n\tprivate _rootHashChanger: HashChanger | null = null;\n\t/** The route that was current when the router stopped: `initialize(true)` resumes it, as UI5 does. */\n\tprivate _stoppedRoute = \"\";\n\tprivate _settlementResolvers: ((result: NavigationResult) => void)[] = [];\n\tprivate _lastSettlement: NavigationResult | null = null;\n\tprivate _pendingGuardDescriptors: GuardDescriptor[];\n\tprivate _sourceDescriptors: ManifestGuardDescriptor[] = [];\n\t/** The manifest guards registered for a route, by which `addRoute()` places the guards a route inherits then. */\n\tprivate _manifestGuards: { descriptor: ManifestGuardDescriptor; fn: GuardFn }[] = [];\n\tprivate _destroyed = false;\n\t/** What UI5 itself wrote to `_bMatchingProcessStarted` (see {@link _mirrorMatchingProcess}). */\n\tprivate _nativeMatching = false;\n\t/** Promises that wait for the `routeMatched` of a match that has not started (see {@link attachRouteMatched}). */\n\tprivate _matchWaiters: (() => void)[] = [];\n\t/**\n\t * Set while block-mode guard modules load; `start` says whether to initialize once they have,\n\t * `ignoreInitialHash` is the argument of the `initialize()` call that asked for it.\n\t */\n\tprivate _blockLoad: { start: boolean; ignoreInitialHash?: boolean } | null = null;\n\tprivate _meta: RouteMetaStore;\n\t/** Recorded by `addRoute()`, which the UI5 constructor calls before field setup; `declare` keeps field setup from resetting it. */\n\tdeclare private _routeNames: string[];\n\t/** Routes that also match when an earlier route has matched the hash (`greedy: true`). */\n\tdeclare private _greedyRouteNames: string[];\n\tprivate readonly _ownerComponent: UIComponent | undefined;\n\n\tconstructor(routes?: object | object[], config?: GuardRouterConfig, owner?: UIComponent, targetsConfig?: object);\n\tconstructor(\n\t\troutes?: object | object[],\n\t\tconfig?: GuardRouterConfig,\n\t\towner?: UIComponent,\n\t\t...rest: [targetsConfig?: object]\n\t) {\n\t\tconst isRecordConfig = isRecord(config);\n\t\tconst guardRouter = isRecordConfig ? config.guardRouter : undefined;\n\t\t// UI5 passes more than its types declare: after the targets config comes the\n\t\t// hash changer of a component that is loaded as a routing target.\n\t\tsuper(routes, isRecordConfig ? withoutGuardRouter(config) : config, owner, ...rest);\n\t\tthis._ownerComponent = owner;\n\t\t// A config without routes has made no addRoute() call.\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tthis._mirrorMatchingProcess();\n\t\tlet componentNamespace = \"\";\n\t\tconst appConfig: unknown = owner?.getManifestEntry(\"sap.app\");\n\t\tif (isRecord(appConfig) && typeof appConfig.id === \"string\") {\n\t\t\tcomponentNamespace = appConfig.id;\n\t\t}\n\t\tconst parsed = parseGuardRouterConfig(guardRouter, componentNamespace);\n\t\tthis._options = parsed.options;\n\t\tthis._meta = new RouteMetaStore(\n\t\t\tparsed.routeMeta,\n\t\t\tthis._options.inheritance === \"pattern-tree\" ? () => this._collectRoutePatterns() : null,\n\t\t);\n\t\tthis._pendingGuardDescriptors = parsed.guards;\n\n\t\t// Fire-and-forget preload hint: a module cached by initialize()\n\t\t// needs no async load on navigation (see _registerLazyGuards).\n\t\t// Block mode loads modules itself in initialize().\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tconst uniquePaths = [...new Set(this._pendingGuardDescriptors.map((d) => d.modulePath))];\n\t\t\t// A failed preload is reported when the guard runs: its lazy load warns\n\t\t\t// and the navigation settles as Error.\n\t\t\tsap.ui.require(uniquePaths, undefined, () => {});\n\t\t}\n\t}\n\n\t/**\n\t * Report a navigation that waits for async guards as a route match in progress, through the\n\t * UI5-private member `_bMatchingProcessStarted` of `sap.ui.core.routing.Router`. UI5 reads it\n\t * to tell whether the router of a nested component is still matching; without this, a parent\n\t * route would count the component as displayed before its first route matched. The router does\n\t * not write the member: it replaces it with an accessor that keeps what UI5 writes in\n\t * {@link _nativeMatching} and also reads `true` while a navigation is postponed.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t */\n\tprivate _mirrorMatchingProcess(): void {\n\t\tObject.defineProperty(this, \"_bMatchingProcessStarted\", {\n\t\t\tget: () => this._isMatching(),\n\t\t\tset: (matching: boolean) => {\n\t\t\t\tthis._nativeMatching = matching;\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Whether a route match is in progress: in UI5, or postponed until async guards have decided. */\n\tprivate _isMatching(): boolean {\n\t\treturn this._nativeMatching || (this._phase.kind === \"evaluating\" && this._phase.postponed === true);\n\t}\n\n\t/**\n\t * Attach an event handler for the `routeMatched` event, as the native router does. In addition,\n\t * remember a Promise resolve function ({@link isPromiseResolver}) that is subscribed while the\n\t * router is not initialized or a match is in progress: that is how a UI5 component target\n\t * waits for this router. UI5 relies on a match always ending in `routeMatched`, which a\n\t * navigation that guards block, fail or cancel never fires, so {@link _settleMatchWaiters}\n\t * resolves the Promise then. Application code that subscribes a Promise resolve function under\n\t * the same condition is treated alike.\n\t *\n\t * See docs/reference/architecture.md (\"UI5 Internals the Router Relies On\") for the UI5 code this\n\t * relies on, and docs/reference/upstream-parity.md for the tests that pin it.\n\t *\n\t * @override sap.ui.core.routing.Router#attachRouteMatched\n\t * @since 1.7.0\n\t */\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this;\n\toverride attachRouteMatched(fnFunction: (evt: Router$RouteMatchedEvent) => void, oListener?: object): this;\n\toverride attachRouteMatched(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$RouteMatchedEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\tif (isPromiseResolver(oData) && (!this.isInitialized() || this._isMatching())) {\n\t\t\tthis._matchWaiters.push(oData);\n\t\t}\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn super.attachRouteMatched(oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Decide what becomes of the Promises that wait for a `routeMatched`\n\t * (see {@link attachRouteMatched}). Runs in a microtask after a settlement, so that a commit\n\t * has reached `super.parse()` and a navigation that supersedes the settled one has started:\n\t * - A navigation waits for async guards: the Promises keep waiting, for its settlement.\n\t * - UI5 is matching a route: the Promises are forgotten, the `routeMatched` of that match\n\t * resolves them. If UI5 never fires it, because the display of a target fails, they wait\n\t * forever, as with the native router.\n\t * - Otherwise no match is coming, and the Promises are resolved.\n\t *\n\t * A navigation that starts after this microtask is not waited for. A Promise that is resolved\n\t * here stays subscribed, and UI5 calls it again with the next `routeMatched`, which has no\n\t * effect on a Promise.\n\t */\n\tprivate _settleMatchWaiters(): void {\n\t\tif (this._phase.kind === \"evaluating\" && this._phase.postponed) return;\n\t\tconst waiters = this._matchWaiters;\n\t\tthis._matchWaiters = [];\n\t\tif (this._nativeMatching) return;\n\t\tfor (const resolve of waiters) resolve();\n\t}\n\n\t/**\n\t * Initialize the router. When manifest guards are declared and\n\t * `guardLoading` is `\"block\"`, module loading starts and\n\t * `super.initialize()` is deferred until all modules are loaded.\n\t * In `\"lazy\"` mode, lazy wrappers are registered synchronously\n\t * and `super.initialize()` is called immediately.\n\t *\n\t * While block-mode modules load, the router is not initialized yet:\n\t * calling `initialize()` again changes nothing, and `stop()` cancels\n\t * the pending start until `initialize()` is called again.\n\t *\n\t * @param bIgnoreInitialHash - Whether the current hash is left unparsed, as in the native router (since 1.7.0).\n\t * @override sap.ui.core.routing.Router#initialize\n\t * @since 1.0.1\n\t */\n\toverride initialize(bIgnoreInitialHash?: boolean): this {\n\t\tif (this._blockLoad) {\n\t\t\tif (!this._blockLoad.start) {\n\t\t\t\tthis._blockLoad.start = true;\n\t\t\t\tthis._blockLoad.ignoreInitialHash = bIgnoreInitialHash;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (this._pendingGuardDescriptors.length === 0) {\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\tconst descriptors = this._pendingGuardDescriptors.map((source) => ({ ...source, source }));\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = descriptors;\n\n\t\tconst expandedDescriptors =\n\t\t\tthis._options.inheritance === \"pattern-tree\"\n\t\t\t\t? expandToDescendants(descriptors, this._collectRoutePatterns())\n\t\t\t\t: descriptors;\n\n\t\tif (this._options.guardLoading === \"lazy\") {\n\t\t\tthis._registerLazyGuards(expandedDescriptors);\n\t\t\treturn this._start(bIgnoreInitialHash);\n\t\t}\n\n\t\t// \"block\" mode: load all modules, then register their guards in declaration order\n\t\t// and initialize. Load and registration failures are logged per module and never\n\t\t// reject. A router destroyed while modules load stays destroyed.\n\t\tconst blockLoad = { start: true, ignoreInitialHash: bIgnoreInitialHash };\n\t\tthis._blockLoad = blockLoad;\n\t\tvoid loadGuardModules(expandedDescriptors).then((results) => {\n\t\t\tthis._blockLoad = null;\n\t\t\tif (this._destroyed) return;\n\t\t\tfor (const { descriptor, guards } of results) {\n\t\t\t\tfor (const fn of guards) this._registerManifestGuard(descriptor, fn);\n\t\t\t}\n\t\t\tif (blockLoad.start) this._start(blockLoad.ignoreInitialHash);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Start the native router. With `ignoreInitialHash` it parses nothing and resumes the route\n\t * that was displayed when the router stopped. That route is the current one again, on the hash\n\t * that the URL shows now, so that its leave guards run and a blocked hash change returns to it.\n\t */\n\tprivate _start(ignoreInitialHash?: boolean): this {\n\t\t// UI5 only warns about a router that is initialized already.\n\t\tconst starting = !this.isInitialized();\n\t\tif (starting) {\n\t\t\t// Before the listener of UI5 that calls parse(), which initialize() attaches.\n\t\t\tthis.getHashChanger().attachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t\t// After the listener of UI5 that informs the routers, which is attached with the hash\n\t\t\t// changer of the first router: UI5 has reported a hash change to every router when\n\t\t\t// this one runs.\n\t\t\tthis._rootHashChanger = HashChanger.getInstance();\n\t\t\tthis._rootHashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\t}\n\t\tsuper.initialize(ignoreInitialHash);\n\t\tif (starting && ignoreInitialHash) {\n\t\t\t// UI5 has reset the hash of the hash changer if a target was displayed without a route.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tthis._currentRoute = this._stoppedRoute;\n\t\t\tthis._currentHash = shownHash ?? null;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * The hash changer of this router reports a hash change: `parse()` is called with it next.\n\t *\n\t * The report is out of date if the hash changer shows a later hash by now, one that it has\n\t * reported to this router already. That happens to a router that shares its hash changer, as\n\t * the routers of all components that are not routing targets do: a router that is informed\n\t * first redirects the hash, UI5 reports the target to every router, and only then the hash\n\t * that was redirected to the routers that are informed later. A hash changer that reports\n\t * while a parent router collects the hashes of a navigation shows no hash at all.\n\t */\n\tprivate _onHashReported(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\tconst shown: unknown = this.getHashChanger().getHash();\n\t\tthis._reportedHash = newHash;\n\t\tthis._reportOutdated = shown !== newHash && shown === this._lastReport;\n\t\tif (!this._reportOutdated) this._lastReport = newHash;\n\t}\n\n\t/**\n\t * UI5 has reported a hash change to every router. The event tells what the URL showed before\n\t * the change, which is what undoes it. A snapshot of the URL taken at any other time would not\n\t * do: the URL also changes without an event, as when the Fiori launchpad puts it back after\n\t * a cross-app navigation that the user cancelled. A navigation that waited for this to put\n\t * the URL back does so now (see {@link _undoHashChange}).\n\t */\n\tprivate _onRootHashChanged(event: HashChangerBase$HashChangedEvent): void {\n\t\t// A string, which the UI5 types declare as an object.\n\t\tconst newHash: unknown = event.getParameter(\"newHash\");\n\t\t// Only the first hash change that the page reports has no previous hash.\n\t\tconst oldHash = event.getParameter(\"oldHash\") ?? \"\";\n\t\tconst hashChanger = HashChanger.getInstance();\n\t\tif (hashChanger === this._rootHashChanger) {\n\t\t\tthis._completeUndo(newHash, oldHash);\n\t\t\treturn;\n\t\t}\n\t\t// The global hash changer was replaced (HashChanger.replaceHashChanger(), as the shell of\n\t\t// the Fiori launchpad does). UI5 has moved this listener to the new one, in front of its\n\t\t// listener that informs the routers. From the next hash change on it runs behind again;\n\t\t// for this one, the routers are informed once this listener has returned.\n\t\thashChanger.detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\thashChanger.attachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = hashChanger;\n\t\tqueueMicrotask(() => this._completeUndo(newHash, oldHash));\n\t}\n\n\t/**\n\t * Tell the undo of the pending navigation what the URL showed before the hash change\n\t * `newHash`, and put the URL back if the navigation waited for that.\n\t */\n\tprivate _completeUndo(newHash: unknown, oldHash: string): void {\n\t\tconst undo = this._undo;\n\t\tif (!undo || undo.first !== newHash) return;\n\t\tundo.fullHash ??= oldHash;\n\t\tif (this._phase.kind === \"restoring\" && this._phase.awaitsReport) this._replaceFullHash(undo.fullHash);\n\t}\n\n\t/**\n\t * Add a route dynamically and integrate it into pattern-tree inheritance.\n\t *\n\t * Appends the route name to the internal route list so that\n\t * `_collectRoutePatterns()` includes it in subsequent inheritance\n\t * lookups, clears the metadata cache, and registers any inherited\n\t * manifest guards when `inheritance` is `\"pattern-tree\"`: on every\n\t * route, ancestor guards still run before descendant guards.\n\t *\n\t * @param oConfig - Route configuration object as defined by `sap.ui.core.routing.Route`.\n\t * @param oParent - Optional parent route, forwarded to the parent `addRoute`.\n\t * @override sap.ui.core.routing.Router#addRoute\n\t * @since 1.6.0\n\t */\n\toverride addRoute(oConfig: $RouteSettings, oParent?: Route): void {\n\t\tsuper.addRoute(oConfig, oParent);\n\n\t\tconst name = oConfig.name;\n\t\tthis._routeNames ??= [];\n\t\tthis._greedyRouteNames ??= [];\n\t\tif (this._routeNames.includes(name)) return;\n\n\t\tthis._routeNames.push(name);\n\t\tif (oConfig.greedy) this._greedyRouteNames.push(name);\n\t\t// The UI5 constructor adds the routes of the config before this constructor sets up the rest.\n\t\tif (!this._meta) return;\n\t\tthis._meta.invalidate();\n\n\t\tif (this._options.inheritance !== \"pattern-tree\") return;\n\n\t\tconst patterns = this._collectRoutePatterns();\n\t\tconst declared = byRouteDepth(this._sourceDescriptors, new Map(patterns.map((r) => [r.name, r.pattern])));\n\t\tconst rankOf = (descriptor: ManifestGuardDescriptor): number =>\n\t\t\tdeclared.findIndex((entry) => entry.source === descriptor.source);\n\n\t\t// Always use lazy registration: if the module was loaded during\n\t\t// initialize() (block mode), the sync cache probe succeeds immediately.\n\t\t// This avoids an async gap between addRoute() and the first navigation.\n\t\tfor (const descriptor of expandForNewRoute(this._sourceDescriptors, name, patterns)) {\n\t\t\t// Ancestor guards run first: the new guards go before the manifest guards of the route\n\t\t\t// that stem from an entry of a deeper route, or from a later entry of the same depth.\n\t\t\tconst rank = rankOf(descriptor);\n\t\t\tconst next = this._manifestGuards\n\t\t\t\t.filter(\n\t\t\t\t\t(guard) =>\n\t\t\t\t\t\tguard.descriptor.route === descriptor.route &&\n\t\t\t\t\t\tguard.descriptor.type === descriptor.type &&\n\t\t\t\t\t\trankOf(guard.descriptor) > rank,\n\t\t\t\t)\n\t\t\t\t.toSorted((a, b) => rankOf(a.descriptor) - rankOf(b.descriptor))[0];\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn, next?.fn);\n\t\t}\n\t}\n\n\t/**\n\t * Register a global guard that runs for every navigation.\n\t *\n\t * @param guard - Guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"addGuard\")) return this;\n\t\tthis._pipeline.addGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a previously registered global guard.\n\t *\n\t * @param guard - Guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveGuard(guard: GuardFn): this {\n\t\tif (!this._isFn(guard, \"removeGuard\")) return this;\n\t\tthis._pipeline.removeGlobalGuard(guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a guard for a specific route.\n\t *\n\t * Accepts either a guard function (registered as an enter guard) or a\n\t * configuration object with `beforeEnter` and/or `beforeLeave` guards.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Guard function or {@link RouteGuardConfig} object.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tconst { beforeEnter, beforeLeave } = guard;\n\t\t\tif (beforeEnter === undefined && beforeLeave === undefined) {\n\t\t\t\tLog.info(\"addRouteGuard: config has no beforeEnter or beforeLeave\", routeName, LOG_COMPONENT);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\t// As for a guard function: the route is checked only when something is registered.\n\t\t\tconst enter = beforeEnter !== undefined && this._isFn(beforeEnter, \"addRouteGuard\", routeName);\n\t\t\tconst leave = beforeLeave !== undefined && this._isFn(beforeLeave, \"addRouteGuard\", routeName);\n\t\t\tif (!enter && !leave) return this;\n\t\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\t\tif (enter) this._pipeline.addEnterGuard(routeName, beforeEnter);\n\t\t\tif (leave) this._pipeline.addLeaveGuard(routeName, beforeLeave);\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"addRouteGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addRouteGuard\");\n\t\tthis._pipeline.addEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Remove a guard from a specific route.\n\t *\n\t * Accepts the same forms as `addRouteGuard`: a guard function removes\n\t * an enter guard; a configuration object removes `beforeEnter` and/or\n\t * `beforeLeave` by reference.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Guard function or {@link RouteGuardConfig} object to remove by reference.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveRouteGuard(routeName: string, guard: GuardFn | RouteGuardConfig): this {\n\t\tif (isRouteGuardConfig(guard)) {\n\t\t\tif (typeof guard.beforeEnter === \"function\") {\n\t\t\t\tthis.removeRouteGuard(routeName, guard.beforeEnter);\n\t\t\t}\n\t\t\tif (typeof guard.beforeLeave === \"function\") {\n\t\t\t\tthis.removeLeaveGuard(routeName, guard.beforeLeave);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif (!this._isFn(guard, \"removeRouteGuard\", routeName)) return this;\n\t\tthis._pipeline.removeEnterGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Register a leave guard for a specific route.\n\t *\n\t * Leave guards run when navigating **away from** the route, before any\n\t * enter guards for the target route. They answer the binary question\n\t * \"can I leave?\" and return only a boolean (no redirects).\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`. If the route is unknown, the {@link GuardRouterOptions.unknownRouteRegistration} policy applies (default: warn).\n\t * @param guard - Leave guard function to register. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\taddLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"addLeaveGuard\", routeName)) return this;\n\t\tthis._handleUnknownRouteRegistration(routeName, \"addLeaveGuard\");\n\t\tthis._pipeline.addLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Disambiguate the `navTo()` overload shapes into resolved arguments.\n\t *\n\t * UI5's native `navTo` has two signatures where the third parameter is either\n\t * `componentTargetInfo` (object) or `bReplace` (boolean). This method normalizes\n\t * both forms so the rest of `navTo` can work with a single set of variables.\n\t * The options follow `bReplace`, or take its place when it is left out.\n\t */\n\tprivate _resolveNavToArgs(\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): {\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>;\n\t\treplace?: boolean;\n\t\tguardOptions?: GuardNavToOptions;\n\t} {\n\t\tif (typeof componentTargetInfoOrReplace === \"boolean\") {\n\t\t\t// Short form: navTo(name, params, replace, options?)\n\t\t\treturn {\n\t\t\t\treplace: componentTargetInfoOrReplace,\n\t\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : undefined,\n\t\t\t};\n\t\t}\n\t\t// Long form: navTo(name, params, componentTargetInfo, replace, options?)\n\t\treturn {\n\t\t\tcomponentTargetInfo: componentTargetInfoOrReplace,\n\t\t\treplace: typeof replaceOrOptions === \"boolean\" ? replaceOrOptions : undefined,\n\t\t\tguardOptions: typeof replaceOrOptions === \"object\" ? replaceOrOptions : options,\n\t\t};\n\t}\n\n\t/** Return `true` when the value is a function; otherwise log a warning. */\n\tprivate _isFn(value: unknown, method: string, detail?: string): boolean {\n\t\tif (typeof value === \"function\") return true;\n\t\tLog.warning(`${method}: not a function, ignoring`, detail, LOG_COMPONENT);\n\t\treturn false;\n\t}\n\n\t/** Apply the `unknownRouteRegistration` policy: warn or throw when the route is unknown. */\n\tprivate _handleUnknownRouteRegistration(routeName: string, methodName: string, kept = \"guard registered\"): void {\n\t\tif (this.getRoute(routeName)) return;\n\n\t\tswitch (this._options.unknownRouteRegistration) {\n\t\t\tcase \"ignore\":\n\t\t\t\treturn;\n\t\t\tcase \"throw\":\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${methodName} called for unknown route \"${routeName}\". ` +\n\t\t\t\t\t\t`Set guardRouter.unknownRouteRegistration to \"warn\" or \"ignore\" to allow this.`,\n\t\t\t\t);\n\t\t\tcase \"warn\":\n\t\t\t\tLog.warning(`${methodName}: unknown route, ${kept} anyway`, routeName, LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Remove a leave guard from a specific route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param guard - Leave guard function to remove by reference. Non-functions are ignored with a warning.\n\t * @returns `this` for chaining.\n\t * @since 1.0.1\n\t */\n\tremoveLeaveGuard(routeName: string, guard: LeaveGuardFn): this {\n\t\tif (!this._isFn(guard, \"removeLeaveGuard\", routeName)) return this;\n\t\tthis._pipeline.removeLeaveGuard(routeName, guard);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return the resolved metadata for a route.\n\t *\n\t * When `inheritance` is `\"pattern-tree\"`, walks the ancestor chain and\n\t * shallow-merges metadata shallowest-first (child values win on conflict).\n\t * Both manifest and runtime metadata participate in inheritance.\n\t * The router caches results; {@link setRouteMeta} and `addRoute()` clear the cache.\n\t *\n\t * Logs a warning for unknown non-empty route names and returns an empty\n\t * frozen object. The empty string `\"\"` is treated as a valid root route.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @returns Frozen record of metadata key-value pairs, or an empty frozen object if the route has no metadata.\n\t * @since 1.6.0\n\t */\n\tgetRouteMeta(routeName: string): Readonly<Record<string, unknown>> {\n\t\t// Empty string is a valid root route name (initial state before first navigation)\n\t\tif (routeName !== \"\" && !this.getRoute(routeName)) {\n\t\t\tLog.warning(\"getRouteMeta: unknown route, returning empty metadata\", routeName, LOG_COMPONENT);\n\t\t\treturn EMPTY_META;\n\t\t}\n\t\treturn this._meta.get(routeName);\n\t}\n\n\t/**\n\t * Set runtime metadata for a route.\n\t *\n\t * Runtime metadata is merged on top of any manifest-declared metadata\n\t * when retrieved via {@link getRouteMeta}. When `inheritance` is\n\t * `\"pattern-tree\"`, descendant routes also see the updated values.\n\t * Invalidates the resolved-metadata cache. Non-object values are\n\t * ignored with a warning. Subject to the `unknownRouteRegistration` policy.\n\t *\n\t * @param routeName - Route name as defined in `manifest.json`.\n\t * @param meta - Plain object of metadata key-value pairs.\n\t * @returns `this` for chaining.\n\t * @since 1.6.0\n\t */\n\tsetRouteMeta(routeName: string, meta: Record<string, unknown>): this {\n\t\tif (!isRecord(meta)) {\n\t\t\tLog.warning(\"setRouteMeta: expected object, ignoring\", routeName, LOG_COMPONENT);\n\t\t\treturn this;\n\t\t}\n\t\tif (routeName !== \"\") this._handleUnknownRouteRegistration(routeName, \"setRouteMeta\", \"metadata stored\");\n\t\tthis._meta.set(routeName, meta);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Return a Promise that settles when the current guard pipeline finishes.\n\t *\n\t * If a navigation is pending, the Promise resolves when that pipeline settles.\n\t * If no navigation is pending, it resolves immediately with the most recent\n\t * settlement result. Before any navigation has settled, it falls back to a\n\t * synthetic `Committed` result derived from the router's current route/hash\n\t * state. After `stop()`, that idle fallback reports empty route/hash values\n\t * until a new navigation settles, or `initialize(true)` resumes the route.\n\t *\n\t * @returns Promise that resolves with a {@link NavigationResult} once the pipeline settles.\n\t * @since 1.2.0\n\t */\n\tnavigationSettled(): Promise<NavigationResult> {\n\t\tif (this._phase.kind === \"idle\" || this._phase.kind === \"committing\") {\n\t\t\treturn Promise.resolve(\n\t\t\t\tthis._lastSettlement ?? {\n\t\t\t\t\tstatus: NavigationOutcome.Committed,\n\t\t\t\t\troute: this._currentRoute,\n\t\t\t\t\thash: this._currentHash ?? \"\",\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\treturn new Promise((resolve) => {\n\t\t\tthis._settlementResolvers.push(resolve);\n\t\t});\n\t}\n\n\t/**\n\t * Attach an event handler for the `navigationSettled` event.\n\t *\n\t * Fires synchronously after every guard pipeline settlement with\n\t * a {@link NavigationResult} payload. Unlike the one-shot\n\t * `navigationSettled()` Promise, this event fires for every\n\t * navigation outcome without re-registration. It does not fire for the\n\t * navigation that `destroy()` cancels.\n\t *\n\t * @param oData - Application-specific payload passed to the handler as second argument.\n\t * @param fnFunction - The function to be called when the event occurs.\n\t * @param oListener - Context object to call the event handler with. Defaults to this Router.\n\t * @since 1.3.0\n\t */\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this;\n\tattachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this;\n\tattachNavigationSettled(\n\t\toData: object,\n\t\tfnFunction: (evt: Router$NavigationSettledEvent) => void,\n\t\toListener?: object,\n\t): this {\n\t\t// The arguments go on as received: EventProvider#attachEvent tells the two call forms apart.\n\t\treturn this.attachEvent(\"navigationSettled\", oData, fnFunction, oListener);\n\t}\n\n\t/**\n\t * Detach a previously attached `navigationSettled` event handler.\n\t *\n\t * The passed parameters must match those used for registration with\n\t * {@link #attachNavigationSettled} beforehand.\n\t *\n\t * @param fnFunction - The handler function to detach.\n\t * @param oListener - Context object on which the given function had to be called.\n\t * @since 1.3.0\n\t */\n\tdetachNavigationSettled(fnFunction: (evt: Router$NavigationSettledEvent) => void, oListener?: object): this {\n\t\tthis.detachEvent(\"navigationSettled\", fnFunction, oListener);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Drain all settlement resolvers with the given result and fire\n\t * the `navigationSettled` event.\n\t */\n\tprivate _flushSettlement(result: NavigationResult): void {\n\t\tthis._lastSettlement = result;\n\t\tLog.debug(`Navigation settled: ${result.status}`, result.hash, LOG_COMPONENT);\n\t\t// After the call that settled: by then a commit has reached super.parse(), and a navigation\n\t\t// that supersedes this one has started.\n\t\tqueueMicrotask(() => this._settleMatchWaiters());\n\t\tconst resolvers = this._settlementResolvers;\n\t\tthis._settlementResolvers = [];\n\t\tfor (const resolve of resolvers) {\n\t\t\tresolve(result);\n\t\t}\n\t\t// No handler runs while destroy() tears the router down; the native destroy() fires no event either.\n\t\tif (this._destroyed) return;\n\t\ttry {\n\t\t\tthis.fireEvent(\"navigationSettled\", result);\n\t\t} catch (error) {\n\t\t\t// A handler must not keep the router from finishing the navigation it reports.\n\t\t\tLog.error(\"A navigationSettled handler threw\", String(error), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/**\n\t * Navigate to a route with preflight guard evaluation.\n\t *\n\t * For programmatic navigation, guards run BEFORE the hash changes.\n\t * This prevents history pollution: blocked navigations never push a\n\t * history entry, and redirected navigations go directly to the final\n\t * target, which is written the way this call asked for (`bReplace`).\n\t *\n\t * A `navTo()` to the committed hash changes no route of this router, so\n\t * no guard runs: any pending navigation is cancelled and the call goes\n\t * to the native `navTo()`, which sets or resets the hashes of nested\n\t * components (`componentTargetInfo`). If the target matches the\n\t * in-flight attempt's hash, the in-flight preflight continues undisturbed.\n\t *\n\t * When all guards are synchronous, the decision and the resulting\n\t * hash change happen in the same tick. When any guard returns a\n\t * Promise, `navTo()` returns `this` immediately and defers the\n\t * hash change to when the guard resolves.\n\t *\n\t * Assumes `super.navTo()` calls `HashChanger.setHash()` which fires\n\t * `hashChanged` synchronously, causing `parse()` to re-enter in the\n\t * same call stack (validated by test). If the hash changer refuses the\n\t * hash change, as the Fiori launchpad's navigation filter does when its\n\t * dirty-state check stops it, nothing is committed and the navigation\n\t * settles as `Blocked`.\n\t *\n\t * With component targets (`componentTargetInfo`) UI5 writes the hash\n\t * later, once the nested components are loaded. The navigation commits\n\t * and settles when `parse()` receives that hash. Until then it is\n\t * pending: a navigation that supersedes it, `stop()` or `destroy()`\n\t * settles it as `Cancelled`. That also ends a navigation whose hash UI5\n\t * never writes, because a nested component failed to load or the router\n\t * is not async.\n\t *\n\t * On a router that is not initialized (before `initialize()`, while\n\t * block-mode guard modules load, after `stop()`) the call goes straight\n\t * to the native `navTo()`, which only sets the hash or does nothing when\n\t * stopped. The guards run when the router starts and parses the hash.\n\t *\n\t * @override sap.ui.core.routing.Router#navTo\n\t * @since 1.0.1\n\t */\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean): this;\n\toverride navTo(routeName: string, parameters?: object, bReplace?: boolean, options?: GuardNavToOptions): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfo?: Record<string, ComponentTargetParameters>,\n\t\tbReplace?: boolean,\n\t\toptions?: GuardNavToOptions,\n\t): this;\n\toverride navTo(\n\t\trouteName: string,\n\t\tparameters?: object,\n\t\tcomponentTargetInfoOrReplace?: Record<string, ComponentTargetParameters> | boolean,\n\t\treplaceOrOptions?: boolean | GuardNavToOptions,\n\t\toptions?: GuardNavToOptions,\n\t): this {\n\t\t// The guards are gone: code that awaited navigationSettled() may still call navTo().\n\t\tif (this._destroyed) {\n\t\t\tLog.warning(\"navTo: router is destroyed, ignoring\", routeName, LOG_COMPONENT);\n\t\t\treturn this;\n\t\t}\n\t\tconst { componentTargetInfo, replace, guardOptions } = this._resolveNavToArgs(\n\t\t\tcomponentTargetInfoOrReplace,\n\t\t\treplaceOrOptions,\n\t\t\toptions,\n\t\t);\n\n\t\t// Redirect path: _redirect() calls this.navTo() while in committing/redirect phase.\n\t\t// Bypass preflight -- parse() will commit directly via the committing phase.\n\t\tif (this._phase.kind === \"committing\" && this._phase.origin === \"redirect\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// A router that does not listen to hash changes (not initialized, loading block-mode\n\t\t// guards, or stopped) navigates like the native one: the guards run once it parses the hash.\n\t\tif (!this.isInitialized()) {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst route = this.getRoute(routeName);\n\t\tif (!route) {\n\t\t\t// Unknown route -- let the parent handle it (it logs a warning).\n\t\t\t// Cancel any pending async navigation so settlement resolvers drain\n\t\t\t// and the stale pipeline does not commit a superseded navigation.\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst targetHash = route.getURL(parameters ?? {});\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// Same hash: no route of this router changes, so there is nothing to guard. Cancel any\n\t\t// pending navigation and navigate natively: UI5 still sets the hashes of nested\n\t\t// components (componentTargetInfo), or resets them when none are given.\n\t\tif (targetHash === this._currentHash) {\n\t\t\tthis._cancelPendingNavigation(true);\n\t\t\t// A navigationSettled handler of the cancelled navigation may have navigated on.\n\t\t\tconst shownHash: string | undefined = this.getHashChanger().getHash();\n\t\t\tif (shownHash === undefined || shownHash === targetHash) {\n\t\t\t\t// If UI5 has reset the hash of the hash changer, after a target was displayed without\n\t\t\t\t// a route, it reports the hash again, and parse() lets the route match again.\n\t\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tconst skipGuards = guardOptions?.skipGuards === true || this._options.navToPreflight === \"bypass\";\n\n\t\t// Pending-hash dedup: if an async preflight for this exact hash is\n\t\t// already running, don't cancel and restart it. A navigation that skips\n\t\t// the guards does not wait for them.\n\t\tif (!skipGuards && this._phase.kind === \"evaluating\" && targetHash === this._phase.attempt.hash) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// parse() evaluates the guards once the hash has changed. It supersedes a pending\n\t\t// navigation then, and undoes the hash change of that navigation with its own.\n\t\tif (!skipGuards && this._options.navToPreflight === \"off\") {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, replace);\n\t\t\treturn this;\n\t\t}\n\n\t\t// Cancel any pending navigation (including previous async preflight).\n\t\t// A superseded hash-change navigation leaves its hash in the URL: restore it\n\t\t// unless this navigation moves the URL.\n\t\tconst restoreHash = this._pendingRestoresHash();\n\t\tthis._cancelPendingNavigation();\n\n\t\tif (skipGuards) {\n\t\t\tthis._navigateAllowed(\n\t\t\t\trouteName,\n\t\t\t\tparameters,\n\t\t\t\tcomponentTargetInfo,\n\t\t\t\treplace,\n\t\t\t\ttargetHash,\n\t\t\t\ttoRoute,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tconst attempt = this._startAttempt(targetHash, restoreHash);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async preflight result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyPreflightDecision(\n\t\t\t\t\t\td,\n\t\t\t\t\t\trouteName,\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\treplace,\n\t\t\t\t\t\ttargetHash,\n\t\t\t\t\t\ttoRoute,\n\t\t\t\t\t\tcontext.bag,\n\t\t\t\t\t\tattempt,\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\ttargetHash,\n\t\t\t\trestoreHash,\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\n\t\tthis._applyPreflightDecision(\n\t\t\tdecision,\n\t\t\trouteName,\n\t\t\tparameters,\n\t\t\tcomponentTargetInfo,\n\t\t\treplace,\n\t\t\ttargetHash,\n\t\t\ttoRoute,\n\t\t\tcontext.bag,\n\t\t\tattempt,\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Navigate to a `navTo()` target that needs no guards (allowed or bypassed) and commit it,\n\t * or block it if the hash change was refused (see {@link _commitAfterNavTo}).\n\t */\n\tprivate _navigateAllowed(\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tthis._phase = {\n\t\t\tkind: \"committing\",\n\t\t\troute: toRoute,\n\t\t\thash: targetHash,\n\t\t\torigin: \"preflight\",\n\t\t\trestoreHash,\n\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t};\n\t\ttry {\n\t\t\tsuper.navTo(routeName, parameters, componentTargetInfo, bReplace);\n\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\tthis._blockNavigation(targetHash, restoreHash);\n\t\t\t}\n\t\t} finally {\n\t\t\t// A failed hash change must not leave the next one to be committed without guards.\n\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\tthis._phase = IDLE;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Apply a preflight guard decision. For \"allow\", enter the committing\n\t * phase and call super.navTo(). For \"block\", flush settlement; the hash is\n\t * only touched to restore it after a superseded hash-change navigation.\n\t * For \"redirect\", start a redirect chain.\n\t * For \"error\", flush Error settlement with the guard's error.\n\t */\n\tprivate _applyPreflightDecision(\n\t\tdecision: GuardDecision,\n\t\trouteName: string,\n\t\tparameters: object | undefined,\n\t\tcomponentTargetInfo: Record<string, ComponentTargetParameters> | undefined,\n\t\tbReplace: boolean | undefined,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._navigateAllowed(\n\t\t\t\t\trouteName,\n\t\t\t\t\tparameters,\n\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\tbReplace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\ttoRoute,\n\t\t\t\t\tattempt.restoreHash,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._startRedirectChain(decision.target, targetHash, bag, attempt, bReplace);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, targetHash, attempt.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Intercept hash changes and run the guard pipeline before route matching.\n\t *\n\t * Called by the HashChanger on every `hashChanged` event. Runs leave guards\n\t * (current route), then global + route-specific enter guards (target route).\n\t * Stays synchronous when all guards return plain values; falls back to async\n\t * when a guard returns a Promise. A generation counter discards stale results\n\t * when navigations overlap.\n\t *\n\t * @param newHash - The new hash fragment from the URL.\n\t * @override sap.ui.core.routing.Router#parse\n\t * @since 1.0.1\n\t */\n\toverride parse(newHash: string): void {\n\t\tif (this._destroyed) {\n\t\t\t// The base router only warns about a hash change that reaches a destroyed router.\n\t\t\tsuper.parse(newHash);\n\t\t\treturn;\n\t\t}\n\t\tconst reported = this._reportedHash === newHash;\n\t\tthis._reportedHash = null;\n\t\t// The URL shows a later hash, which this router has parsed.\n\t\tif (reported && this._reportOutdated) return;\n\t\t// The hash that _restoreHash() is writing.\n\t\tif (newHash === this._suppressedHash) return;\n\n\t\tconst undo = this._undo;\n\t\tif (undo?.started && undo.fullHash === HashChanger.getInstance().getHash()) {\n\t\t\t// The URL is back where the router has put it (see _undoHashChange), so nothing is\n\t\t\t// evaluated. What the hash changer reports now is the hash of the route that is shown.\n\t\t\tthis._undo = null;\n\t\t\tthis._currentHash = newHash;\n\t\t\tthis._finishRestore(newHash);\n\t\t\treturn;\n\t\t}\n\n\t\tconst phase = this._phase;\n\t\tconst commit = phase.kind === \"awaitingHash\" ? phase.commit : phase.kind === \"committing\" ? phase : null;\n\t\tif (commit?.hash === newHash) {\n\t\t\tthis._phase = commit;\n\t\t\tthis._commitNavigation(newHash, commit.route);\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentHash = this._currentHash;\n\t\tif (newHash === currentHash) {\n\t\t\tif (this._pendingRestoresHash()) {\n\t\t\t\t// The URL is back on the committed hash, whose route was never left. That ends the\n\t\t\t\t// navigation that had moved it away; one that waits for UI5 to write its hash goes on.\n\t\t\t\tif (this._phase.kind === \"evaluating\") this._cancelPendingNavigation();\n\t\t\t\telse this._undo = null;\n\t\t\t} else {\n\t\t\t\t// The committed hash is reported again, and its route matches again as it does\n\t\t\t\t// natively: UI5 has written the hash of a navigation with component targets, or has\n\t\t\t\t// reset the hash of the hash changer after a target was displayed without a route,\n\t\t\t\t// or parse() was called directly.\n\t\t\t\tsuper.parse(newHash);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst routeInfo = this._matchRoute(newHash);\n\t\tconst toRoute = routeInfo.name;\n\n\t\t// A pending navigation that has moved the URL as well leaves this one to undo both changes.\n\t\tconst pendingUndo = this._pendingRestoresHash() ? undo : null;\n\t\t// The router is putting the URL back and gets another hash: that one is not undone as a\n\t\t// whole, so that an undo cannot cause the next one.\n\t\tconst undoing = this._phase.kind === \"restoring\";\n\t\tthis._cancelPendingNavigation();\n\t\t// A navigationSettled handler that navigated on the cancellation has moved the URL on.\n\t\tif (this._currentHash !== currentHash) return;\n\t\tthis._undo = undoing ? null : this._describeUndo(pendingUndo, reported);\n\t\t// Another listener of the hash change that navTo() caused has replaced the hash, before\n\t\t// this router received it: undoing this hash change undoes the one of navTo() as well.\n\t\tif (this._undo && commit === phase && !commit.restoreHash) this._undo.fullHash = commit.writtenOver;\n\n\t\tconst direction = reported ? History.getInstance().getDirection() : undefined;\n\t\tconst attempt = this._startAttempt(newHash, true, direction);\n\t\tconst { generation } = attempt;\n\n\t\tconst context = this._createGuardContext(routeInfo, newHash, attempt.controller.signal);\n\n\t\tconst decision = this._evaluateGuards(context);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => {\n\t\t\t\t\tif (generation !== this._parseGeneration) {\n\t\t\t\t\t\tLog.debug(\n\t\t\t\t\t\t\t\"Async guard result discarded (superseded by newer navigation)\",\n\t\t\t\t\t\t\tnewHash,\n\t\t\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._applyDecision(d, newHash, toRoute, context.bag, attempt);\n\t\t\t\t},\n\t\t\t\tnewHash,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyDecision(decision, newHash, toRoute, context.bag, attempt);\n\t}\n\n\t/**\n\t * Stop listening to hash changes and reset guard state.\n\t *\n\t * Resets `_currentRoute` and `_currentHash` so that a subsequent\n\t * `initialize()` re-parses the current hash and fires `routeMatched`,\n\t * matching the native `sap.m.routing.Router` behavior. The route is\n\t * kept for `initialize(true)`, which resumes it instead.\n\t *\n\t * @override sap.ui.core.routing.Router#stop\n\t * @since 1.0.1\n\t */\n\toverride stop(): this {\n\t\tif (this._blockLoad) this._blockLoad.start = false;\n\t\t// Cancel first so in-flight navigationSettled() resolvers receive the\n\t\t// Cancelled result before _lastSettlement is cleared below.\n\t\tthis._cancelPendingNavigation();\n\t\t// A hash change that was to put the URL back does not reach a stopped router.\n\t\tthis._undo = null;\n\t\t// Nothing is committed on a router that is stopped already, or stops before its first navigation settles.\n\t\tif (this._currentHash !== null) this._stoppedRoute = this._currentRoute;\n\t\tthis._currentRoute = \"\";\n\t\tthis._currentHash = null;\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tsuper.stop();\n\t\treturn this;\n\t}\n\n\t/** Detach what {@link _start} has attached. */\n\tprivate _detachHashListeners(): void {\n\t\tthis.getHashChanger().detachEvent(\"hashChanged\", this._onHashReported, this);\n\t\t// UI5 moves the listener along when the global hash changer is replaced.\n\t\tHashChanger.getInstance().detachEvent(\"hashChanged\", this._onRootHashChanged, this);\n\t\tthis._rootHashChanger = null;\n\t}\n\n\t/**\n\t * Invalidate any in-flight async guard work. Bumps the generation counter\n\t * so pending `.then()` callbacks see they are stale, aborts the signal,\n\t * and transitions to idle. A navigation that waits for its guards or for\n\t * its hash settles as `Cancelled`. With `restoreHash`, a cancelled hash-change\n\t * navigation also gets its hash restored: `navTo()` passes it when the\n\t * call itself will not move the URL.\n\t */\n\tprivate _cancelPendingNavigation(restoreHash = false): void {\n\t\t++this._parseGeneration;\n\t\tconst phase = this._phase;\n\t\tconst pendingRestoresHash = this._pendingRestoresHash();\n\t\t// Idle before the settlement fires, so that a handler can navigate.\n\t\tthis._phase = IDLE;\n\t\t// A navigation that is committing ends with the navigation that supersedes it.\n\t\tif (phase.kind === \"idle\" || phase.kind === \"committing\") return;\n\t\tif (phase.kind === \"restoring\") {\n\t\t\t// A navigation that waits for the URL to be back has ended already: it settles as it ended.\n\t\t\tthis._flushSettlement(phase.result);\n\t\t\treturn;\n\t\t}\n\t\tif (phase.kind === \"evaluating\") phase.attempt.controller.abort();\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Cancelled, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tphase.kind === \"evaluating\" ? phase.attempt.hash : phase.commit.hash,\n\t\t\trestoreHash && pendingRestoresHash,\n\t\t);\n\t}\n\n\t/**\n\t * Whether the pending navigation leaves a hash in the URL that never committed, the one of a\n\t * hash-change navigation: it must be restored unless a navigation moves the URL.\n\t */\n\tprivate _pendingRestoresHash(): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind === \"evaluating\") return phase.attempt.restoreHash;\n\t\tif (phase.kind === \"committing\") return phase.restoreHash;\n\t\treturn phase.kind === \"awaitingHash\" && phase.commit.restoreHash;\n\t}\n\n\t/**\n\t * Start evaluating a navigation. Its generation is its own, so the result of any earlier\n\t * attempt is stale: also one that a navigationSettled handler started while this\n\t * navigation cancelled its predecessor, which is aborted here without a settlement.\n\t */\n\tprivate _startAttempt(hash: string, restoreHash: boolean, direction?: Direction): NavigationAttempt {\n\t\tif (this._phase.kind === \"evaluating\") this._phase.attempt.controller.abort();\n\t\tconst attempt: NavigationAttempt = {\n\t\t\thash,\n\t\t\tcontroller: new AbortController(),\n\t\t\tgeneration: ++this._parseGeneration,\n\t\t\trestoreHash,\n\t\t\tdirection,\n\t\t};\n\t\tthis._phase = { kind: \"evaluating\", attempt };\n\t\treturn attempt;\n\t}\n\n\t/**\n\t * Apply the decision of async guards once it is there. Until then the navigation is postponed,\n\t * which UI5 sees as a route match in progress (see {@link _mirrorMatchingProcess}). The pipeline\n\t * turns a failing guard into an error decision, so an error thrown here comes from applying the\n\t * decision, which has no caller to throw to: it is logged, and fails the navigation unless that\n\t * has settled.\n\t */\n\tprivate _applyWhenDecided(\n\t\tdecision: PromiseLike<GuardDecision>,\n\t\tapply: (decision: GuardDecision) => void,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t): void {\n\t\tif (this._phase.kind === \"evaluating\") this._phase = { ...this._phase, postponed: true };\n\t\tdecision.then((d) => {\n\t\t\tconst lastSettlement = this._lastSettlement;\n\t\t\ttry {\n\t\t\t\tapply(d);\n\t\t\t} catch (error) {\n\t\t\t\tLog.error(\n\t\t\t\t\t\"Navigation failed after its guards had settled\",\n\t\t\t\t\terror instanceof Error ? error : String(error),\n\t\t\t\t\tLOG_COMPONENT,\n\t\t\t\t);\n\t\t\t\tif (this._lastSettlement === lastSettlement) {\n\t\t\t\t\tthis._errorNavigation(error, attemptedHash, restoreHash);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Apply a guard decision for the parse() fallback path.\n\t */\n\tprivate _applyDecision(\n\t\tdecision: GuardDecision,\n\t\thash: string,\n\t\troute: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t): void {\n\t\t// A guard that navigated itself has superseded the navigation it was guarding.\n\t\tif (attempt.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\":\n\t\t\t\tthis._phase = { kind: \"committing\", route, hash, origin: \"parse\", restoreHash: false };\n\t\t\t\tthis._commitNavigation(hash, route);\n\t\t\t\tbreak;\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(hash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\t// The hash that redirects has reached the browser: the target takes its history entry.\n\t\t\t\tthis._startRedirectChain(decision.target, hash, bag, attempt, true);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, hash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Leave the title history of UI5 (`getTitleHistory()`) as after the native equivalent of a\n\t * redirected hash change: the hash change, then `navTo(target, ..., true)`. The route of the\n\t * hash change never matched, so UI5 has not handled its title:\n\t * - A new entry or a step forward would have added a title, which the title of the target\n\t * replaces: UI5 must not remove the title of the route before it.\n\t * - A step back would have removed the title of the route that was left, so that the target\n\t * replaces the title of the entry the step arrived at: UI5 removes the first for the\n\t * replaced hash, the router removes the second, under the condition of UI5 for a step back.\n\t */\n\tprivate _alignTitleHistory(direction: Direction | undefined): void {\n\t\tif (direction === HistoryDirection.NewEntry || direction === HistoryDirection.Forwards) {\n\t\t\tReflect.set(this, \"_bLastHashReplaced\", false);\n\t\t} else if (direction === HistoryDirection.Backwards) {\n\t\t\tconst titles: unknown[] = this.getTitleHistory();\n\t\t\tconst left = titles.at(-1);\n\t\t\tconst replaced = titles.at(-2);\n\t\t\tif (isRecord(left) && isRecord(replaced) && !left.isHome && left.title !== replaced.title) {\n\t\t\t\ttitles.splice(-2, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Delegate to the parent router and update internal state.\n\t *\n\t * State is updated BEFORE calling parse to ensure that if event handlers\n\t * (e.g., routeMatched) trigger nested navigation, the leave guards will\n\t * run for the correct (new) route rather than the old one. The settlement\n\t * fires before parse as well, so the settlements of such nested navigations\n\t * follow it.\n\t */\n\tprivate _commitNavigation(hash: string, route: string): void {\n\t\tconst wasRedirect = this._phase.kind === \"committing\" && this._phase.origin === \"redirect\";\n\t\tif (this._phase.kind === \"committing\") this._alignTitleHistory(this._phase.direction);\n\t\t// The URL has moved on: a hash change that was to put it back is not awaited any more.\n\t\tthis._undo = null;\n\t\tthis._currentHash = hash;\n\t\tthis._currentRoute = route;\n\t\t// Transition to idle before super.parse so that routeMatched/patternMatched\n\t\t// handlers that call navTo() go through the full guard pipeline.\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement({\n\t\t\tstatus: wasRedirect\n\t\t\t\t? NavigationOutcome.Redirected\n\t\t\t\t: this._currentRoute === \"\"\n\t\t\t\t\t? NavigationOutcome.Bypassed\n\t\t\t\t\t: NavigationOutcome.Committed,\n\t\t\troute: this._currentRoute,\n\t\t\thash,\n\t\t});\n\t\t// A navigationSettled handler that navigated on has committed its own hash.\n\t\tif (this._currentHash !== hash) return;\n\t\tsuper.parse(hash);\n\t}\n\n\t/**\n\t * Commit the navigation of the committing phase after `super.navTo()` unless `parse()` has\n\t * committed it. Returns whether the navigation takes place:\n\t * - The hash changer shows the target hash: the route matches here.\n\t * - UI5 writes the hash later, which it does with component targets, once the nested\n\t * components are loaded. The navigation waits for it: it commits, and the route matches,\n\t * when `parse()` gets that hash, as the route does natively. Committed here, the router\n\t * would be on a route that UI5 does not display if the hash is never written.\n\t * - Otherwise the hash changer has refused the hash change, as the Fiori launchpad does while\n\t * it asks the user about unsaved data. Nothing changed, so nothing is committed.\n\t */\n\tprivate _commitAfterNavTo(componentTargetInfo: Record<string, ComponentTargetParameters> | undefined): boolean {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"committing\") return true;\n\t\tif (this.getHashChanger().getHash() === phase.hash) {\n\t\t\tthis._commitNavigation(phase.hash, phase.route);\n\t\t\treturn true;\n\t\t}\n\t\tif (!componentTargetInfo || Object.keys(componentTargetInfo).length === 0) return false;\n\t\tthis._phase = { kind: \"awaitingHash\", commit: phase };\n\t\treturn true;\n\t}\n\n\t/**\n\t * Evaluate guards on a redirect target and apply the resulting decision.\n\t *\n\t * Handles the unknown-route block, loop detection (visited-hash set +\n\t * depth cap), sync/async guard evaluation, and recursive chaining when\n\t * the target's guard itself returns a redirect. All hops in a chain\n\t * share the same AbortSignal and generation counter from the original\n\t * navigation so that a superseding navigation correctly discards\n\t * in-flight redirect work.\n\t *\n\t * @param target - Redirect target: a route name string or {@link GuardRedirect} with parameters.\n\t * @param chain - Mutable context threaded through the redirect chain (visited set, signals, etc.).\n\t */\n\tprivate _redirect(target: string | GuardRedirect, chain: RedirectChainContext): void {\n\t\tconst targetName = typeof target === \"string\" ? target : target.route;\n\t\tconst targetRoute = this.getRoute(targetName);\n\t\tif (!targetRoute) {\n\t\t\tLog.warning(\n\t\t\t\t`Guard redirect target \"${targetName}\" is not a known route, treating as blocked`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tlet targetHash: string;\n\t\ttry {\n\t\t\ttargetHash = targetRoute.getURL(typeof target === \"string\" ? {} : (target.parameters ?? {}));\n\t\t} catch (error) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect target \"${targetName}\" has no valid hash, navigation failed`,\n\t\t\t\tString(error),\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._errorNavigation(error, chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\n\t\tif (chain.visited.has(targetHash)) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect loop detected: ${[...chain.visited, targetHash].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tif (chain.visited.size > MAX_REDIRECT_DEPTH) {\n\t\t\tLog.error(\n\t\t\t\t`Guard redirect chain exceeded maximum depth (${MAX_REDIRECT_DEPTH}): ${[...chain.visited].join(\" -> \")}`,\n\t\t\t\tundefined,\n\t\t\t\tLOG_COMPONENT,\n\t\t\t);\n\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\treturn;\n\t\t}\n\t\tchain.visited.add(targetHash);\n\n\t\tconst routeInfo = this._matchRoute(targetHash);\n\t\tconst toRoute = routeInfo.name;\n\t\tconst context = this._createGuardContext(routeInfo, targetHash, chain.signal, chain);\n\n\t\tconst decision = this._evaluateGuards(context, true);\n\n\t\tif (isPromiseLike(decision)) {\n\t\t\tthis._applyWhenDecided(\n\t\t\t\tdecision,\n\t\t\t\t(d) => this._applyRedirectDecision(d, target, targetHash, toRoute, chain),\n\t\t\t\tchain.attemptedHash,\n\t\t\t\tchain.restoreHash,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._applyRedirectDecision(decision, target, targetHash, toRoute, chain);\n\t}\n\n\t/**\n\t * Apply a guard decision within a redirect chain. For \"allow\", enter\n\t * committing phase and delegate to navTo (which hits the existing bypass);\n\t * if that does not reach parse(), commit the target directly. A target that\n\t * is displayed already settles the navigation without a commit.\n\t * For \"block\", block the entire chain. For \"redirect\", recurse.\n\t *\n\t * @param decision - Normalized guard pipeline result for this hop.\n\t * @param target - The redirect target (route name or {@link GuardRedirect}).\n\t * @param targetHash - Resolved hash for the redirect target.\n\t * @param toRoute - Route that matches the hash, as in the hop's guard context: the route UI5 displays.\n\t * @param chain - Shared redirect chain context with visited set, signals, etc.\n\t */\n\tprivate _applyRedirectDecision(\n\t\tdecision: GuardDecision,\n\t\ttarget: string | GuardRedirect,\n\t\ttargetHash: string,\n\t\ttoRoute: string,\n\t\tchain: RedirectChainContext,\n\t): void {\n\t\t// Superseded while the hop's guards ran: by a newer navigation, or by a guard that navigated.\n\t\tif (chain.generation !== this._parseGeneration) return;\n\t\tswitch (decision.action) {\n\t\t\tcase \"allow\": {\n\t\t\t\tconst componentTargetInfo = typeof target === \"string\" ? undefined : target.componentTargetInfo;\n\t\t\t\tif (targetHash === this._currentHash) {\n\t\t\t\t\t// The target is displayed already, so no route matches again, as for a navTo() to\n\t\t\t\t\t// the committed hash: the URL is put back and UI5 sets the hashes of nested components.\n\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\tthis._settleUncommitted(\n\t\t\t\t\t\t{ status: NavigationOutcome.Redirected, route: this._currentRoute, hash: targetHash },\n\t\t\t\t\t\tchain.attemptedHash,\n\t\t\t\t\t\tchain.restoreHash,\n\t\t\t\t\t\ttypeof target !== \"string\" && componentTargetInfo\n\t\t\t\t\t\t\t? () => {\n\t\t\t\t\t\t\t\t\t// Unless a settlement handler has moved the URL on.\n\t\t\t\t\t\t\t\t\tif (this.getHashChanger().getHash() !== targetHash) return;\n\t\t\t\t\t\t\t\t\tsuper.navTo(\n\t\t\t\t\t\t\t\t\t\ttarget.route,\n\t\t\t\t\t\t\t\t\t\ttarget.parameters ?? {},\n\t\t\t\t\t\t\t\t\t\tcomponentTargetInfo,\n\t\t\t\t\t\t\t\t\t\tchain.replace,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis._phase = {\n\t\t\t\t\tkind: \"committing\",\n\t\t\t\t\troute: toRoute,\n\t\t\t\t\thash: targetHash,\n\t\t\t\t\torigin: \"redirect\",\n\t\t\t\t\tdirection: chain.direction,\n\t\t\t\t\trestoreHash: chain.restoreHash,\n\t\t\t\t\twrittenOver: HashChanger.getInstance().getHash(),\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\t// Writing the hash the URL already shows changes nothing, except that a nested\n\t\t\t\t\t// router would add its prefix for an empty hash (see _restoreHash).\n\t\t\t\t\tconst hashShown = this.getHashChanger().getHash() === targetHash;\n\t\t\t\t\tif (typeof target === \"string\") {\n\t\t\t\t\t\tif (!hashShown) this.navTo(target, {}, {}, chain.replace);\n\t\t\t\t\t} else if (!hashShown || componentTargetInfo) {\n\t\t\t\t\t\tthis.navTo(target.route, target.parameters ?? {}, componentTargetInfo, chain.replace);\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._commitAfterNavTo(componentTargetInfo)) {\n\t\t\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (this._phase.kind === \"committing\") {\n\t\t\t\t\t\tthis._phase = IDLE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"block\":\n\t\t\t\tthis._blockNavigation(chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t\tcase \"redirect\":\n\t\t\t\tthis._redirect(decision.target, chain);\n\t\t\t\tbreak;\n\t\t\tcase \"error\":\n\t\t\t\tthis._errorNavigation(decision.error, chain.attemptedHash, chain.restoreHash);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** The route that matches a hash, and its arguments. For a hash that no route matches: no route (`\"\"`), no arguments. */\n\tprivate _matchRoute(hash: string): RouteInfo {\n\t\tconst info = this.getRouteInfoByHash(hash);\n\t\treturn { name: info?.name ?? \"\", arguments: info?.arguments ?? {} };\n\t}\n\n\t/**\n\t * The greedy routes that match `hash` in addition to `firstMatch`, the first route that\n\t * matches it. UI5 matches them as well and fires their events.\n\t */\n\tprivate _greedyMatches(hash: string, firstMatch: string): string[] {\n\t\treturn this._greedyRouteNames.filter((name) => name !== firstMatch && this.getRoute(name)?.match(hash));\n\t}\n\n\t/**\n\t * Evaluate the guards of a navigation: of the routes in its context, and of the greedy routes\n\t * that are left and entered with them. A hop of a redirect chain leaves no route.\n\t */\n\tprivate _evaluateGuards(context: GuardContext, redirectHop = false): GuardDecision | Promise<GuardDecision> {\n\t\treturn this._pipeline.evaluate(context, {\n\t\t\tskipLeaveGuards: redirectHop,\n\t\t\talsoLeaving: this._greedyMatches(context.fromHash, context.fromRoute),\n\t\t\talsoEntering: this._greedyMatches(context.toHash, context.toRoute),\n\t\t});\n\t}\n\n\t/**\n\t * Build the guard context of a navigation to `routeInfo`. A hop of a redirect chain passes the\n\t * chain, whose source route, source hash and bag are those of the original navigation.\n\t */\n\tprivate _createGuardContext(\n\t\trouteInfo: RouteInfo,\n\t\ttoHash: string,\n\t\tsignal: AbortSignal,\n\t\tchain?: RedirectChainContext,\n\t): GuardContext {\n\t\tconst fromRoute = chain ? chain.fromRoute : this._currentRoute;\n\t\treturn {\n\t\t\ttoRoute: routeInfo.name,\n\t\t\ttoHash,\n\t\t\ttoArguments: routeInfo.arguments,\n\t\t\tfromRoute,\n\t\t\tfromHash: chain ? chain.fromHash : (this._currentHash ?? \"\"),\n\t\t\tsignal,\n\t\t\tbag: chain ? chain.bag : new Map<string, unknown>(),\n\t\t\ttoMeta: this.getRouteMeta(routeInfo.name),\n\t\t\tfromMeta: this.getRouteMeta(fromRoute),\n\t\t\townerComponent: this._ownerComponent,\n\t\t};\n\t}\n\n\t/**\n\t * Start a new redirect chain for the given evaluating attempt.\n\t * Called by {@link _applyPreflightDecision} and {@link _applyDecision}\n\t * when a guard returns a redirect. Delegates to {@link _redirect} with\n\t * a fresh {@link RedirectChainContext}.\n\t */\n\tprivate _startRedirectChain(\n\t\ttarget: string | GuardRedirect,\n\t\thash: string,\n\t\tbag: Map<string, unknown>,\n\t\tattempt: NavigationAttempt,\n\t\treplace: boolean | undefined,\n\t): void {\n\t\tconst visited = new Set<string>();\n\t\tvisited.add(hash);\n\t\tthis._redirect(target, {\n\t\t\tvisited,\n\t\t\tattemptedHash: hash,\n\t\t\trestoreHash: attempt.restoreHash,\n\t\t\treplace,\n\t\t\tdirection: attempt.direction,\n\t\t\tfromRoute: this._currentRoute,\n\t\t\tfromHash: this._currentHash ?? \"\",\n\t\t\tsignal: attempt.controller.signal,\n\t\t\tgeneration: attempt.generation,\n\t\t\tbag,\n\t\t});\n\t}\n\n\t/**\n\t * Settle as Blocked. With `restoreHash` (default), the hash change of the navigation is\n\t * undone first (see {@link _settleUncommitted}). Preflight callers pass false unless they\n\t * superseded a hash-change navigation: otherwise the hash was never changed.\n\t */\n\tprivate _blockNavigation(attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Blocked, route: this._currentRoute, hash: this._currentHash ?? \"\" },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Clear pending state and flush an Error settlement.\n\t * Same structure as {@link _blockNavigation} but with `NavigationOutcome.Error`\n\t * and the error that caused the failure.\n\t */\n\tprivate _errorNavigation(error: unknown, attemptedHash?: string, restoreHash = true): void {\n\t\tthis._phase = IDLE;\n\t\tthis._settleUncommitted(\n\t\t\t{ status: NavigationOutcome.Error, route: this._currentRoute, hash: this._currentHash ?? \"\", error },\n\t\t\tattemptedHash,\n\t\t\trestoreHash,\n\t\t);\n\t}\n\n\t/**\n\t * Settle a navigation that did not commit. With `restoreHash`, the hash it left in the URL\n\t * is restored first, so that settlement handlers run on the final URL and a hash they set\n\t * is not overwritten. The exception is a first navigation: nothing is committed yet, so the\n\t * empty hash is restored after the settlement and parsed as a navigation of its own.\n\t * `whenBack` runs after the settlement.\n\t */\n\tprivate _settleUncommitted(\n\t\tresult: NavigationResult,\n\t\tattemptedHash: string | undefined,\n\t\trestoreHash: boolean,\n\t\twhenBack?: () => void,\n\t): void {\n\t\tconst loadDefaultRoute = restoreHash && this._currentHash === null && !!attemptedHash;\n\t\t// It settles once the URL is back.\n\t\tif (restoreHash && !loadDefaultRoute && !this._undoHashChange(result, whenBack)) return;\n\t\tthis._flushSettlement(result);\n\t\twhenBack?.();\n\t\t// Unless a handler navigated and committed in the meantime.\n\t\tif (loadDefaultRoute && this._currentHash === null) this._restoreHash(\"\", false);\n\t}\n\n\t/**\n\t * Describe how to undo the hash change that the navigation starts with. After `pending`, the\n\t * undo of a navigation that this one supersedes, it takes back both changes. A `parse()` that\n\t * is not `reported` by the hash changer comes with no hash change.\n\t */\n\tprivate _describeUndo(pending: HashChangeUndo | null, reported: boolean): HashChangeUndo | null {\n\t\tif (!reported) return pending;\n\t\tconst shown = HashChanger.getInstance().getHash();\n\t\tconst step = lastStep;\n\t\tif (!pending) return { first: shown, fullHash: undefined, shown, step, started: false };\n\t\tconst offset = pending.step && step ? pending.step.offset + step.offset : 0;\n\t\treturn {\n\t\t\tfirst: pending.first,\n\t\t\tfullHash: pending.fullHash,\n\t\t\tshown,\n\t\t\tstep: step && offset ? { offset, href: step.href } : null,\n\t\t\tstarted: false,\n\t\t};\n\t}\n\n\t/**\n\t * Put the URL back after a navigation that did not commit. Returns whether it is back;\n\t * otherwise `result` settles when it is.\n\t *\n\t * While the URL still shows the hash change that started the navigation, that change is undone\n\t * as a whole, so that the hashes of nested routers are back as well:\n\t * - A step through the browser history is taken back, which leaves the history as it was.\n\t * The browser does that asynchronously.\n\t * - Any other change (a new entry, or a step the browser does not report) has its entry replaced with\n\t * the full previous hash, once UI5 has reported the change to every router. Nested routers\n\t * have received their part of the refused hash by then; they receive the previous one next.\n\t *\n\t * `parse()` ends the wait when the hash change arrives that shows the full previous hash.\n\t *\n\t * If the URL has moved on since, only the hash of this router is restored. So it is while\n\t * no navigation has committed: the URL before the change showed no route of this router either.\n\t */\n\tprivate _undoHashChange(result: NavigationResult, whenBack?: () => void): boolean {\n\t\tconst undo = this._undo;\n\t\tconst hash = this._currentHash;\n\t\tconst rootHash = HashChanger.getInstance().getHash();\n\t\tif (undo === null || hash === null || undo.shown !== rootHash || undo.fullHash === rootHash) {\n\t\t\tthis._restoreHash(hash ?? \"\");\n\t\t\treturn true;\n\t\t}\n\t\tconst href = window.location.href;\n\t\tundo.started = true;\n\t\tthis._phase = { kind: \"restoring\", result, whenBack };\n\t\tif (undoneHref === href) {\n\t\t\t// Another router is taking the step back.\n\t\t} else if (undo.step) {\n\t\t\tundoneHref = href;\n\t\t\twindow.history.go(-undo.step.offset);\n\t\t} else if (undo.fullHash === undefined) {\n\t\t\t// UI5 is still reporting the change to the nested routers.\n\t\t\tthis._phase = { ...this._phase, awaitsReport: true };\n\t\t} else {\n\t\t\tthis._replaceFullHash(undo.fullHash);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Replace the hash of the root hash changer with the full previous hash, and settle the\n\t * navigation that waits for it unless `parse()` has done so.\n\t */\n\tprivate _replaceFullHash(fullHash: string): void {\n\t\tHashChanger.getInstance().replaceHash(fullHash, HistoryDirection.Unknown);\n\t\tthis._finishRestore();\n\t}\n\n\t/**\n\t * Settle the navigation that waited for the URL to be back: on `hash`, if the hash changer\n\t * has reported one with the URL.\n\t */\n\tprivate _finishRestore(hash?: string): void {\n\t\tconst phase = this._phase;\n\t\tif (phase.kind !== \"restoring\") return;\n\t\tthis._phase = IDLE;\n\t\tthis._flushSettlement(hash === undefined ? phase.result : { ...phase.result, hash });\n\t\tphase.whenBack?.();\n\t}\n\n\t/**\n\t * Restore the previous hash of this router without creating a history entry\n\t * (see {@link _undoHashChange} for the hash change of a navigation).\n\t * Assumes replaceHash fires hashChanged synchronously (validated by test).\n\t * `_currentRoute` stays unchanged because the navigation never\n\t * committed. The user remains on the same logical route.\n\t *\n\t * A hash that the hash changer already shows is not written again: the navigation never\n\t * moved it. For a nested router, writing its empty hash would add its prefix to the browser\n\t * hash (`shell` becomes `shell&/child/`).\n\t */\n\tprivate _restoreHash(hash: string, suppressParse = true): void {\n\t\tconst hashChanger = this.getHashChanger();\n\t\tif (hashChanger.getHash() === hash) return;\n\t\tthis._suppressedHash = suppressParse ? hash : null;\n\t\tvoid hashChanger.replaceHash(hash, HistoryDirection.Unknown);\n\t\tthis._suppressedHash = null;\n\t}\n\n\t/**\n\t * Collect all route names and their patterns from the router.\n\t * Skips routes whose pattern is undefined (no pattern configured).\n\t */\n\tprivate _collectRoutePatterns(): RoutePattern[] {\n\t\tconst result: RoutePattern[] = [];\n\t\tfor (const name of this._routeNames) {\n\t\t\tconst pattern = this.getRoute(name)?.getPattern();\n\t\t\tif (pattern !== undefined) result.push({ name, pattern });\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Register one manifest guard: as the last guard of its route, or in front of the guard\n\t * `before`. A registration error (`unknownRouteRegistration: \"throw\"` for an unknown route)\n\t * is logged and skips the guard: no caller of the manifest config could catch it, and it\n\t * must not keep the router from starting.\n\t */\n\tprivate _registerManifestGuard(descriptor: ManifestGuardDescriptor, guardFn: GuardFn, before?: GuardFn): void {\n\t\ttry {\n\t\t\tif (descriptor.route === \"*\") {\n\t\t\t\tthis.addGuard(guardFn);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (descriptor.type === \"leave\") {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addLeaveGuard\");\n\t\t\t\tthis._pipeline.addLeaveGuard(descriptor.route, guardFn, before);\n\t\t\t} else {\n\t\t\t\tthis._handleUnknownRouteRegistration(descriptor.route, \"addRouteGuard\");\n\t\t\t\tthis._pipeline.addEnterGuard(descriptor.route, guardFn, before);\n\t\t\t}\n\t\t\tthis._manifestGuards.push({ descriptor, fn: guardFn });\n\t\t} catch (err: unknown) {\n\t\t\tLog.error(`guardRouter.guards: failed to register \"${descriptor.modulePath}\"`, String(err), LOG_COMPONENT);\n\t\t}\n\t}\n\n\t/** Register the guards of each descriptor, loading their modules on first use (see `createLazyGuards`). */\n\tprivate _registerLazyGuards(descriptors: ManifestGuardDescriptor[]): void {\n\t\tfor (const descriptor of descriptors) {\n\t\t\tfor (const fn of createLazyGuards(descriptor)) this._registerManifestGuard(descriptor, fn);\n\t\t}\n\t}\n\n\t/**\n\t * Clean up guards on destroy. Bumps generation to discard pending async results.\n\t * A second call does nothing, like `sap.ui.core.routing.Router#destroy`.\n\t *\n\t * @since 1.0.1\n\t */\n\toverride destroy(): this {\n\t\tif (this._destroyed) return this;\n\t\tthis._destroyed = true;\n\t\tthis._pipeline.clear();\n\t\tthis._pendingGuardDescriptors = [];\n\t\tthis._sourceDescriptors = [];\n\t\tthis._manifestGuards = [];\n\t\tthis._cancelPendingNavigation();\n\t\tthis._lastSettlement = null;\n\t\tthis._detachHashListeners();\n\t\tthis._meta.clear();\n\t\tsuper.destroy();\n\t\treturn this;\n\t}\n}\n"],"mappings":";;;;;;QAsBOA,iBAAiB,GAAAC,sBAAA,CAAAC,mBAAA;EAAA,MACjBC,aAAa,GAAAF,sBAAA,CAAAG,eAAA;EAAA,MAAwBC,aAAa,GAAAD,eAAA;EAAA,MAAEE,iBAAiB,GAAAF,eAAA;EAAA,MAAEG,aAAa,GAAAH,eAAA;EAAA,MAC5DI,QAAQ,GAAAC,cAAA;EAAA,MAAEC,sBAAsB,GAAAD,cAAA;EAAA,MACtDE,gBAAgB,GAAAC,eAAA;EAAA,MAAEC,gBAAgB,GAAAD,eAAA;EAAA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