import{useEffect as l,useRef as i}from"react";import{useLocation as s}from"react-router-dom";import{removeLeadingSlash as n}from"@redocly/theme/core/openapi";import{getElementById as a}from"../Content/useAutoScroll.js";function m(r,c){const e=i(null),o=s(),f=n(o.pathname.replace(c,""));return l(()=>{if(e.current&&r.href&&n(r.href)===f&&(typeof e?.current?.scrollIntoView=="function"&&e.current.scrollIntoView(),o.hash)){const t=a(o.hash.replace("#","").toLowerCase());t&&t.scrollIntoView()}},[]),e}var w=m;export{w as default};
