{"version":3,"file":"link.cjs","names":[],"sources":["../../src/link.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { useStore } from '@tanstack/react-store'\nimport { flushSync } from 'react-dom'\nimport {\n  deepEqual,\n  exactPathTest,\n  functionalUpdate,\n  hasKeys,\n  isDangerousProtocol,\n  preloadWarning,\n  removeTrailingSlash,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nimport { useForwardedRef, useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n  AnyRouter,\n  Constrain,\n  LinkOptions,\n  RegisteredRouter,\n  RoutePaths,\n} from '@tanstack/router-core'\nimport type { ReactNode } from 'react'\nimport type {\n  ValidateLinkOptions,\n  ValidateLinkOptionsArray,\n} from './typePrimitives'\n\n/**\n * Build anchor-like props for declarative navigation and preloading.\n *\n * Returns stable `href`, event handlers and accessibility props derived from\n * router options and active state. Used internally by `Link` and custom links.\n *\n * Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,\n * `activeProps`, `inactiveProps`, and more.\n *\n * @returns React anchor props suitable for `<a>` or custom components.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook\n */\nexport function useLinkProps<\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = string,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(\n  options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n  forwardedRef?: React.ForwardedRef<Element>,\n): React.ComponentPropsWithRef<'a'> {\n  const router = useRouter()\n  const innerRef = useForwardedRef(forwardedRef)\n\n  // Determine if we're on the server - used for tree-shaking client-only code\n  const _isServer = isServer ?? router.isServer\n\n  const {\n    // custom props\n    activeProps,\n    inactiveProps,\n    activeOptions,\n    to,\n    preload: userPreload,\n    preloadDelay: userPreloadDelay,\n    preloadIntentProximity: _preloadIntentProximity,\n    hashScrollIntoView,\n    replace,\n    startTransition,\n    resetScroll,\n    viewTransition,\n    // element props\n    children,\n    target,\n    disabled,\n    style,\n    className,\n    onClick,\n    onBlur,\n    onFocus,\n    onMouseEnter,\n    onMouseLeave,\n    onTouchStart,\n    ignoreBlocker,\n    // prevent these from being returned\n    params: _params,\n    search: _search,\n    hash: _hash,\n    state: _state,\n    mask: _mask,\n    reloadDocument: _reloadDocument,\n    unsafeRelative: _unsafeRelative,\n    from: _from,\n    _fromLocation,\n    ...propsSafeToSpread\n  } = options\n\n  // ==========================================================================\n  // SERVER EARLY RETURN\n  // On the server, we return static props without any event handlers,\n  // effects, or client-side interactivity.\n  //\n  // For SSR parity (to avoid hydration errors), we still compute the link's\n  // active status on the server, but we avoid creating any router-state\n  // subscriptions by reading from the location store directly.\n  //\n  // Note: `location.hash` is not available on the server.\n  // ==========================================================================\n  if (_isServer) {\n    const safeInternal = isSafeInternal(to)\n\n    // If `to` is obviously an absolute URL, treat as external and avoid\n    // computing the internal location via `buildLocation`.\n    if (\n      typeof to === 'string' &&\n      !safeInternal &&\n      // Quick checks to avoid `new URL` in common internal-like cases\n      to.indexOf(':') > -1\n    ) {\n      try {\n        new URL(to)\n        if (isDangerousProtocol(to, router.protocolAllowlist)) {\n          if (process.env.NODE_ENV !== 'production') {\n            console.warn(`Blocked Link with dangerous protocol: ${to}`)\n          }\n          return {\n            ...propsSafeToSpread,\n            ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n            href: undefined,\n            ...(children && { children }),\n            ...(target && { target }),\n            ...(disabled && { disabled }),\n            ...(style && { style }),\n            ...(className && { className }),\n          }\n        }\n\n        return {\n          ...propsSafeToSpread,\n          ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n          href: to,\n          ...(children && { children }),\n          ...(target && { target }),\n          ...(disabled && { disabled }),\n          ...(style && { style }),\n          ...(className && { className }),\n        }\n      } catch {\n        // Not an absolute URL\n      }\n    }\n\n    const next = router.buildLocation({ ...options, from: options.from } as any)\n\n    // Use publicHref - it contains the correct href for display\n    // When a rewrite changes the origin, publicHref is the full URL\n    // Otherwise it's the origin-stripped path\n    // This avoids constructing URL objects in the hot path\n    const hrefOptionPublicHref = next.maskedLocation\n      ? next.maskedLocation.publicHref\n      : next.publicHref\n    const hrefOptionExternal = next.maskedLocation\n      ? next.maskedLocation.external\n      : next.external\n    const hrefOption = getHrefOption(\n      hrefOptionPublicHref,\n      hrefOptionExternal,\n      router.history,\n      disabled,\n    )\n\n    const externalLink = (() => {\n      if (hrefOption?.external) {\n        if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) {\n          if (process.env.NODE_ENV !== 'production') {\n            console.warn(\n              `Blocked Link with dangerous protocol: ${hrefOption.href}`,\n            )\n          }\n          return undefined\n        }\n        return hrefOption.href\n      }\n\n      if (safeInternal) return undefined\n\n      // Only attempt URL parsing when it looks like an absolute URL.\n      if (typeof to === 'string' && to.indexOf(':') > -1) {\n        try {\n          new URL(to)\n          if (isDangerousProtocol(to, router.protocolAllowlist)) {\n            if (process.env.NODE_ENV !== 'production') {\n              console.warn(`Blocked Link with dangerous protocol: ${to}`)\n            }\n            return undefined\n          }\n          return to\n        } catch {}\n      }\n\n      return undefined\n    })()\n\n    const isActive = (() => {\n      if (externalLink) return false\n\n      const currentLocation = router.stores.location.get()\n\n      const exact = activeOptions?.exact ?? false\n\n      if (exact) {\n        const testExact = exactPathTest(\n          currentLocation.pathname,\n          next.pathname,\n          router.basepath,\n        )\n        if (!testExact) {\n          return false\n        }\n      } else {\n        const currentPathSplit = removeTrailingSlash(\n          currentLocation.pathname,\n          router.basepath,\n        )\n        const nextPathSplit = removeTrailingSlash(\n          next.pathname,\n          router.basepath,\n        )\n\n        const pathIsFuzzyEqual =\n          currentPathSplit.startsWith(nextPathSplit) &&\n          (currentPathSplit.length === nextPathSplit.length ||\n            currentPathSplit[nextPathSplit.length] === '/')\n\n        if (!pathIsFuzzyEqual) {\n          return false\n        }\n      }\n\n      const includeSearch = activeOptions?.includeSearch ?? true\n      if (includeSearch) {\n        if (currentLocation.search !== next.search) {\n          const currentSearchEmpty =\n            !currentLocation.search ||\n            (typeof currentLocation.search === 'object' &&\n              !hasKeys(currentLocation.search))\n          const nextSearchEmpty =\n            !next.search ||\n            (typeof next.search === 'object' &&\n              !hasKeys(next.search as Record<string, unknown>))\n\n          if (!(currentSearchEmpty && nextSearchEmpty)) {\n            const searchTest = deepEqual(currentLocation.search, next.search, {\n              partial: !exact,\n              ignoreUndefined: !activeOptions?.explicitUndefined,\n            })\n            if (!searchTest) {\n              return false\n            }\n          }\n        }\n      }\n\n      // Hash is not available on the server\n      if (activeOptions?.includeHash) {\n        return false\n      }\n\n      return true\n    })()\n\n    if (externalLink) {\n      return {\n        ...propsSafeToSpread,\n        ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n        href: externalLink,\n        ...(children && { children }),\n        ...(target && { target }),\n        ...(disabled && { disabled }),\n        ...(style && { style }),\n        ...(className && { className }),\n      }\n    }\n\n    const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n      isActive\n        ? (functionalUpdate(activeProps as any, {}) ?? STATIC_ACTIVE_OBJECT)\n        : STATIC_EMPTY_OBJECT\n\n    const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n      isActive\n        ? STATIC_EMPTY_OBJECT\n        : (functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT)\n\n    const resolvedStyle = (() => {\n      const baseStyle = style\n      const activeStyle = resolvedActiveProps.style\n      const inactiveStyle = resolvedInactiveProps.style\n\n      if (!baseStyle && !activeStyle && !inactiveStyle) {\n        return undefined\n      }\n\n      if (baseStyle && !activeStyle && !inactiveStyle) {\n        return baseStyle\n      }\n\n      if (!baseStyle && activeStyle && !inactiveStyle) {\n        return activeStyle\n      }\n\n      if (!baseStyle && !activeStyle && inactiveStyle) {\n        return inactiveStyle\n      }\n\n      return {\n        ...baseStyle,\n        ...activeStyle,\n        ...inactiveStyle,\n      }\n    })()\n\n    const resolvedClassName = (() => {\n      const baseClassName = className\n      const activeClassName = resolvedActiveProps.className\n      const inactiveClassName = resolvedInactiveProps.className\n\n      if (!baseClassName && !activeClassName && !inactiveClassName) {\n        return ''\n      }\n\n      let out = ''\n\n      if (baseClassName) {\n        out = baseClassName\n      }\n\n      if (activeClassName) {\n        out = out ? `${out} ${activeClassName}` : activeClassName\n      }\n\n      if (inactiveClassName) {\n        out = out ? `${out} ${inactiveClassName}` : inactiveClassName\n      }\n\n      return out\n    })()\n\n    return {\n      ...propsSafeToSpread,\n      ...resolvedActiveProps,\n      ...resolvedInactiveProps,\n      href: hrefOption?.href,\n      ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n      disabled: !!disabled,\n      target,\n      ...(resolvedStyle && { style: resolvedStyle }),\n      ...(resolvedClassName && { className: resolvedClassName }),\n      ...(disabled && STATIC_DISABLED_PROPS),\n      ...(isActive && STATIC_ACTIVE_PROPS),\n    }\n  }\n\n  // ==========================================================================\n  // CLIENT-ONLY CODE\n  // Everything below this point only runs on the client. The `isServer` check\n  // above is a compile-time constant that bundlers use for dead code elimination,\n  // so this entire section is removed from server bundles.\n  //\n  // We disable the rules-of-hooks lint rule because these hooks appear after\n  // an early return. This is safe because:\n  // 1. `isServer` is a compile-time constant from conditional exports\n  // 2. In server bundles, this code is completely eliminated by the bundler\n  // 3. In client bundles, `isServer` is `false`, so the early return never executes\n  // ==========================================================================\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const isHydrated = useHydrated()\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const _options = React.useMemo(\n    () => options,\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [\n      router,\n      options.from,\n      options._fromLocation,\n      options.hash,\n      options.to,\n      options.search,\n      options.params,\n      options.state,\n      options.mask,\n      options.unsafeRelative,\n    ],\n  )\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const currentLocation = useStore(\n    router.stores.location,\n    (l) => l,\n    (prev, next) => prev.href === next.href,\n  )\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const next = React.useMemo(() => {\n    const opts = { _fromLocation: currentLocation, ..._options }\n    return router.buildLocation(opts as any)\n  }, [router, currentLocation, _options])\n\n  // Use publicHref - it contains the correct href for display\n  // When a rewrite changes the origin, publicHref is the full URL\n  // Otherwise it's the origin-stripped path\n  // This avoids constructing URL objects in the hot path\n  const hrefOptionPublicHref = next.maskedLocation\n    ? next.maskedLocation.publicHref\n    : next.publicHref\n  const hrefOptionExternal = next.maskedLocation\n    ? next.maskedLocation.external\n    : next.external\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const hrefOption = React.useMemo(\n    () =>\n      getHrefOption(\n        hrefOptionPublicHref,\n        hrefOptionExternal,\n        router.history,\n        disabled,\n      ),\n    [disabled, hrefOptionExternal, hrefOptionPublicHref, router.history],\n  )\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const externalLink = React.useMemo(() => {\n    if (hrefOption?.external) {\n      // Block dangerous protocols for external links\n      if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) {\n        if (process.env.NODE_ENV !== 'production') {\n          console.warn(\n            `Blocked Link with dangerous protocol: ${hrefOption.href}`,\n          )\n        }\n        return undefined\n      }\n      return hrefOption.href\n    }\n    const safeInternal = isSafeInternal(to)\n    if (safeInternal) return undefined\n    if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n    try {\n      new URL(to as any)\n      // Block dangerous protocols like javascript:, blob:, data:\n      if (isDangerousProtocol(to, router.protocolAllowlist)) {\n        if (process.env.NODE_ENV !== 'production') {\n          console.warn(`Blocked Link with dangerous protocol: ${to}`)\n        }\n        return undefined\n      }\n      return to\n    } catch {}\n    return undefined\n  }, [to, hrefOption, router.protocolAllowlist])\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const isActive = React.useMemo(() => {\n    if (externalLink) return false\n    if (activeOptions?.exact) {\n      const testExact = exactPathTest(\n        currentLocation.pathname,\n        next.pathname,\n        router.basepath,\n      )\n      if (!testExact) {\n        return false\n      }\n    } else {\n      const currentPathSplit = removeTrailingSlash(\n        currentLocation.pathname,\n        router.basepath,\n      )\n      const nextPathSplit = removeTrailingSlash(next.pathname, router.basepath)\n\n      const pathIsFuzzyEqual =\n        currentPathSplit.startsWith(nextPathSplit) &&\n        (currentPathSplit.length === nextPathSplit.length ||\n          currentPathSplit[nextPathSplit.length] === '/')\n\n      if (!pathIsFuzzyEqual) {\n        return false\n      }\n    }\n\n    if (activeOptions?.includeSearch ?? true) {\n      const searchTest = deepEqual(currentLocation.search, next.search, {\n        partial: !activeOptions?.exact,\n        ignoreUndefined: !activeOptions?.explicitUndefined,\n      })\n      if (!searchTest) {\n        return false\n      }\n    }\n\n    if (activeOptions?.includeHash) {\n      return isHydrated && currentLocation.hash === next.hash\n    }\n    return true\n  }, [\n    activeOptions?.exact,\n    activeOptions?.explicitUndefined,\n    activeOptions?.includeHash,\n    activeOptions?.includeSearch,\n    currentLocation,\n    externalLink,\n    isHydrated,\n    next.hash,\n    next.pathname,\n    next.search,\n    router.basepath,\n  ])\n\n  // Get the active props\n  const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n    ? (functionalUpdate(activeProps as any, {}) ?? STATIC_ACTIVE_OBJECT)\n    : STATIC_EMPTY_OBJECT\n\n  // Get the inactive props\n  const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n    isActive\n      ? STATIC_EMPTY_OBJECT\n      : (functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT)\n\n  const resolvedClassName = [\n    className,\n    resolvedActiveProps.className,\n    resolvedInactiveProps.className,\n  ]\n    .filter(Boolean)\n    .join(' ')\n\n  const resolvedStyle = (style ||\n    resolvedActiveProps.style ||\n    resolvedInactiveProps.style) && {\n    ...style,\n    ...resolvedActiveProps.style,\n    ...resolvedInactiveProps.style,\n  }\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const [isTransitioning, setIsTransitioning] = React.useState(false)\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const hasRenderFetched = React.useRef(false)\n\n  const preload =\n    options.reloadDocument || externalLink\n      ? false\n      : (userPreload ?? router.options.defaultPreload)\n  const preloadDelay =\n    userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const doPreload = React.useCallback(() => {\n    router\n      .preloadRoute({ ..._options, _builtLocation: next } as any)\n      .catch((err) => {\n        console.warn(err)\n        console.warn(preloadWarning)\n      })\n  }, [router, _options, next])\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  const preloadViewportIoCallback = React.useCallback(\n    (entry: IntersectionObserverEntry | undefined) => {\n      if (entry?.isIntersecting) {\n        doPreload()\n      }\n    },\n    [doPreload],\n  )\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  useIntersectionObserver(\n    innerRef,\n    preloadViewportIoCallback,\n    intersectionObserverOptions,\n    { disabled: !!disabled || !(preload === 'viewport') },\n  )\n\n  // eslint-disable-next-line react-hooks/rules-of-hooks\n  React.useEffect(() => {\n    if (hasRenderFetched.current) {\n      return\n    }\n    if (!disabled && preload === 'render') {\n      doPreload()\n      hasRenderFetched.current = true\n    }\n  }, [disabled, doPreload, preload])\n\n  // The click handler\n  const handleClick = (e: React.MouseEvent) => {\n    // Check actual element's target attribute as fallback\n    const elementTarget = (\n      e.currentTarget as HTMLAnchorElement | SVGAElement\n    ).getAttribute('target')\n    const effectiveTarget = target !== undefined ? target : elementTarget\n\n    if (\n      !disabled &&\n      !isCtrlEvent(e) &&\n      !e.defaultPrevented &&\n      (!effectiveTarget || effectiveTarget === '_self') &&\n      e.button === 0\n    ) {\n      e.preventDefault()\n\n      flushSync(() => {\n        setIsTransitioning(true)\n      })\n\n      const unsub = router.subscribe('onResolved', () => {\n        unsub()\n        setIsTransitioning(false)\n      })\n\n      // All is well? Navigate!\n      // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n      router.navigate({\n        ..._options,\n        replace,\n        resetScroll,\n        hashScrollIntoView,\n        startTransition,\n        viewTransition,\n        ignoreBlocker,\n      })\n    }\n  }\n\n  if (externalLink) {\n    return {\n      ...propsSafeToSpread,\n      ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n      href: externalLink,\n      ...(children && { children }),\n      ...(target && { target }),\n      ...(disabled && { disabled }),\n      ...(style && { style }),\n      ...(className && { className }),\n      ...(onClick && { onClick }),\n      ...(onBlur && { onBlur }),\n      ...(onFocus && { onFocus }),\n      ...(onMouseEnter && { onMouseEnter }),\n      ...(onMouseLeave && { onMouseLeave }),\n      ...(onTouchStart && { onTouchStart }),\n    }\n  }\n\n  const enqueueIntentPreload = (e: React.MouseEvent | React.FocusEvent) => {\n    if (disabled || preload !== 'intent') return\n\n    if (!preloadDelay) {\n      doPreload()\n      return\n    }\n\n    const eventTarget = e.currentTarget\n\n    if (timeoutMap.has(eventTarget)) {\n      return\n    }\n\n    const id = setTimeout(() => {\n      timeoutMap.delete(eventTarget)\n      doPreload()\n    }, preloadDelay)\n    timeoutMap.set(eventTarget, id)\n  }\n\n  const handleTouchStart = (_: React.TouchEvent) => {\n    if (disabled || preload !== 'intent') return\n    doPreload()\n  }\n\n  const handleLeave = (e: React.MouseEvent | React.FocusEvent) => {\n    if (disabled || !preload || !preloadDelay) return\n    const eventTarget = e.currentTarget\n    const id = timeoutMap.get(eventTarget)\n    if (id) {\n      clearTimeout(id)\n      timeoutMap.delete(eventTarget)\n    }\n  }\n\n  return {\n    ...propsSafeToSpread,\n    ...resolvedActiveProps,\n    ...resolvedInactiveProps,\n    href: hrefOption?.href,\n    ref: innerRef as React.ComponentPropsWithRef<'a'>['ref'],\n    onClick: composeHandlers([onClick, handleClick]),\n    onBlur: composeHandlers([onBlur, handleLeave]),\n    onFocus: composeHandlers([onFocus, enqueueIntentPreload]),\n    onMouseEnter: composeHandlers([onMouseEnter, enqueueIntentPreload]),\n    onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n    onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n    disabled: !!disabled,\n    target,\n    ...(resolvedStyle && { style: resolvedStyle }),\n    ...(resolvedClassName && { className: resolvedClassName }),\n    ...(disabled && STATIC_DISABLED_PROPS),\n    ...(isActive && STATIC_ACTIVE_PROPS),\n    ...(isHydrated && isTransitioning && STATIC_TRANSITIONING_PROPS),\n  }\n}\n\nconst STATIC_EMPTY_OBJECT = {}\nconst STATIC_ACTIVE_OBJECT = { className: 'active' }\nconst STATIC_DISABLED_PROPS = { role: 'link', 'aria-disabled': true }\nconst STATIC_ACTIVE_PROPS = { 'data-status': 'active', 'aria-current': 'page' }\nconst STATIC_TRANSITIONING_PROPS = { 'data-transitioning': 'transitioning' }\n\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nconst intersectionObserverOptions: IntersectionObserverInit = {\n  rootMargin: '100px',\n}\n\nconst composeHandlers =\n  (handlers: Array<undefined | React.EventHandler<any>>) =>\n  (e: React.SyntheticEvent) => {\n    for (const handler of handlers) {\n      if (!handler) continue\n      if (e.defaultPrevented) return\n      handler(e)\n    }\n  }\n\nfunction getHrefOption(\n  publicHref: string,\n  external: boolean,\n  history: AnyRouter['history'],\n  disabled: boolean | undefined,\n) {\n  if (disabled) return undefined\n  // Full URL means rewrite changed the origin - treat as external-like\n  if (external) {\n    return { href: publicHref, external: true }\n  }\n  return {\n    href: history.createHref(publicHref) || '/',\n    external: false,\n  }\n}\n\nfunction isSafeInternal(to: unknown) {\n  if (typeof to !== 'string') return false\n  const zero = to.charCodeAt(0)\n  if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n  return zero === 46 // '.', '..', './', '../'\n}\n\ntype UseLinkReactProps<TComp> = TComp extends keyof React.JSX.IntrinsicElements\n  ? React.JSX.IntrinsicElements[TComp]\n  : TComp extends React.ComponentType<any>\n    ? React.ComponentPropsWithoutRef<TComp> &\n        React.RefAttributes<React.ComponentRef<TComp>>\n    : never\n\nexport type UseLinkPropsOptions<\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n  TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  UseLinkReactProps<'a'>\n\nexport type ActiveLinkOptions<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n  LinkComponentReactProps<TComp> & {\n    [key: `data-${string}`]: unknown\n  }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n  /**\n   * A function that returns additional props for the `active` state of this link.\n   * These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n   */\n  activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n  /**\n   * A function that returns additional props for the `inactive` state of this link.\n   * These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n   */\n  inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n  LinkPropsChildren\n\nexport interface LinkPropsChildren {\n  // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n  children?:\n    | React.ReactNode\n    | ((state: {\n        isActive: boolean\n        isTransitioning: boolean\n      }) => React.ReactNode)\n}\n\ntype LinkComponentReactProps<TComp> = Omit<\n  UseLinkReactProps<TComp>,\n  keyof CreateLinkProps\n>\n\nexport type LinkComponentProps<\n  TComp = 'a',\n  TRouter extends AnyRouter = RegisteredRouter,\n  TFrom extends string = string,\n  TTo extends string | undefined = '.',\n  TMaskFrom extends string = TFrom,\n  TMaskTo extends string = '.',\n> = LinkComponentReactProps<TComp> &\n  LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n  any,\n  any,\n  string,\n  string,\n  string,\n  string\n>\n\nexport type LinkComponent<\n  in out TComp,\n  in out TDefaultFrom extends string = string,\n> = <\n  TRouter extends AnyRouter = RegisteredRouter,\n  const TFrom extends string = TDefaultFrom,\n  const TTo extends string | undefined = undefined,\n  const TMaskFrom extends string = TFrom,\n  const TMaskTo extends string = '',\n>(\n  props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => React.ReactElement\n\nexport interface LinkComponentRoute<\n  in out TDefaultFrom extends string = string,\n> {\n  defaultFrom: TDefaultFrom;\n  <\n    TRouter extends AnyRouter = RegisteredRouter,\n    const TTo extends string | undefined = undefined,\n    const TMaskTo extends string = '',\n  >(\n    props: LinkComponentProps<\n      'a',\n      TRouter,\n      this['defaultFrom'],\n      TTo,\n      this['defaultFrom'],\n      TMaskTo\n    >,\n  ): React.ReactElement\n}\n\n/**\n * Creates a typed Link-like component that preserves TanStack Router's\n * navigation semantics and type-safety while delegating rendering to the\n * provided host component.\n *\n * Useful for integrating design system anchors/buttons while keeping\n * router-aware props (eg. `to`, `params`, `search`, `preload`).\n *\n * @param Comp The host component to render (eg. a design-system Link/Button)\n * @returns A router-aware component with the same API as `Link`.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n */\nexport function createLink<const TComp>(\n  Comp: Constrain<TComp, any, (props: CreateLinkProps) => ReactNode>,\n): LinkComponent<TComp> {\n  return React.forwardRef(function CreatedLink(props, ref) {\n    return <Link {...(props as any)} _asChild={Comp} ref={ref} />\n  }) as any\n}\n\n/**\n * A strongly-typed anchor component for declarative navigation.\n * Handles path, search, hash and state updates with optional route preloading\n * and active-state styling.\n *\n * Props:\n * - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n * - `preloadDelay`: Delay in ms before preloading on hover\n * - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n * - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n * - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n * - `ignoreBlocker`: Bypass registered blockers\n *\n * @returns An anchor-like element that navigates without full page reloads.\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n */\nexport const Link: LinkComponent<'a'> = React.forwardRef<Element, any>(\n  (props, ref) => {\n    const { _asChild, ...rest } = props\n    const { type: _type, ...linkProps } = useLinkProps(rest as any, ref)\n\n    const children =\n      typeof rest.children === 'function'\n        ? rest.children({\n            isActive: (linkProps as any)['data-status'] === 'active',\n          })\n        : rest.children\n\n    if (!_asChild) {\n      // the ReturnType of useLinkProps returns the correct type for a <a> element, not a general component that has a disabled prop\n      // @ts-expect-error\n      const { disabled: _, ...rest } = linkProps\n      return React.createElement('a', rest, children)\n    }\n    return React.createElement(_asChild, linkProps, children)\n  },\n) as any\n\nfunction isCtrlEvent(e: React.MouseEvent) {\n  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nexport type LinkOptionsFnOptions<\n  TOptions,\n  TComp,\n  TRouter extends AnyRouter = RegisteredRouter,\n> =\n  TOptions extends ReadonlyArray<any>\n    ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n    : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n  const TOptions,\n  TRouter extends AnyRouter = RegisteredRouter,\n>(\n  options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\n/**\n * Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n * Accepts a literal options object and returns it typed for later spreading.\n * @example\n * const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n */\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n  return options as any\n}\n\n/**\n * Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n * Use to validate and reuse navigation options across your app.\n * @example\n * const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,aAOd,SACA,cACkC;CAClC,MAAM,SAAS,kBAAA,UAAU;CACzB,MAAM,WAAW,cAAA,gBAAgB,YAAY;CAG7C,MAAM,YAAY,+BAAA,YAAY,OAAO;CAErC,MAAM,EAEJ,aACA,eACA,eACA,IACA,SAAS,aACT,cAAc,kBACd,wBAAwB,yBACxB,oBACA,SACA,iBACA,aACA,gBAEA,UACA,QACA,UACA,OACA,WACA,SACA,QACA,SACA,cACA,cACA,cACA,eAEA,QAAQ,SACR,QAAQ,SACR,MAAM,OACN,OAAO,QACP,MAAM,OACN,gBAAgB,iBAChB,gBAAgB,iBAChB,MAAM,OACN,eACA,GAAG,sBACD;CAaJ,IAAI,WAAW;EACb,MAAM,eAAe,eAAe,EAAE;EAItC,IACE,OAAO,OAAO,YACd,CAAC,gBAED,GAAG,QAAQ,GAAG,IAAI,IAElB,IAAI;GACF,IAAI,IAAI,EAAE;GACV,KAAA,GAAA,sBAAA,qBAAwB,IAAI,OAAO,iBAAiB,GAAG;IACrD,IAAA,QAAA,IAAA,aAA6B,cAC3B,QAAQ,KAAK,yCAAyC,IAAI;IAE5D,OAAO;KACL,GAAG;KACH,KAAK;KACL,MAAM,KAAA;KACN,GAAI,YAAY,EAAE,SAAS;KAC3B,GAAI,UAAU,EAAE,OAAO;KACvB,GAAI,YAAY,EAAE,SAAS;KAC3B,GA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