diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt index 97704808..58d0d97b 100644 --- a/THIRD_PARTY.txt +++ b/THIRD_PARTY.txt @@ -1491,7 +1491,7 @@ https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production https://cdnjs.cloudflare.com/ajax/libs/react-redux/7.2.8/react-redux.min.js https://cdnjs.cloudflare.com/ajax/libs/react-redux/8.0.5/react-redux.min.js https://cdnjs.cloudflare.com/ajax/libs/react-router/5.3.3/react-router.min.js -https://cdnjs.cloudflare.com/ajax/libs/react-router/6.5.0/react-router.production.min.js +https://cdnjs.cloudflare.com/ajax/libs/react-router/6.6.0/react-router.production.min.js https://cdnjs.cloudflare.com/ajax/libs/redux/4.2.0/redux.min.js https://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.7.1/rickshaw.min.css https://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.7.1/rickshaw.min.js diff --git a/modules/internal/targets.js b/modules/internal/targets.js index 2d27d4e6..dfb83234 100644 --- a/modules/internal/targets.js +++ b/modules/internal/targets.js @@ -407,7 +407,7 @@ targets.setLastVersion = function (type, version) { if (type.startsWith('/react-redux/7.')) return '7.2.8'; if (type.startsWith('/react-redux/8.')) return '8.0.5'; if (type.startsWith('/react-router/5.')) return '5.3.3'; - if (type.startsWith('/react-router/6.')) return '6.5.0'; + if (type.startsWith('/react-router/6.')) return '6.6.0'; if (type.startsWith('/react-side-effect/')) return '2.1.2'; if (type.startsWith('/react-lifecycles-compat/')) return '3.0.4'; if (type.startsWith('/redux/4.')) return '4.2.0'; diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 0594e0ee..846dc969 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -37,7 +37,7 @@
  • dygraph v2.1.0 -> v2.1.2 (#1261)
  • slider-pro v1.6.0 -> v1.6.1 (#1262)
  • Chart.js v4.0.1 -> v4.1.1 (#1263)
  • -
  • react-router v6.4.5 -> v6.5.0 (#1266)
  • +
  • react-router v6.4.5 -> v6.6.0 (#1266)
  • algoliasearch v4.14.2 -> v4.14.3 (#1267)
  • Added

    diff --git a/resources/react-router/6.5.0/react-router.min.jsm b/resources/react-router/6.5.0/react-router.min.jsm deleted file mode 100644 index 0c9283db..00000000 --- a/resources/react-router/6.5.0/react-router.min.jsm +++ /dev/null @@ -1,12 +0,0 @@ -/** - * React Router v6.5.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@remix-run/router"),require("react")):"function"==typeof define&&define.amd?define(["exports","@remix-run/router","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.RemixRouter,e.React)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(r);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.value=n,a.getSnapshot=t,d(a)&&o({inst:a})}),[e,n,t]),l((()=>{d(a)&&o({inst:a});return e((()=>{d(a)&&o({inst:a})}))}),[e]),c(n),n},h="useSyncExternalStore"in a?(e=>e.useSyncExternalStore)(a):p,m=a.createContext(null),f=a.createContext(null),v=a.createContext(null),g=a.createContext(null),y=a.createContext(null),E=a.createContext(null),b=a.createContext({outlet:null,matches:[]}),x=a.createContext(null);function P(){return null!=a.useContext(E)}function R(){return P()||t.invariant(!1),a.useContext(E).location}function C(){P()||t.invariant(!1);let{basename:e,navigator:r}=a.useContext(y),{matches:n}=a.useContext(b),{pathname:o}=R(),i=JSON.stringify(t.UNSAFE_getPathContributingMatches(n).map((e=>e.pathnameBase))),u=a.useRef(!1);return a.useEffect((()=>{u.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!u.current)return;if("number"==typeof n)return void r.go(n);let l=t.resolveTo(n,JSON.parse(i),o,"path"===a.relative);"/"!==e&&(l.pathname="/"===l.pathname?e:t.joinPaths([e,l.pathname])),(a.replace?r.replace:r.push)(l,a.state,a)}),[e,r,i,o])}const O=a.createContext(null);function j(e){let t=a.useContext(b).outlet;return t?a.createElement(O.Provider,{value:e},t):t}function S(e,r){let{relative:n}=void 0===r?{}:r,{matches:o}=a.useContext(b),{pathname:i}=R(),u=JSON.stringify(t.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase)));return a.useMemo((()=>t.resolveTo(e,JSON.parse(u),i,"path"===n)),[e,u,i,n])}function D(e,r){P()||t.invariant(!1);let{navigator:n}=a.useContext(y),i=a.useContext(v),{matches:u}=a.useContext(b),l=u[u.length-1],s=l?l.params:{};!l||l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let d,p=R();if(r){var h;let e="string"==typeof r?t.parsePath(r):r;"/"===c||(null==(h=e.pathname)?void 0:h.startsWith(c))||t.invariant(!1),d=e}else d=p;let m=d.pathname||"/",f="/"===c?m:m.slice(c.length)||"/",g=t.matchRoutes(e,{pathname:f}),x=N(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:t.joinPaths([c,n.encodeLocation?n.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:t.joinPaths([c,n.encodeLocation?n.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),u,i||void 0);return r&&x?a.createElement(E.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:t.Action.Pop}},x):x}function _(){let e=T(),r=t.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unhandled Thrown Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},r),n?a.createElement("pre",{style:i},n):null,a.createElement("p",null,"💿 Hey developer 👋"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:u},"errorElement")," props on ",a.createElement("code",{style:u},"")))}class U extends a.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?a.createElement(x.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function A(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(m);return o&&r.route.errorElement&&(o._deepestRenderedBoundaryId=r.route.id),a.createElement(b.Provider,{value:t},n)}function N(e,r,n){if(void 0===r&&(r=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let o=e,i=null==n?void 0:n.errors;if(null!=i){let e=o.findIndex((e=>e.route.id&&(null==i?void 0:i[e.route.id])));e>=0||t.invariant(!1),o=o.slice(0,Math.min(o.length,e+1))}return o.reduceRight(((e,t,u)=>{let l=t.route.id?null==i?void 0:i[t.route.id]:null,s=n?t.route.errorElement||a.createElement(_,null):null,c=()=>a.createElement(A,{match:t,routeContext:{outlet:e,matches:r.concat(o.slice(0,u+1))}},l?s:void 0!==t.route.element?t.route.element:e);return n&&(t.route.errorElement||0===u)?a.createElement(U,{location:n.location,component:s,error:l,children:c()}):c()}),null)}var M,w,L;function F(e){let r=a.useContext(v);return r||t.invariant(!1),r}function T(){var e;let r=a.useContext(x),n=F(w.UseRouteError),o=a.useContext(b),i=o.matches[o.matches.length-1];return r||(o||t.invariant(!1),i.route.id||t.invariant(!1),null==(e=n.errors)?void 0:e[i.route.id])}function k(){let e=a.useContext(g);return null==e?void 0:e._data}function B(e){t.invariant(!1)}function H(e){let{basename:r="/",children:n=null,location:o,navigationType:i=t.Action.Pop,navigator:u,static:l=!1}=e;P()&&t.invariant(!1);let s=r.replace(/^\/*/,"/"),c=a.useMemo((()=>({basename:s,navigator:u,static:l})),[s,u,l]);"string"==typeof o&&(o=t.parsePath(o));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:f="default"}=o,v=a.useMemo((()=>{let e=t.stripBasename(d,s);return null==e?null:{pathname:e,search:p,hash:h,state:m,key:f}}),[s,d,p,h,m,f]);return null==v?null:a.createElement(y.Provider,{value:c},a.createElement(E.Provider,{children:n,value:{location:v,navigationType:i}}))}function I(e){let{children:t,location:r}=e,n=a.useContext(f);return D(n&&!t?n.router.routes:q(t),r)}!function(e){e.UseRevalidator="useRevalidator"}(M||(M={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(w||(w={})),function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(L||(L={}));const J=new Promise((()=>{}));class z extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:r,resolve:n}=this.props,o=null,i=L.pending;if(n instanceof Promise)if(this.state.error){i=L.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?L.error:void 0!==o._data?L.success:L.pending):(i=L.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=L.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===L.error&&o._error instanceof t.AbortedDeferredError)throw J;if(i===L.error&&!r)throw o._error;if(i===L.error)return a.createElement(g.Provider,{value:o,children:r});if(i===L.success)return a.createElement(g.Provider,{value:o,children:e});throw o}}function V(e){let{children:t}=e,r=k();return"function"==typeof t?t(r):a.createElement(a.Fragment,null,t)}function q(e,r){void 0===r&&(r=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;if(e.type===a.Fragment)return void n.push.apply(n,q(e.props.children,r));e.type!==B&&t.invariant(!1),e.props.index&&e.props.children&&t.invariant(!1);let i=[...r,o],u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(u.children=q(e.props.children,i)),n.push(u)})),n}function W(e){return e.map((e=>{let t=o({},e);return null==t.hasErrorBoundary&&(t.hasErrorBoundary=null!=t.errorElement),t.children&&(t.children=W(t.children)),t}))}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return t.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return t.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return t.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return t.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return t.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return t.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return t.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return t.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return t.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return t.redirect}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return t.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(z,{resolve:n,errorElement:r},a.createElement(V,null,t))},e.MemoryRouter=function(e){let{basename:r,children:n,initialEntries:o,initialIndex:i}=e,u=a.useRef();null==u.current&&(u.current=t.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let l=u.current,[s,c]=a.useState({action:l.action,location:l.location});return a.useLayoutEffect((()=>l.listen(c)),[l]),a.createElement(H,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})},e.Navigate=function(e){let{to:r,replace:n,state:o,relative:i}=e;P()||t.invariant(!1);let u=a.useContext(v),l=C();return a.useEffect((()=>{u&&"idle"!==u.navigation.state||l(r,{replace:n,state:o,relative:i})})),null},e.Outlet=function(e){return j(e.context)},e.Route=B,e.Router=H,e.RouterProvider=function(e){let{fallbackElement:t,router:r}=e,n=h(r.subscribe,(()=>r.state),(()=>r.state)),o=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),i=r.basename||"/";return a.createElement(f.Provider,{value:{router:r,navigator:o,static:!1,basename:i}},a.createElement(v.Provider,{value:n},a.createElement(H,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:o},r.state.initialized?a.createElement(I,null):t)))},e.Routes=I,e.UNSAFE_DataRouterContext=f,e.UNSAFE_DataRouterStateContext=v,e.UNSAFE_DataStaticRouterContext=m,e.UNSAFE_LocationContext=E,e.UNSAFE_NavigationContext=y,e.UNSAFE_RouteContext=b,e.UNSAFE_enhanceManualRouteObjects=W,e.createMemoryRouter=function(e,r){return t.createRouter({basename:null==r?void 0:r.basename,history:t.createMemoryHistory({initialEntries:null==r?void 0:r.initialEntries,initialIndex:null==r?void 0:r.initialIndex}),hydrationData:null==r?void 0:r.hydrationData,routes:W(e)}).initialize()},e.createRoutesFromChildren=q,e.createRoutesFromElements=q,e.renderMatches=function(e){return N(e)},e.useActionData=function(){let e=F(w.UseActionData);return a.useContext(b)||t.invariant(!1),Object.values((null==e?void 0:e.actionData)||{})[0]},e.useAsyncError=function(){let e=a.useContext(g);return null==e?void 0:e._error},e.useAsyncValue=k,e.useHref=function(e,r){let{relative:n}=void 0===r?{}:r;P()||t.invariant(!1);let{basename:o,navigator:i}=a.useContext(y),{hash:u,pathname:l,search:s}=S(e,{relative:n}),c=l;return"/"!==o&&(c="/"===l?o:t.joinPaths([o,l])),i.createHref({pathname:c,search:s,hash:u})},e.useInRouterContext=P,e.useLoaderData=function(){let e=F(w.UseLoaderData),r=a.useContext(b);r||t.invariant(!1);let n=r.matches[r.matches.length-1];return n.route.id||t.invariant(!1),e.loaderData[n.route.id]},e.useLocation=R,e.useMatch=function(e){P()||t.invariant(!1);let{pathname:r}=R();return a.useMemo((()=>t.matchPath(e,r)),[r,e])},e.useMatches=function(){let{matches:e,loaderData:t}=F(w.UseMatches);return a.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])},e.useNavigate=C,e.useNavigation=function(){return F(w.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(E).navigationType},e.useOutlet=j,e.useOutletContext=function(){return a.useContext(O)},e.useParams=function(){let{matches:e}=a.useContext(b),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=S,e.useRevalidator=function(){let e=function(e){let r=a.useContext(f);return r||t.invariant(!1),r}(M.UseRevalidator),r=F(w.UseRevalidator);return{revalidate:e.router.revalidate,state:r.revalidation}},e.useRouteError=T,e.useRouteLoaderData=function(e){return F(w.UseRouteLoaderData).loaderData[e]},e.useRoutes=D,Object.defineProperty(e,"__esModule",{value:!0})})); -//# sourceMappingURL=react-router.production.min.js.map diff --git a/resources/react-router/6.5.0/note b/resources/react-router/6.6.0/note similarity index 100% rename from resources/react-router/6.5.0/note rename to resources/react-router/6.6.0/note diff --git a/resources/react-router/6.6.0/react-router.min.jsm b/resources/react-router/6.6.0/react-router.min.jsm new file mode 100644 index 00000000..faaf7f16 --- /dev/null +++ b/resources/react-router/6.6.0/react-router.min.jsm @@ -0,0 +1,12 @@ +/** + * React Router v6.6.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@remix-run/router"),require("react")):"function"==typeof define&&define.amd?define(["exports","@remix-run/router","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.RemixRouter,e.React)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(r);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.value=n,a.getSnapshot=t,d(a)&&o({inst:a})}),[e,n,t]),l((()=>{d(a)&&o({inst:a});return e((()=>{d(a)&&o({inst:a})}))}),[e]),c(n),n},h="useSyncExternalStore"in a?(e=>e.useSyncExternalStore)(a):p,m=a.createContext(null),f=a.createContext(null),v=a.createContext(null),g=a.createContext(null),E=a.createContext(null),y=a.createContext(null),b=a.createContext({outlet:null,matches:[]}),x=a.createContext(null);function P(){return null!=a.useContext(y)}function R(){return P()||t.invariant(!1),a.useContext(y).location}function C(){P()||t.invariant(!1);let{basename:e,navigator:r}=a.useContext(E),{matches:n}=a.useContext(b),{pathname:o}=R(),i=JSON.stringify(t.UNSAFE_getPathContributingMatches(n).map((e=>e.pathnameBase))),u=a.useRef(!1);return a.useEffect((()=>{u.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!u.current)return;if("number"==typeof n)return void r.go(n);let l=t.resolveTo(n,JSON.parse(i),o,"path"===a.relative);"/"!==e&&(l.pathname="/"===l.pathname?e:t.joinPaths([e,l.pathname])),(a.replace?r.replace:r.push)(l,a.state,a)}),[e,r,i,o])}const O=a.createContext(null);function j(e){let t=a.useContext(b).outlet;return t?a.createElement(O.Provider,{value:e},t):t}function S(e,r){let{relative:n}=void 0===r?{}:r,{matches:o}=a.useContext(b),{pathname:i}=R(),u=JSON.stringify(t.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase)));return a.useMemo((()=>t.resolveTo(e,JSON.parse(u),i,"path"===n)),[e,u,i,n])}function D(e,r){P()||t.invariant(!1);let{navigator:n}=a.useContext(E),i=a.useContext(v),{matches:u}=a.useContext(b),l=u[u.length-1],s=l?l.params:{};!l||l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let d,p=R();if(r){var h;let e="string"==typeof r?t.parsePath(r):r;"/"===c||(null==(h=e.pathname)?void 0:h.startsWith(c))||t.invariant(!1),d=e}else d=p;let m=d.pathname||"/",f="/"===c?m:m.slice(c.length)||"/",g=t.matchRoutes(e,{pathname:f}),x=N(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:t.joinPaths([c,n.encodeLocation?n.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:t.joinPaths([c,n.encodeLocation?n.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),u,i||void 0);return r&&x?a.createElement(y.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:t.Action.Pop}},x):x}function U(){let e=k(),r=t.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unhandled Thrown Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},r),n?a.createElement("pre",{style:i},n):null,a.createElement("p",null,"💿 Hey developer 👋"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:u},"errorElement")," props on ",a.createElement("code",{style:u},"")))}class _ extends a.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?a.createElement(b.Provider,{value:this.props.routeContext},a.createElement(x.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function A(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(m);return o&&r.route.errorElement&&(o._deepestRenderedBoundaryId=r.route.id),a.createElement(b.Provider,{value:t},n)}function N(e,r,n){if(void 0===r&&(r=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let o=e,i=null==n?void 0:n.errors;if(null!=i){let e=o.findIndex((e=>e.route.id&&(null==i?void 0:i[e.route.id])));e>=0||t.invariant(!1),o=o.slice(0,Math.min(o.length,e+1))}return o.reduceRight(((e,t,u)=>{let l=t.route.id?null==i?void 0:i[t.route.id]:null,s=n?t.route.errorElement||a.createElement(U,null):null,c=r.concat(o.slice(0,u+1)),d=()=>a.createElement(A,{match:t,routeContext:{outlet:e,matches:c}},l?s:void 0!==t.route.element?t.route.element:e);return n&&(t.route.errorElement||0===u)?a.createElement(_,{location:n.location,component:s,error:l,children:d(),routeContext:{outlet:null,matches:c}}):d()}),null)}var M,w,L;function F(e){let r=a.useContext(v);return r||t.invariant(!1),r}function T(e){let r=function(e){let r=a.useContext(b);return r||t.invariant(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||t.invariant(!1),n.route.id}function k(){var e;let t=a.useContext(x),r=F(w.UseRouteError),n=T(w.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}function B(){let e=a.useContext(g);return null==e?void 0:e._data}function I(e){t.invariant(!1)}function H(e){let{basename:r="/",children:n=null,location:o,navigationType:i=t.Action.Pop,navigator:u,static:l=!1}=e;P()&&t.invariant(!1);let s=r.replace(/^\/*/,"/"),c=a.useMemo((()=>({basename:s,navigator:u,static:l})),[s,u,l]);"string"==typeof o&&(o=t.parsePath(o));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:f="default"}=o,v=a.useMemo((()=>{let e=t.stripBasename(d,s);return null==e?null:{pathname:e,search:p,hash:h,state:m,key:f}}),[s,d,p,h,m,f]);return null==v?null:a.createElement(E.Provider,{value:c},a.createElement(y.Provider,{children:n,value:{location:v,navigationType:i}}))}function J(e){let{children:t,location:r}=e,n=a.useContext(f);return D(n&&!t?n.router.routes:Y(t),r)}!function(e){e.UseRevalidator="useRevalidator"}(M||(M={})),function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(w||(w={})),function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(L||(L={}));const z=new Promise((()=>{}));class V extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:r,resolve:n}=this.props,o=null,i=L.pending;if(n instanceof Promise)if(this.state.error){i=L.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?L.error:void 0!==o._data?L.success:L.pending):(i=L.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=L.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===L.error&&o._error instanceof t.AbortedDeferredError)throw z;if(i===L.error&&!r)throw o._error;if(i===L.error)return a.createElement(g.Provider,{value:o,children:r});if(i===L.success)return a.createElement(g.Provider,{value:o,children:e});throw o}}function q(e){let{children:t}=e,r=B();return"function"==typeof t?t(r):a.createElement(a.Fragment,null,t)}function Y(e,r){void 0===r&&(r=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;if(e.type===a.Fragment)return void n.push.apply(n,Y(e.props.children,r));e.type!==I&&t.invariant(!1),e.props.index&&e.props.children&&t.invariant(!1);let i=[...r,o],u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(u.children=Y(e.props.children,i)),n.push(u)})),n}function W(e){return e.map((e=>{let t=o({},e);return null==t.hasErrorBoundary&&(t.hasErrorBoundary=null!=t.errorElement),t.children&&(t.children=W(t.children)),t}))}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return t.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return t.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return t.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return t.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return t.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return t.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return t.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return t.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return t.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return t.redirect}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return t.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(V,{resolve:n,errorElement:r},a.createElement(q,null,t))},e.MemoryRouter=function(e){let{basename:r,children:n,initialEntries:o,initialIndex:i}=e,u=a.useRef();null==u.current&&(u.current=t.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let l=u.current,[s,c]=a.useState({action:l.action,location:l.location});return a.useLayoutEffect((()=>l.listen(c)),[l]),a.createElement(H,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})},e.Navigate=function(e){let{to:r,replace:n,state:o,relative:i}=e;P()||t.invariant(!1);let u=a.useContext(v),l=C();return a.useEffect((()=>{u&&"idle"!==u.navigation.state||l(r,{replace:n,state:o,relative:i})})),null},e.Outlet=function(e){return j(e.context)},e.Route=I,e.Router=H,e.RouterProvider=function(e){let{fallbackElement:t,router:r}=e,n=h(r.subscribe,(()=>r.state),(()=>r.state)),o=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),i=r.basename||"/";return a.createElement(f.Provider,{value:{router:r,navigator:o,static:!1,basename:i}},a.createElement(v.Provider,{value:n},a.createElement(H,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:o},r.state.initialized?a.createElement(J,null):t)))},e.Routes=J,e.UNSAFE_DataRouterContext=f,e.UNSAFE_DataRouterStateContext=v,e.UNSAFE_DataStaticRouterContext=m,e.UNSAFE_LocationContext=y,e.UNSAFE_NavigationContext=E,e.UNSAFE_RouteContext=b,e.UNSAFE_enhanceManualRouteObjects=W,e.createMemoryRouter=function(e,r){return t.createRouter({basename:null==r?void 0:r.basename,history:t.createMemoryHistory({initialEntries:null==r?void 0:r.initialEntries,initialIndex:null==r?void 0:r.initialIndex}),hydrationData:null==r?void 0:r.hydrationData,routes:W(e)}).initialize()},e.createRoutesFromChildren=Y,e.createRoutesFromElements=Y,e.renderMatches=function(e){return N(e)},e.useActionData=function(){let e=F(w.UseActionData);return a.useContext(b)||t.invariant(!1),Object.values((null==e?void 0:e.actionData)||{})[0]},e.useAsyncError=function(){let e=a.useContext(g);return null==e?void 0:e._error},e.useAsyncValue=B,e.useHref=function(e,r){let{relative:n}=void 0===r?{}:r;P()||t.invariant(!1);let{basename:o,navigator:i}=a.useContext(E),{hash:u,pathname:l,search:s}=S(e,{relative:n}),c=l;return"/"!==o&&(c="/"===l?o:t.joinPaths([o,l])),i.createHref({pathname:c,search:s,hash:u})},e.useInRouterContext=P,e.useLoaderData=function(){let e=F(w.UseLoaderData),t=T(w.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=R,e.useMatch=function(e){P()||t.invariant(!1);let{pathname:r}=R();return a.useMemo((()=>t.matchPath(e,r)),[r,e])},e.useMatches=function(){let{matches:e,loaderData:t}=F(w.UseMatches);return a.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])},e.useNavigate=C,e.useNavigation=function(){return F(w.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(y).navigationType},e.useOutlet=j,e.useOutletContext=function(){return a.useContext(O)},e.useParams=function(){let{matches:e}=a.useContext(b),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=S,e.useRevalidator=function(){let e=function(e){let r=a.useContext(f);return r||t.invariant(!1),r}(M.UseRevalidator),r=F(w.UseRevalidator);return{revalidate:e.router.revalidate,state:r.revalidation}},e.useRouteError=k,e.useRouteLoaderData=function(e){return F(w.UseRouteLoaderData).loaderData[e]},e.useRoutes=D,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=react-router.production.min.js.map