@ionic/react-router 8.7.13-dev.11766081813.18052ea1 → 8.7.13-dev.11766090775.11e2bebb

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.
package/dist/index.js CHANGED
@@ -1490,17 +1490,30 @@ class StackManager extends React.PureComponent {
1490
1490
  }, VIEW_UNMOUNT_DELAY_MS);
1491
1491
  }
1492
1492
  /**
1493
- * Cleans up orphaned sibling views after replace actions (redirects).
1493
+ * Cleans up orphaned sibling views after replace actions or push-to-container navigations.
1494
1494
  */
1495
1495
  cleanupOrphanedSiblingViews(routeInfo, enteringViewItem, leavingViewItem) {
1496
- var _a, _b, _c, _d;
1497
- if (routeInfo.routeAction !== 'replace') {
1498
- return;
1499
- }
1496
+ var _a, _b, _c, _d, _e, _f, _g;
1500
1497
  const enteringRoutePath = (_b = (_a = enteringViewItem.reactElement) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.path;
1501
1498
  if (!enteringRoutePath) {
1502
1499
  return;
1503
1500
  }
1501
+ const leavingRoutePath = (_d = (_c = leavingViewItem === null || leavingViewItem === void 0 ? void 0 : leavingViewItem.reactElement) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.path;
1502
+ const isContainerRoute = (path) => path === null || path === void 0 ? void 0 : path.endsWith('/*');
1503
+ const isReplaceAction = routeInfo.routeAction === 'replace';
1504
+ const isPushToContainer = routeInfo.routeAction === 'push' && routeInfo.routeDirection === 'none' && isContainerRoute(enteringRoutePath);
1505
+ if (!isReplaceAction && !isPushToContainer) {
1506
+ return;
1507
+ }
1508
+ // Skip cleanup for tab switches
1509
+ const isSameView = enteringViewItem === leavingViewItem;
1510
+ const isSameContainerRoute = isContainerRoute(enteringRoutePath) && leavingRoutePath === enteringRoutePath;
1511
+ const isNavigatingWithinContainer = isPushToContainer &&
1512
+ !leavingViewItem &&
1513
+ ((_e = routeInfo.prevRouteLastPathname) === null || _e === void 0 ? void 0 : _e.startsWith(enteringRoutePath.replace(/\/\*$/, '')));
1514
+ if (isSameView || isSameContainerRoute || isNavigatingWithinContainer) {
1515
+ return;
1516
+ }
1504
1517
  const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];
1505
1518
  const areSiblingRoutes = (path1, path2) => {
1506
1519
  const path1IsRelative = !path1.startsWith('/');
@@ -1518,7 +1531,7 @@ class StackManager extends React.PureComponent {
1518
1531
  return getParent(path1) === getParent(path2);
1519
1532
  };
1520
1533
  for (const viewItem of allViewsInOutlet) {
1521
- const viewRoutePath = (_d = (_c = viewItem.reactElement) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.path;
1534
+ const viewRoutePath = (_g = (_f = viewItem.reactElement) === null || _f === void 0 ? void 0 : _f.props) === null || _g === void 0 ? void 0 : _g.path;
1522
1535
  const shouldSkip = viewItem.id === enteringViewItem.id ||
1523
1536
  (leavingViewItem && viewItem.id === leavingViewItem.id) ||
1524
1537
  !viewItem.mount ||
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/pathMatching.ts","../src/ReactRouter/utils/computeParentPath.ts","../src/ReactRouter/utils/pathNormalization.ts","../src/ReactRouter/utils/routeElements.ts","../src/ReactRouter/utils/viewItemUtils.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const IonRouteInner = ({ path, element }: IonRouteProps) => {\n return <Route path={path} element={element} />;\n};\n","import type { PathMatch } from 'react-router';\nimport { matchPath as reactRouterMatchPath } from 'react-router-dom';\n\n/**\n * Options for the matchPath function.\n */\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n caseSensitive?: boolean;\n end?: boolean;\n index?: boolean;\n };\n}\n\n/**\n * The matchPath function is used only for matching paths, not rendering components or elements.\n * @see https://reactrouter.com/v6/utils/match-path\n */\nexport const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathMatch<string> | null => {\n const { path, index, ...restProps } = componentProps;\n\n // Handle index routes - they match when pathname is empty or just \"/\"\n if (index && !path) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: false,\n end: true,\n },\n };\n }\n return null;\n }\n\n // Handle empty path routes - they match when pathname is also empty or just \"/\"\n if (path === '' || path === undefined) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: restProps.caseSensitive ?? false,\n end: restProps.end ?? true,\n },\n };\n }\n return null;\n }\n\n // For relative paths (don't start with '/'), normalize both path and pathname for matching\n if (!path.startsWith('/')) {\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path: `/${path}`,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n const normalizedPathname = pathname.startsWith('/') ? pathname : `/${pathname}`;\n const match = reactRouterMatchPath(matchOptions, normalizedPathname);\n\n if (match) {\n // Adjust the match to remove the leading '/' we added\n return {\n ...match,\n pathname: pathname,\n pathnameBase: match.pathnameBase === '/' ? '' : match.pathnameBase.slice(1),\n pattern: {\n ...match.pattern,\n path: path,\n },\n };\n }\n\n return null;\n }\n\n // For absolute paths, use React Router's matcher directly.\n // React Router v6 routes default to `end: true` unless the pattern\n // explicitly opts into wildcards with `*`. Mirror that behaviour so\n // matching parity stays aligned with <Route>.\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n return reactRouterMatchPath(matchOptions, pathname);\n};\n\n/**\n * Determines the portion of a pathname that a given route pattern should match against.\n * For absolute route patterns we return the full pathname. For relative patterns we\n * strip off the already-matched parent segments so React Router receives the remainder.\n */\nexport const derivePathnameToMatch = (fullPathname: string, routePath?: string): string => {\n // For absolute or empty routes, use the full pathname as-is\n if (!routePath || routePath === '' || routePath.startsWith('/')) {\n return fullPathname;\n }\n\n const trimmedPath = fullPathname.startsWith('/') ? fullPathname.slice(1) : fullPathname;\n if (!trimmedPath) {\n // For root-level relative routes (pathname is \"/\" and routePath is relative),\n // return the full pathname so matchPath can normalize both.\n // This allows routes like <Route path=\"foo/*\" .../> at root level to work correctly.\n return fullPathname;\n }\n\n const fullSegments = trimmedPath.split('/').filter(Boolean);\n if (fullSegments.length === 0) {\n return '';\n }\n\n const routeSegments = routePath.split('/').filter(Boolean);\n if (routeSegments.length === 0) {\n return trimmedPath;\n }\n\n const wildcardIndex = routeSegments.findIndex((segment) => segment === '*' || segment === '**');\n\n if (wildcardIndex >= 0) {\n const baseSegments = routeSegments.slice(0, wildcardIndex);\n if (baseSegments.length === 0) {\n return trimmedPath;\n }\n\n const startIndex = fullSegments.findIndex((_, idx) =>\n baseSegments.every((seg, segIdx) => {\n const target = fullSegments[idx + segIdx];\n if (!target) {\n return false;\n }\n if (seg.startsWith(':')) {\n return true;\n }\n return target === seg;\n })\n );\n\n if (startIndex >= 0) {\n return fullSegments.slice(startIndex).join('/');\n }\n }\n\n if (routeSegments.length <= fullSegments.length) {\n return fullSegments.slice(fullSegments.length - routeSegments.length).join('/');\n }\n\n return fullSegments[fullSegments.length - 1] ?? trimmedPath;\n};\n","import type React from 'react';\n\nimport { matchPath } from './pathMatching';\n\n/**\n * Finds the longest common prefix among an array of paths.\n * Used to determine the scope of an outlet with absolute routes.\n *\n * @param paths An array of absolute path strings.\n * @returns The common prefix shared by all paths.\n */\nexport const computeCommonPrefix = (paths: string[]): string => {\n if (paths.length === 0) return '';\n if (paths.length === 1) {\n // For a single path, extract the directory-like prefix\n // e.g., /dynamic-routes/home -> /dynamic-routes\n const segments = paths[0].split('/').filter(Boolean);\n if (segments.length > 1) {\n return '/' + segments.slice(0, -1).join('/');\n }\n return '/' + segments[0];\n }\n\n // Split all paths into segments\n const segmentArrays = paths.map((p) => p.split('/').filter(Boolean));\n const minLength = Math.min(...segmentArrays.map((s) => s.length));\n\n const commonSegments: string[] = [];\n for (let i = 0; i < minLength; i++) {\n const segment = segmentArrays[0][i];\n // Skip segments with route parameters or wildcards\n if (segment.includes(':') || segment.includes('*')) {\n break;\n }\n const allMatch = segmentArrays.every((s) => s[i] === segment);\n if (allMatch) {\n commonSegments.push(segment);\n } else {\n break;\n }\n }\n\n return commonSegments.length > 0 ? '/' + commonSegments.join('/') : '';\n};\n\n/**\n * Checks if a route path is a \"splat-only\" route (just `*` or `/*`).\n */\nconst isSplatOnlyRoute = (routePath: string | undefined): boolean => {\n return routePath === '*' || routePath === '/*';\n};\n\n/**\n * Checks if a route has an embedded wildcard (e.g., \"tab1/*\" but not \"*\" or \"/*\").\n */\nconst hasEmbeddedWildcard = (routePath: string | undefined): boolean => {\n return !!routePath && routePath.includes('*') && !isSplatOnlyRoute(routePath);\n};\n\n/**\n * Checks if a route with an embedded wildcard matches a pathname.\n */\nconst matchesEmbeddedWildcardRoute = (route: React.ReactElement, pathname: string): boolean => {\n const routePath = route.props.path as string | undefined;\n if (!hasEmbeddedWildcard(routePath)) {\n return false;\n }\n return !!matchPath({ pathname, componentProps: route.props });\n};\n\n/**\n * Checks if a route is a specific match (not wildcard-only or index).\n */\nexport const isSpecificRouteMatch = (route: React.ReactElement, remainingPath: string): boolean => {\n const routePath = route.props.path;\n if (route.props.index || isSplatOnlyRoute(routePath)) {\n return false;\n }\n return !!matchPath({ pathname: remainingPath, componentProps: route.props });\n};\n\n/**\n * Result of parent path computation.\n */\nexport interface ParentPathResult {\n parentPath: string | undefined;\n outletMountPath: string | undefined;\n}\n\ninterface RouteAnalysis {\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n routeChildren: React.ReactElement[];\n}\n\n/**\n * Analyzes route children to determine their characteristics.\n *\n * @param routeChildren The route children to analyze.\n * @returns Analysis of the route characteristics.\n */\nexport const analyzeRouteChildren = (routeChildren: React.ReactElement[]): RouteAnalysis => {\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n const hasIndexRoute = routeChildren.some((route) => route.props.index);\n\n const hasWildcardRoute = routeChildren.some((route) => {\n const routePath = route.props.path;\n return routePath === '*' || routePath === '/*';\n });\n\n return { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute, routeChildren };\n};\n\ninterface ComputeParentPathOptions {\n currentPathname: string;\n outletMountPath: string | undefined;\n routeChildren: React.ReactElement[];\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n}\n\n/**\n * Checks if any route matches as a specific (non-wildcard, non-index) route.\n */\nconst findSpecificMatch = (routeChildren: React.ReactElement[], remainingPath: string): boolean => {\n return routeChildren.some(\n (route) => isSpecificRouteMatch(route, remainingPath) || matchesEmbeddedWildcardRoute(route, remainingPath)\n );\n};\n\n/**\n * Checks if any specific route could plausibly match the remaining path.\n * Used to determine if we should fall back to a wildcard match.\n */\nconst couldSpecificRouteMatch = (routeChildren: React.ReactElement[], remainingPath: string): boolean => {\n const remainingFirstSegment = remainingPath.split('/')[0];\n return routeChildren.some((route) => {\n const routePath = route.props.path as string | undefined;\n if (!routePath || routePath === '*' || routePath === '/*') return false;\n if (route.props.index) return false;\n\n const routeFirstSegment = routePath.split('/')[0].replace(/[*:]/g, '');\n if (!routeFirstSegment) return false;\n\n // Check for prefix overlap (either direction)\n return (\n routeFirstSegment.startsWith(remainingFirstSegment.slice(0, 3)) ||\n remainingFirstSegment.startsWith(routeFirstSegment.slice(0, 3))\n );\n });\n};\n\n/**\n * Checks for index route match when remaining path is empty.\n * Index routes only match at the outlet's mount path level.\n */\nconst checkIndexMatch = (\n parentPath: string,\n remainingPath: string,\n hasIndexRoute: boolean,\n outletMountPath: string | undefined\n): string | undefined => {\n if ((remainingPath === '' || remainingPath === '/') && hasIndexRoute) {\n if (outletMountPath) {\n // Index should only match at the existing mount path\n return parentPath === outletMountPath ? parentPath : undefined;\n }\n // No mount path yet - this would establish it\n return parentPath;\n }\n return undefined;\n};\n\n/**\n * Determines the best parent path from the available matches.\n * Priority: specific > wildcard > index\n */\nconst selectBestMatch = (\n specificMatch: string | undefined,\n wildcardMatch: string | undefined,\n indexMatch: string | undefined\n): string | undefined => {\n return specificMatch ?? wildcardMatch ?? indexMatch;\n};\n\n/**\n * Handles outlets with only absolute routes by computing their common prefix.\n */\nconst computeAbsoluteRoutesParentPath = (\n routeChildren: React.ReactElement[],\n currentPathname: string,\n outletMountPath: string | undefined\n): ParentPathResult | undefined => {\n const absolutePathRoutes = routeChildren.filter((route) => {\n const path = route.props.path;\n return path && path.startsWith('/');\n });\n\n if (absolutePathRoutes.length === 0) {\n return undefined;\n }\n\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n if (!commonPrefix || commonPrefix === '/') {\n return undefined;\n }\n\n const newOutletMountPath = outletMountPath || commonPrefix;\n\n if (!currentPathname.startsWith(commonPrefix)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: commonPrefix, outletMountPath: newOutletMountPath };\n};\n\n/**\n * Computes the parent path for a nested outlet based on the current pathname\n * and the outlet's route configuration.\n *\n * The algorithm finds the shortest parent path where a route matches the remaining path.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n *\n * @param options The options for computing the parent path.\n * @returns The computed parent path result.\n */\nexport const computeParentPath = (options: ComputeParentPathOptions): ParentPathResult => {\n const { currentPathname, outletMountPath, routeChildren, hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } =\n options;\n\n // If pathname is outside the established mount path scope, skip computation\n if (outletMountPath && !currentPathname.startsWith(outletMountPath)) {\n return { parentPath: undefined, outletMountPath };\n }\n\n if ((hasRelativeRoutes || hasIndexRoute) && currentPathname.includes('/')) {\n const segments = currentPathname.split('/').filter(Boolean);\n\n if (segments.length >= 1) {\n let firstSpecificMatch: string | undefined;\n let firstWildcardMatch: string | undefined;\n let indexMatchAtMount: string | undefined;\n\n // Iterate through path segments to find the shortest matching parent path\n for (let i = 1; i <= segments.length; i++) {\n const parentPath = '/' + segments.slice(0, i).join('/');\n const remainingPath = segments.slice(i).join('/');\n\n // Check for specific route match (highest priority)\n if (!firstSpecificMatch && findSpecificMatch(routeChildren, remainingPath)) {\n firstSpecificMatch = parentPath;\n break;\n }\n\n // Check for wildcard match (only if remaining path is non-empty)\n const hasNonEmptyRemaining = remainingPath !== '' && remainingPath !== '/';\n if (!firstWildcardMatch && hasNonEmptyRemaining && hasWildcardRoute) {\n if (!couldSpecificRouteMatch(routeChildren, remainingPath)) {\n firstWildcardMatch = parentPath;\n }\n }\n\n // Check for index route match\n const indexMatch = checkIndexMatch(parentPath, remainingPath, hasIndexRoute, outletMountPath);\n if (indexMatch) {\n indexMatchAtMount = indexMatch;\n }\n }\n\n // Fallback: check root level for embedded wildcard routes (e.g., \"tab1/*\")\n if (!firstSpecificMatch) {\n const fullRemainingPath = segments.join('/');\n if (routeChildren.some((route) => matchesEmbeddedWildcardRoute(route, fullRemainingPath))) {\n firstSpecificMatch = '/';\n }\n }\n\n const bestPath = selectBestMatch(firstSpecificMatch, firstWildcardMatch, indexMatchAtMount);\n\n // Establish mount path on first successful match\n const newOutletMountPath = outletMountPath || bestPath;\n\n if (newOutletMountPath && !currentPathname.startsWith(newOutletMountPath)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: bestPath, outletMountPath: newOutletMountPath };\n }\n }\n\n // Handle outlets with only absolute routes\n if (!hasRelativeRoutes && !hasIndexRoute) {\n const result = computeAbsoluteRoutesParentPath(routeChildren, currentPathname, outletMountPath);\n if (result) {\n return result;\n }\n }\n\n return { parentPath: outletMountPath, outletMountPath };\n};\n","/**\n * Ensures the given path has a leading slash.\n *\n * @param value The path string to normalize.\n * @returns The path with a leading slash.\n */\nexport const ensureLeadingSlash = (value: string): string => {\n if (value === '') {\n return '/';\n }\n return value.startsWith('/') ? value : `/${value}`;\n};\n\n/**\n * Strips the trailing slash from a path, unless it's the root path.\n *\n * @param value The path string to normalize.\n * @returns The path without a trailing slash.\n */\nexport const stripTrailingSlash = (value: string): string => {\n return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value;\n};\n\n/**\n * Normalizes a pathname for comparison by ensuring a leading slash\n * and removing trailing slashes.\n *\n * @param value The pathname to normalize, can be undefined.\n * @returns A normalized pathname string.\n */\nexport const normalizePathnameForComparison = (value: string | undefined): string => {\n if (!value || value === '') {\n return '/';\n }\n const withLeadingSlash = ensureLeadingSlash(value);\n return stripTrailingSlash(withLeadingSlash);\n};\n","import React from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\n\n/**\n * Extracts the children from a Routes wrapper component.\n * The use of `<Routes />` is encouraged with React Router v6.\n *\n * @param node The React node to extract Routes children from.\n * @returns The children of the Routes component, or undefined if not found.\n */\nexport const getRoutesChildren = (node: React.ReactNode): React.ReactNode | undefined => {\n let routesNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (child.type === Routes) {\n routesNode = child;\n }\n });\n\n if (routesNode) {\n // The children of the `<Routes />` component are most likely\n // (and should be) the `<Route />` components.\n return (routesNode as React.ReactElement).props.children;\n }\n return undefined;\n};\n\n/**\n * Extracts Route children from a node (either directly or from a Routes wrapper).\n *\n * @param children The children to extract routes from.\n * @returns An array of Route elements.\n */\nexport const extractRouteChildren = (children: React.ReactNode): React.ReactElement[] => {\n const routesChildren = getRoutesChildren(children) ?? children;\n return React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n};\n\n/**\n * Checks if a React element is a Navigate component (redirect).\n *\n * @param element The element to check.\n * @returns True if the element is a Navigate component.\n */\nexport const isNavigateElement = (element: unknown): boolean => {\n return (\n React.isValidElement(element) &&\n (element.type === Navigate || (typeof element.type === 'function' && element.type.name === 'Navigate'))\n );\n};\n","import type { ViewItem } from '@ionic/react';\n\n/**\n * Sorts view items by route specificity (most specific first).\n * - Exact matches (no wildcards/params) come first\n * - Among wildcard routes, longer paths are more specific\n *\n * @param views The view items to sort.\n * @returns A new sorted array of view items.\n */\nexport const sortViewsBySpecificity = (views: ViewItem[]): ViewItem[] => {\n return [...views].sort((a, b) => {\n const pathA = a.routeData?.childProps?.path || '';\n const pathB = b.routeData?.childProps?.path || '';\n\n // Exact matches (no wildcards/params) come first\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among wildcard routes, longer paths are more specific\n return pathB.length - pathA.length;\n });\n};\n","/**\n * `ReactRouterViewStack` is a custom navigation manager used in Ionic React\n * apps to map React Router route elements (such as `<IonRoute>`) to \"view\n * items\" that Ionic can manage in a view stack. This is critical to maintain\n * Ionic’s animation, lifecycle, and history behavior across views.\n */\n\nimport type { RouteInfo, ViewItem } from '@ionic/react';\nimport { generateId, IonRoute, ViewLifeCycleManager, ViewStacks } from '@ionic/react';\nimport React from 'react';\nimport type { PathMatch } from 'react-router';\nimport { Navigate, UNSAFE_RouteContext as RouteContext } from 'react-router-dom';\n\nimport { analyzeRouteChildren, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { normalizePathnameForComparison } from './utils/pathNormalization';\nimport { extractRouteChildren, isNavigateElement } from './utils/routeElements';\nimport { sortViewsBySpecificity } from './utils/viewItemUtils';\n\n/**\n * Delay in milliseconds before removing a Navigate view item after a redirect.\n * This ensures the redirect navigation completes before the view is removed.\n */\nconst NAVIGATE_REDIRECT_DELAY_MS = 100;\n\n/**\n * Delay in milliseconds before cleaning up a view without an IonPage element.\n * This double-checks that the view is truly not needed before removal.\n */\nconst VIEW_CLEANUP_DELAY_MS = 200;\n\ntype RouteParams = Record<string, string | undefined>;\n\ntype RouteContextMatch = {\n params: RouteParams;\n pathname: string;\n pathnameBase: string;\n route: {\n id: string;\n path?: string;\n element: React.ReactNode;\n index: boolean;\n caseSensitive?: boolean;\n hasErrorBoundary: boolean;\n };\n};\n\n/**\n * Computes the absolute pathnameBase for a route element based on its type.\n * Handles relative paths, index routes, and splat routes differently.\n */\nconst computeAbsolutePathnameBase = (\n routeElement: React.ReactElement,\n routeMatch: PathMatch<string> | undefined,\n parentPathnameBase: string,\n routeInfoPathname: string\n): string => {\n const routePath = routeElement.props.path;\n const isRelativePath = routePath && !routePath.startsWith('/');\n const isIndexRoute = !!routeElement.props.index;\n const isSplatOnlyRoute = routePath === '*' || routePath === '/*';\n\n if (isSplatOnlyRoute) {\n // Splat routes should NOT contribute their matched portion to pathnameBase\n // This aligns with React Router v7's v7_relativeSplatPath behavior\n return parentPathnameBase;\n }\n\n if (isRelativePath && routeMatch?.pathnameBase) {\n const relativeBase = routeMatch.pathnameBase.startsWith('/')\n ? routeMatch.pathnameBase.slice(1)\n : routeMatch.pathnameBase;\n return parentPathnameBase === '/' ? `/${relativeBase}` : `${parentPathnameBase}/${relativeBase}`;\n }\n\n if (isIndexRoute) {\n return parentPathnameBase;\n }\n\n return routeMatch?.pathnameBase || routeInfoPathname;\n};\n\n/**\n * Gets fallback params from view items in other outlets when parent context is empty.\n * This handles cases where React context propagation doesn't work as expected.\n */\nconst getFallbackParamsFromViewItems = (\n allViewItems: ViewItem[],\n currentOutletId: string,\n currentPathname: string\n): RouteParams => {\n const params: RouteParams = {};\n\n for (const otherViewItem of allViewItems) {\n if (otherViewItem.outletId === currentOutletId) continue;\n\n const otherMatch = otherViewItem.routeData?.match;\n if (otherMatch?.params && Object.keys(otherMatch.params).length > 0) {\n const matchedPathname = otherMatch.pathnameBase || otherMatch.pathname;\n if (matchedPathname && currentPathname.startsWith(matchedPathname)) {\n Object.assign(params, otherMatch.params);\n }\n }\n }\n\n return params;\n};\n\n/**\n * Builds the matches array for RouteContext.\n */\nconst buildContextMatches = (\n parentMatches: RouteContextMatch[],\n combinedParams: RouteParams,\n routeMatch: PathMatch<string> | undefined,\n routeInfoPathname: string,\n absolutePathnameBase: string,\n viewItem: ViewItem,\n routeElement: React.ReactElement,\n componentElement: React.ReactNode\n): RouteContextMatch[] => {\n return [\n ...parentMatches,\n {\n params: combinedParams,\n pathname: routeMatch?.pathname || routeInfoPathname,\n pathnameBase: absolutePathnameBase,\n route: {\n id: viewItem.id,\n path: routeElement.props.path,\n element: componentElement,\n index: !!routeElement.props.index,\n caseSensitive: routeElement.props.caseSensitive,\n hasErrorBoundary: false,\n },\n },\n ];\n};\n\nconst createDefaultMatch = (\n fullPathname: string,\n routeProps: { path?: string; caseSensitive?: boolean; end?: boolean; index?: boolean }\n): PathMatch<string> => {\n const isIndexRoute = !!routeProps.index;\n const patternPath = routeProps.path ?? '';\n const pathnameBase = fullPathname === '' ? '/' : fullPathname;\n const computedEnd =\n routeProps.end !== undefined ? routeProps.end : patternPath !== '' ? !patternPath.endsWith('*') : true;\n\n return {\n params: {},\n pathname: isIndexRoute ? '' : fullPathname,\n pathnameBase,\n pattern: {\n path: patternPath,\n caseSensitive: routeProps.caseSensitive ?? false,\n end: isIndexRoute ? true : computedEnd,\n },\n };\n};\n\nconst computeRelativeToParent = (pathname: string, parentPath?: string): string | null => {\n if (!parentPath) return null;\n const normalizedParent = normalizePathnameForComparison(parentPath);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname === normalizedParent) {\n return '';\n }\n\n const withSlash = normalizedParent === '/' ? '/' : normalizedParent + '/';\n if (normalizedPathname.startsWith(withSlash)) {\n return normalizedPathname.slice(withSlash.length);\n }\n return null;\n};\n\nconst resolveIndexRouteMatch = (\n viewItem: ViewItem,\n pathname: string,\n parentPath?: string\n): PathMatch<string> | null => {\n if (!viewItem.routeData?.childProps?.index) {\n return null;\n }\n\n // Prefer computing against the parent path when available to align with RRv6 semantics\n const relative = computeRelativeToParent(pathname, parentPath);\n if (relative !== null) {\n // Index routes match only when there is no remaining path\n if (relative === '' || relative === '/') {\n return createDefaultMatch(parentPath || pathname, viewItem.routeData.childProps);\n }\n return null;\n }\n\n // Fallback: use previously computed match base for equality check\n const previousMatch = viewItem.routeData?.match;\n if (!previousMatch) {\n return null;\n }\n\n const normalizedPathname = normalizePathnameForComparison(pathname);\n const normalizedBase = normalizePathnameForComparison(previousMatch.pathnameBase || previousMatch.pathname || '');\n\n return normalizedPathname === normalizedBase ? previousMatch : null;\n};\n\nexport class ReactRouterViewStack extends ViewStacks {\n constructor() {\n super();\n }\n\n /**\n * Creates a new view item for the given outlet and react route element.\n * Associates route props with the matched route path for further lookups.\n */\n createViewItem = (outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) => {\n const routePath = reactElement.props.path || '';\n\n // Check if we already have a view item for this exact route that we can reuse\n // Include wildcard routes like tabs/* since they should be reused\n // Also check unmounted items that might have been preserved for browser navigation\n const existingViewItem = this.getViewItemsForOutlet(outletId).find((v) => {\n const existingRouteProps = v.reactElement?.props ?? {};\n const existingPath = existingRouteProps.path || '';\n const existingElement = existingRouteProps.element;\n const newElement = reactElement.props.element;\n const existingIsIndexRoute = !!existingRouteProps.index;\n const newIsIndexRoute = !!reactElement.props.index;\n\n // For Navigate components, match by destination\n const existingIsNavigate = React.isValidElement(existingElement) && existingElement.type === Navigate;\n const newIsNavigate = React.isValidElement(newElement) && newElement.type === Navigate;\n if (existingIsNavigate && newIsNavigate) {\n const existingTo = (existingElement.props as { to?: string })?.to;\n const newTo = (newElement.props as { to?: string })?.to;\n if (existingTo === newTo) {\n return true;\n }\n }\n\n if (existingIsIndexRoute && newIsIndexRoute) {\n return true;\n }\n\n // Reuse view items with the same path\n // Special case: reuse tabs/* and other specific wildcard routes\n // Don't reuse index routes (empty path) or generic catch-all wildcards (*)\n if (existingPath === routePath && existingPath !== '' && existingPath !== '*') {\n // Parameterized routes need pathname matching to ensure /details/1 and /details/2\n // get separate view items. For wildcard routes (e.g., user/:userId/*), compare\n // pathnameBase to allow child path changes while preserving the parent view.\n const hasParams = routePath.includes(':');\n const isWildcard = routePath.includes('*');\n if (hasParams) {\n if (isWildcard) {\n const existingPathnameBase = v.routeData?.match?.pathnameBase;\n const newMatch = matchComponent(reactElement, routeInfo.pathname, false);\n const newPathnameBase = newMatch?.pathnameBase;\n if (existingPathnameBase !== newPathnameBase) {\n return false;\n }\n } else {\n const existingPathname = v.routeData?.match?.pathname;\n if (existingPathname !== routeInfo.pathname) {\n return false;\n }\n }\n }\n return true;\n }\n // Also reuse specific wildcard routes like tabs/*\n if (existingPath === routePath && existingPath.endsWith('/*') && existingPath !== '/*') {\n return true;\n }\n return false;\n });\n\n if (existingViewItem) {\n // Update and ensure the existing view item is properly configured\n existingViewItem.reactElement = reactElement;\n existingViewItem.mount = true;\n existingViewItem.ionPageElement = page || existingViewItem.ionPageElement;\n const updatedMatch =\n matchComponent(reactElement, routeInfo.pathname, false) ||\n existingViewItem.routeData?.match ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n existingViewItem.routeData = {\n match: updatedMatch,\n childProps: reactElement.props,\n lastPathname: existingViewItem.routeData?.lastPathname, // Preserve navigation history\n };\n return existingViewItem;\n }\n\n const id = `${outletId}-${generateId(outletId)}`;\n\n const viewItem: ViewItem = {\n id,\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: true,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n const initialMatch =\n matchComponent(reactElement, routeInfo.pathname, true) ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n viewItem.routeData = {\n match: initialMatch,\n childProps: reactElement.props,\n };\n\n this.add(viewItem);\n\n return viewItem;\n };\n\n /**\n * Renders a ViewLifeCycleManager for the given view item.\n * Handles cleanup if the view no longer matches.\n *\n * - Deactivates view if it no longer matches the current route\n * - Wraps the route element in <Routes> to support nested routing and ensure remounting\n * - Adds a unique key to <Routes> so React Router remounts routes when switching\n */\n private renderViewItem = (viewItem: ViewItem, routeInfo: RouteInfo, parentPath?: string) => {\n const routePath = viewItem.reactElement.props.path || '';\n let match = matchComponent(viewItem.reactElement, routeInfo.pathname);\n\n if (!match) {\n const indexMatch = resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath);\n if (indexMatch) {\n match = indexMatch;\n }\n }\n\n // For parameterized routes, check if this is a navigation to a different path instance\n // In that case, we should NOT reuse this view - a new view should be created\n const isParameterRoute = routePath.includes(':');\n const previousMatch = viewItem.routeData?.match;\n const isSamePath = match?.pathname === previousMatch?.pathname;\n\n // Flag to indicate this view should not be reused for this different parameterized path\n const shouldSkipForDifferentParam = isParameterRoute && match && previousMatch && !isSamePath;\n\n // Don't deactivate views automatically - let the StackManager handle view lifecycle\n // This preserves views in the stack for navigation history like native apps\n // Views will be hidden/shown by the StackManager's transition logic instead of being unmounted\n\n // Special handling for Navigate components - they should unmount after redirecting\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n if (isNavigateComponent) {\n // Navigate components should only be mounted when they match\n // Once they redirect (no longer match), they should be removed completely\n // IMPORTANT: For index routes, we need to check indexMatch too since matchComponent\n // may not properly match index routes without explicit parent path context\n const indexMatch = viewItem.routeData?.childProps?.index\n ? resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath)\n : null;\n const hasValidMatch = match || indexMatch;\n\n if (!hasValidMatch && viewItem.mount) {\n viewItem.mount = false;\n // Schedule removal of the Navigate view item after a short delay\n // This ensures the redirect completes before removal\n setTimeout(() => {\n this.remove(viewItem);\n }, NAVIGATE_REDIRECT_DELAY_MS);\n }\n }\n\n // Components that don't have IonPage elements and no longer match should be cleaned up\n // BUT we need to be careful not to remove them if they're part of browser navigation history\n // This handles components that perform immediate actions like programmatic navigation\n // EXCEPTION: Navigate components should ALWAYS remain mounted until they redirect\n // since they need to be rendered to trigger the navigation\n if (!match && viewItem.mount && !viewItem.ionPageElement && !isNavigateComponent) {\n // Check if this view item should be preserved for browser navigation\n // We'll keep it if it was recently active (within the last navigation)\n const shouldPreserve =\n viewItem.routeData.lastPathname === routeInfo.pathname ||\n viewItem.routeData.match?.pathname === routeInfo.lastPathname;\n\n if (!shouldPreserve) {\n // This view item doesn't match and doesn't have an IonPage\n // It's likely a utility component that performs an action and navigates away\n viewItem.mount = false;\n // Schedule removal to allow it to be recreated on next navigation\n setTimeout(() => {\n // Double-check before removing - the view might be needed again\n const stillNotNeeded = !viewItem.mount && !viewItem.ionPageElement;\n if (stillNotNeeded) {\n this.remove(viewItem);\n }\n }, VIEW_CLEANUP_DELAY_MS);\n } else {\n // Preserve it but unmount it for now\n viewItem.mount = false;\n }\n }\n\n // Reactivate view if it matches but was previously deactivated\n // Don't reactivate if this is a parameterized route navigating to a different path instance\n if (match && !viewItem.mount && !shouldSkipForDifferentParam) {\n viewItem.mount = true;\n viewItem.routeData.match = match;\n }\n\n // Deactivate wildcard routes and catch-all routes (empty path) when we have specific route matches\n // This prevents \"Not found\" or fallback pages from showing alongside valid routes\n if (routePath === '*' || routePath === '') {\n // Check if any other view in this outlet has a match for the current route\n const hasSpecificMatch = this.getViewItemsForOutlet(viewItem.outletId).some((v) => {\n if (v.id === viewItem.id) return false; // Skip self\n const vRoutePath = v.reactElement?.props?.path || '';\n if (vRoutePath === '*' || vRoutePath === '') return false; // Skip other wildcard/empty routes\n\n // Check if this view item would match the current route\n const vMatch = v.reactElement ? matchComponent(v.reactElement, routeInfo.pathname) : null;\n return !!vMatch;\n });\n\n if (hasSpecificMatch) {\n viewItem.mount = false;\n if (viewItem.ionPageElement) {\n viewItem.ionPageElement.classList.add('ion-page-hidden');\n viewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n const routeElement = React.cloneElement(viewItem.reactElement);\n const componentElement = routeElement.props.element;\n // Don't update match for parameterized routes navigating to different path instances\n // This preserves the original match so that findViewItemByPath can correctly skip this view\n if (match && viewItem.routeData.match !== match && !shouldSkipForDifferentParam) {\n viewItem.routeData.match = match;\n }\n const routeMatch = shouldSkipForDifferentParam ? viewItem.routeData?.match : match || viewItem.routeData?.match;\n\n return (\n <RouteContext.Consumer key={`view-context-${viewItem.id}`}>\n {(parentContext) => {\n const parentMatches = (parentContext?.matches ?? []) as RouteContextMatch[];\n\n // Accumulate params from parent matches, with fallback to other outlets\n let accumulatedParentParams = parentMatches.reduce<RouteParams>((acc, m) => ({ ...acc, ...m.params }), {});\n if (parentMatches.length === 0 && Object.keys(accumulatedParentParams).length === 0) {\n accumulatedParentParams = getFallbackParamsFromViewItems(\n this.getAllViewItems(),\n viewItem.outletId,\n routeInfo.pathname\n );\n }\n\n const combinedParams = { ...accumulatedParentParams, ...(routeMatch?.params ?? {}) };\n const parentPathnameBase =\n parentMatches.length > 0 ? parentMatches[parentMatches.length - 1].pathnameBase : '/';\n const absolutePathnameBase = computeAbsolutePathnameBase(\n routeElement,\n routeMatch,\n parentPathnameBase,\n routeInfo.pathname\n );\n\n const contextMatches = buildContextMatches(\n parentMatches,\n combinedParams,\n routeMatch,\n routeInfo.pathname,\n absolutePathnameBase,\n viewItem,\n routeElement,\n componentElement\n );\n\n const routeContextValue = parentContext\n ? { ...parentContext, matches: contextMatches }\n : { outlet: null, matches: contextMatches, isDataRoute: false };\n\n return (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n <RouteContext.Provider value={routeContextValue}>{componentElement}</RouteContext.Provider>\n </ViewLifeCycleManager>\n );\n }}\n </RouteContext.Consumer>\n );\n };\n\n /**\n * Re-renders all active view items for the specified outlet.\n * Ensures React elements are updated with the latest match.\n *\n * 1. Iterates through children of IonRouterOutlet\n * 2. Updates each matching viewItem with the current child React element\n * (important for updating props or changes to elements)\n * 3. Returns a list of React components that will be rendered inside the outlet\n * Each view is wrapped in <ViewLifeCycleManager> to manage lifecycle and rendering\n */\n getChildrenToRender = (outletId: string, ionRouterOutlet: React.ReactElement, routeInfo: RouteInfo) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Determine parentPath for nested outlets to properly evaluate index routes\n let parentPath: string | undefined = undefined;\n try {\n // Only attempt parent path computation for non-root outlets\n // Root outlets have IDs like 'routerOutlet' or 'routerOutlet-2'\n const isRootOutlet = outletId.startsWith('routerOutlet');\n if (!isRootOutlet) {\n const routeChildren = extractRouteChildren(ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n if (hasRelativeRoutes || hasIndexRoute) {\n const result = computeParentPath({\n currentPathname: routeInfo.pathname,\n outletMountPath: undefined,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n parentPath = result.parentPath;\n }\n }\n } catch (e) {\n // Non-fatal: if we fail to compute parentPath, fall back to previous behavior\n }\n\n // Sync child elements with stored viewItems (e.g. to reflect new props)\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n // Ensure the child is a valid React element since we\n // might have whitespace strings or other non-element children\n if (React.isValidElement(child)) {\n // Find view item by exact path match to avoid wildcard routes overwriting specific routes\n const childPath = (child.props as any).path;\n const viewItem = viewItems.find((v) => {\n const viewItemPath = v.reactElement?.props?.path;\n // Only update if paths match exactly (prevents wildcard routes from overwriting specific routes)\n return viewItemPath === childPath;\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n }\n });\n\n // Filter out duplicate view items by ID (but keep all mounted items)\n const uniqueViewItems = viewItems.filter((viewItem, index, array) => {\n // Remove duplicates by ID (keep first occurrence)\n const isFirstOccurrence = array.findIndex((v) => v.id === viewItem.id) === index;\n return isFirstOccurrence;\n });\n\n // Filter out unmounted Navigate components to prevent them from being rendered\n // and triggering unwanted redirects\n const renderableViewItems = uniqueViewItems.filter((viewItem) => {\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n // Exclude unmounted Navigate components from rendering\n if (isNavigateComponent && !viewItem.mount) {\n return false;\n }\n\n // Filter out views that are unmounted, have no ionPageElement, and don't match the current route.\n // These are \"stale\" views from previous routes that should not be rendered.\n // Views WITH ionPageElement are handled by the normal lifecycle events.\n // Views that MATCH the current route should be kept (they might be transitioning).\n if (!viewItem.mount && !viewItem.ionPageElement) {\n // Check if this view's route path matches the current pathname\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n if (viewRoutePath) {\n // First try exact match using matchComponent\n const routeMatch = matchComponent(viewItem.reactElement, routeInfo.pathname);\n if (routeMatch) {\n // View matches current route, keep it\n return true;\n }\n\n // For parent routes (like /multiple-tabs or /routing), check if current pathname\n // starts with this route's path. This handles views with IonSplitPane/IonTabs\n // that don't have IonPage but should remain mounted while navigating within their children.\n const normalizedViewPath = normalizePathnameForComparison(viewRoutePath.replace(/\\/?\\*$/, '')); // Remove trailing wildcard\n const normalizedCurrentPath = normalizePathnameForComparison(routeInfo.pathname);\n\n // Check if current pathname is within this view's route hierarchy\n const isWithinRouteHierarchy =\n normalizedCurrentPath === normalizedViewPath || normalizedCurrentPath.startsWith(normalizedViewPath + '/');\n\n if (!isWithinRouteHierarchy) {\n // View is outside current route hierarchy, remove it\n setTimeout(() => {\n this.remove(viewItem);\n }, 0);\n return false;\n }\n }\n }\n\n return true;\n });\n\n const renderedItems = renderableViewItems.map((viewItem) => this.renderViewItem(viewItem, routeInfo, parentPath));\n return renderedItems;\n };\n\n /**\n * Finds a view item matching the current route, optionally updating its match state.\n */\n findViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) => {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n };\n\n /**\n * Finds the view item that was previously active before a route change.\n */\n findLeavingViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) => {\n // If the lastPathname is not set, we cannot find a leaving view item\n if (!routeInfo.lastPathname) {\n return undefined;\n }\n\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname, outletId, mustBeIonRoute);\n return viewItem;\n };\n\n /**\n * Finds a view item by pathname only, used in simpler queries.\n */\n findViewItemByPathname = (pathname: string, outletId?: string) => {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n };\n\n /**\n * Core function that matches a given pathname against all view items.\n * Returns both the matched view item and match metadata.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean, allowDefaultMatch = true) {\n let viewItem: ViewItem | undefined;\n let match: PathMatch<string> | null = null;\n let viewStack: ViewItem[];\n\n if (outletId) {\n viewStack = sortViewsBySpecificity(this.getViewItemsForOutlet(outletId));\n viewStack.some(matchView);\n if (!viewItem && allowDefaultMatch) viewStack.some(matchDefaultRoute);\n } else {\n const viewItems = sortViewsBySpecificity(this.getAllViewItems());\n viewItems.some(matchView);\n if (!viewItem && allowDefaultMatch) viewItems.some(matchDefaultRoute);\n }\n\n // If we still have not found a view item for this outlet, try to find a matching\n // view item across all outlets and adopt it into the current outlet. This helps\n // recover when an outlet remounts and receives a new id, leaving views associated\n // with the previous outlet id.\n // Do not adopt across outlets; if we didn't find a view for this outlet,\n // defer to route matching to create a new one.\n\n return { viewItem, match };\n\n /**\n * Matches a route path with dynamic parameters (e.g. /tabs/:id)\n */\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) return false;\n\n const viewItemPath = v.routeData.childProps.path || '';\n const isIndexRoute = !!v.routeData.childProps.index;\n const previousMatch = v.routeData?.match;\n const result = v.reactElement ? matchComponent(v.reactElement, pathname) : null;\n\n if (!result) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n }\n\n if (result) {\n const hasParams = result.params && Object.keys(result.params).length > 0;\n const isSamePath = result.pathname === previousMatch?.pathname;\n const isWildcardRoute = viewItemPath.includes('*');\n const isParameterRoute = viewItemPath.includes(':');\n\n // Don't allow view items with undefined paths to match specific routes\n // This prevents broken index route view items from interfering with navigation\n if (!viewItemPath && !isIndexRoute && pathname !== '/' && pathname !== '') {\n return false;\n }\n\n // For parameterized routes, check if we should reuse the view item.\n // Wildcard routes (e.g., user/:userId/*) compare pathnameBase to allow\n // child path changes while preserving the parent view.\n if (isParameterRoute && !isSamePath) {\n if (isWildcardRoute) {\n const isSameBase = result.pathnameBase === previousMatch?.pathnameBase;\n if (isSameBase) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n // For routes without params, or when navigating to the exact same path,\n // or when there's no previous match, reuse the view item\n if (!hasParams || isSamePath || !previousMatch) {\n match = result;\n viewItem = v;\n return true;\n }\n\n // For wildcard routes (without params), only reuse if the pathname exactly matches\n if (isWildcardRoute && isSamePath) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Matches a view with no path prop (default fallback route) or index route.\n */\n function matchDefaultRoute(v: ViewItem): boolean {\n const childProps = v.routeData.childProps;\n\n const isDefaultRoute = childProps.path === undefined || childProps.path === '';\n const isIndexRoute = !!childProps.index;\n\n if (isIndexRoute) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n return false;\n }\n\n // For empty path routes, only match if we're at the same level as when the view was created.\n // This prevents an empty path view item from being reused for different routes.\n if (isDefaultRoute) {\n const previousPathnameBase = v.routeData?.match?.pathnameBase || '';\n const normalizedBase = normalizePathnameForComparison(previousPathnameBase);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname !== normalizedBase) {\n return false;\n }\n\n match = {\n params: {},\n pathname,\n pathnameBase: pathname === '' ? '/' : pathname,\n pattern: {\n path: '',\n caseSensitive: childProps.caseSensitive ?? false,\n end: true,\n },\n };\n viewItem = v;\n return true;\n }\n\n return false;\n }\n }\n\n /**\n * Clean up old, unmounted view items to prevent memory leaks\n */\n private cleanupStaleViewItems = (outletId: string) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Keep only the most recent mounted views and a few unmounted ones for history\n const maxUnmountedItems = 3;\n const unmountedItems = viewItems.filter((v) => !v.mount);\n\n if (unmountedItems.length > maxUnmountedItems) {\n // Remove oldest unmounted items\n const itemsToRemove = unmountedItems.slice(0, unmountedItems.length - maxUnmountedItems);\n itemsToRemove.forEach((item) => {\n this.remove(item);\n });\n }\n };\n\n /**\n * Override add to prevent duplicate view items with the same ID in the same outlet\n * But allow multiple view items for the same route path (for navigation history)\n */\n add = (viewItem: ViewItem) => {\n const existingViewItem = this.getViewItemsForOutlet(viewItem.outletId).find((v) => v.id === viewItem.id);\n\n if (existingViewItem) {\n return;\n }\n\n super.add(viewItem);\n\n this.cleanupStaleViewItems(viewItem.outletId);\n };\n\n /**\n * Override remove\n */\n remove = (viewItem: ViewItem) => {\n super.remove(viewItem);\n };\n}\n\n/**\n * Utility to apply matchPath to a React element and return its match state.\n */\nfunction matchComponent(node: React.ReactElement, pathname: string, allowFallback = false) {\n const routeProps = node?.props ?? {};\n const routePath: string | undefined = routeProps.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n const match = matchPath({\n pathname: pathnameToMatch,\n componentProps: routeProps,\n });\n\n if (match || !allowFallback) {\n return match;\n }\n\n const isIndexRoute = !!routeProps.index;\n\n if (isIndexRoute) {\n return createDefaultMatch(pathname, routeProps);\n }\n\n if (!routePath || routePath === '') {\n return createDefaultMatch(pathname, routeProps);\n }\n\n return null;\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","/**\n * `StackManager` is responsible for managing page transitions, keeping track\n * of views (pages), and ensuring that navigation behaves like native apps —\n * particularly with animations and swipe gestures.\n */\n\nimport type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport { clonePageElement } from './clonePageElement';\nimport { analyzeRouteChildren, computeCommonPrefix, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { stripTrailingSlash } from './utils/pathNormalization';\nimport { extractRouteChildren, getRoutesChildren, isNavigateElement } from './utils/routeElements';\n\n/**\n * Delay in milliseconds before unmounting a view after a transition completes.\n * This ensures the page transition animation finishes before the view is removed.\n */\nconst VIEW_UNMOUNT_DELAY_MS = 250;\n\n/**\n * Delay in milliseconds to wait for an IonPage element to be mounted before\n * proceeding with a page transition.\n */\nconst ION_PAGE_WAIT_TIMEOUT_MS = 50;\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n id?: string;\n}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden');\n\nconst hideIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.add('ion-page-hidden');\n element.setAttribute('aria-hidden', 'true');\n }\n};\n\nconst showIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.remove('ion-page-hidden');\n element.removeAttribute('aria-hidden');\n }\n};\n\nexport class StackManager extends React.PureComponent<StackManagerProps> {\n id: string; // Unique id for the router outlet aka outletId\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private clearOutletTimeout: any;\n private pendingPageTransition = false;\n private waitingForIonPage = false;\n private ionPageWaitTimeout?: ReturnType<typeof setTimeout>;\n private outOfScopeUnmountTimeout?: ReturnType<typeof setTimeout>;\n /**\n * Track the last transition's entering and leaving view IDs to prevent\n * duplicate transitions during rapid navigation (e.g., Navigate redirects)\n */\n private lastTransition?: { enteringId: string; leavingId?: string };\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = props.id || `routerOutlet-${generateId('routerOutlet')}`;\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n private outletMountPath: string | undefined = undefined;\n\n /**\n * Determines the parent path for nested routing in React Router 6.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n */\n private getParentPath(): string | undefined {\n const currentPathname = this.props.routeInfo.pathname;\n\n // Prevent out-of-scope outlets from adopting unrelated routes\n if (this.outletMountPath && !currentPathname.startsWith(this.outletMountPath)) {\n return undefined;\n }\n\n if (this.ionRouterOutlet) {\n const routeChildren = extractRouteChildren(this.ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n const isRootOutlet = this.id.startsWith('routerOutlet');\n const needsParentPath = !isRootOutlet || hasRelativeRoutes || hasIndexRoute;\n\n if (needsParentPath) {\n const result = computeParentPath({\n currentPathname,\n outletMountPath: this.outletMountPath,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n\n if (result.outletMountPath && !this.outletMountPath) {\n this.outletMountPath = result.outletMountPath;\n }\n\n return result.parentPath;\n }\n }\n\n return this.outletMountPath;\n }\n\n /**\n * Finds the entering and leaving view items, handling redirect cases.\n */\n private findViewItems(routeInfo: RouteInfo): {\n enteringViewItem: ViewItem | undefined;\n leavingViewItem: ViewItem | undefined;\n } {\n const enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n // Try to find leaving view by previous pathname\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // For redirects where entering === leaving, find the actual previous view\n if (\n enteringViewItem &&\n leavingViewItem &&\n enteringViewItem === leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n // Handle redirect scenario with no leaving view\n if (\n enteringViewItem &&\n !leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n return { enteringViewItem, leavingViewItem };\n }\n\n private shouldUnmountLeavingView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (!leavingViewItem) {\n return false;\n }\n\n if (routeInfo.routeAction === 'replace') {\n const enteringRoutePath = enteringViewItem?.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem?.reactElement?.props?.path as string | undefined;\n\n // Never unmount root path - needed for back navigation\n if (leavingRoutePath === '/' || leavingRoutePath === '') {\n return false;\n }\n\n if (enteringRoutePath && leavingRoutePath) {\n const getParentPath = (path: string) => {\n const normalized = path.replace(/\\/\\*$/, '');\n const lastSlash = normalized.lastIndexOf('/');\n return lastSlash > 0 ? normalized.substring(0, lastSlash) : '/';\n };\n\n const enteringParent = getParentPath(enteringRoutePath);\n const leavingParent = getParentPath(leavingRoutePath);\n\n // Unmount if routes are siblings or entering is a child of leaving (redirect)\n const areSiblings = enteringParent === leavingParent && enteringParent !== '/';\n const isChildRedirect =\n enteringRoutePath.startsWith(leavingRoutePath) ||\n (leavingRoutePath.endsWith('/*') && enteringRoutePath.startsWith(leavingRoutePath.slice(0, -2)));\n\n return areSiblings || isChildRedirect;\n }\n\n return false;\n }\n\n // For non-replace actions, only unmount for back navigation\n const isForwardPush = routeInfo.routeAction === 'push' && (routeInfo as any).routeDirection === 'forward';\n if (!isForwardPush && routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles out-of-scope outlet. Returns true if transition should be aborted.\n */\n private handleOutOfScopeOutlet(routeInfo: RouteInfo): boolean {\n if (!this.outletMountPath || routeInfo.pathname.startsWith(this.outletMountPath)) {\n return false;\n }\n\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n this.context.unMountViewItem(viewItem);\n });\n\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles nested outlet with relative routes but no parent path. Returns true to abort.\n */\n private handleOutOfContextNestedOutlet(\n parentPath: string | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n const isRootOutlet = this.id.startsWith('routerOutlet');\n if (isRootOutlet || parentPath !== undefined || !this.ionRouterOutlet) {\n return false;\n }\n\n const routesChildren =\n getRoutesChildren(this.ionRouterOutlet.props.children) ?? this.ionRouterOutlet.props.children;\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n if (hasRelativeRoutes) {\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles nested outlet with no matching route. Returns true to abort.\n */\n private handleNoMatchingRoute(\n enteringRoute: React.ReactElement | undefined,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n const isRootOutlet = this.id.startsWith('routerOutlet');\n if (isRootOutlet || enteringRoute || enteringViewItem) {\n return false;\n }\n\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles transition when entering view has ion-page element ready.\n */\n private handleReadyEnteringView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n // Handle parameterized route changes (same view, different params)\n if (enteringViewItem === leavingViewItem) {\n const routePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const isParameterizedRoute = routePath ? routePath.includes(':') : false;\n\n if (isParameterizedRoute) {\n const updatedMatch = matchComponent(enteringViewItem.reactElement, routeInfo.pathname, true);\n if (updatedMatch) {\n enteringViewItem.routeData.match = updatedMatch;\n }\n\n const enteringEl = enteringViewItem.ionPageElement;\n if (enteringEl) {\n enteringEl.classList.remove('ion-page-hidden', 'ion-page-invisible');\n enteringEl.removeAttribute('aria-hidden');\n }\n\n this.forceUpdate();\n return;\n }\n }\n\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Re-mount views that were previously unmounted (e.g., navigating back to home)\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n\n // Check visibility state BEFORE showing entering view\n const enteringWasVisible = enteringViewItem.ionPageElement && isViewVisible(enteringViewItem.ionPageElement);\n const leavingIsHidden =\n leavingViewItem !== undefined && leavingViewItem.ionPageElement && !isViewVisible(leavingViewItem.ionPageElement);\n\n const currentTransition = {\n enteringId: enteringViewItem.id,\n leavingId: leavingViewItem?.id,\n };\n\n const isDuplicateTransition =\n leavingViewItem &&\n this.lastTransition &&\n this.lastTransition.leavingId &&\n this.lastTransition.enteringId === currentTransition.enteringId &&\n this.lastTransition.leavingId === currentTransition.leavingId;\n\n // Skip if transition already performed (e.g., via swipe gesture)\n if (enteringWasVisible && leavingIsHidden && isDuplicateTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Trigger ionViewDidLeave lifecycle for ViewLifeCycleManager cleanup\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n showIonPageElement(enteringViewItem.ionPageElement);\n\n // Handle duplicate transition or swipe gesture completion\n if (isDuplicateTransition || this.skipTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Re-fire ionViewDidLeave since gesture completed before mount=false was set\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n this.lastTransition = currentTransition;\n\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem);\n\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n this.handleLeavingViewUnmount(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n // Clean up orphaned sibling views after replace actions (redirects)\n this.cleanupOrphanedSiblingViews(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n /**\n * Handles leaving view unmount for replace actions.\n */\n private handleLeavingViewUnmount(routeInfo: RouteInfo, enteringViewItem: ViewItem, leavingViewItem: ViewItem): void {\n if (!leavingViewItem.ionPageElement) {\n return;\n }\n\n // Only replace actions unmount views; push/pop cache for navigation history\n if (routeInfo.routeAction !== 'replace') {\n return;\n }\n\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem.reactElement?.props?.path as string | undefined;\n const isEnteringContainerRoute = enteringRoutePath && enteringRoutePath.endsWith('/*');\n const isLeavingSpecificRoute =\n leavingRoutePath &&\n leavingRoutePath !== '' &&\n leavingRoutePath !== '*' &&\n !leavingRoutePath.endsWith('/*') &&\n !leavingViewItem.reactElement?.props?.index;\n\n // Skip removal for container-to-container transitions (e.g., /tabs/* → /settings/*).\n // These routes manage their own nested outlets; unmounting would disrupt child views.\n if (isEnteringContainerRoute && !isLeavingSpecificRoute) {\n return;\n }\n\n const viewToUnmount = leavingViewItem;\n setTimeout(() => {\n this.context.unMountViewItem(viewToUnmount);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Cleans up orphaned sibling views after replace actions (redirects).\n */\n private cleanupOrphanedSiblingViews(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined\n ): void {\n if (routeInfo.routeAction !== 'replace') {\n return;\n }\n\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n if (!enteringRoutePath) {\n return;\n }\n\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n\n const areSiblingRoutes = (path1: string, path2: string): boolean => {\n const path1IsRelative = !path1.startsWith('/');\n const path2IsRelative = !path2.startsWith('/');\n\n if (path1IsRelative && path2IsRelative) {\n const path1Depth = path1.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n const path2Depth = path2.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n return path1Depth === path2Depth && path1Depth <= 1;\n }\n\n const getParent = (path: string) => {\n const normalized = path.replace(/\\/\\*$/, '');\n const lastSlash = normalized.lastIndexOf('/');\n return lastSlash > 0 ? normalized.substring(0, lastSlash) : '/';\n };\n\n return getParent(path1) === getParent(path2);\n };\n\n for (const viewItem of allViewsInOutlet) {\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n\n const shouldSkip =\n viewItem.id === enteringViewItem.id ||\n (leavingViewItem && viewItem.id === leavingViewItem.id) ||\n !viewItem.mount ||\n !viewRoutePath ||\n (viewRoutePath.endsWith('/*') && enteringRoutePath.endsWith('/*'));\n\n if (shouldSkip) {\n continue;\n }\n\n if (areSiblingRoutes(enteringRoutePath, viewRoutePath)) {\n hideIonPageElement(viewItem.ionPageElement);\n viewItem.mount = false;\n\n const viewToRemove = viewItem;\n setTimeout(() => {\n this.context.unMountViewItem(viewToRemove);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n }\n }\n\n /**\n * Handles entering view with no ion-page element yet (waiting for render).\n */\n private handleWaitingForIonPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n const enteringRouteElement = enteringViewItem.reactElement?.props?.element;\n\n // Handle Navigate components (they never render an IonPage)\n if (isNavigateElement(enteringRouteElement)) {\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n // Hide the leaving view immediately for Navigate redirects\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n // Don't unmount if entering and leaving are the same view item\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n }\n\n this.forceUpdate();\n return;\n }\n\n // Hide leaving view while we wait for the entering view's IonPage to mount\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n this.waitingForIonPage = true;\n\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n }\n\n this.ionPageWaitTimeout = setTimeout(() => {\n this.ionPageWaitTimeout = undefined;\n\n if (!this.waitingForIonPage) {\n return;\n }\n this.waitingForIonPage = false;\n\n const latestEnteringView = this.context.findViewItemByRouteInfo(routeInfo, this.id) ?? enteringViewItem;\n const latestLeavingView = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id) ?? leavingViewItem;\n\n if (latestEnteringView?.ionPageElement) {\n this.transitionPage(routeInfo, latestEnteringView, latestLeavingView ?? undefined);\n\n if (shouldUnmountLeavingViewItem && latestLeavingView && latestEnteringView !== latestLeavingView) {\n latestLeavingView.mount = false;\n // Call handleLeavingViewUnmount to ensure the view is properly removed\n this.handleLeavingViewUnmount(routeInfo, latestEnteringView, latestLeavingView);\n }\n\n this.forceUpdate();\n }\n }, ION_PAGE_WAIT_TIMEOUT_MS);\n\n this.forceUpdate();\n }\n\n /**\n * Gets the route info to use for finding views during swipe-to-go-back gestures.\n * This pattern is used in multiple places in setupRouterOutlet.\n */\n private getSwipeBackRouteInfo(): RouteInfo {\n const { routeInfo } = this.props;\n return this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as RouteInfo);\n }\n\n componentDidMount() {\n if (this.clearOutletTimeout) {\n /**\n * The clearOutlet integration with React Router is a bit hacky.\n * It uses a timeout to clear the outlet after a transition.\n * In React v18, components are mounted and unmounted in development mode\n * to check for side effects.\n *\n * This clearTimeout prevents the outlet from being cleared when the component is re-mounted,\n * which should only happen in development mode and as a result of a hot reload.\n */\n clearTimeout(this.clearOutletTimeout);\n }\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n this.handlePageTransition(this.props.routeInfo);\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n this.waitingForIonPage = false;\n\n // Hide all views in this outlet before clearing.\n // This is critical for nested outlets - when the parent component unmounts,\n // the nested outlet's componentDidUpdate won't be called, so we must hide\n // the ion-page elements here to prevent them from remaining visible on top\n // of other content after navigation to a different route.\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n });\n\n this.clearOutletTimeout = this.context.clearOutlet(this.id);\n }\n\n /**\n * Sets the transition between pages within this router outlet.\n * This function determines the entering and leaving views based on the\n * provided route information and triggers the appropriate animation.\n * It also handles scenarios like initial loads, back navigation, and\n * navigation to the same view with different parameters.\n *\n * @param routeInfo It contains info about the current route,\n * the previous route, and the action taken (e.g., push, replace).\n *\n * @returns A promise that resolves when the transition is complete.\n * If no transition is needed or if the router outlet isn't ready,\n * the Promise may resolve immediately.\n */\n async handlePageTransition(routeInfo: RouteInfo) {\n // Wait for router outlet to mount\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n this.pendingPageTransition = true;\n return;\n }\n\n // Find entering and leaving view items\n const viewItems = this.findViewItems(routeInfo);\n let enteringViewItem = viewItems.enteringViewItem;\n const leavingViewItem = viewItems.leavingViewItem;\n const shouldUnmountLeavingViewItem = this.shouldUnmountLeavingView(routeInfo, enteringViewItem, leavingViewItem);\n\n // Get parent path for nested outlets\n const parentPath = this.getParentPath();\n\n // Handle out-of-scope outlet (route outside mount path)\n if (this.handleOutOfScopeOutlet(routeInfo)) {\n return;\n }\n\n // Clear any pending out-of-scope unmount timeout\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n // Handle nested outlet with relative routes but no valid parent path\n if (this.handleOutOfContextNestedOutlet(parentPath, leavingViewItem)) {\n return;\n }\n\n // Find the matching route element\n const enteringRoute = findRouteByRouteInfo(\n this.ionRouterOutlet?.props.children,\n routeInfo,\n parentPath\n ) as React.ReactElement;\n\n // Handle nested outlet with no matching route\n if (this.handleNoMatchingRoute(enteringRoute, enteringViewItem, leavingViewItem)) {\n return;\n }\n\n // Create or update the entering view item\n if (enteringViewItem && enteringRoute) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n // Handle transition based on ion-page element availability\n // Check if the ionPageElement is still in the document.\n // If the view was previously unmounted (mount=false), the ViewLifeCycleManager\n // removes the React component from the tree, which removes the IonPage from the DOM.\n // The ionPageElement reference becomes stale and we need to wait for a new one.\n const ionPageIsInDocument =\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement);\n\n if (enteringViewItem && ionPageIsInDocument) {\n // Clear waiting state\n if (this.waitingForIonPage) {\n this.waitingForIonPage = false;\n }\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n\n this.handleReadyEnteringView(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n } else if (enteringViewItem && !ionPageIsInDocument) {\n // Wait for ion-page to mount\n // This handles both: no ionPageElement, or stale ionPageElement (not in document)\n // Clear stale reference if the element is no longer in the document\n if (enteringViewItem.ionPageElement && !document.body.contains(enteringViewItem.ionPageElement)) {\n enteringViewItem.ionPageElement = undefined;\n }\n // Ensure the view is marked as mounted so ViewLifeCycleManager renders the IonPage\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n this.handleWaitingForIonPage(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n return;\n } else if (!enteringViewItem && !enteringRoute) {\n // No view or route found - likely leaving to another outlet\n if (leavingViewItem) {\n hideIonPageElement(leavingViewItem.ionPageElement);\n if (shouldUnmountLeavingViewItem) {\n leavingViewItem.mount = false;\n }\n }\n }\n\n this.forceUpdate();\n }\n\n /**\n * Registers an `<IonPage>` DOM element with the `StackManager`.\n * This is called when `<IonPage>` has been mounted.\n *\n * @param page The element of the rendered `<IonPage>`.\n * @param routeInfo The route information that associates with `<IonPage>`.\n */\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n /**\n * DO NOT remove ion-page-invisible here.\n *\n * PageManager.componentDidMount adds ion-page-invisible before calling registerIonPage.\n * At this point, the <IonPage> div exists but its CHILDREN (header, toolbar, menu-button)\n * have NOT rendered yet. If we remove ion-page-invisible now, the page becomes visible\n * with empty/incomplete content, causing a flicker (especially for ion-menu-button which\n * starts with menu-button-hidden class).\n *\n * Instead, let transitionPage handle visibility AFTER waiting for components to be ready.\n * This ensures the page only becomes visible when its content is fully rendered.\n */\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n\n /**\n * FIX for issue #28878: Reject orphaned IonPage registrations.\n *\n * When a component conditionally renders different IonPages (e.g., list vs empty state)\n * using React keys, and state changes simultaneously with navigation, the new IonPage\n * tries to register for a route we're navigating away from. This creates a stale view.\n *\n * Only reject if both pageIds exist and differ, to allow nested outlet registrations.\n */\n if (this.shouldRejectOrphanedPage(page, oldPageElement, routeInfo)) {\n this.hideAndRemoveOrphanedPage(page);\n return;\n }\n\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n /**\n * Checks if a new IonPage should be rejected (component re-rendered while navigating away).\n */\n private shouldRejectOrphanedPage(\n newPage: HTMLElement,\n oldPageElement: HTMLElement | undefined,\n routeInfo: RouteInfo\n ): boolean {\n if (!oldPageElement || oldPageElement === newPage) {\n return false;\n }\n\n const newPageId = newPage.getAttribute('data-pageid');\n const oldPageId = oldPageElement.getAttribute('data-pageid');\n\n if (!newPageId || !oldPageId || newPageId === oldPageId) {\n return false;\n }\n\n return this.props.routeInfo.pathname !== routeInfo.pathname;\n }\n\n private hideAndRemoveOrphanedPage(page: HTMLElement): void {\n page.classList.add('ion-page-hidden');\n page.setAttribute('aria-hidden', 'true');\n\n setTimeout(() => {\n if (page.parentElement) {\n page.remove();\n }\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Configures swipe-to-go-back gesture for the router outlet.\n */\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const config = getConfig();\n const swipeEnabled = config && config.get('swipeBackEnabled', routerOutlet.mode === 'ios');\n if (!swipeEnabled) {\n return false;\n }\n\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n\n // View might have mount=false but ionPageElement still in DOM\n const ionPageInDocument = Boolean(\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement)\n );\n\n const canStartSwipe =\n !!enteringViewItem &&\n (enteringViewItem.mount || ionPageInDocument) &&\n enteringViewItem.routeData.match.pattern.path !== routeInfo.pathname;\n\n return canStartSwipe;\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n // First try to find the view in the current outlet, then search all outlets\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Ensure the entering view is mounted so React keeps rendering it during the gesture.\n // This is important when the view was previously marked for unmount but its\n // ionPageElement is still in the DOM.\n if (enteringViewItem && !enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n\n // When the gesture starts, kick off a transition controlled via swipe gesture\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n return Promise.resolve();\n };\n\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n // User finished the swipe gesture, so complete the back navigation\n this.skipTransition = true;\n this.context.goBack();\n } else {\n // Swipe gesture was aborted - re-hide the page that was going to enter\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n // First try to find the view in the current outlet, then search all outlets\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Don't hide if entering and leaving are the same (parameterized route edge case)\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n hideIonPageElement(enteringViewItem.ionPageElement);\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n /**\n * Animates the transition between the entering and leaving pages within the\n * router outlet.\n *\n * @param routeInfo Info about the current route.\n * @param enteringViewItem The view item that is entering.\n * @param leavingViewItem The view item that is leaving.\n * @param direction The direction of the transition.\n * @param progressAnimation Indicates if the transition is part of a\n * gesture controlled animation (e.g., swipe to go back).\n * Defaults to `false`.\n */\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false\n ) {\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n }\n\n await routerOutlet.commit(enteringEl, leavingEl, {\n duration: skipTransition || directionToUse === undefined ? 0 : undefined,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // Clone page for same-view transitions (e.g., /user/1 → /user/2)\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n // Route no longer matches (e.g., /user/1 → /settings)\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n const leavingEl = leavingViewItem?.ionPageElement;\n // For non-animated transitions, don't pass leaving element to commit() to avoid\n // flicker caused by commit() briefly unhiding the leaving page\n const isNonAnimatedTransition = directionToUse === undefined && !progressAnimation;\n\n if (isNonAnimatedTransition && leavingEl) {\n /**\n * Flicker prevention for non-animated transitions:\n * 1. Keep entering invisible during commit and component mounting\n * 2. Wait for components (including menu button) to be ready\n * 3. Swap visibility atomically\n */\n const enteringEl = enteringViewItem.ionPageElement;\n\n enteringEl.classList.add('ion-page');\n if (!enteringEl.classList.contains('ion-page-invisible')) {\n enteringEl.classList.add('ion-page-invisible');\n }\n enteringEl.classList.remove('ion-page-hidden');\n enteringEl.removeAttribute('aria-hidden');\n\n await routerOutlet.commit(enteringEl, undefined, {\n duration: 0,\n direction: undefined,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation: false,\n animationBuilder: routeInfo.routeAnimation,\n });\n\n // Re-add invisible after commit removes it (commit's afterTransition handling)\n enteringEl.classList.add('ion-page-invisible');\n\n /**\n * Wait for components to be ready. Menu buttons start hidden (menu-button-hidden)\n * and become visible after componentDidLoad. Wait for hydration and visibility.\n */\n const waitForComponentsReady = () => {\n return new Promise<void>((resolve) => {\n const checkReady = () => {\n const ionicComponents = enteringEl.querySelectorAll(\n 'ion-header, ion-toolbar, ion-buttons, ion-menu-button, ion-title, ion-content'\n );\n const allHydrated = Array.from(ionicComponents).every((el) => el.classList.contains('hydrated'));\n\n const menuButtons = enteringEl.querySelectorAll('ion-menu-button');\n const menuButtonsReady = Array.from(menuButtons).every(\n (el) => !el.classList.contains('menu-button-hidden')\n );\n\n return allHydrated && menuButtonsReady;\n };\n\n if (checkReady()) {\n resolve();\n return;\n }\n\n let resolved = false;\n const observer = new MutationObserver(() => {\n if (!resolved && checkReady()) {\n resolved = true;\n observer.disconnect();\n resolve();\n }\n });\n\n observer.observe(enteringEl, {\n subtree: true,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n setTimeout(() => {\n if (!resolved) {\n resolved = true;\n observer.disconnect();\n resolve();\n }\n }, 100);\n });\n };\n\n await waitForComponentsReady();\n\n // Swap visibility in sync with browser's render cycle\n await new Promise<void>((resolve) => {\n requestAnimationFrame(() => {\n enteringEl.classList.remove('ion-page-invisible');\n // Second rAF ensures entering is painted before hiding leaving\n requestAnimationFrame(() => {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n resolve();\n });\n });\n });\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingEl);\n // For animated transitions, hide leaving element after commit completes\n if (leavingEl && !progressAnimation) {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n // Store reference for use in getParentPath() and handlePageTransition()\n this.ionRouterOutlet = ionRouterOutlet;\n\n const components = this.context.getChildrenToRender(this.id, this.ionRouterOutlet, this.props.routeInfo, () => {\n // Callback triggers re-render when view items are modified during getChildrenToRender\n this.forceUpdate();\n });\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n // Check for legacy refs.\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\n/**\n * Finds the `<Route />` node matching the current route info.\n * If no `<Route />` can be matched, a fallback node is returned.\n * Routes are prioritized by specificity (most specific first).\n *\n * @param node The root node to search for `<Route />` nodes.\n * @param routeInfo The route information to match against.\n * @param parentPath The parent path that was matched by the parent outlet (for nested routing)\n */\nfunction findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, parentPath?: string) {\n let matchedNode: React.ReactNode;\n let fallbackNode: React.ReactNode;\n\n // `<Route />` nodes are rendered inside of a <Routes /> node\n const routesChildren = getRoutesChildren(node) ?? node;\n\n // Collect all route children\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n // Sort routes by specificity (most specific first)\n const sortedRoutes = routeChildren.sort((a, b) => {\n const pathA = a.props.path || '';\n const pathB = b.props.path || '';\n\n // Index routes come first\n if (a.props.index && !b.props.index) return -1;\n if (!a.props.index && b.props.index) return 1;\n\n // Wildcard-only routes (*) should come LAST\n const aIsWildcardOnly = pathA === '*';\n const bIsWildcardOnly = pathB === '*';\n\n if (!aIsWildcardOnly && bIsWildcardOnly) return -1;\n if (aIsWildcardOnly && !bIsWildcardOnly) return 1;\n\n // Exact matches (no wildcards/params) come before wildcard/param routes\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among routes with same wildcard status, longer paths are more specific\n if (pathA.length !== pathB.length) {\n return pathB.length - pathA.length;\n }\n\n return 0;\n });\n\n // For nested routes in React Router 6, we need to extract the relative path\n // that this outlet should be responsible for matching\n const originalPathname = routeInfo.pathname;\n let relativePathnameToMatch = routeInfo.pathname;\n\n // Check if we have relative routes (routes that don't start with '/')\n const hasRelativeRoutes = sortedRoutes.some((r) => r.props.path && !r.props.path.startsWith('/'));\n const hasIndexRoute = sortedRoutes.some((r) => r.props.index);\n\n // SIMPLIFIED: Trust React Router 6's matching more, compute relative path when parent is known\n if ((hasRelativeRoutes || hasIndexRoute) && parentPath) {\n const parentPrefix = parentPath.replace('/*', '');\n // Normalize both paths to start with '/' for consistent comparison\n const normalizedParent = stripTrailingSlash(parentPrefix.startsWith('/') ? parentPrefix : `/${parentPrefix}`);\n const normalizedPathname = stripTrailingSlash(routeInfo.pathname);\n\n // Only compute relative path if pathname is within parent scope\n if (normalizedPathname.startsWith(normalizedParent + '/') || normalizedPathname === normalizedParent) {\n const pathSegments = routeInfo.pathname.split('/').filter(Boolean);\n const parentSegments = normalizedParent.split('/').filter(Boolean);\n const relativeSegments = pathSegments.slice(parentSegments.length);\n relativePathnameToMatch = relativeSegments.join('/'); // Empty string is valid for index routes\n }\n }\n\n // Find the first matching route\n for (const child of sortedRoutes) {\n const childPath = child.props.path as string | undefined;\n const isAbsoluteRoute = childPath && childPath.startsWith('/');\n\n // Determine which pathname to match against:\n // - For absolute routes: use the original full pathname\n // - For relative routes with a parent: use the computed relative pathname\n // - For relative routes at root level (no parent): use the original pathname\n // (matchPath will handle the relative-to-absolute normalization)\n const pathnameToMatch = isAbsoluteRoute ? originalPathname : relativePathnameToMatch;\n\n // Determine the path portion to match:\n // - For absolute routes: use derivePathnameToMatch\n // - For relative routes at root level (no parent): use original pathname\n // directly since matchPath normalizes both path and pathname\n // - For relative routes with parent: use derivePathnameToMatch for wildcards,\n // or the computed relative pathname for non-wildcards\n let pathForMatch: string;\n if (isAbsoluteRoute) {\n pathForMatch = derivePathnameToMatch(pathnameToMatch, childPath);\n } else if (!parentPath && childPath) {\n // Root-level relative route: use the full pathname and let matchPath\n // handle the normalization (it adds '/' to both path and pathname)\n pathForMatch = originalPathname;\n } else if (childPath && childPath.includes('*')) {\n // Relative wildcard route with parent path: use derivePathnameToMatch\n pathForMatch = derivePathnameToMatch(pathnameToMatch, childPath);\n } else {\n pathForMatch = pathnameToMatch;\n }\n\n const match = matchPath({\n pathname: pathForMatch,\n componentProps: child.props,\n });\n\n if (match) {\n matchedNode = child;\n break;\n }\n }\n\n if (matchedNode) {\n return matchedNode;\n }\n\n // If we haven't found a node, try to find one that doesn't have a path prop (fallback route)\n // BUT only return the fallback if the current pathname is within the outlet's scope.\n // For outlets with absolute paths, compute the common prefix to determine scope.\n const absolutePathRoutes = routeChildren.filter((r) => r.props.path && r.props.path.startsWith('/'));\n\n // Determine if pathname is within scope before returning fallback\n let isPathnameInScope = true;\n\n if (absolutePathRoutes.length > 0) {\n // Find common prefix of all absolute paths to determine outlet scope\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n // If we have a common prefix, check if the current pathname is within that scope\n if (commonPrefix && commonPrefix !== '/') {\n isPathnameInScope = routeInfo.pathname.startsWith(commonPrefix);\n }\n }\n\n // Only look for fallback route if pathname is within scope\n if (isPathnameInScope) {\n for (const child of routeChildren) {\n if (!child.props.path) {\n fallbackNode = child;\n break;\n }\n }\n }\n\n return matchedNode ?? fallbackNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean) {\n const routePath: string | undefined = node?.props?.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n return matchPath({\n pathname: pathnameToMatch,\n componentProps: {\n ...node.props,\n end: forceExact,\n },\n });\n}\n","/**\n * `IonRouter` is responsible for managing the application's navigation\n * state, tracking the history of visited routes, and coordinating\n * transitions between different views. It intercepts route changes from\n * React Router and translates them into actions that Ionic can understand\n * and animate.\n */\n\nimport type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n RouterOptions,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\n// Use Location directly - state is typed as `unknown` in history v5\ntype HistoryLocation = Location;\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: RouterOptions;\n}\n\ninterface IonRouterProps {\n registerHistoryListener: (cb: (location: HistoryLocation, action: HistoryAction) => void) => void;\n}\n\ntype RouteParams = Record<string, string | string[] | undefined>;\ntype SafeRouteParams = Record<string, string | string[]>;\n\nconst filterUndefinedParams = (params: RouteParams): SafeRouteParams => {\n const result: SafeRouteParams = {};\n for (const key of Object.keys(params)) {\n const value = params[key];\n if (value !== undefined) {\n result[key] = value;\n }\n }\n return result;\n};\n\nconst areParamsEqual = (a?: RouteParams, b?: RouteParams) => {\n const paramsA = a || {};\n const paramsB = b || {};\n const keysA = Object.keys(paramsA);\n const keysB = Object.keys(paramsB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n return keysA.every((key) => {\n const valueA = paramsA[key];\n const valueB = paramsB[key];\n if (Array.isArray(valueA) && Array.isArray(valueB)) {\n if (valueA.length !== valueB.length) {\n return false;\n }\n return valueA.every((entry, idx) => entry === valueB[idx]);\n }\n return valueA === valueB;\n });\n};\n\nexport const IonRouter = ({ children, registerHistoryListener }: PropsWithChildren<IonRouterProps>) => {\n const location = useLocation();\n const navigate = useNavigate();\n\n const didMountRef = useRef(false);\n const locationHistory = useRef(new LocationHistory());\n const currentTab = useRef<string | undefined>(undefined);\n const viewStack = useRef(new ReactRouterViewStack());\n const incomingRouteParams = useRef<Partial<RouteInfo> | null>(null);\n\n const [routeInfo, setRouteInfo] = useState<RouteInfo>({\n id: generateId('routeInfo'),\n pathname: location.pathname,\n search: location.search,\n params: {},\n });\n\n useEffect(() => {\n if (didMountRef.current) {\n return;\n }\n\n // Seed the history stack with the initial location and begin listening\n // for future navigations once React has committed the mount. This avoids\n // duplicate entries when React StrictMode runs an extra render pre-commit.\n locationHistory.current.add(routeInfo);\n registerHistoryListener(handleHistoryChange);\n\n didMountRef.current = true;\n }, []);\n\n // Sync route params extracted by React Router's path matching back into routeInfo.\n // The view stack's match may contain params (e.g., :id) not present in the initial routeInfo.\n useEffect(() => {\n const activeView = viewStack.current.findViewItemByRouteInfo(routeInfo, undefined, true);\n const matchedParams = activeView?.routeData.match?.params as RouteParams | undefined;\n\n if (matchedParams) {\n const paramsCopy = filterUndefinedParams({ ...matchedParams });\n if (areParamsEqual(routeInfo.params as RouteParams | undefined, paramsCopy)) {\n return;\n }\n\n const updatedRouteInfo: RouteInfo = {\n ...routeInfo,\n params: paramsCopy,\n };\n locationHistory.current.update(updatedRouteInfo);\n setRouteInfo(updatedRouteInfo);\n }\n }, [routeInfo]);\n\n /**\n * Triggered whenever the history changes, either through user navigation\n * or programmatic changes. It transforms the raw browser history changes\n * into `RouteInfo` objects, which are needed Ionic's animations and\n * navigation patterns.\n *\n * @param location The current location object from the history.\n * @param action The action that triggered the history change.\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n let leavingLocationInfo: RouteInfo;\n /**\n * A programmatic navigation was triggered.\n * e.g., `<Redirect />`, `history.push()`, or `handleNavigate()`\n */\n if (incomingRouteParams.current) {\n /**\n * The current history entry is overwritten, so the previous entry\n * is the one we are leaving.\n */\n if (incomingRouteParams.current?.routeAction === 'replace') {\n leavingLocationInfo = locationHistory.current.previous();\n } else {\n // If the action is 'push' or 'pop', we want to use the current route.\n leavingLocationInfo = locationHistory.current.current();\n }\n } else {\n /**\n * An external navigation was triggered\n * e.g., browser back/forward button or direct link\n *\n * The leaving location is the current route.\n */\n leavingLocationInfo = locationHistory.current.current();\n }\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname) {\n if (!incomingRouteParams.current) {\n // Determine if the destination is a tab route by checking if it matches\n // the pattern of tab routes (containing /tabs/ in the path)\n const isTabRoute = /\\/tabs(\\/|$)/.test(location.pathname);\n const tabToUse = isTabRoute ? currentTab.current : undefined;\n\n // If we're leaving tabs entirely, clear the current tab\n if (!isTabRoute && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * A `REPLACE` action can be triggered by React Router's\n * `<Redirect />` component.\n */\n if (action === 'REPLACE') {\n incomingRouteParams.current = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n /**\n * A `POP` action can be triggered by the browser's back/forward\n * button.\n */\n if (action === 'POP') {\n const currentRoute = locationHistory.current.current();\n /**\n * Check if the current route was \"pushed\" by a previous route\n * (indicates a linear history path).\n */\n if (currentRoute && currentRoute.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(currentRoute);\n incomingRouteParams.current = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n // It's a non-linear history path like a direct link.\n } else {\n incomingRouteParams.current = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n }\n if (!incomingRouteParams.current) {\n const state = location.state as LocationState | null;\n incomingRouteParams.current = {\n routeAction: 'push',\n routeDirection: state?.direction || 'forward',\n routeOptions: state?.routerOptions,\n tab: tabToUse,\n };\n }\n }\n\n let routeInfo: RouteInfo;\n\n // If we're navigating away from tabs to a non-tab route, clear the current tab\n if (!/\\/tabs(\\/|$)/.test(location.pathname) && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * An existing id indicates that it's re-activating an existing route.\n * e.g., tab switching or navigating back to a previous route\n */\n if (incomingRouteParams.current?.id) {\n routeInfo = {\n ...(incomingRouteParams.current as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n locationHistory.current.add(routeInfo);\n /**\n * A new route is being created since it's not re-activating\n * an existing route.\n */\n } else {\n const isPushed =\n incomingRouteParams.current?.routeAction === 'push' &&\n incomingRouteParams.current.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...incomingRouteParams.current,\n lastPathname: leavingLocationInfo.pathname, // The URL we just came from\n pathname: location.pathname, // The current (destination) URL\n search: location.search,\n params: incomingRouteParams.current?.params\n ? filterUndefinedParams(incomingRouteParams.current.params as RouteParams)\n : {},\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n // Only inherit tab from leaving route if we don't already have one.\n // This preserves tab context for same-tab navigation while allowing cross-tab navigation.\n routeInfo.tab = routeInfo.tab || leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n // Triggered by a browser back button or handleNavigateBack.\n } else if (routeInfo.routeAction === 'pop') {\n // Find the route that pushed this one.\n const r = locationHistory.current.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n // Navigating to a new tab.\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n /**\n * If we are switching tabs grab the last route info for the\n * tab and use its `pushedByRoute`.\n */\n const lastRoute = locationHistory.current.getCurrentRouteInfoForTab(routeInfo.tab);\n /**\n * Tab bar switches (direction 'none') should not create cross-tab back\n * navigation. Only inherit pushedByRoute from the tab's own history.\n */\n if (routeInfo.routeDirection === 'none') {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute ?? leavingLocationInfo.pathname;\n }\n // Triggered by `history.replace()` or a `<Redirect />` component, etc.\n } else if (routeInfo.routeAction === 'replace') {\n /**\n * Make sure to set the `lastPathname`, etc.. to the current route\n * so the page transitions out.\n */\n const currentRouteInfo = locationHistory.current.current();\n\n /**\n * Special handling for `replace` to ensure correct `pushedByRoute`\n * and `lastPathname`.\n *\n * If going from `/home` to `/child`, then replacing from\n * `/child` to `/home`, we don't want the route info to\n * say that `/home` was pushed by `/home` which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n locationHistory.current.add(routeInfo);\n }\n setRouteInfo(routeInfo);\n }\n\n incomingRouteParams.current = null;\n };\n\n /**\n * Resets the specified tab to its initial, root route.\n *\n * @param tab The tab to reset.\n * @param originalHref The original href for the tab.\n * @param originalRouteOptions The original route options for the tab.\n */\n const handleResetTab = (tab: string, originalHref: string, originalRouteOptions: any) => {\n const routeInfo = locationHistory.current.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = originalHref;\n newRouteInfo.routeOptions = originalRouteOptions;\n incomingRouteParams.current = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n navigate(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n };\n\n /**\n * Handles tab changes.\n *\n * @param tab The tab to switch to.\n * @param path The new path for the tab.\n * @param routeOptions Additional route options.\n */\n const handleChangeTab = (tab: string, path?: string, routeOptions?: any) => {\n if (!path) {\n return;\n }\n\n const routeInfo = locationHistory.current.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n // User has navigated to the current tab before.\n if (routeInfo) {\n const routeParams = {\n ...routeInfo,\n routeAction: 'push' as RouteAction,\n routeDirection: 'none' as RouterDirection,\n };\n /**\n * User is navigating to the same tab.\n * e.g., `/tabs/home` → `/tabs/home`\n */\n if (routeInfo.pathname === pathname) {\n incomingRouteParams.current = {\n ...routeParams,\n routeOptions,\n };\n\n navigate(routeInfo.pathname + (routeInfo.search || ''));\n /**\n * User is navigating to a different tab.\n * e.g., `/tabs/home` → `/tabs/settings`\n */\n } else {\n incomingRouteParams.current = {\n ...routeParams,\n pathname,\n search: search ? '?' + search : undefined,\n routeOptions,\n };\n\n navigate(pathname + (search ? '?' + search : ''));\n }\n // User has not navigated to this tab before.\n } else {\n handleNavigate(pathname, 'push', 'none', undefined, routeOptions, tab);\n }\n };\n\n /**\n * Set the current active tab in `locationHistory`.\n * This is crucial for maintaining tab history since each tab has\n * its own navigation stack.\n *\n * @param tab The tab to set as active.\n */\n const handleSetCurrentTab = (tab: string) => {\n currentTab.current = tab;\n const ri = { ...locationHistory.current.current() };\n if (ri.tab !== tab) {\n ri.tab = tab;\n locationHistory.current.update(ri);\n }\n };\n\n /**\n * Handles the native back button press.\n * It's usually called when a user presses the platform-native back action.\n */\n const handleNativeBack = () => {\n navigate(-1);\n };\n\n /**\n * Used to manage the back navigation within the Ionic React's routing\n * system. It's deeply integrated with Ionic's view lifecycle, animations,\n * and its custom history tracking (`locationHistory`) to provide a\n * native-like transition and maintain correct application state.\n *\n * @param defaultHref The fallback URL to navigate to if there's no\n * previous entry in the `locationHistory` stack.\n * @param routeAnimation A custom animation builder to override the\n * default \"back\" animation.\n */\n const handleNavigateBack = (defaultHref: string | RouteInfo = '/', routeAnimation?: AnimationBuilder) => {\n const config = getConfig();\n defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref' as any);\n const routeInfo = locationHistory.current.current();\n // It's a linear navigation.\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n incomingRouteParams.current = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n /**\n * Check if it's a simple linear back navigation (not tabbed).\n * e.g., `/home` → `/settings` → back to `/home`\n */\n const condition1 = routeInfo.lastPathname === routeInfo.pushedByRoute;\n const condition2 = prevInfo.pathname === routeInfo.pushedByRoute && routeInfo.tab === '' && prevInfo.tab === '';\n if (condition1 || condition2) {\n navigate(-1);\n } else {\n /**\n * It's a non-linear back navigation.\n * e.g., direct link or tab switch or nested navigation with redirects\n */\n handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n /**\n * `pushedByRoute` exists, but no corresponding previous entry in\n * the history stack.\n */\n } else {\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n /**\n * No `pushedByRoute` (e.g., initial page load or tab root).\n * Tabs with no back history should not navigate.\n */\n } else {\n if (routeInfo && routeInfo.tab) {\n return;\n }\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n };\n\n /**\n * Used to programmatically navigate through the app.\n *\n * @param path The path to navigate to.\n * @param routeAction The action to take (push, replace, etc.).\n * @param routeDirection The direction of the navigation (forward,\n * back, etc.).\n * @param routeAnimation The animation to use for the transition.\n * @param routeOptions Additional options for the route.\n * @param tab The tab to navigate to, if applicable.\n */\n const handleNavigate = (\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) => {\n const normalizedRouteDirection =\n routeAction === 'push' && routeDirection === undefined ? 'forward' : routeDirection;\n\n // When navigating from tabs context, we need to determine if the destination\n // is also within tabs. If not, we should clear the tab context.\n let navigationTab = tab;\n\n // If no explicit tab is provided and we're in a tab context,\n // check if the destination path is outside of the current tab context\n if (!tab && currentTab.current && path) {\n // Get the current route info to understand where we are\n const currentRoute = locationHistory.current.current();\n\n // If we're navigating from a tab route to a completely different path structure,\n // we should clear the tab context. This is a simplified check that assumes\n // tab routes share a common parent path.\n if (currentRoute && currentRoute.pathname) {\n // Extract the base tab path (e.g., /routing/tabs from /routing/tabs/home)\n const tabBaseMatch = currentRoute.pathname.match(/^(.*\\/tabs)/);\n if (tabBaseMatch) {\n const tabBasePath = tabBaseMatch[1];\n // If the new path doesn't start with the tab base path, we're leaving tabs\n if (!path.startsWith(tabBasePath)) {\n currentTab.current = undefined;\n navigationTab = undefined;\n } else {\n // Still within tabs, preserve the tab context\n navigationTab = currentTab.current;\n }\n }\n }\n }\n\n const baseParams = incomingRouteParams.current ?? {};\n incomingRouteParams.current = {\n ...baseParams,\n routeAction,\n routeDirection: normalizedRouteDirection,\n routeOptions,\n routeAnimation,\n tab: navigationTab,\n };\n\n navigate(path, { replace: routeAction !== 'push' });\n };\n\n const routeMangerContextValue: RouteManagerContextState = {\n canGoBack: () => locationHistory.current.canGoBack(),\n clearOutlet: viewStack.current.clear,\n findViewItemByPathname: viewStack.current.findViewItemByPathname,\n getChildrenToRender: viewStack.current.getChildrenToRender,\n getViewItemsForOutlet: viewStack.current.getViewItemsForOutlet.bind(viewStack.current),\n goBack: () => handleNavigateBack(),\n createViewItem: viewStack.current.createViewItem,\n findViewItemByRouteInfo: viewStack.current.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: viewStack.current.findLeavingViewItemByRouteInfo,\n addViewItem: viewStack.current.add,\n unMountViewItem: viewStack.current.remove,\n };\n\n return (\n <RouteManagerContext.Provider value={routeMangerContextValue}>\n <NavManager\n ionRoute={IonRouteInner}\n ionRedirect={{}}\n stackManager={StackManager}\n routeInfo={routeInfo}\n onNativeBack={handleNativeBack}\n onNavigateBack={handleNavigateBack}\n onNavigate={handleNavigate}\n onSetCurrentTab={handleSetCurrentTab}\n onChangeTab={handleChangeTab}\n onResetTab={handleResetTab}\n locationHistory={locationHistory.current}\n >\n {children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n};\n\nIonRouter.displayName = 'IonRouter';\n","/**\n * `IonReactRouter` facilitates the integration of Ionic's specific\n * navigation and UI management with the standard React Router mechanisms,\n * allowing an inner Ionic-specific router (`IonRouter`) to react to\n * navigation events.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { BrowserRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\n/**\n * This component acts as a bridge to ensure React Router hooks like\n * `useLocation` and `useNavigationType` are called within the valid\n * context of a `<BrowserRouter>`.\n *\n * It was split from `IonReactRouter` because these hooks must be\n * descendants of a `<Router>` component, which `BrowserRouter` provides.\n */\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param loc The current browser history location object.\n * @param act The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactRouter = ({ children, ...browserRouterProps }: PropsWithChildren<BrowserRouterProps>) => {\n return (\n <BrowserRouter {...browserRouterProps}>\n <RouterContent>{children}</RouterContent>\n </BrowserRouter>\n );\n};\n","/**\n * `IonReactMemoryRouter` provides a way to use `react-router` in\n * environments where a traditional browser history (like `BrowserRouter`)\n * isn't available or desirable.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { MemoryRouter, useLocation, useNavigationType } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactMemoryRouter = ({ children, ...routerProps }: PropsWithChildren<MemoryRouterProps>) => {\n return (\n <MemoryRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </MemoryRouter>\n );\n};\n","/**\n * `IonReactHashRouter` provides a way to use hash-based routing in Ionic\n * React applications.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { HashRouterProps } from 'react-router-dom';\nimport { HashRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactHashRouter = ({ children, ...routerProps }: PropsWithChildren<HashRouterProps>) => {\n return (\n <HashRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </HashRouter>\n );\n};\n"],"names":["reactRouterMatchPath","matchComponent","RouteContext","RouterContent","useLocation","useNavigationType"],"mappings":";;;;;;AAIO,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAiB,KAAI;IAChE,OAAO,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAA,CAAI;AAChD,CAAC;;ACgBD;;;AAGG;AACI,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAoB,KAA8B;;AACpG,IAAA,MAAM,EAAE,IAAI,EAAE,KAAK,EAAA,GAAmB,cAAc,EAA5B,SAAS,GAAA,MAAA,CAAK,cAAc,EAA9C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AC/C,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAE9B,OAAO,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,uBAAuB,EAAE,uBAAuB,EAAA,EAAG,QAAQ,CAAa;AAC5F,CAAC;AAEM,MAAM,kBAAkB,GAAG,CAAC,EAAgE,KAAI;AAApE,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAAsD,EAAjD,WAAW,GAAA,MAAA,CAAA,EAAA,EAA1B,YAA4B,CAAF;AAC3D,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,WAAW,CAAA;AACzB,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,EAAE,QAAQ,CAAiB,CAC9B;AAEjB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/ReactRouter/IonRouteInner.tsx","../src/ReactRouter/utils/pathMatching.ts","../src/ReactRouter/utils/computeParentPath.ts","../src/ReactRouter/utils/pathNormalization.ts","../src/ReactRouter/utils/routeElements.ts","../src/ReactRouter/utils/viewItemUtils.ts","../src/ReactRouter/ReactRouterViewStack.tsx","../src/ReactRouter/clonePageElement.ts","../src/ReactRouter/StackManager.tsx","../src/ReactRouter/IonRouter.tsx","../src/ReactRouter/IonReactRouter.tsx","../src/ReactRouter/IonReactMemoryRouter.tsx","../src/ReactRouter/IonReactHashRouter.tsx"],"sourcesContent":["import type { IonRouteProps } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const IonRouteInner = ({ path, element }: IonRouteProps) => {\n return <Route path={path} element={element} />;\n};\n","import type { PathMatch } from 'react-router';\nimport { matchPath as reactRouterMatchPath } from 'react-router-dom';\n\n/**\n * Options for the matchPath function.\n */\ninterface MatchPathOptions {\n /**\n * The pathname to match against.\n */\n pathname: string;\n /**\n * The props to match against, they are identical to the matching props `Route` accepts.\n */\n componentProps: {\n path?: string;\n caseSensitive?: boolean;\n end?: boolean;\n index?: boolean;\n };\n}\n\n/**\n * The matchPath function is used only for matching paths, not rendering components or elements.\n * @see https://reactrouter.com/v6/utils/match-path\n */\nexport const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathMatch<string> | null => {\n const { path, index, ...restProps } = componentProps;\n\n // Handle index routes - they match when pathname is empty or just \"/\"\n if (index && !path) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: false,\n end: true,\n },\n };\n }\n return null;\n }\n\n // Handle empty path routes - they match when pathname is also empty or just \"/\"\n if (path === '' || path === undefined) {\n if (pathname === '' || pathname === '/') {\n return {\n params: {},\n pathname: pathname,\n pathnameBase: pathname || '/',\n pattern: {\n path: '',\n caseSensitive: restProps.caseSensitive ?? false,\n end: restProps.end ?? true,\n },\n };\n }\n return null;\n }\n\n // For relative paths (don't start with '/'), normalize both path and pathname for matching\n if (!path.startsWith('/')) {\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path: `/${path}`,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n const normalizedPathname = pathname.startsWith('/') ? pathname : `/${pathname}`;\n const match = reactRouterMatchPath(matchOptions, normalizedPathname);\n\n if (match) {\n // Adjust the match to remove the leading '/' we added\n return {\n ...match,\n pathname: pathname,\n pathnameBase: match.pathnameBase === '/' ? '' : match.pathnameBase.slice(1),\n pattern: {\n ...match.pattern,\n path: path,\n },\n };\n }\n\n return null;\n }\n\n // For absolute paths, use React Router's matcher directly.\n // React Router v6 routes default to `end: true` unless the pattern\n // explicitly opts into wildcards with `*`. Mirror that behaviour so\n // matching parity stays aligned with <Route>.\n const matchOptions: Parameters<typeof reactRouterMatchPath>[0] = {\n path,\n ...restProps,\n };\n\n if (matchOptions?.end === undefined) {\n matchOptions.end = !path.endsWith('*');\n }\n\n return reactRouterMatchPath(matchOptions, pathname);\n};\n\n/**\n * Determines the portion of a pathname that a given route pattern should match against.\n * For absolute route patterns we return the full pathname. For relative patterns we\n * strip off the already-matched parent segments so React Router receives the remainder.\n */\nexport const derivePathnameToMatch = (fullPathname: string, routePath?: string): string => {\n // For absolute or empty routes, use the full pathname as-is\n if (!routePath || routePath === '' || routePath.startsWith('/')) {\n return fullPathname;\n }\n\n const trimmedPath = fullPathname.startsWith('/') ? fullPathname.slice(1) : fullPathname;\n if (!trimmedPath) {\n // For root-level relative routes (pathname is \"/\" and routePath is relative),\n // return the full pathname so matchPath can normalize both.\n // This allows routes like <Route path=\"foo/*\" .../> at root level to work correctly.\n return fullPathname;\n }\n\n const fullSegments = trimmedPath.split('/').filter(Boolean);\n if (fullSegments.length === 0) {\n return '';\n }\n\n const routeSegments = routePath.split('/').filter(Boolean);\n if (routeSegments.length === 0) {\n return trimmedPath;\n }\n\n const wildcardIndex = routeSegments.findIndex((segment) => segment === '*' || segment === '**');\n\n if (wildcardIndex >= 0) {\n const baseSegments = routeSegments.slice(0, wildcardIndex);\n if (baseSegments.length === 0) {\n return trimmedPath;\n }\n\n const startIndex = fullSegments.findIndex((_, idx) =>\n baseSegments.every((seg, segIdx) => {\n const target = fullSegments[idx + segIdx];\n if (!target) {\n return false;\n }\n if (seg.startsWith(':')) {\n return true;\n }\n return target === seg;\n })\n );\n\n if (startIndex >= 0) {\n return fullSegments.slice(startIndex).join('/');\n }\n }\n\n if (routeSegments.length <= fullSegments.length) {\n return fullSegments.slice(fullSegments.length - routeSegments.length).join('/');\n }\n\n return fullSegments[fullSegments.length - 1] ?? trimmedPath;\n};\n","import type React from 'react';\n\nimport { matchPath } from './pathMatching';\n\n/**\n * Finds the longest common prefix among an array of paths.\n * Used to determine the scope of an outlet with absolute routes.\n *\n * @param paths An array of absolute path strings.\n * @returns The common prefix shared by all paths.\n */\nexport const computeCommonPrefix = (paths: string[]): string => {\n if (paths.length === 0) return '';\n if (paths.length === 1) {\n // For a single path, extract the directory-like prefix\n // e.g., /dynamic-routes/home -> /dynamic-routes\n const segments = paths[0].split('/').filter(Boolean);\n if (segments.length > 1) {\n return '/' + segments.slice(0, -1).join('/');\n }\n return '/' + segments[0];\n }\n\n // Split all paths into segments\n const segmentArrays = paths.map((p) => p.split('/').filter(Boolean));\n const minLength = Math.min(...segmentArrays.map((s) => s.length));\n\n const commonSegments: string[] = [];\n for (let i = 0; i < minLength; i++) {\n const segment = segmentArrays[0][i];\n // Skip segments with route parameters or wildcards\n if (segment.includes(':') || segment.includes('*')) {\n break;\n }\n const allMatch = segmentArrays.every((s) => s[i] === segment);\n if (allMatch) {\n commonSegments.push(segment);\n } else {\n break;\n }\n }\n\n return commonSegments.length > 0 ? '/' + commonSegments.join('/') : '';\n};\n\n/**\n * Checks if a route path is a \"splat-only\" route (just `*` or `/*`).\n */\nconst isSplatOnlyRoute = (routePath: string | undefined): boolean => {\n return routePath === '*' || routePath === '/*';\n};\n\n/**\n * Checks if a route has an embedded wildcard (e.g., \"tab1/*\" but not \"*\" or \"/*\").\n */\nconst hasEmbeddedWildcard = (routePath: string | undefined): boolean => {\n return !!routePath && routePath.includes('*') && !isSplatOnlyRoute(routePath);\n};\n\n/**\n * Checks if a route with an embedded wildcard matches a pathname.\n */\nconst matchesEmbeddedWildcardRoute = (route: React.ReactElement, pathname: string): boolean => {\n const routePath = route.props.path as string | undefined;\n if (!hasEmbeddedWildcard(routePath)) {\n return false;\n }\n return !!matchPath({ pathname, componentProps: route.props });\n};\n\n/**\n * Checks if a route is a specific match (not wildcard-only or index).\n */\nexport const isSpecificRouteMatch = (route: React.ReactElement, remainingPath: string): boolean => {\n const routePath = route.props.path;\n if (route.props.index || isSplatOnlyRoute(routePath)) {\n return false;\n }\n return !!matchPath({ pathname: remainingPath, componentProps: route.props });\n};\n\n/**\n * Result of parent path computation.\n */\nexport interface ParentPathResult {\n parentPath: string | undefined;\n outletMountPath: string | undefined;\n}\n\ninterface RouteAnalysis {\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n routeChildren: React.ReactElement[];\n}\n\n/**\n * Analyzes route children to determine their characteristics.\n *\n * @param routeChildren The route children to analyze.\n * @returns Analysis of the route characteristics.\n */\nexport const analyzeRouteChildren = (routeChildren: React.ReactElement[]): RouteAnalysis => {\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n const hasIndexRoute = routeChildren.some((route) => route.props.index);\n\n const hasWildcardRoute = routeChildren.some((route) => {\n const routePath = route.props.path;\n return routePath === '*' || routePath === '/*';\n });\n\n return { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute, routeChildren };\n};\n\ninterface ComputeParentPathOptions {\n currentPathname: string;\n outletMountPath: string | undefined;\n routeChildren: React.ReactElement[];\n hasRelativeRoutes: boolean;\n hasIndexRoute: boolean;\n hasWildcardRoute: boolean;\n}\n\n/**\n * Checks if any route matches as a specific (non-wildcard, non-index) route.\n */\nconst findSpecificMatch = (routeChildren: React.ReactElement[], remainingPath: string): boolean => {\n return routeChildren.some(\n (route) => isSpecificRouteMatch(route, remainingPath) || matchesEmbeddedWildcardRoute(route, remainingPath)\n );\n};\n\n/**\n * Checks if any specific route could plausibly match the remaining path.\n * Used to determine if we should fall back to a wildcard match.\n */\nconst couldSpecificRouteMatch = (routeChildren: React.ReactElement[], remainingPath: string): boolean => {\n const remainingFirstSegment = remainingPath.split('/')[0];\n return routeChildren.some((route) => {\n const routePath = route.props.path as string | undefined;\n if (!routePath || routePath === '*' || routePath === '/*') return false;\n if (route.props.index) return false;\n\n const routeFirstSegment = routePath.split('/')[0].replace(/[*:]/g, '');\n if (!routeFirstSegment) return false;\n\n // Check for prefix overlap (either direction)\n return (\n routeFirstSegment.startsWith(remainingFirstSegment.slice(0, 3)) ||\n remainingFirstSegment.startsWith(routeFirstSegment.slice(0, 3))\n );\n });\n};\n\n/**\n * Checks for index route match when remaining path is empty.\n * Index routes only match at the outlet's mount path level.\n */\nconst checkIndexMatch = (\n parentPath: string,\n remainingPath: string,\n hasIndexRoute: boolean,\n outletMountPath: string | undefined\n): string | undefined => {\n if ((remainingPath === '' || remainingPath === '/') && hasIndexRoute) {\n if (outletMountPath) {\n // Index should only match at the existing mount path\n return parentPath === outletMountPath ? parentPath : undefined;\n }\n // No mount path yet - this would establish it\n return parentPath;\n }\n return undefined;\n};\n\n/**\n * Determines the best parent path from the available matches.\n * Priority: specific > wildcard > index\n */\nconst selectBestMatch = (\n specificMatch: string | undefined,\n wildcardMatch: string | undefined,\n indexMatch: string | undefined\n): string | undefined => {\n return specificMatch ?? wildcardMatch ?? indexMatch;\n};\n\n/**\n * Handles outlets with only absolute routes by computing their common prefix.\n */\nconst computeAbsoluteRoutesParentPath = (\n routeChildren: React.ReactElement[],\n currentPathname: string,\n outletMountPath: string | undefined\n): ParentPathResult | undefined => {\n const absolutePathRoutes = routeChildren.filter((route) => {\n const path = route.props.path;\n return path && path.startsWith('/');\n });\n\n if (absolutePathRoutes.length === 0) {\n return undefined;\n }\n\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n if (!commonPrefix || commonPrefix === '/') {\n return undefined;\n }\n\n const newOutletMountPath = outletMountPath || commonPrefix;\n\n if (!currentPathname.startsWith(commonPrefix)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: commonPrefix, outletMountPath: newOutletMountPath };\n};\n\n/**\n * Computes the parent path for a nested outlet based on the current pathname\n * and the outlet's route configuration.\n *\n * The algorithm finds the shortest parent path where a route matches the remaining path.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n *\n * @param options The options for computing the parent path.\n * @returns The computed parent path result.\n */\nexport const computeParentPath = (options: ComputeParentPathOptions): ParentPathResult => {\n const { currentPathname, outletMountPath, routeChildren, hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } =\n options;\n\n // If pathname is outside the established mount path scope, skip computation\n if (outletMountPath && !currentPathname.startsWith(outletMountPath)) {\n return { parentPath: undefined, outletMountPath };\n }\n\n if ((hasRelativeRoutes || hasIndexRoute) && currentPathname.includes('/')) {\n const segments = currentPathname.split('/').filter(Boolean);\n\n if (segments.length >= 1) {\n let firstSpecificMatch: string | undefined;\n let firstWildcardMatch: string | undefined;\n let indexMatchAtMount: string | undefined;\n\n // Iterate through path segments to find the shortest matching parent path\n for (let i = 1; i <= segments.length; i++) {\n const parentPath = '/' + segments.slice(0, i).join('/');\n const remainingPath = segments.slice(i).join('/');\n\n // Check for specific route match (highest priority)\n if (!firstSpecificMatch && findSpecificMatch(routeChildren, remainingPath)) {\n firstSpecificMatch = parentPath;\n break;\n }\n\n // Check for wildcard match (only if remaining path is non-empty)\n const hasNonEmptyRemaining = remainingPath !== '' && remainingPath !== '/';\n if (!firstWildcardMatch && hasNonEmptyRemaining && hasWildcardRoute) {\n if (!couldSpecificRouteMatch(routeChildren, remainingPath)) {\n firstWildcardMatch = parentPath;\n }\n }\n\n // Check for index route match\n const indexMatch = checkIndexMatch(parentPath, remainingPath, hasIndexRoute, outletMountPath);\n if (indexMatch) {\n indexMatchAtMount = indexMatch;\n }\n }\n\n // Fallback: check root level for embedded wildcard routes (e.g., \"tab1/*\")\n if (!firstSpecificMatch) {\n const fullRemainingPath = segments.join('/');\n if (routeChildren.some((route) => matchesEmbeddedWildcardRoute(route, fullRemainingPath))) {\n firstSpecificMatch = '/';\n }\n }\n\n const bestPath = selectBestMatch(firstSpecificMatch, firstWildcardMatch, indexMatchAtMount);\n\n // Establish mount path on first successful match\n const newOutletMountPath = outletMountPath || bestPath;\n\n if (newOutletMountPath && !currentPathname.startsWith(newOutletMountPath)) {\n return { parentPath: undefined, outletMountPath: newOutletMountPath };\n }\n\n return { parentPath: bestPath, outletMountPath: newOutletMountPath };\n }\n }\n\n // Handle outlets with only absolute routes\n if (!hasRelativeRoutes && !hasIndexRoute) {\n const result = computeAbsoluteRoutesParentPath(routeChildren, currentPathname, outletMountPath);\n if (result) {\n return result;\n }\n }\n\n return { parentPath: outletMountPath, outletMountPath };\n};\n","/**\n * Ensures the given path has a leading slash.\n *\n * @param value The path string to normalize.\n * @returns The path with a leading slash.\n */\nexport const ensureLeadingSlash = (value: string): string => {\n if (value === '') {\n return '/';\n }\n return value.startsWith('/') ? value : `/${value}`;\n};\n\n/**\n * Strips the trailing slash from a path, unless it's the root path.\n *\n * @param value The path string to normalize.\n * @returns The path without a trailing slash.\n */\nexport const stripTrailingSlash = (value: string): string => {\n return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value;\n};\n\n/**\n * Normalizes a pathname for comparison by ensuring a leading slash\n * and removing trailing slashes.\n *\n * @param value The pathname to normalize, can be undefined.\n * @returns A normalized pathname string.\n */\nexport const normalizePathnameForComparison = (value: string | undefined): string => {\n if (!value || value === '') {\n return '/';\n }\n const withLeadingSlash = ensureLeadingSlash(value);\n return stripTrailingSlash(withLeadingSlash);\n};\n","import React from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\n\n/**\n * Extracts the children from a Routes wrapper component.\n * The use of `<Routes />` is encouraged with React Router v6.\n *\n * @param node The React node to extract Routes children from.\n * @returns The children of the Routes component, or undefined if not found.\n */\nexport const getRoutesChildren = (node: React.ReactNode): React.ReactNode | undefined => {\n let routesNode: React.ReactNode;\n React.Children.forEach(node as React.ReactElement, (child: React.ReactElement) => {\n if (child.type === Routes) {\n routesNode = child;\n }\n });\n\n if (routesNode) {\n // The children of the `<Routes />` component are most likely\n // (and should be) the `<Route />` components.\n return (routesNode as React.ReactElement).props.children;\n }\n return undefined;\n};\n\n/**\n * Extracts Route children from a node (either directly or from a Routes wrapper).\n *\n * @param children The children to extract routes from.\n * @returns An array of Route elements.\n */\nexport const extractRouteChildren = (children: React.ReactNode): React.ReactElement[] => {\n const routesChildren = getRoutesChildren(children) ?? children;\n return React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n};\n\n/**\n * Checks if a React element is a Navigate component (redirect).\n *\n * @param element The element to check.\n * @returns True if the element is a Navigate component.\n */\nexport const isNavigateElement = (element: unknown): boolean => {\n return (\n React.isValidElement(element) &&\n (element.type === Navigate || (typeof element.type === 'function' && element.type.name === 'Navigate'))\n );\n};\n","import type { ViewItem } from '@ionic/react';\n\n/**\n * Sorts view items by route specificity (most specific first).\n * - Exact matches (no wildcards/params) come first\n * - Among wildcard routes, longer paths are more specific\n *\n * @param views The view items to sort.\n * @returns A new sorted array of view items.\n */\nexport const sortViewsBySpecificity = (views: ViewItem[]): ViewItem[] => {\n return [...views].sort((a, b) => {\n const pathA = a.routeData?.childProps?.path || '';\n const pathB = b.routeData?.childProps?.path || '';\n\n // Exact matches (no wildcards/params) come first\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among wildcard routes, longer paths are more specific\n return pathB.length - pathA.length;\n });\n};\n","/**\n * `ReactRouterViewStack` is a custom navigation manager used in Ionic React\n * apps to map React Router route elements (such as `<IonRoute>`) to \"view\n * items\" that Ionic can manage in a view stack. This is critical to maintain\n * Ionic’s animation, lifecycle, and history behavior across views.\n */\n\nimport type { RouteInfo, ViewItem } from '@ionic/react';\nimport { generateId, IonRoute, ViewLifeCycleManager, ViewStacks } from '@ionic/react';\nimport React from 'react';\nimport type { PathMatch } from 'react-router';\nimport { Navigate, UNSAFE_RouteContext as RouteContext } from 'react-router-dom';\n\nimport { analyzeRouteChildren, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { normalizePathnameForComparison } from './utils/pathNormalization';\nimport { extractRouteChildren, isNavigateElement } from './utils/routeElements';\nimport { sortViewsBySpecificity } from './utils/viewItemUtils';\n\n/**\n * Delay in milliseconds before removing a Navigate view item after a redirect.\n * This ensures the redirect navigation completes before the view is removed.\n */\nconst NAVIGATE_REDIRECT_DELAY_MS = 100;\n\n/**\n * Delay in milliseconds before cleaning up a view without an IonPage element.\n * This double-checks that the view is truly not needed before removal.\n */\nconst VIEW_CLEANUP_DELAY_MS = 200;\n\ntype RouteParams = Record<string, string | undefined>;\n\ntype RouteContextMatch = {\n params: RouteParams;\n pathname: string;\n pathnameBase: string;\n route: {\n id: string;\n path?: string;\n element: React.ReactNode;\n index: boolean;\n caseSensitive?: boolean;\n hasErrorBoundary: boolean;\n };\n};\n\n/**\n * Computes the absolute pathnameBase for a route element based on its type.\n * Handles relative paths, index routes, and splat routes differently.\n */\nconst computeAbsolutePathnameBase = (\n routeElement: React.ReactElement,\n routeMatch: PathMatch<string> | undefined,\n parentPathnameBase: string,\n routeInfoPathname: string\n): string => {\n const routePath = routeElement.props.path;\n const isRelativePath = routePath && !routePath.startsWith('/');\n const isIndexRoute = !!routeElement.props.index;\n const isSplatOnlyRoute = routePath === '*' || routePath === '/*';\n\n if (isSplatOnlyRoute) {\n // Splat routes should NOT contribute their matched portion to pathnameBase\n // This aligns with React Router v7's v7_relativeSplatPath behavior\n return parentPathnameBase;\n }\n\n if (isRelativePath && routeMatch?.pathnameBase) {\n const relativeBase = routeMatch.pathnameBase.startsWith('/')\n ? routeMatch.pathnameBase.slice(1)\n : routeMatch.pathnameBase;\n return parentPathnameBase === '/' ? `/${relativeBase}` : `${parentPathnameBase}/${relativeBase}`;\n }\n\n if (isIndexRoute) {\n return parentPathnameBase;\n }\n\n return routeMatch?.pathnameBase || routeInfoPathname;\n};\n\n/**\n * Gets fallback params from view items in other outlets when parent context is empty.\n * This handles cases where React context propagation doesn't work as expected.\n */\nconst getFallbackParamsFromViewItems = (\n allViewItems: ViewItem[],\n currentOutletId: string,\n currentPathname: string\n): RouteParams => {\n const params: RouteParams = {};\n\n for (const otherViewItem of allViewItems) {\n if (otherViewItem.outletId === currentOutletId) continue;\n\n const otherMatch = otherViewItem.routeData?.match;\n if (otherMatch?.params && Object.keys(otherMatch.params).length > 0) {\n const matchedPathname = otherMatch.pathnameBase || otherMatch.pathname;\n if (matchedPathname && currentPathname.startsWith(matchedPathname)) {\n Object.assign(params, otherMatch.params);\n }\n }\n }\n\n return params;\n};\n\n/**\n * Builds the matches array for RouteContext.\n */\nconst buildContextMatches = (\n parentMatches: RouteContextMatch[],\n combinedParams: RouteParams,\n routeMatch: PathMatch<string> | undefined,\n routeInfoPathname: string,\n absolutePathnameBase: string,\n viewItem: ViewItem,\n routeElement: React.ReactElement,\n componentElement: React.ReactNode\n): RouteContextMatch[] => {\n return [\n ...parentMatches,\n {\n params: combinedParams,\n pathname: routeMatch?.pathname || routeInfoPathname,\n pathnameBase: absolutePathnameBase,\n route: {\n id: viewItem.id,\n path: routeElement.props.path,\n element: componentElement,\n index: !!routeElement.props.index,\n caseSensitive: routeElement.props.caseSensitive,\n hasErrorBoundary: false,\n },\n },\n ];\n};\n\nconst createDefaultMatch = (\n fullPathname: string,\n routeProps: { path?: string; caseSensitive?: boolean; end?: boolean; index?: boolean }\n): PathMatch<string> => {\n const isIndexRoute = !!routeProps.index;\n const patternPath = routeProps.path ?? '';\n const pathnameBase = fullPathname === '' ? '/' : fullPathname;\n const computedEnd =\n routeProps.end !== undefined ? routeProps.end : patternPath !== '' ? !patternPath.endsWith('*') : true;\n\n return {\n params: {},\n pathname: isIndexRoute ? '' : fullPathname,\n pathnameBase,\n pattern: {\n path: patternPath,\n caseSensitive: routeProps.caseSensitive ?? false,\n end: isIndexRoute ? true : computedEnd,\n },\n };\n};\n\nconst computeRelativeToParent = (pathname: string, parentPath?: string): string | null => {\n if (!parentPath) return null;\n const normalizedParent = normalizePathnameForComparison(parentPath);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname === normalizedParent) {\n return '';\n }\n\n const withSlash = normalizedParent === '/' ? '/' : normalizedParent + '/';\n if (normalizedPathname.startsWith(withSlash)) {\n return normalizedPathname.slice(withSlash.length);\n }\n return null;\n};\n\nconst resolveIndexRouteMatch = (\n viewItem: ViewItem,\n pathname: string,\n parentPath?: string\n): PathMatch<string> | null => {\n if (!viewItem.routeData?.childProps?.index) {\n return null;\n }\n\n // Prefer computing against the parent path when available to align with RRv6 semantics\n const relative = computeRelativeToParent(pathname, parentPath);\n if (relative !== null) {\n // Index routes match only when there is no remaining path\n if (relative === '' || relative === '/') {\n return createDefaultMatch(parentPath || pathname, viewItem.routeData.childProps);\n }\n return null;\n }\n\n // Fallback: use previously computed match base for equality check\n const previousMatch = viewItem.routeData?.match;\n if (!previousMatch) {\n return null;\n }\n\n const normalizedPathname = normalizePathnameForComparison(pathname);\n const normalizedBase = normalizePathnameForComparison(previousMatch.pathnameBase || previousMatch.pathname || '');\n\n return normalizedPathname === normalizedBase ? previousMatch : null;\n};\n\nexport class ReactRouterViewStack extends ViewStacks {\n constructor() {\n super();\n }\n\n /**\n * Creates a new view item for the given outlet and react route element.\n * Associates route props with the matched route path for further lookups.\n */\n createViewItem = (outletId: string, reactElement: React.ReactElement, routeInfo: RouteInfo, page?: HTMLElement) => {\n const routePath = reactElement.props.path || '';\n\n // Check if we already have a view item for this exact route that we can reuse\n // Include wildcard routes like tabs/* since they should be reused\n // Also check unmounted items that might have been preserved for browser navigation\n const existingViewItem = this.getViewItemsForOutlet(outletId).find((v) => {\n const existingRouteProps = v.reactElement?.props ?? {};\n const existingPath = existingRouteProps.path || '';\n const existingElement = existingRouteProps.element;\n const newElement = reactElement.props.element;\n const existingIsIndexRoute = !!existingRouteProps.index;\n const newIsIndexRoute = !!reactElement.props.index;\n\n // For Navigate components, match by destination\n const existingIsNavigate = React.isValidElement(existingElement) && existingElement.type === Navigate;\n const newIsNavigate = React.isValidElement(newElement) && newElement.type === Navigate;\n if (existingIsNavigate && newIsNavigate) {\n const existingTo = (existingElement.props as { to?: string })?.to;\n const newTo = (newElement.props as { to?: string })?.to;\n if (existingTo === newTo) {\n return true;\n }\n }\n\n if (existingIsIndexRoute && newIsIndexRoute) {\n return true;\n }\n\n // Reuse view items with the same path\n // Special case: reuse tabs/* and other specific wildcard routes\n // Don't reuse index routes (empty path) or generic catch-all wildcards (*)\n if (existingPath === routePath && existingPath !== '' && existingPath !== '*') {\n // Parameterized routes need pathname matching to ensure /details/1 and /details/2\n // get separate view items. For wildcard routes (e.g., user/:userId/*), compare\n // pathnameBase to allow child path changes while preserving the parent view.\n const hasParams = routePath.includes(':');\n const isWildcard = routePath.includes('*');\n if (hasParams) {\n if (isWildcard) {\n const existingPathnameBase = v.routeData?.match?.pathnameBase;\n const newMatch = matchComponent(reactElement, routeInfo.pathname, false);\n const newPathnameBase = newMatch?.pathnameBase;\n if (existingPathnameBase !== newPathnameBase) {\n return false;\n }\n } else {\n const existingPathname = v.routeData?.match?.pathname;\n if (existingPathname !== routeInfo.pathname) {\n return false;\n }\n }\n }\n return true;\n }\n // Also reuse specific wildcard routes like tabs/*\n if (existingPath === routePath && existingPath.endsWith('/*') && existingPath !== '/*') {\n return true;\n }\n return false;\n });\n\n if (existingViewItem) {\n // Update and ensure the existing view item is properly configured\n existingViewItem.reactElement = reactElement;\n existingViewItem.mount = true;\n existingViewItem.ionPageElement = page || existingViewItem.ionPageElement;\n const updatedMatch =\n matchComponent(reactElement, routeInfo.pathname, false) ||\n existingViewItem.routeData?.match ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n existingViewItem.routeData = {\n match: updatedMatch,\n childProps: reactElement.props,\n lastPathname: existingViewItem.routeData?.lastPathname, // Preserve navigation history\n };\n return existingViewItem;\n }\n\n const id = `${outletId}-${generateId(outletId)}`;\n\n const viewItem: ViewItem = {\n id,\n outletId,\n ionPageElement: page,\n reactElement,\n mount: true,\n ionRoute: true,\n };\n\n if (reactElement.type === IonRoute) {\n viewItem.disableIonPageManagement = reactElement.props.disableIonPageManagement;\n }\n\n const initialMatch =\n matchComponent(reactElement, routeInfo.pathname, true) ||\n createDefaultMatch(routeInfo.pathname, reactElement.props);\n\n viewItem.routeData = {\n match: initialMatch,\n childProps: reactElement.props,\n };\n\n this.add(viewItem);\n\n return viewItem;\n };\n\n /**\n * Renders a ViewLifeCycleManager for the given view item.\n * Handles cleanup if the view no longer matches.\n *\n * - Deactivates view if it no longer matches the current route\n * - Wraps the route element in <Routes> to support nested routing and ensure remounting\n * - Adds a unique key to <Routes> so React Router remounts routes when switching\n */\n private renderViewItem = (viewItem: ViewItem, routeInfo: RouteInfo, parentPath?: string) => {\n const routePath = viewItem.reactElement.props.path || '';\n let match = matchComponent(viewItem.reactElement, routeInfo.pathname);\n\n if (!match) {\n const indexMatch = resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath);\n if (indexMatch) {\n match = indexMatch;\n }\n }\n\n // For parameterized routes, check if this is a navigation to a different path instance\n // In that case, we should NOT reuse this view - a new view should be created\n const isParameterRoute = routePath.includes(':');\n const previousMatch = viewItem.routeData?.match;\n const isSamePath = match?.pathname === previousMatch?.pathname;\n\n // Flag to indicate this view should not be reused for this different parameterized path\n const shouldSkipForDifferentParam = isParameterRoute && match && previousMatch && !isSamePath;\n\n // Don't deactivate views automatically - let the StackManager handle view lifecycle\n // This preserves views in the stack for navigation history like native apps\n // Views will be hidden/shown by the StackManager's transition logic instead of being unmounted\n\n // Special handling for Navigate components - they should unmount after redirecting\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n if (isNavigateComponent) {\n // Navigate components should only be mounted when they match\n // Once they redirect (no longer match), they should be removed completely\n // IMPORTANT: For index routes, we need to check indexMatch too since matchComponent\n // may not properly match index routes without explicit parent path context\n const indexMatch = viewItem.routeData?.childProps?.index\n ? resolveIndexRouteMatch(viewItem, routeInfo.pathname, parentPath)\n : null;\n const hasValidMatch = match || indexMatch;\n\n if (!hasValidMatch && viewItem.mount) {\n viewItem.mount = false;\n // Schedule removal of the Navigate view item after a short delay\n // This ensures the redirect completes before removal\n setTimeout(() => {\n this.remove(viewItem);\n }, NAVIGATE_REDIRECT_DELAY_MS);\n }\n }\n\n // Components that don't have IonPage elements and no longer match should be cleaned up\n // BUT we need to be careful not to remove them if they're part of browser navigation history\n // This handles components that perform immediate actions like programmatic navigation\n // EXCEPTION: Navigate components should ALWAYS remain mounted until they redirect\n // since they need to be rendered to trigger the navigation\n if (!match && viewItem.mount && !viewItem.ionPageElement && !isNavigateComponent) {\n // Check if this view item should be preserved for browser navigation\n // We'll keep it if it was recently active (within the last navigation)\n const shouldPreserve =\n viewItem.routeData.lastPathname === routeInfo.pathname ||\n viewItem.routeData.match?.pathname === routeInfo.lastPathname;\n\n if (!shouldPreserve) {\n // This view item doesn't match and doesn't have an IonPage\n // It's likely a utility component that performs an action and navigates away\n viewItem.mount = false;\n // Schedule removal to allow it to be recreated on next navigation\n setTimeout(() => {\n // Double-check before removing - the view might be needed again\n const stillNotNeeded = !viewItem.mount && !viewItem.ionPageElement;\n if (stillNotNeeded) {\n this.remove(viewItem);\n }\n }, VIEW_CLEANUP_DELAY_MS);\n } else {\n // Preserve it but unmount it for now\n viewItem.mount = false;\n }\n }\n\n // Reactivate view if it matches but was previously deactivated\n // Don't reactivate if this is a parameterized route navigating to a different path instance\n if (match && !viewItem.mount && !shouldSkipForDifferentParam) {\n viewItem.mount = true;\n viewItem.routeData.match = match;\n }\n\n // Deactivate wildcard routes and catch-all routes (empty path) when we have specific route matches\n // This prevents \"Not found\" or fallback pages from showing alongside valid routes\n if (routePath === '*' || routePath === '') {\n // Check if any other view in this outlet has a match for the current route\n const hasSpecificMatch = this.getViewItemsForOutlet(viewItem.outletId).some((v) => {\n if (v.id === viewItem.id) return false; // Skip self\n const vRoutePath = v.reactElement?.props?.path || '';\n if (vRoutePath === '*' || vRoutePath === '') return false; // Skip other wildcard/empty routes\n\n // Check if this view item would match the current route\n const vMatch = v.reactElement ? matchComponent(v.reactElement, routeInfo.pathname) : null;\n return !!vMatch;\n });\n\n if (hasSpecificMatch) {\n viewItem.mount = false;\n if (viewItem.ionPageElement) {\n viewItem.ionPageElement.classList.add('ion-page-hidden');\n viewItem.ionPageElement.setAttribute('aria-hidden', 'true');\n }\n }\n }\n\n const routeElement = React.cloneElement(viewItem.reactElement);\n const componentElement = routeElement.props.element;\n // Don't update match for parameterized routes navigating to different path instances\n // This preserves the original match so that findViewItemByPath can correctly skip this view\n if (match && viewItem.routeData.match !== match && !shouldSkipForDifferentParam) {\n viewItem.routeData.match = match;\n }\n const routeMatch = shouldSkipForDifferentParam ? viewItem.routeData?.match : match || viewItem.routeData?.match;\n\n return (\n <RouteContext.Consumer key={`view-context-${viewItem.id}`}>\n {(parentContext) => {\n const parentMatches = (parentContext?.matches ?? []) as RouteContextMatch[];\n\n // Accumulate params from parent matches, with fallback to other outlets\n let accumulatedParentParams = parentMatches.reduce<RouteParams>((acc, m) => ({ ...acc, ...m.params }), {});\n if (parentMatches.length === 0 && Object.keys(accumulatedParentParams).length === 0) {\n accumulatedParentParams = getFallbackParamsFromViewItems(\n this.getAllViewItems(),\n viewItem.outletId,\n routeInfo.pathname\n );\n }\n\n const combinedParams = { ...accumulatedParentParams, ...(routeMatch?.params ?? {}) };\n const parentPathnameBase =\n parentMatches.length > 0 ? parentMatches[parentMatches.length - 1].pathnameBase : '/';\n const absolutePathnameBase = computeAbsolutePathnameBase(\n routeElement,\n routeMatch,\n parentPathnameBase,\n routeInfo.pathname\n );\n\n const contextMatches = buildContextMatches(\n parentMatches,\n combinedParams,\n routeMatch,\n routeInfo.pathname,\n absolutePathnameBase,\n viewItem,\n routeElement,\n componentElement\n );\n\n const routeContextValue = parentContext\n ? { ...parentContext, matches: contextMatches }\n : { outlet: null, matches: contextMatches, isDataRoute: false };\n\n return (\n <ViewLifeCycleManager\n key={`view-${viewItem.id}`}\n mount={viewItem.mount}\n removeView={() => this.remove(viewItem)}\n >\n <RouteContext.Provider value={routeContextValue}>{componentElement}</RouteContext.Provider>\n </ViewLifeCycleManager>\n );\n }}\n </RouteContext.Consumer>\n );\n };\n\n /**\n * Re-renders all active view items for the specified outlet.\n * Ensures React elements are updated with the latest match.\n *\n * 1. Iterates through children of IonRouterOutlet\n * 2. Updates each matching viewItem with the current child React element\n * (important for updating props or changes to elements)\n * 3. Returns a list of React components that will be rendered inside the outlet\n * Each view is wrapped in <ViewLifeCycleManager> to manage lifecycle and rendering\n */\n getChildrenToRender = (outletId: string, ionRouterOutlet: React.ReactElement, routeInfo: RouteInfo) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Determine parentPath for nested outlets to properly evaluate index routes\n let parentPath: string | undefined = undefined;\n try {\n // Only attempt parent path computation for non-root outlets\n // Root outlets have IDs like 'routerOutlet' or 'routerOutlet-2'\n const isRootOutlet = outletId.startsWith('routerOutlet');\n if (!isRootOutlet) {\n const routeChildren = extractRouteChildren(ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n if (hasRelativeRoutes || hasIndexRoute) {\n const result = computeParentPath({\n currentPathname: routeInfo.pathname,\n outletMountPath: undefined,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n parentPath = result.parentPath;\n }\n }\n } catch (e) {\n // Non-fatal: if we fail to compute parentPath, fall back to previous behavior\n }\n\n // Sync child elements with stored viewItems (e.g. to reflect new props)\n React.Children.forEach(ionRouterOutlet.props.children, (child: React.ReactElement) => {\n // Ensure the child is a valid React element since we\n // might have whitespace strings or other non-element children\n if (React.isValidElement(child)) {\n // Find view item by exact path match to avoid wildcard routes overwriting specific routes\n const childPath = (child.props as any).path;\n const viewItem = viewItems.find((v) => {\n const viewItemPath = v.reactElement?.props?.path;\n // Only update if paths match exactly (prevents wildcard routes from overwriting specific routes)\n return viewItemPath === childPath;\n });\n if (viewItem) {\n viewItem.reactElement = child;\n }\n }\n });\n\n // Filter out duplicate view items by ID (but keep all mounted items)\n const uniqueViewItems = viewItems.filter((viewItem, index, array) => {\n // Remove duplicates by ID (keep first occurrence)\n const isFirstOccurrence = array.findIndex((v) => v.id === viewItem.id) === index;\n return isFirstOccurrence;\n });\n\n // Filter out unmounted Navigate components to prevent them from being rendered\n // and triggering unwanted redirects\n const renderableViewItems = uniqueViewItems.filter((viewItem) => {\n const elementComponent = viewItem.reactElement?.props?.element;\n const isNavigateComponent = isNavigateElement(elementComponent);\n\n // Exclude unmounted Navigate components from rendering\n if (isNavigateComponent && !viewItem.mount) {\n return false;\n }\n\n // Filter out views that are unmounted, have no ionPageElement, and don't match the current route.\n // These are \"stale\" views from previous routes that should not be rendered.\n // Views WITH ionPageElement are handled by the normal lifecycle events.\n // Views that MATCH the current route should be kept (they might be transitioning).\n if (!viewItem.mount && !viewItem.ionPageElement) {\n // Check if this view's route path matches the current pathname\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n if (viewRoutePath) {\n // First try exact match using matchComponent\n const routeMatch = matchComponent(viewItem.reactElement, routeInfo.pathname);\n if (routeMatch) {\n // View matches current route, keep it\n return true;\n }\n\n // For parent routes (like /multiple-tabs or /routing), check if current pathname\n // starts with this route's path. This handles views with IonSplitPane/IonTabs\n // that don't have IonPage but should remain mounted while navigating within their children.\n const normalizedViewPath = normalizePathnameForComparison(viewRoutePath.replace(/\\/?\\*$/, '')); // Remove trailing wildcard\n const normalizedCurrentPath = normalizePathnameForComparison(routeInfo.pathname);\n\n // Check if current pathname is within this view's route hierarchy\n const isWithinRouteHierarchy =\n normalizedCurrentPath === normalizedViewPath || normalizedCurrentPath.startsWith(normalizedViewPath + '/');\n\n if (!isWithinRouteHierarchy) {\n // View is outside current route hierarchy, remove it\n setTimeout(() => {\n this.remove(viewItem);\n }, 0);\n return false;\n }\n }\n }\n\n return true;\n });\n\n const renderedItems = renderableViewItems.map((viewItem) => this.renderViewItem(viewItem, routeInfo, parentPath));\n return renderedItems;\n };\n\n /**\n * Finds a view item matching the current route, optionally updating its match state.\n */\n findViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, updateMatch?: boolean) => {\n const { viewItem, match } = this.findViewItemByPath(routeInfo.pathname, outletId);\n const shouldUpdateMatch = updateMatch === undefined || updateMatch === true;\n if (shouldUpdateMatch && viewItem && match) {\n viewItem.routeData.match = match;\n }\n return viewItem;\n };\n\n /**\n * Finds the view item that was previously active before a route change.\n */\n findLeavingViewItemByRouteInfo = (routeInfo: RouteInfo, outletId?: string, mustBeIonRoute = true) => {\n // If the lastPathname is not set, we cannot find a leaving view item\n if (!routeInfo.lastPathname) {\n return undefined;\n }\n\n const { viewItem } = this.findViewItemByPath(routeInfo.lastPathname, outletId, mustBeIonRoute);\n return viewItem;\n };\n\n /**\n * Finds a view item by pathname only, used in simpler queries.\n */\n findViewItemByPathname = (pathname: string, outletId?: string) => {\n const { viewItem } = this.findViewItemByPath(pathname, outletId);\n return viewItem;\n };\n\n /**\n * Core function that matches a given pathname against all view items.\n * Returns both the matched view item and match metadata.\n */\n private findViewItemByPath(pathname: string, outletId?: string, mustBeIonRoute?: boolean, allowDefaultMatch = true) {\n let viewItem: ViewItem | undefined;\n let match: PathMatch<string> | null = null;\n let viewStack: ViewItem[];\n\n if (outletId) {\n viewStack = sortViewsBySpecificity(this.getViewItemsForOutlet(outletId));\n viewStack.some(matchView);\n if (!viewItem && allowDefaultMatch) viewStack.some(matchDefaultRoute);\n } else {\n const viewItems = sortViewsBySpecificity(this.getAllViewItems());\n viewItems.some(matchView);\n if (!viewItem && allowDefaultMatch) viewItems.some(matchDefaultRoute);\n }\n\n // If we still have not found a view item for this outlet, try to find a matching\n // view item across all outlets and adopt it into the current outlet. This helps\n // recover when an outlet remounts and receives a new id, leaving views associated\n // with the previous outlet id.\n // Do not adopt across outlets; if we didn't find a view for this outlet,\n // defer to route matching to create a new one.\n\n return { viewItem, match };\n\n /**\n * Matches a route path with dynamic parameters (e.g. /tabs/:id)\n */\n function matchView(v: ViewItem) {\n if (mustBeIonRoute && !v.ionRoute) return false;\n\n const viewItemPath = v.routeData.childProps.path || '';\n const isIndexRoute = !!v.routeData.childProps.index;\n const previousMatch = v.routeData?.match;\n const result = v.reactElement ? matchComponent(v.reactElement, pathname) : null;\n\n if (!result) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n }\n\n if (result) {\n const hasParams = result.params && Object.keys(result.params).length > 0;\n const isSamePath = result.pathname === previousMatch?.pathname;\n const isWildcardRoute = viewItemPath.includes('*');\n const isParameterRoute = viewItemPath.includes(':');\n\n // Don't allow view items with undefined paths to match specific routes\n // This prevents broken index route view items from interfering with navigation\n if (!viewItemPath && !isIndexRoute && pathname !== '/' && pathname !== '') {\n return false;\n }\n\n // For parameterized routes, check if we should reuse the view item.\n // Wildcard routes (e.g., user/:userId/*) compare pathnameBase to allow\n // child path changes while preserving the parent view.\n if (isParameterRoute && !isSamePath) {\n if (isWildcardRoute) {\n const isSameBase = result.pathnameBase === previousMatch?.pathnameBase;\n if (isSameBase) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n return false;\n }\n\n // For routes without params, or when navigating to the exact same path,\n // or when there's no previous match, reuse the view item\n if (!hasParams || isSamePath || !previousMatch) {\n match = result;\n viewItem = v;\n return true;\n }\n\n // For wildcard routes (without params), only reuse if the pathname exactly matches\n if (isWildcardRoute && isSamePath) {\n match = result;\n viewItem = v;\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Matches a view with no path prop (default fallback route) or index route.\n */\n function matchDefaultRoute(v: ViewItem): boolean {\n const childProps = v.routeData.childProps;\n\n const isDefaultRoute = childProps.path === undefined || childProps.path === '';\n const isIndexRoute = !!childProps.index;\n\n if (isIndexRoute) {\n const indexMatch = resolveIndexRouteMatch(v, pathname, undefined);\n if (indexMatch) {\n match = indexMatch;\n viewItem = v;\n return true;\n }\n return false;\n }\n\n // For empty path routes, only match if we're at the same level as when the view was created.\n // This prevents an empty path view item from being reused for different routes.\n if (isDefaultRoute) {\n const previousPathnameBase = v.routeData?.match?.pathnameBase || '';\n const normalizedBase = normalizePathnameForComparison(previousPathnameBase);\n const normalizedPathname = normalizePathnameForComparison(pathname);\n\n if (normalizedPathname !== normalizedBase) {\n return false;\n }\n\n match = {\n params: {},\n pathname,\n pathnameBase: pathname === '' ? '/' : pathname,\n pattern: {\n path: '',\n caseSensitive: childProps.caseSensitive ?? false,\n end: true,\n },\n };\n viewItem = v;\n return true;\n }\n\n return false;\n }\n }\n\n /**\n * Clean up old, unmounted view items to prevent memory leaks\n */\n private cleanupStaleViewItems = (outletId: string) => {\n const viewItems = this.getViewItemsForOutlet(outletId);\n\n // Keep only the most recent mounted views and a few unmounted ones for history\n const maxUnmountedItems = 3;\n const unmountedItems = viewItems.filter((v) => !v.mount);\n\n if (unmountedItems.length > maxUnmountedItems) {\n // Remove oldest unmounted items\n const itemsToRemove = unmountedItems.slice(0, unmountedItems.length - maxUnmountedItems);\n itemsToRemove.forEach((item) => {\n this.remove(item);\n });\n }\n };\n\n /**\n * Override add to prevent duplicate view items with the same ID in the same outlet\n * But allow multiple view items for the same route path (for navigation history)\n */\n add = (viewItem: ViewItem) => {\n const existingViewItem = this.getViewItemsForOutlet(viewItem.outletId).find((v) => v.id === viewItem.id);\n\n if (existingViewItem) {\n return;\n }\n\n super.add(viewItem);\n\n this.cleanupStaleViewItems(viewItem.outletId);\n };\n\n /**\n * Override remove\n */\n remove = (viewItem: ViewItem) => {\n super.remove(viewItem);\n };\n}\n\n/**\n * Utility to apply matchPath to a React element and return its match state.\n */\nfunction matchComponent(node: React.ReactElement, pathname: string, allowFallback = false) {\n const routeProps = node?.props ?? {};\n const routePath: string | undefined = routeProps.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n const match = matchPath({\n pathname: pathnameToMatch,\n componentProps: routeProps,\n });\n\n if (match || !allowFallback) {\n return match;\n }\n\n const isIndexRoute = !!routeProps.index;\n\n if (isIndexRoute) {\n return createDefaultMatch(pathname, routeProps);\n }\n\n if (!routePath || routePath === '') {\n return createDefaultMatch(pathname, routeProps);\n }\n\n return null;\n}\n","export function clonePageElement(leavingViewHtml: string | HTMLElement) {\n let html: string;\n if (typeof leavingViewHtml === 'string') {\n html = leavingViewHtml;\n } else {\n html = leavingViewHtml.outerHTML;\n }\n if (document) {\n const newEl = document.createElement('div');\n newEl.innerHTML = html;\n newEl.style.zIndex = '';\n // Remove an existing back button so the new element doesn't get two of them\n const ionBackButton = newEl.getElementsByTagName('ion-back-button');\n if (ionBackButton[0]) {\n ionBackButton[0].remove();\n }\n return newEl.firstChild as HTMLElement;\n }\n return undefined;\n}\n","/**\n * `StackManager` is responsible for managing page transitions, keeping track\n * of views (pages), and ensuring that navigation behaves like native apps —\n * particularly with animations and swipe gestures.\n */\n\nimport type { RouteInfo, StackContextState, ViewItem } from '@ionic/react';\nimport { RouteManagerContext, StackContext, generateId, getConfig } from '@ionic/react';\nimport React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport { clonePageElement } from './clonePageElement';\nimport { analyzeRouteChildren, computeCommonPrefix, computeParentPath } from './utils/computeParentPath';\nimport { derivePathnameToMatch, matchPath } from './utils/pathMatching';\nimport { stripTrailingSlash } from './utils/pathNormalization';\nimport { extractRouteChildren, getRoutesChildren, isNavigateElement } from './utils/routeElements';\n\n/**\n * Delay in milliseconds before unmounting a view after a transition completes.\n * This ensures the page transition animation finishes before the view is removed.\n */\nconst VIEW_UNMOUNT_DELAY_MS = 250;\n\n/**\n * Delay in milliseconds to wait for an IonPage element to be mounted before\n * proceeding with a page transition.\n */\nconst ION_PAGE_WAIT_TIMEOUT_MS = 50;\n\ninterface StackManagerProps {\n routeInfo: RouteInfo;\n id?: string;\n}\n\nconst isViewVisible = (el: HTMLElement) =>\n !el.classList.contains('ion-page-invisible') && !el.classList.contains('ion-page-hidden');\n\nconst hideIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.add('ion-page-hidden');\n element.setAttribute('aria-hidden', 'true');\n }\n};\n\nconst showIonPageElement = (element: HTMLElement | undefined): void => {\n if (element) {\n element.classList.remove('ion-page-hidden');\n element.removeAttribute('aria-hidden');\n }\n};\n\nexport class StackManager extends React.PureComponent<StackManagerProps> {\n id: string; // Unique id for the router outlet aka outletId\n context!: React.ContextType<typeof RouteManagerContext>;\n ionRouterOutlet?: React.ReactElement;\n routerOutletElement: HTMLIonRouterOutletElement | undefined;\n prevProps?: StackManagerProps;\n skipTransition: boolean;\n\n stackContextValue: StackContextState = {\n registerIonPage: this.registerIonPage.bind(this),\n isInOutlet: () => true,\n };\n\n private clearOutletTimeout: any;\n private pendingPageTransition = false;\n private waitingForIonPage = false;\n private ionPageWaitTimeout?: ReturnType<typeof setTimeout>;\n private outOfScopeUnmountTimeout?: ReturnType<typeof setTimeout>;\n /**\n * Track the last transition's entering and leaving view IDs to prevent\n * duplicate transitions during rapid navigation (e.g., Navigate redirects)\n */\n private lastTransition?: { enteringId: string; leavingId?: string };\n\n constructor(props: StackManagerProps) {\n super(props);\n this.registerIonPage = this.registerIonPage.bind(this);\n this.transitionPage = this.transitionPage.bind(this);\n this.handlePageTransition = this.handlePageTransition.bind(this);\n this.id = props.id || `routerOutlet-${generateId('routerOutlet')}`;\n this.prevProps = undefined;\n this.skipTransition = false;\n }\n\n private outletMountPath: string | undefined = undefined;\n\n /**\n * Determines the parent path for nested routing in React Router 6.\n * Priority: specific routes > wildcard routes > index routes (only at mount point)\n */\n private getParentPath(): string | undefined {\n const currentPathname = this.props.routeInfo.pathname;\n\n // Prevent out-of-scope outlets from adopting unrelated routes\n if (this.outletMountPath && !currentPathname.startsWith(this.outletMountPath)) {\n return undefined;\n }\n\n if (this.ionRouterOutlet) {\n const routeChildren = extractRouteChildren(this.ionRouterOutlet.props.children);\n const { hasRelativeRoutes, hasIndexRoute, hasWildcardRoute } = analyzeRouteChildren(routeChildren);\n\n const isRootOutlet = this.id.startsWith('routerOutlet');\n const needsParentPath = !isRootOutlet || hasRelativeRoutes || hasIndexRoute;\n\n if (needsParentPath) {\n const result = computeParentPath({\n currentPathname,\n outletMountPath: this.outletMountPath,\n routeChildren,\n hasRelativeRoutes,\n hasIndexRoute,\n hasWildcardRoute,\n });\n\n if (result.outletMountPath && !this.outletMountPath) {\n this.outletMountPath = result.outletMountPath;\n }\n\n return result.parentPath;\n }\n }\n\n return this.outletMountPath;\n }\n\n /**\n * Finds the entering and leaving view items, handling redirect cases.\n */\n private findViewItems(routeInfo: RouteInfo): {\n enteringViewItem: ViewItem | undefined;\n leavingViewItem: ViewItem | undefined;\n } {\n const enteringViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n let leavingViewItem = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id);\n\n // Try to find leaving view by previous pathname\n if (!leavingViewItem && routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n }\n\n // For redirects where entering === leaving, find the actual previous view\n if (\n enteringViewItem &&\n leavingViewItem &&\n enteringViewItem === leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n // Handle redirect scenario with no leaving view\n if (\n enteringViewItem &&\n !leavingViewItem &&\n routeInfo.routeAction === 'replace' &&\n routeInfo.prevRouteLastPathname\n ) {\n const actualLeavingView = this.context.findViewItemByPathname(routeInfo.prevRouteLastPathname, this.id);\n if (actualLeavingView && actualLeavingView !== enteringViewItem) {\n leavingViewItem = actualLeavingView;\n }\n }\n\n return { enteringViewItem, leavingViewItem };\n }\n\n private shouldUnmountLeavingView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n if (!leavingViewItem) {\n return false;\n }\n\n if (routeInfo.routeAction === 'replace') {\n const enteringRoutePath = enteringViewItem?.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem?.reactElement?.props?.path as string | undefined;\n\n // Never unmount root path - needed for back navigation\n if (leavingRoutePath === '/' || leavingRoutePath === '') {\n return false;\n }\n\n if (enteringRoutePath && leavingRoutePath) {\n const getParentPath = (path: string) => {\n const normalized = path.replace(/\\/\\*$/, '');\n const lastSlash = normalized.lastIndexOf('/');\n return lastSlash > 0 ? normalized.substring(0, lastSlash) : '/';\n };\n\n const enteringParent = getParentPath(enteringRoutePath);\n const leavingParent = getParentPath(leavingRoutePath);\n\n // Unmount if routes are siblings or entering is a child of leaving (redirect)\n const areSiblings = enteringParent === leavingParent && enteringParent !== '/';\n const isChildRedirect =\n enteringRoutePath.startsWith(leavingRoutePath) ||\n (leavingRoutePath.endsWith('/*') && enteringRoutePath.startsWith(leavingRoutePath.slice(0, -2)));\n\n return areSiblings || isChildRedirect;\n }\n\n return false;\n }\n\n // For non-replace actions, only unmount for back navigation\n const isForwardPush = routeInfo.routeAction === 'push' && (routeInfo as any).routeDirection === 'forward';\n if (!isForwardPush && routeInfo.routeDirection !== 'none' && enteringViewItem !== leavingViewItem) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles out-of-scope outlet. Returns true if transition should be aborted.\n */\n private handleOutOfScopeOutlet(routeInfo: RouteInfo): boolean {\n if (!this.outletMountPath || routeInfo.pathname.startsWith(this.outletMountPath)) {\n return false;\n }\n\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n this.context.unMountViewItem(viewItem);\n });\n\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles nested outlet with relative routes but no parent path. Returns true to abort.\n */\n private handleOutOfContextNestedOutlet(\n parentPath: string | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n const isRootOutlet = this.id.startsWith('routerOutlet');\n if (isRootOutlet || parentPath !== undefined || !this.ionRouterOutlet) {\n return false;\n }\n\n const routesChildren =\n getRoutesChildren(this.ionRouterOutlet.props.children) ?? this.ionRouterOutlet.props.children;\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n const hasRelativeRoutes = routeChildren.some((route) => {\n const path = route.props.path;\n return path && !path.startsWith('/') && path !== '*';\n });\n\n if (hasRelativeRoutes) {\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles nested outlet with no matching route. Returns true to abort.\n */\n private handleNoMatchingRoute(\n enteringRoute: React.ReactElement | undefined,\n enteringViewItem: ViewItem | undefined,\n leavingViewItem: ViewItem | undefined\n ): boolean {\n const isRootOutlet = this.id.startsWith('routerOutlet');\n if (isRootOutlet || enteringRoute || enteringViewItem) {\n return false;\n }\n\n hideIonPageElement(leavingViewItem?.ionPageElement);\n if (leavingViewItem) {\n leavingViewItem.mount = false;\n }\n this.forceUpdate();\n return true;\n }\n\n /**\n * Handles transition when entering view has ion-page element ready.\n */\n private handleReadyEnteringView(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n // Handle parameterized route changes (same view, different params)\n if (enteringViewItem === leavingViewItem) {\n const routePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const isParameterizedRoute = routePath ? routePath.includes(':') : false;\n\n if (isParameterizedRoute) {\n const updatedMatch = matchComponent(enteringViewItem.reactElement, routeInfo.pathname, true);\n if (updatedMatch) {\n enteringViewItem.routeData.match = updatedMatch;\n }\n\n const enteringEl = enteringViewItem.ionPageElement;\n if (enteringEl) {\n enteringEl.classList.remove('ion-page-hidden', 'ion-page-invisible');\n enteringEl.removeAttribute('aria-hidden');\n }\n\n this.forceUpdate();\n return;\n }\n }\n\n if (!leavingViewItem && this.props.routeInfo.prevRouteLastPathname) {\n leavingViewItem = this.context.findViewItemByPathname(this.props.routeInfo.prevRouteLastPathname, this.id);\n }\n\n // Re-mount views that were previously unmounted (e.g., navigating back to home)\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n\n // Check visibility state BEFORE showing entering view\n const enteringWasVisible = enteringViewItem.ionPageElement && isViewVisible(enteringViewItem.ionPageElement);\n const leavingIsHidden =\n leavingViewItem !== undefined && leavingViewItem.ionPageElement && !isViewVisible(leavingViewItem.ionPageElement);\n\n const currentTransition = {\n enteringId: enteringViewItem.id,\n leavingId: leavingViewItem?.id,\n };\n\n const isDuplicateTransition =\n leavingViewItem &&\n this.lastTransition &&\n this.lastTransition.leavingId &&\n this.lastTransition.enteringId === currentTransition.enteringId &&\n this.lastTransition.leavingId === currentTransition.leavingId;\n\n // Skip if transition already performed (e.g., via swipe gesture)\n if (enteringWasVisible && leavingIsHidden && isDuplicateTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Trigger ionViewDidLeave lifecycle for ViewLifeCycleManager cleanup\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n showIonPageElement(enteringViewItem.ionPageElement);\n\n // Handle duplicate transition or swipe gesture completion\n if (isDuplicateTransition || this.skipTransition) {\n if (\n this.skipTransition &&\n shouldUnmountLeavingViewItem &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem\n ) {\n leavingViewItem.mount = false;\n // Re-fire ionViewDidLeave since gesture completed before mount=false was set\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back');\n }\n this.skipTransition = false;\n this.forceUpdate();\n return;\n }\n\n this.lastTransition = currentTransition;\n\n this.transitionPage(routeInfo, enteringViewItem, leavingViewItem);\n\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n this.handleLeavingViewUnmount(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n // Clean up orphaned sibling views after replace actions (redirects)\n this.cleanupOrphanedSiblingViews(routeInfo, enteringViewItem, leavingViewItem);\n }\n\n /**\n * Handles leaving view unmount for replace actions.\n */\n private handleLeavingViewUnmount(routeInfo: RouteInfo, enteringViewItem: ViewItem, leavingViewItem: ViewItem): void {\n if (!leavingViewItem.ionPageElement) {\n return;\n }\n\n // Only replace actions unmount views; push/pop cache for navigation history\n if (routeInfo.routeAction !== 'replace') {\n return;\n }\n\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n const leavingRoutePath = leavingViewItem.reactElement?.props?.path as string | undefined;\n const isEnteringContainerRoute = enteringRoutePath && enteringRoutePath.endsWith('/*');\n const isLeavingSpecificRoute =\n leavingRoutePath &&\n leavingRoutePath !== '' &&\n leavingRoutePath !== '*' &&\n !leavingRoutePath.endsWith('/*') &&\n !leavingViewItem.reactElement?.props?.index;\n\n // Skip removal for container-to-container transitions (e.g., /tabs/* → /settings/*).\n // These routes manage their own nested outlets; unmounting would disrupt child views.\n if (isEnteringContainerRoute && !isLeavingSpecificRoute) {\n return;\n }\n\n const viewToUnmount = leavingViewItem;\n setTimeout(() => {\n this.context.unMountViewItem(viewToUnmount);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Cleans up orphaned sibling views after replace actions or push-to-container navigations.\n */\n private cleanupOrphanedSiblingViews(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined\n ): void {\n const enteringRoutePath = enteringViewItem.reactElement?.props?.path as string | undefined;\n if (!enteringRoutePath) {\n return;\n }\n\n const leavingRoutePath = leavingViewItem?.reactElement?.props?.path as string | undefined;\n const isContainerRoute = (path: string | undefined) => path?.endsWith('/*');\n\n const isReplaceAction = routeInfo.routeAction === 'replace';\n const isPushToContainer =\n routeInfo.routeAction === 'push' && routeInfo.routeDirection === 'none' && isContainerRoute(enteringRoutePath);\n\n if (!isReplaceAction && !isPushToContainer) {\n return;\n }\n\n // Skip cleanup for tab switches\n const isSameView = enteringViewItem === leavingViewItem;\n const isSameContainerRoute = isContainerRoute(enteringRoutePath) && leavingRoutePath === enteringRoutePath;\n const isNavigatingWithinContainer =\n isPushToContainer &&\n !leavingViewItem &&\n routeInfo.prevRouteLastPathname?.startsWith(enteringRoutePath.replace(/\\/\\*$/, ''));\n\n if (isSameView || isSameContainerRoute || isNavigatingWithinContainer) {\n return;\n }\n\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n\n const areSiblingRoutes = (path1: string, path2: string): boolean => {\n const path1IsRelative = !path1.startsWith('/');\n const path2IsRelative = !path2.startsWith('/');\n\n if (path1IsRelative && path2IsRelative) {\n const path1Depth = path1.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n const path2Depth = path2.replace(/\\/\\*$/, '').split('/').filter(Boolean).length;\n return path1Depth === path2Depth && path1Depth <= 1;\n }\n\n const getParent = (path: string) => {\n const normalized = path.replace(/\\/\\*$/, '');\n const lastSlash = normalized.lastIndexOf('/');\n return lastSlash > 0 ? normalized.substring(0, lastSlash) : '/';\n };\n\n return getParent(path1) === getParent(path2);\n };\n\n for (const viewItem of allViewsInOutlet) {\n const viewRoutePath = viewItem.reactElement?.props?.path as string | undefined;\n\n const shouldSkip =\n viewItem.id === enteringViewItem.id ||\n (leavingViewItem && viewItem.id === leavingViewItem.id) ||\n !viewItem.mount ||\n !viewRoutePath ||\n (viewRoutePath.endsWith('/*') && enteringRoutePath.endsWith('/*'));\n\n if (shouldSkip) {\n continue;\n }\n\n if (areSiblingRoutes(enteringRoutePath, viewRoutePath)) {\n hideIonPageElement(viewItem.ionPageElement);\n viewItem.mount = false;\n\n const viewToRemove = viewItem;\n setTimeout(() => {\n this.context.unMountViewItem(viewToRemove);\n this.forceUpdate();\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n }\n }\n\n /**\n * Handles entering view with no ion-page element yet (waiting for render).\n */\n private handleWaitingForIonPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem: ViewItem | undefined,\n shouldUnmountLeavingViewItem: boolean\n ): void {\n const enteringRouteElement = enteringViewItem.reactElement?.props?.element;\n\n // Handle Navigate components (they never render an IonPage)\n if (isNavigateElement(enteringRouteElement)) {\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n // Hide the leaving view immediately for Navigate redirects\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n // Don't unmount if entering and leaving are the same view item\n if (shouldUnmountLeavingViewItem && leavingViewItem && enteringViewItem !== leavingViewItem) {\n leavingViewItem.mount = false;\n }\n\n this.forceUpdate();\n return;\n }\n\n // Hide leaving view while we wait for the entering view's IonPage to mount\n hideIonPageElement(leavingViewItem?.ionPageElement);\n\n this.waitingForIonPage = true;\n\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n }\n\n this.ionPageWaitTimeout = setTimeout(() => {\n this.ionPageWaitTimeout = undefined;\n\n if (!this.waitingForIonPage) {\n return;\n }\n this.waitingForIonPage = false;\n\n const latestEnteringView = this.context.findViewItemByRouteInfo(routeInfo, this.id) ?? enteringViewItem;\n const latestLeavingView = this.context.findLeavingViewItemByRouteInfo(routeInfo, this.id) ?? leavingViewItem;\n\n if (latestEnteringView?.ionPageElement) {\n this.transitionPage(routeInfo, latestEnteringView, latestLeavingView ?? undefined);\n\n if (shouldUnmountLeavingViewItem && latestLeavingView && latestEnteringView !== latestLeavingView) {\n latestLeavingView.mount = false;\n // Call handleLeavingViewUnmount to ensure the view is properly removed\n this.handleLeavingViewUnmount(routeInfo, latestEnteringView, latestLeavingView);\n }\n\n this.forceUpdate();\n }\n }, ION_PAGE_WAIT_TIMEOUT_MS);\n\n this.forceUpdate();\n }\n\n /**\n * Gets the route info to use for finding views during swipe-to-go-back gestures.\n * This pattern is used in multiple places in setupRouterOutlet.\n */\n private getSwipeBackRouteInfo(): RouteInfo {\n const { routeInfo } = this.props;\n return this.prevProps && this.prevProps.routeInfo.pathname === routeInfo.pushedByRoute\n ? this.prevProps.routeInfo\n : ({ pathname: routeInfo.pushedByRoute || '' } as RouteInfo);\n }\n\n componentDidMount() {\n if (this.clearOutletTimeout) {\n /**\n * The clearOutlet integration with React Router is a bit hacky.\n * It uses a timeout to clear the outlet after a transition.\n * In React v18, components are mounted and unmounted in development mode\n * to check for side effects.\n *\n * This clearTimeout prevents the outlet from being cleared when the component is re-mounted,\n * which should only happen in development mode and as a result of a hot reload.\n */\n clearTimeout(this.clearOutletTimeout);\n }\n if (this.routerOutletElement) {\n this.setupRouterOutlet(this.routerOutletElement);\n this.handlePageTransition(this.props.routeInfo);\n }\n }\n\n componentDidUpdate(prevProps: StackManagerProps) {\n const { pathname } = this.props.routeInfo;\n const { pathname: prevPathname } = prevProps.routeInfo;\n\n if (pathname !== prevPathname) {\n this.prevProps = prevProps;\n this.handlePageTransition(this.props.routeInfo);\n } else if (this.pendingPageTransition) {\n this.handlePageTransition(this.props.routeInfo);\n this.pendingPageTransition = false;\n }\n }\n\n componentWillUnmount() {\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n this.waitingForIonPage = false;\n\n // Hide all views in this outlet before clearing.\n // This is critical for nested outlets - when the parent component unmounts,\n // the nested outlet's componentDidUpdate won't be called, so we must hide\n // the ion-page elements here to prevent them from remaining visible on top\n // of other content after navigation to a different route.\n const allViewsInOutlet = this.context.getViewItemsForOutlet ? this.context.getViewItemsForOutlet(this.id) : [];\n allViewsInOutlet.forEach((viewItem) => {\n hideIonPageElement(viewItem.ionPageElement);\n });\n\n this.clearOutletTimeout = this.context.clearOutlet(this.id);\n }\n\n /**\n * Sets the transition between pages within this router outlet.\n * This function determines the entering and leaving views based on the\n * provided route information and triggers the appropriate animation.\n * It also handles scenarios like initial loads, back navigation, and\n * navigation to the same view with different parameters.\n *\n * @param routeInfo It contains info about the current route,\n * the previous route, and the action taken (e.g., push, replace).\n *\n * @returns A promise that resolves when the transition is complete.\n * If no transition is needed or if the router outlet isn't ready,\n * the Promise may resolve immediately.\n */\n async handlePageTransition(routeInfo: RouteInfo) {\n // Wait for router outlet to mount\n if (!this.routerOutletElement || !this.routerOutletElement.commit) {\n this.pendingPageTransition = true;\n return;\n }\n\n // Find entering and leaving view items\n const viewItems = this.findViewItems(routeInfo);\n let enteringViewItem = viewItems.enteringViewItem;\n const leavingViewItem = viewItems.leavingViewItem;\n const shouldUnmountLeavingViewItem = this.shouldUnmountLeavingView(routeInfo, enteringViewItem, leavingViewItem);\n\n // Get parent path for nested outlets\n const parentPath = this.getParentPath();\n\n // Handle out-of-scope outlet (route outside mount path)\n if (this.handleOutOfScopeOutlet(routeInfo)) {\n return;\n }\n\n // Clear any pending out-of-scope unmount timeout\n if (this.outOfScopeUnmountTimeout) {\n clearTimeout(this.outOfScopeUnmountTimeout);\n this.outOfScopeUnmountTimeout = undefined;\n }\n\n // Handle nested outlet with relative routes but no valid parent path\n if (this.handleOutOfContextNestedOutlet(parentPath, leavingViewItem)) {\n return;\n }\n\n // Find the matching route element\n const enteringRoute = findRouteByRouteInfo(\n this.ionRouterOutlet?.props.children,\n routeInfo,\n parentPath\n ) as React.ReactElement;\n\n // Handle nested outlet with no matching route\n if (this.handleNoMatchingRoute(enteringRoute, enteringViewItem, leavingViewItem)) {\n return;\n }\n\n // Create or update the entering view item\n if (enteringViewItem && enteringRoute) {\n enteringViewItem.reactElement = enteringRoute;\n } else if (enteringRoute) {\n enteringViewItem = this.context.createViewItem(this.id, enteringRoute, routeInfo);\n this.context.addViewItem(enteringViewItem);\n }\n\n // Handle transition based on ion-page element availability\n // Check if the ionPageElement is still in the document.\n // If the view was previously unmounted (mount=false), the ViewLifeCycleManager\n // removes the React component from the tree, which removes the IonPage from the DOM.\n // The ionPageElement reference becomes stale and we need to wait for a new one.\n const ionPageIsInDocument =\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement);\n\n if (enteringViewItem && ionPageIsInDocument) {\n // Clear waiting state\n if (this.waitingForIonPage) {\n this.waitingForIonPage = false;\n }\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n\n this.handleReadyEnteringView(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n } else if (enteringViewItem && !ionPageIsInDocument) {\n // Wait for ion-page to mount\n // This handles both: no ionPageElement, or stale ionPageElement (not in document)\n // Clear stale reference if the element is no longer in the document\n if (enteringViewItem.ionPageElement && !document.body.contains(enteringViewItem.ionPageElement)) {\n enteringViewItem.ionPageElement = undefined;\n }\n // Ensure the view is marked as mounted so ViewLifeCycleManager renders the IonPage\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n this.handleWaitingForIonPage(routeInfo, enteringViewItem, leavingViewItem, shouldUnmountLeavingViewItem);\n return;\n } else if (!enteringViewItem && !enteringRoute) {\n // No view or route found - likely leaving to another outlet\n if (leavingViewItem) {\n hideIonPageElement(leavingViewItem.ionPageElement);\n if (shouldUnmountLeavingViewItem) {\n leavingViewItem.mount = false;\n }\n }\n }\n\n this.forceUpdate();\n }\n\n /**\n * Registers an `<IonPage>` DOM element with the `StackManager`.\n * This is called when `<IonPage>` has been mounted.\n *\n * @param page The element of the rendered `<IonPage>`.\n * @param routeInfo The route information that associates with `<IonPage>`.\n */\n registerIonPage(page: HTMLElement, routeInfo: RouteInfo) {\n /**\n * DO NOT remove ion-page-invisible here.\n *\n * PageManager.componentDidMount adds ion-page-invisible before calling registerIonPage.\n * At this point, the <IonPage> div exists but its CHILDREN (header, toolbar, menu-button)\n * have NOT rendered yet. If we remove ion-page-invisible now, the page becomes visible\n * with empty/incomplete content, causing a flicker (especially for ion-menu-button which\n * starts with menu-button-hidden class).\n *\n * Instead, let transitionPage handle visibility AFTER waiting for components to be ready.\n * This ensures the page only becomes visible when its content is fully rendered.\n */\n this.waitingForIonPage = false;\n if (this.ionPageWaitTimeout) {\n clearTimeout(this.ionPageWaitTimeout);\n this.ionPageWaitTimeout = undefined;\n }\n this.pendingPageTransition = false;\n\n const foundView = this.context.findViewItemByRouteInfo(routeInfo, this.id);\n\n if (foundView) {\n const oldPageElement = foundView.ionPageElement;\n\n /**\n * FIX for issue #28878: Reject orphaned IonPage registrations.\n *\n * When a component conditionally renders different IonPages (e.g., list vs empty state)\n * using React keys, and state changes simultaneously with navigation, the new IonPage\n * tries to register for a route we're navigating away from. This creates a stale view.\n *\n * Only reject if both pageIds exist and differ, to allow nested outlet registrations.\n */\n if (this.shouldRejectOrphanedPage(page, oldPageElement, routeInfo)) {\n this.hideAndRemoveOrphanedPage(page);\n return;\n }\n\n foundView.ionPageElement = page;\n foundView.ionRoute = true;\n\n /**\n * React 18 will unmount and remount IonPage\n * elements in development mode when using createRoot.\n * This can cause duplicate page transitions to occur.\n */\n if (oldPageElement === page) {\n return;\n }\n }\n this.handlePageTransition(routeInfo);\n }\n\n /**\n * Checks if a new IonPage should be rejected (component re-rendered while navigating away).\n */\n private shouldRejectOrphanedPage(\n newPage: HTMLElement,\n oldPageElement: HTMLElement | undefined,\n routeInfo: RouteInfo\n ): boolean {\n if (!oldPageElement || oldPageElement === newPage) {\n return false;\n }\n\n const newPageId = newPage.getAttribute('data-pageid');\n const oldPageId = oldPageElement.getAttribute('data-pageid');\n\n if (!newPageId || !oldPageId || newPageId === oldPageId) {\n return false;\n }\n\n return this.props.routeInfo.pathname !== routeInfo.pathname;\n }\n\n private hideAndRemoveOrphanedPage(page: HTMLElement): void {\n page.classList.add('ion-page-hidden');\n page.setAttribute('aria-hidden', 'true');\n\n setTimeout(() => {\n if (page.parentElement) {\n page.remove();\n }\n }, VIEW_UNMOUNT_DELAY_MS);\n }\n\n /**\n * Configures swipe-to-go-back gesture for the router outlet.\n */\n async setupRouterOutlet(routerOutlet: HTMLIonRouterOutletElement) {\n const canStart = () => {\n const config = getConfig();\n const swipeEnabled = config && config.get('swipeBackEnabled', routerOutlet.mode === 'ios');\n if (!swipeEnabled) {\n return false;\n }\n\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n\n // View might have mount=false but ionPageElement still in DOM\n const ionPageInDocument = Boolean(\n enteringViewItem?.ionPageElement && document.body.contains(enteringViewItem.ionPageElement)\n );\n\n const canStartSwipe =\n !!enteringViewItem &&\n (enteringViewItem.mount || ionPageInDocument) &&\n enteringViewItem.routeData.match.pattern.path !== routeInfo.pathname;\n\n return canStartSwipe;\n };\n\n const onStart = async () => {\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n // First try to find the view in the current outlet, then search all outlets\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Ensure the entering view is mounted so React keeps rendering it during the gesture.\n // This is important when the view was previously marked for unmount but its\n // ionPageElement is still in the DOM.\n if (enteringViewItem && !enteringViewItem.mount) {\n enteringViewItem.mount = true;\n }\n\n // When the gesture starts, kick off a transition controlled via swipe gesture\n if (enteringViewItem && leavingViewItem) {\n await this.transitionPage(routeInfo, enteringViewItem, leavingViewItem, 'back', true);\n }\n\n return Promise.resolve();\n };\n\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n // User finished the swipe gesture, so complete the back navigation\n this.skipTransition = true;\n this.context.goBack();\n } else {\n // Swipe gesture was aborted - re-hide the page that was going to enter\n const { routeInfo } = this.props;\n const swipeBackRouteInfo = this.getSwipeBackRouteInfo();\n // First try to find the view in the current outlet, then search all outlets\n let enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, this.id, false);\n if (!enteringViewItem) {\n enteringViewItem = this.context.findViewItemByRouteInfo(swipeBackRouteInfo, undefined, false);\n }\n const leavingViewItem = this.context.findViewItemByRouteInfo(routeInfo, this.id, false);\n\n // Don't hide if entering and leaving are the same (parameterized route edge case)\n if (enteringViewItem !== leavingViewItem && enteringViewItem?.ionPageElement !== undefined) {\n hideIonPageElement(enteringViewItem.ionPageElement);\n }\n }\n };\n\n routerOutlet.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n }\n\n /**\n * Animates the transition between the entering and leaving pages within the\n * router outlet.\n *\n * @param routeInfo Info about the current route.\n * @param enteringViewItem The view item that is entering.\n * @param leavingViewItem The view item that is leaving.\n * @param direction The direction of the transition.\n * @param progressAnimation Indicates if the transition is part of a\n * gesture controlled animation (e.g., swipe to go back).\n * Defaults to `false`.\n */\n async transitionPage(\n routeInfo: RouteInfo,\n enteringViewItem: ViewItem,\n leavingViewItem?: ViewItem,\n direction?: 'forward' | 'back',\n progressAnimation = false\n ) {\n const runCommit = async (enteringEl: HTMLElement, leavingEl?: HTMLElement) => {\n const skipTransition = this.skipTransition;\n\n /**\n * If the transition was handled\n * via the swipe to go back gesture,\n * then we do not want to perform\n * another transition.\n *\n * We skip adding ion-page or ion-page-invisible\n * because the entering view already exists in the DOM.\n * If we added the classes, there would be a flicker where\n * the view would be briefly hidden.\n */\n if (skipTransition) {\n /**\n * We need to reset skipTransition before\n * we call routerOutlet.commit otherwise\n * the transition triggered by the swipe\n * to go back gesture would reset it. In\n * that case you would see a duplicate\n * transition triggered by handlePageTransition\n * in componentDidUpdate.\n */\n this.skipTransition = false;\n } else {\n enteringEl.classList.add('ion-page');\n enteringEl.classList.add('ion-page-invisible');\n }\n\n await routerOutlet.commit(enteringEl, leavingEl, {\n duration: skipTransition || directionToUse === undefined ? 0 : undefined,\n direction: directionToUse,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation,\n animationBuilder: routeInfo.routeAnimation,\n });\n };\n\n const routerOutlet = this.routerOutletElement!;\n\n const routeInfoFallbackDirection =\n routeInfo.routeDirection === 'none' || routeInfo.routeDirection === 'root' ? undefined : routeInfo.routeDirection;\n const directionToUse = direction ?? routeInfoFallbackDirection;\n\n if (enteringViewItem && enteringViewItem.ionPageElement && this.routerOutletElement) {\n if (leavingViewItem && leavingViewItem.ionPageElement && enteringViewItem === leavingViewItem) {\n // Clone page for same-view transitions (e.g., /user/1 → /user/2)\n const match = matchComponent(leavingViewItem.reactElement, routeInfo.pathname);\n if (match) {\n const newLeavingElement = clonePageElement(leavingViewItem.ionPageElement.outerHTML);\n if (newLeavingElement) {\n this.routerOutletElement.appendChild(newLeavingElement);\n await runCommit(enteringViewItem.ionPageElement, newLeavingElement);\n this.routerOutletElement.removeChild(newLeavingElement);\n }\n } else {\n // Route no longer matches (e.g., /user/1 → /settings)\n await runCommit(enteringViewItem.ionPageElement, undefined);\n }\n } else {\n const leavingEl = leavingViewItem?.ionPageElement;\n // For non-animated transitions, don't pass leaving element to commit() to avoid\n // flicker caused by commit() briefly unhiding the leaving page\n const isNonAnimatedTransition = directionToUse === undefined && !progressAnimation;\n\n if (isNonAnimatedTransition && leavingEl) {\n /**\n * Flicker prevention for non-animated transitions:\n * 1. Keep entering invisible during commit and component mounting\n * 2. Wait for components (including menu button) to be ready\n * 3. Swap visibility atomically\n */\n const enteringEl = enteringViewItem.ionPageElement;\n\n enteringEl.classList.add('ion-page');\n if (!enteringEl.classList.contains('ion-page-invisible')) {\n enteringEl.classList.add('ion-page-invisible');\n }\n enteringEl.classList.remove('ion-page-hidden');\n enteringEl.removeAttribute('aria-hidden');\n\n await routerOutlet.commit(enteringEl, undefined, {\n duration: 0,\n direction: undefined,\n showGoBack: !!routeInfo.pushedByRoute,\n progressAnimation: false,\n animationBuilder: routeInfo.routeAnimation,\n });\n\n // Re-add invisible after commit removes it (commit's afterTransition handling)\n enteringEl.classList.add('ion-page-invisible');\n\n /**\n * Wait for components to be ready. Menu buttons start hidden (menu-button-hidden)\n * and become visible after componentDidLoad. Wait for hydration and visibility.\n */\n const waitForComponentsReady = () => {\n return new Promise<void>((resolve) => {\n const checkReady = () => {\n const ionicComponents = enteringEl.querySelectorAll(\n 'ion-header, ion-toolbar, ion-buttons, ion-menu-button, ion-title, ion-content'\n );\n const allHydrated = Array.from(ionicComponents).every((el) => el.classList.contains('hydrated'));\n\n const menuButtons = enteringEl.querySelectorAll('ion-menu-button');\n const menuButtonsReady = Array.from(menuButtons).every(\n (el) => !el.classList.contains('menu-button-hidden')\n );\n\n return allHydrated && menuButtonsReady;\n };\n\n if (checkReady()) {\n resolve();\n return;\n }\n\n let resolved = false;\n const observer = new MutationObserver(() => {\n if (!resolved && checkReady()) {\n resolved = true;\n observer.disconnect();\n resolve();\n }\n });\n\n observer.observe(enteringEl, {\n subtree: true,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n setTimeout(() => {\n if (!resolved) {\n resolved = true;\n observer.disconnect();\n resolve();\n }\n }, 100);\n });\n };\n\n await waitForComponentsReady();\n\n // Swap visibility in sync with browser's render cycle\n await new Promise<void>((resolve) => {\n requestAnimationFrame(() => {\n enteringEl.classList.remove('ion-page-invisible');\n // Second rAF ensures entering is painted before hiding leaving\n requestAnimationFrame(() => {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n resolve();\n });\n });\n });\n } else {\n await runCommit(enteringViewItem.ionPageElement, leavingEl);\n // For animated transitions, hide leaving element after commit completes\n if (leavingEl && !progressAnimation) {\n leavingEl.classList.add('ion-page-hidden');\n leavingEl.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n }\n\n render() {\n const { children } = this.props;\n const ionRouterOutlet = React.Children.only(children) as React.ReactElement;\n // Store reference for use in getParentPath() and handlePageTransition()\n this.ionRouterOutlet = ionRouterOutlet;\n\n const components = this.context.getChildrenToRender(this.id, this.ionRouterOutlet, this.props.routeInfo, () => {\n // Callback triggers re-render when view items are modified during getChildrenToRender\n this.forceUpdate();\n });\n\n return (\n <StackContext.Provider value={this.stackContextValue}>\n {React.cloneElement(\n ionRouterOutlet as any,\n {\n ref: (node: HTMLIonRouterOutletElement) => {\n if (ionRouterOutlet.props.setRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.setRef(node);\n }\n if (ionRouterOutlet.props.forwardedRef) {\n // Needed to handle external refs from devs.\n ionRouterOutlet.props.forwardedRef.current = node;\n }\n this.routerOutletElement = node;\n const { ref } = ionRouterOutlet as any;\n // Check for legacy refs.\n if (typeof ref === 'function') {\n ref(node);\n }\n },\n },\n components\n )}\n </StackContext.Provider>\n );\n }\n\n static get contextType() {\n return RouteManagerContext;\n }\n}\n\nexport default StackManager;\n\n/**\n * Finds the `<Route />` node matching the current route info.\n * If no `<Route />` can be matched, a fallback node is returned.\n * Routes are prioritized by specificity (most specific first).\n *\n * @param node The root node to search for `<Route />` nodes.\n * @param routeInfo The route information to match against.\n * @param parentPath The parent path that was matched by the parent outlet (for nested routing)\n */\nfunction findRouteByRouteInfo(node: React.ReactNode, routeInfo: RouteInfo, parentPath?: string) {\n let matchedNode: React.ReactNode;\n let fallbackNode: React.ReactNode;\n\n // `<Route />` nodes are rendered inside of a <Routes /> node\n const routesChildren = getRoutesChildren(node) ?? node;\n\n // Collect all route children\n const routeChildren = React.Children.toArray(routesChildren).filter(\n (child): child is React.ReactElement => React.isValidElement(child) && child.type === Route\n );\n\n // Sort routes by specificity (most specific first)\n const sortedRoutes = routeChildren.sort((a, b) => {\n const pathA = a.props.path || '';\n const pathB = b.props.path || '';\n\n // Index routes come first\n if (a.props.index && !b.props.index) return -1;\n if (!a.props.index && b.props.index) return 1;\n\n // Wildcard-only routes (*) should come LAST\n const aIsWildcardOnly = pathA === '*';\n const bIsWildcardOnly = pathB === '*';\n\n if (!aIsWildcardOnly && bIsWildcardOnly) return -1;\n if (aIsWildcardOnly && !bIsWildcardOnly) return 1;\n\n // Exact matches (no wildcards/params) come before wildcard/param routes\n const aHasWildcard = pathA.includes('*') || pathA.includes(':');\n const bHasWildcard = pathB.includes('*') || pathB.includes(':');\n\n if (!aHasWildcard && bHasWildcard) return -1;\n if (aHasWildcard && !bHasWildcard) return 1;\n\n // Among routes with same wildcard status, longer paths are more specific\n if (pathA.length !== pathB.length) {\n return pathB.length - pathA.length;\n }\n\n return 0;\n });\n\n // For nested routes in React Router 6, we need to extract the relative path\n // that this outlet should be responsible for matching\n const originalPathname = routeInfo.pathname;\n let relativePathnameToMatch = routeInfo.pathname;\n\n // Check if we have relative routes (routes that don't start with '/')\n const hasRelativeRoutes = sortedRoutes.some((r) => r.props.path && !r.props.path.startsWith('/'));\n const hasIndexRoute = sortedRoutes.some((r) => r.props.index);\n\n // SIMPLIFIED: Trust React Router 6's matching more, compute relative path when parent is known\n if ((hasRelativeRoutes || hasIndexRoute) && parentPath) {\n const parentPrefix = parentPath.replace('/*', '');\n // Normalize both paths to start with '/' for consistent comparison\n const normalizedParent = stripTrailingSlash(parentPrefix.startsWith('/') ? parentPrefix : `/${parentPrefix}`);\n const normalizedPathname = stripTrailingSlash(routeInfo.pathname);\n\n // Only compute relative path if pathname is within parent scope\n if (normalizedPathname.startsWith(normalizedParent + '/') || normalizedPathname === normalizedParent) {\n const pathSegments = routeInfo.pathname.split('/').filter(Boolean);\n const parentSegments = normalizedParent.split('/').filter(Boolean);\n const relativeSegments = pathSegments.slice(parentSegments.length);\n relativePathnameToMatch = relativeSegments.join('/'); // Empty string is valid for index routes\n }\n }\n\n // Find the first matching route\n for (const child of sortedRoutes) {\n const childPath = child.props.path as string | undefined;\n const isAbsoluteRoute = childPath && childPath.startsWith('/');\n\n // Determine which pathname to match against:\n // - For absolute routes: use the original full pathname\n // - For relative routes with a parent: use the computed relative pathname\n // - For relative routes at root level (no parent): use the original pathname\n // (matchPath will handle the relative-to-absolute normalization)\n const pathnameToMatch = isAbsoluteRoute ? originalPathname : relativePathnameToMatch;\n\n // Determine the path portion to match:\n // - For absolute routes: use derivePathnameToMatch\n // - For relative routes at root level (no parent): use original pathname\n // directly since matchPath normalizes both path and pathname\n // - For relative routes with parent: use derivePathnameToMatch for wildcards,\n // or the computed relative pathname for non-wildcards\n let pathForMatch: string;\n if (isAbsoluteRoute) {\n pathForMatch = derivePathnameToMatch(pathnameToMatch, childPath);\n } else if (!parentPath && childPath) {\n // Root-level relative route: use the full pathname and let matchPath\n // handle the normalization (it adds '/' to both path and pathname)\n pathForMatch = originalPathname;\n } else if (childPath && childPath.includes('*')) {\n // Relative wildcard route with parent path: use derivePathnameToMatch\n pathForMatch = derivePathnameToMatch(pathnameToMatch, childPath);\n } else {\n pathForMatch = pathnameToMatch;\n }\n\n const match = matchPath({\n pathname: pathForMatch,\n componentProps: child.props,\n });\n\n if (match) {\n matchedNode = child;\n break;\n }\n }\n\n if (matchedNode) {\n return matchedNode;\n }\n\n // If we haven't found a node, try to find one that doesn't have a path prop (fallback route)\n // BUT only return the fallback if the current pathname is within the outlet's scope.\n // For outlets with absolute paths, compute the common prefix to determine scope.\n const absolutePathRoutes = routeChildren.filter((r) => r.props.path && r.props.path.startsWith('/'));\n\n // Determine if pathname is within scope before returning fallback\n let isPathnameInScope = true;\n\n if (absolutePathRoutes.length > 0) {\n // Find common prefix of all absolute paths to determine outlet scope\n const absolutePaths = absolutePathRoutes.map((r) => r.props.path as string);\n const commonPrefix = computeCommonPrefix(absolutePaths);\n\n // If we have a common prefix, check if the current pathname is within that scope\n if (commonPrefix && commonPrefix !== '/') {\n isPathnameInScope = routeInfo.pathname.startsWith(commonPrefix);\n }\n }\n\n // Only look for fallback route if pathname is within scope\n if (isPathnameInScope) {\n for (const child of routeChildren) {\n if (!child.props.path) {\n fallbackNode = child;\n break;\n }\n }\n }\n\n return matchedNode ?? fallbackNode;\n}\n\nfunction matchComponent(node: React.ReactElement, pathname: string, forceExact?: boolean) {\n const routePath: string | undefined = node?.props?.path;\n const pathnameToMatch = derivePathnameToMatch(pathname, routePath);\n\n return matchPath({\n pathname: pathnameToMatch,\n componentProps: {\n ...node.props,\n end: forceExact,\n },\n });\n}\n","/**\n * `IonRouter` is responsible for managing the application's navigation\n * state, tracking the history of visited routes, and coordinating\n * transitions between different views. It intercepts route changes from\n * React Router and translates them into actions that Ionic can understand\n * and animate.\n */\n\nimport type {\n AnimationBuilder,\n RouteAction,\n RouteInfo,\n RouteManagerContextState,\n RouterDirection,\n RouterOptions,\n} from '@ionic/react';\nimport { LocationHistory, NavManager, RouteManagerContext, generateId, getConfig } from '@ionic/react';\nimport type { Action as HistoryAction, Location } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\n\nimport { IonRouteInner } from './IonRouteInner';\nimport { ReactRouterViewStack } from './ReactRouterViewStack';\nimport StackManager from './StackManager';\n\n// Use Location directly - state is typed as `unknown` in history v5\ntype HistoryLocation = Location;\n\nexport interface LocationState {\n direction?: RouterDirection;\n routerOptions?: RouterOptions;\n}\n\ninterface IonRouterProps {\n registerHistoryListener: (cb: (location: HistoryLocation, action: HistoryAction) => void) => void;\n}\n\ntype RouteParams = Record<string, string | string[] | undefined>;\ntype SafeRouteParams = Record<string, string | string[]>;\n\nconst filterUndefinedParams = (params: RouteParams): SafeRouteParams => {\n const result: SafeRouteParams = {};\n for (const key of Object.keys(params)) {\n const value = params[key];\n if (value !== undefined) {\n result[key] = value;\n }\n }\n return result;\n};\n\nconst areParamsEqual = (a?: RouteParams, b?: RouteParams) => {\n const paramsA = a || {};\n const paramsB = b || {};\n const keysA = Object.keys(paramsA);\n const keysB = Object.keys(paramsB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n return keysA.every((key) => {\n const valueA = paramsA[key];\n const valueB = paramsB[key];\n if (Array.isArray(valueA) && Array.isArray(valueB)) {\n if (valueA.length !== valueB.length) {\n return false;\n }\n return valueA.every((entry, idx) => entry === valueB[idx]);\n }\n return valueA === valueB;\n });\n};\n\nexport const IonRouter = ({ children, registerHistoryListener }: PropsWithChildren<IonRouterProps>) => {\n const location = useLocation();\n const navigate = useNavigate();\n\n const didMountRef = useRef(false);\n const locationHistory = useRef(new LocationHistory());\n const currentTab = useRef<string | undefined>(undefined);\n const viewStack = useRef(new ReactRouterViewStack());\n const incomingRouteParams = useRef<Partial<RouteInfo> | null>(null);\n\n const [routeInfo, setRouteInfo] = useState<RouteInfo>({\n id: generateId('routeInfo'),\n pathname: location.pathname,\n search: location.search,\n params: {},\n });\n\n useEffect(() => {\n if (didMountRef.current) {\n return;\n }\n\n // Seed the history stack with the initial location and begin listening\n // for future navigations once React has committed the mount. This avoids\n // duplicate entries when React StrictMode runs an extra render pre-commit.\n locationHistory.current.add(routeInfo);\n registerHistoryListener(handleHistoryChange);\n\n didMountRef.current = true;\n }, []);\n\n // Sync route params extracted by React Router's path matching back into routeInfo.\n // The view stack's match may contain params (e.g., :id) not present in the initial routeInfo.\n useEffect(() => {\n const activeView = viewStack.current.findViewItemByRouteInfo(routeInfo, undefined, true);\n const matchedParams = activeView?.routeData.match?.params as RouteParams | undefined;\n\n if (matchedParams) {\n const paramsCopy = filterUndefinedParams({ ...matchedParams });\n if (areParamsEqual(routeInfo.params as RouteParams | undefined, paramsCopy)) {\n return;\n }\n\n const updatedRouteInfo: RouteInfo = {\n ...routeInfo,\n params: paramsCopy,\n };\n locationHistory.current.update(updatedRouteInfo);\n setRouteInfo(updatedRouteInfo);\n }\n }, [routeInfo]);\n\n /**\n * Triggered whenever the history changes, either through user navigation\n * or programmatic changes. It transforms the raw browser history changes\n * into `RouteInfo` objects, which are needed Ionic's animations and\n * navigation patterns.\n *\n * @param location The current location object from the history.\n * @param action The action that triggered the history change.\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n let leavingLocationInfo: RouteInfo;\n /**\n * A programmatic navigation was triggered.\n * e.g., `<Redirect />`, `history.push()`, or `handleNavigate()`\n */\n if (incomingRouteParams.current) {\n /**\n * The current history entry is overwritten, so the previous entry\n * is the one we are leaving.\n */\n if (incomingRouteParams.current?.routeAction === 'replace') {\n leavingLocationInfo = locationHistory.current.previous();\n } else {\n // If the action is 'push' or 'pop', we want to use the current route.\n leavingLocationInfo = locationHistory.current.current();\n }\n } else {\n /**\n * An external navigation was triggered\n * e.g., browser back/forward button or direct link\n *\n * The leaving location is the current route.\n */\n leavingLocationInfo = locationHistory.current.current();\n }\n\n const leavingUrl = leavingLocationInfo.pathname + leavingLocationInfo.search;\n if (leavingUrl !== location.pathname) {\n if (!incomingRouteParams.current) {\n // Determine if the destination is a tab route by checking if it matches\n // the pattern of tab routes (containing /tabs/ in the path)\n const isTabRoute = /\\/tabs(\\/|$)/.test(location.pathname);\n const tabToUse = isTabRoute ? currentTab.current : undefined;\n\n // If we're leaving tabs entirely, clear the current tab\n if (!isTabRoute && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * A `REPLACE` action can be triggered by React Router's\n * `<Redirect />` component.\n */\n if (action === 'REPLACE') {\n incomingRouteParams.current = {\n routeAction: 'replace',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n /**\n * A `POP` action can be triggered by the browser's back/forward\n * button.\n */\n if (action === 'POP') {\n const currentRoute = locationHistory.current.current();\n /**\n * Check if the current route was \"pushed\" by a previous route\n * (indicates a linear history path).\n */\n if (currentRoute && currentRoute.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(currentRoute);\n incomingRouteParams.current = { ...prevInfo, routeAction: 'pop', routeDirection: 'back' };\n // It's a non-linear history path like a direct link.\n } else {\n incomingRouteParams.current = {\n routeAction: 'pop',\n routeDirection: 'none',\n tab: tabToUse,\n };\n }\n }\n if (!incomingRouteParams.current) {\n const state = location.state as LocationState | null;\n incomingRouteParams.current = {\n routeAction: 'push',\n routeDirection: state?.direction || 'forward',\n routeOptions: state?.routerOptions,\n tab: tabToUse,\n };\n }\n }\n\n let routeInfo: RouteInfo;\n\n // If we're navigating away from tabs to a non-tab route, clear the current tab\n if (!/\\/tabs(\\/|$)/.test(location.pathname) && currentTab.current) {\n currentTab.current = undefined;\n }\n\n /**\n * An existing id indicates that it's re-activating an existing route.\n * e.g., tab switching or navigating back to a previous route\n */\n if (incomingRouteParams.current?.id) {\n routeInfo = {\n ...(incomingRouteParams.current as RouteInfo),\n lastPathname: leavingLocationInfo.pathname,\n };\n locationHistory.current.add(routeInfo);\n /**\n * A new route is being created since it's not re-activating\n * an existing route.\n */\n } else {\n const isPushed =\n incomingRouteParams.current?.routeAction === 'push' &&\n incomingRouteParams.current.routeDirection === 'forward';\n routeInfo = {\n id: generateId('routeInfo'),\n ...incomingRouteParams.current,\n lastPathname: leavingLocationInfo.pathname, // The URL we just came from\n pathname: location.pathname, // The current (destination) URL\n search: location.search,\n params: incomingRouteParams.current?.params\n ? filterUndefinedParams(incomingRouteParams.current.params as RouteParams)\n : {},\n prevRouteLastPathname: leavingLocationInfo.lastPathname,\n };\n if (isPushed) {\n // Only inherit tab from leaving route if we don't already have one.\n // This preserves tab context for same-tab navigation while allowing cross-tab navigation.\n routeInfo.tab = routeInfo.tab || leavingLocationInfo.tab;\n routeInfo.pushedByRoute = leavingLocationInfo.pathname;\n // Triggered by a browser back button or handleNavigateBack.\n } else if (routeInfo.routeAction === 'pop') {\n // Find the route that pushed this one.\n const r = locationHistory.current.findLastLocation(routeInfo);\n routeInfo.pushedByRoute = r?.pushedByRoute;\n // Navigating to a new tab.\n } else if (routeInfo.routeAction === 'push' && routeInfo.tab !== leavingLocationInfo.tab) {\n /**\n * If we are switching tabs grab the last route info for the\n * tab and use its `pushedByRoute`.\n */\n const lastRoute = locationHistory.current.getCurrentRouteInfoForTab(routeInfo.tab);\n /**\n * Tab bar switches (direction 'none') should not create cross-tab back\n * navigation. Only inherit pushedByRoute from the tab's own history.\n */\n if (routeInfo.routeDirection === 'none') {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute;\n } else {\n routeInfo.pushedByRoute = lastRoute?.pushedByRoute ?? leavingLocationInfo.pathname;\n }\n // Triggered by `history.replace()` or a `<Redirect />` component, etc.\n } else if (routeInfo.routeAction === 'replace') {\n /**\n * Make sure to set the `lastPathname`, etc.. to the current route\n * so the page transitions out.\n */\n const currentRouteInfo = locationHistory.current.current();\n\n /**\n * Special handling for `replace` to ensure correct `pushedByRoute`\n * and `lastPathname`.\n *\n * If going from `/home` to `/child`, then replacing from\n * `/child` to `/home`, we don't want the route info to\n * say that `/home` was pushed by `/home` which is not correct.\n */\n const currentPushedBy = currentRouteInfo?.pushedByRoute;\n const pushedByRoute =\n currentPushedBy !== undefined && currentPushedBy !== routeInfo.pathname\n ? currentPushedBy\n : routeInfo.pushedByRoute;\n\n routeInfo.lastPathname = currentRouteInfo?.pathname || routeInfo.lastPathname;\n routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;\n routeInfo.pushedByRoute = pushedByRoute;\n\n /**\n * When replacing routes we should still prefer\n * any custom direction/animation that the developer\n * has specified when navigating first instead of relying\n * on previously used directions/animations.\n */\n routeInfo.routeDirection = routeInfo.routeDirection || currentRouteInfo?.routeDirection;\n routeInfo.routeAnimation = routeInfo.routeAnimation || currentRouteInfo?.routeAnimation;\n }\n\n locationHistory.current.add(routeInfo);\n }\n setRouteInfo(routeInfo);\n }\n\n incomingRouteParams.current = null;\n };\n\n /**\n * Resets the specified tab to its initial, root route.\n *\n * @param tab The tab to reset.\n * @param originalHref The original href for the tab.\n * @param originalRouteOptions The original route options for the tab.\n */\n const handleResetTab = (tab: string, originalHref: string, originalRouteOptions: any) => {\n const routeInfo = locationHistory.current.getFirstRouteInfoForTab(tab);\n if (routeInfo) {\n const newRouteInfo = { ...routeInfo };\n newRouteInfo.pathname = originalHref;\n newRouteInfo.routeOptions = originalRouteOptions;\n incomingRouteParams.current = { ...newRouteInfo, routeAction: 'pop', routeDirection: 'back' };\n navigate(newRouteInfo.pathname + (newRouteInfo.search || ''));\n }\n };\n\n /**\n * Handles tab changes.\n *\n * @param tab The tab to switch to.\n * @param path The new path for the tab.\n * @param routeOptions Additional route options.\n */\n const handleChangeTab = (tab: string, path?: string, routeOptions?: any) => {\n if (!path) {\n return;\n }\n\n const routeInfo = locationHistory.current.getCurrentRouteInfoForTab(tab);\n const [pathname, search] = path.split('?');\n // User has navigated to the current tab before.\n if (routeInfo) {\n const routeParams = {\n ...routeInfo,\n routeAction: 'push' as RouteAction,\n routeDirection: 'none' as RouterDirection,\n };\n /**\n * User is navigating to the same tab.\n * e.g., `/tabs/home` → `/tabs/home`\n */\n if (routeInfo.pathname === pathname) {\n incomingRouteParams.current = {\n ...routeParams,\n routeOptions,\n };\n\n navigate(routeInfo.pathname + (routeInfo.search || ''));\n /**\n * User is navigating to a different tab.\n * e.g., `/tabs/home` → `/tabs/settings`\n */\n } else {\n incomingRouteParams.current = {\n ...routeParams,\n pathname,\n search: search ? '?' + search : undefined,\n routeOptions,\n };\n\n navigate(pathname + (search ? '?' + search : ''));\n }\n // User has not navigated to this tab before.\n } else {\n handleNavigate(pathname, 'push', 'none', undefined, routeOptions, tab);\n }\n };\n\n /**\n * Set the current active tab in `locationHistory`.\n * This is crucial for maintaining tab history since each tab has\n * its own navigation stack.\n *\n * @param tab The tab to set as active.\n */\n const handleSetCurrentTab = (tab: string) => {\n currentTab.current = tab;\n const ri = { ...locationHistory.current.current() };\n if (ri.tab !== tab) {\n ri.tab = tab;\n locationHistory.current.update(ri);\n }\n };\n\n /**\n * Handles the native back button press.\n * It's usually called when a user presses the platform-native back action.\n */\n const handleNativeBack = () => {\n navigate(-1);\n };\n\n /**\n * Used to manage the back navigation within the Ionic React's routing\n * system. It's deeply integrated with Ionic's view lifecycle, animations,\n * and its custom history tracking (`locationHistory`) to provide a\n * native-like transition and maintain correct application state.\n *\n * @param defaultHref The fallback URL to navigate to if there's no\n * previous entry in the `locationHistory` stack.\n * @param routeAnimation A custom animation builder to override the\n * default \"back\" animation.\n */\n const handleNavigateBack = (defaultHref: string | RouteInfo = '/', routeAnimation?: AnimationBuilder) => {\n const config = getConfig();\n defaultHref = defaultHref ? defaultHref : config && config.get('backButtonDefaultHref' as any);\n const routeInfo = locationHistory.current.current();\n // It's a linear navigation.\n if (routeInfo && routeInfo.pushedByRoute) {\n const prevInfo = locationHistory.current.findLastLocation(routeInfo);\n if (prevInfo) {\n /**\n * This needs to be passed to handleNavigate\n * otherwise incomingRouteParams.routeAnimation\n * will be overridden.\n */\n const incomingAnimation = routeAnimation || routeInfo.routeAnimation;\n incomingRouteParams.current = {\n ...prevInfo,\n routeAction: 'pop',\n routeDirection: 'back',\n routeAnimation: incomingAnimation,\n };\n /**\n * Check if it's a simple linear back navigation (not tabbed).\n * e.g., `/home` → `/settings` → back to `/home`\n */\n const condition1 = routeInfo.lastPathname === routeInfo.pushedByRoute;\n const condition2 = prevInfo.pathname === routeInfo.pushedByRoute && routeInfo.tab === '' && prevInfo.tab === '';\n if (condition1 || condition2) {\n navigate(-1);\n } else {\n /**\n * It's a non-linear back navigation.\n * e.g., direct link or tab switch or nested navigation with redirects\n */\n handleNavigate(prevInfo.pathname + (prevInfo.search || ''), 'pop', 'back', incomingAnimation);\n }\n /**\n * `pushedByRoute` exists, but no corresponding previous entry in\n * the history stack.\n */\n } else {\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n /**\n * No `pushedByRoute` (e.g., initial page load or tab root).\n * Tabs with no back history should not navigate.\n */\n } else {\n if (routeInfo && routeInfo.tab) {\n return;\n }\n handleNavigate(defaultHref as string, 'pop', 'back', routeAnimation);\n }\n };\n\n /**\n * Used to programmatically navigate through the app.\n *\n * @param path The path to navigate to.\n * @param routeAction The action to take (push, replace, etc.).\n * @param routeDirection The direction of the navigation (forward,\n * back, etc.).\n * @param routeAnimation The animation to use for the transition.\n * @param routeOptions Additional options for the route.\n * @param tab The tab to navigate to, if applicable.\n */\n const handleNavigate = (\n path: string,\n routeAction: RouteAction,\n routeDirection?: RouterDirection,\n routeAnimation?: AnimationBuilder,\n routeOptions?: any,\n tab?: string\n ) => {\n const normalizedRouteDirection =\n routeAction === 'push' && routeDirection === undefined ? 'forward' : routeDirection;\n\n // When navigating from tabs context, we need to determine if the destination\n // is also within tabs. If not, we should clear the tab context.\n let navigationTab = tab;\n\n // If no explicit tab is provided and we're in a tab context,\n // check if the destination path is outside of the current tab context\n if (!tab && currentTab.current && path) {\n // Get the current route info to understand where we are\n const currentRoute = locationHistory.current.current();\n\n // If we're navigating from a tab route to a completely different path structure,\n // we should clear the tab context. This is a simplified check that assumes\n // tab routes share a common parent path.\n if (currentRoute && currentRoute.pathname) {\n // Extract the base tab path (e.g., /routing/tabs from /routing/tabs/home)\n const tabBaseMatch = currentRoute.pathname.match(/^(.*\\/tabs)/);\n if (tabBaseMatch) {\n const tabBasePath = tabBaseMatch[1];\n // If the new path doesn't start with the tab base path, we're leaving tabs\n if (!path.startsWith(tabBasePath)) {\n currentTab.current = undefined;\n navigationTab = undefined;\n } else {\n // Still within tabs, preserve the tab context\n navigationTab = currentTab.current;\n }\n }\n }\n }\n\n const baseParams = incomingRouteParams.current ?? {};\n incomingRouteParams.current = {\n ...baseParams,\n routeAction,\n routeDirection: normalizedRouteDirection,\n routeOptions,\n routeAnimation,\n tab: navigationTab,\n };\n\n navigate(path, { replace: routeAction !== 'push' });\n };\n\n const routeMangerContextValue: RouteManagerContextState = {\n canGoBack: () => locationHistory.current.canGoBack(),\n clearOutlet: viewStack.current.clear,\n findViewItemByPathname: viewStack.current.findViewItemByPathname,\n getChildrenToRender: viewStack.current.getChildrenToRender,\n getViewItemsForOutlet: viewStack.current.getViewItemsForOutlet.bind(viewStack.current),\n goBack: () => handleNavigateBack(),\n createViewItem: viewStack.current.createViewItem,\n findViewItemByRouteInfo: viewStack.current.findViewItemByRouteInfo,\n findLeavingViewItemByRouteInfo: viewStack.current.findLeavingViewItemByRouteInfo,\n addViewItem: viewStack.current.add,\n unMountViewItem: viewStack.current.remove,\n };\n\n return (\n <RouteManagerContext.Provider value={routeMangerContextValue}>\n <NavManager\n ionRoute={IonRouteInner}\n ionRedirect={{}}\n stackManager={StackManager}\n routeInfo={routeInfo}\n onNativeBack={handleNativeBack}\n onNavigateBack={handleNavigateBack}\n onNavigate={handleNavigate}\n onSetCurrentTab={handleSetCurrentTab}\n onChangeTab={handleChangeTab}\n onResetTab={handleResetTab}\n locationHistory={locationHistory.current}\n >\n {children}\n </NavManager>\n </RouteManagerContext.Provider>\n );\n};\n\nIonRouter.displayName = 'IonRouter';\n","/**\n * `IonReactRouter` facilitates the integration of Ionic's specific\n * navigation and UI management with the standard React Router mechanisms,\n * allowing an inner Ionic-specific router (`IonRouter`) to react to\n * navigation events.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef, useCallback } from 'react';\nimport type { BrowserRouterProps } from 'react-router-dom';\nimport { BrowserRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\n/**\n * This component acts as a bridge to ensure React Router hooks like\n * `useLocation` and `useNavigationType` are called within the valid\n * context of a `<BrowserRouter>`.\n *\n * It was split from `IonReactRouter` because these hooks must be\n * descendants of a `<Router>` component, which `BrowserRouter` provides.\n */\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = useCallback((cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n }, []);\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param loc The current browser history location object.\n * @param act The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = useCallback((loc: HistoryLocation, act: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(loc, act);\n }\n }, []);\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType, handleHistoryChange]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactRouter = ({ children, ...browserRouterProps }: PropsWithChildren<BrowserRouterProps>) => {\n return (\n <BrowserRouter {...browserRouterProps}>\n <RouterContent>{children}</RouterContent>\n </BrowserRouter>\n );\n};\n","/**\n * `IonReactMemoryRouter` provides a way to use `react-router` in\n * environments where a traditional browser history (like `BrowserRouter`)\n * isn't available or desirable.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { MemoryRouterProps } from 'react-router';\nimport { MemoryRouter, useLocation, useNavigationType } from 'react-router';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactMemoryRouter = ({ children, ...routerProps }: PropsWithChildren<MemoryRouterProps>) => {\n return (\n <MemoryRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </MemoryRouter>\n );\n};\n","/**\n * `IonReactHashRouter` provides a way to use hash-based routing in Ionic\n * React applications.\n */\n\nimport type { Action as HistoryAction, Location as HistoryLocation } from 'history';\nimport type { PropsWithChildren } from 'react';\nimport React, { useEffect, useRef } from 'react';\nimport type { HashRouterProps } from 'react-router-dom';\nimport { HashRouter, useLocation, useNavigationType } from 'react-router-dom';\n\nimport { IonRouter } from './IonRouter';\n\nconst RouterContent = ({ children }: PropsWithChildren<{}>) => {\n const location = useLocation();\n const navigationType = useNavigationType();\n\n const historyListenHandler = useRef<(location: HistoryLocation, action: HistoryAction) => void>();\n\n const registerHistoryListener = (cb: (location: HistoryLocation, action: HistoryAction) => void) => {\n historyListenHandler.current = cb;\n };\n\n /**\n * Processes navigation changes within the application.\n *\n * Its purpose is to relay the current `location` and the associated\n * `action` ('PUSH', 'POP', or 'REPLACE') to any registered listeners,\n * primarily for `IonRouter` to manage Ionic-specific UI updates and\n * navigation stack behavior.\n *\n * @param location The current browser history location object.\n * @param action The type of navigation action ('PUSH', 'POP', or\n * 'REPLACE').\n */\n const handleHistoryChange = (location: HistoryLocation, action: HistoryAction) => {\n if (historyListenHandler.current) {\n historyListenHandler.current(location, action);\n }\n };\n\n useEffect(() => {\n handleHistoryChange(location, navigationType);\n }, [location, navigationType]);\n\n return <IonRouter registerHistoryListener={registerHistoryListener}>{children}</IonRouter>;\n};\n\nexport const IonReactHashRouter = ({ children, ...routerProps }: PropsWithChildren<HashRouterProps>) => {\n return (\n <HashRouter {...routerProps}>\n <RouterContent>{children}</RouterContent>\n </HashRouter>\n );\n};\n"],"names":["reactRouterMatchPath","matchComponent","RouteContext","RouterContent","useLocation","useNavigationType"],"mappings":";;;;;;AAIO,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAi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AAE;AAChC,YAAA,oBAAoB,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC;AAC/C,QAAA;AACH,IAAA,CAAC;IAED,SAAS,CAAC,MAAK;AACb,QAAA,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC;AAC/C,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAE9B,OAAO,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,uBAAuB,EAAE,uBAAuB,EAAA,EAAG,QAAQ,CAAa;AAC5F,CAAC;AAEM,MAAM,kBAAkB,GAAG,CAAC,EAAgE,KAAI;AAApE,IAAA,IAAA,EAAE,QAAQ,EAAA,GAAA,EAAsD,EAAjD,WAAW,GAAA,MAAA,CAAA,EAAA,EAA1B,YAA4B,CAAF;AAC3D,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,WAAW,CAAA;AACzB,QAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA,EAAE,QAAQ,CAAiB,CAC9B;AAEjB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/react-router",
3
- "version": "8.7.13-dev.11766081813.18052ea1",
3
+ "version": "8.7.13-dev.11766090775.11e2bebb",
4
4
  "description": "React Router wrapper for @ionic/react",
5
5
  "keywords": [
6
6
  "ionic",
@@ -36,7 +36,7 @@
36
36
  "dist/"
37
37
  ],
38
38
  "dependencies": {
39
- "@ionic/react": "8.7.13-dev.11766081813.18052ea1",
39
+ "@ionic/react": "8.7.13-dev.11766090775.11e2bebb",
40
40
  "tslib": "*"
41
41
  },
42
42
  "peerDependencies": {