xt of a component."):l(!1);return useContext(r).location} function A(){z()?void 0:"production"!==process.env.NODE_ENV?l(!1,"useNavigate() may be used only in the context of a component."):l(!1);var a=useContext(r).navigator,b=useContext(v).pathname,c=useRef(!1);useEffect(function(){c.current=!0});return useCallback(function(d,e){void 0===e&&(e={});c.current?"number"===typeof d?a.go(d):(d=J(d,b),(e.replace?a.replace:a.push)(d,e.state)):"production"!==process.env.NODE_ENV?m(!1,"You should call navigate() in a useEffect, not when your component is first rendered."): void 0},[a,b])}function C(){return useContext(v).outlet}function K(a){var b=useContext(v).pathname;return useMemo(function(){return J(a,b)},[a,b])} function G(a,b){void 0===b&&(b="");var c=useContext(v),d=c.route,e=c.pathname,g=c.params;"production"!==process.env.NODE_ENV&&(c=d&&d.path,q(e,!d||d.path.endsWith("*"),'You rendered descendant (or called `useRoutes`) at "'+e+'" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent to .')));b=b?L([e,b]):e;var h=H();return(d=useMemo(function(){return M(a,h,b)},[h,a,b]))?d.reduceRight(function(a,c){var d=c.pathname,e=c.route;return createElement(v.Provider,{children:e.element,value:{outlet:a,params:k(f({},g,{},c.params)),pathname:L([b,d]),route:e}})},null):null}function N(a){return a.map(function(a){var c={path:a.path||"/",caseSensitive:!0===a.caseSensitive,element:a.element||createElement(B,null)};a.children&&(c.children=N(a.children));return c})} function F(a){var b=[];Children.forEach(a,function(a){if(isValidElement(a))if(a.type===Fragment)b.push.apply(b,F(a.props.children));else{var c={path:a.props.path||"/",caseSensitive:!0===a.props.caseSensitive,element:a};a.props.children&&(a=F(a.props.children),a.length&&(c.children=a));b.push(c)}});return b} function M(a,b,c){void 0===c&&(c="");"string"===typeof b&&(b=parsePath(b));b=b.pathname||"/";if(c)if(c=c.replace(/^\/*/,"/").replace(/\/+$/,""),b.startsWith(c))b=b===c?"/":b.slice(c.length);else return null;a=O(a);P(a);var d=null;for(c=0;null==d&&c component."):l(!1);var c=useContext(r).navigator;useEffect(function(){if(b){var d=c.block(function(b){var c=f({},b,{retry:function(){d();b.retry()}});a(c)});return d}},[c,a,b])}; function useHref(a){z()?void 0:"production"!==process.env.NODE_ENV?l(!1,"useHref() may be used only in the context of a component."):l(!1);var b=useContext(r).navigator;a=K(a);return b.createHref(a)};function useMatch(a){z()?void 0:"production"!==process.env.NODE_ENV?l(!1,"useMatch() may be used only in the context of a component."):l(!1);var b=H();return Q(a,b.pathname)}; function useParams(){return useContext(v).params};function useRoutes(a,b){void 0===b&&(b="");z()?void 0:"production"!==process.env.NODE_ENV?l(!1,"useRoutes() may be used only in the context of a component."):l(!1);var c=useMemo(function(){return N(a)},[a]);return G(c,b)};export{w as MemoryRouter,y as Navigate,B as Outlet,D as Route,x as Router,E as Routes,N as createRoutesFromArray,F as createRoutesFromChildren,generatePath,Q as matchPath,M as matchRoutes,J as resolvePath,useBlocker,useHref,z as useInRouterContext,H as useLocation,useMatch,A as useNavigate,C as useOutlet,useParams,K as useResolvedPath,useRoutes} //# sourceMappingURL=index.js.map