@module-federation/treeshake-server 2.3.0 → 2.3.2

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.
@@ -1,4 +0,0 @@
1
- /*! For license information please see lib-router.ec054261.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_module_federation_treeshake_frontend=self.webpackChunk_module_federation_treeshake_frontend||[]).push([["535"],{3453(e,t,n){n.d(t,{I9:()=>eC,Zp:()=>J,zy:()=>I});var r,a=n(2155),o="popstate";function i(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function l(e,t){if(!1===e||null==e)throw Error(t)}function u(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function s(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function c(e,t,n=null,r,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?d(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),unstable_mask:a}}function h({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function d(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function p(e,t=!1){let n="http://localhost";"u">typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),l(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:h(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function m(e,t,n="/"){return function(e,t,n,r){let a=v(("string"==typeof t?d(t):t).pathname||"/",n);if(null==a)return null;let o=function e(t,n=[],r=[],a="",o=!1){let i=(t,i,u=o,s)=>{var c,h;let d,p,m={relativePath:void 0===s?t.path||"":s,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&u)return;l(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let y=C([a,m.relativePath]),v=r.concat(m);t.children&&t.children.length>0&&(l(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),e(t.children,n,v,y,u)),(null!=t.path||t.index)&&n.push({path:y,score:(c=y,h=t.index,p=(d=c.split("/")).length,d.some(g)&&(p+=-2),h&&(p+=2),d.filter(e=>!g(e)).reduce((e,t)=>e+(f.test(t)?3:""===t?1:10),p)),routesMeta:v})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of function e(t){let n=t.split("/");if(0===n.length)return[];let[r,...a]=n,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),u=[];return u.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&u.push(...l),u.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))i(e,t,!0,n);else i(e,t)}),n}(e);o.sort((e,t)=>{var n,r;return e.score!==t.score?t.score-e.score:(n=e.routesMeta.map(e=>e.childrenIndex),r=t.routesMeta.map(e=>e.childrenIndex),n.length===r.length&&n.slice(0,-1).every((e,t)=>e===r[t])?n[n.length-1]-r[r.length-1]:0)});let i=null;for(let e=0;null==i&&e<o.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return u(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(a);i=function(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let e=0;e<r.length;++e){let l=r[e],u=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c=y({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},s),h=l.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=y({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},s)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:C([o,c.pathname]),pathnameBase:$(C([o,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(o=C([o,c.pathnameBase]))}return i}(o[e],t,r)}return i}(e,t,n,!1)}new WeakMap;var f=/^:[\w-]+$/,g=e=>"*"===e;function y(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){u("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,a,o)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[r];return n&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function v(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}var w=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function b(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function x(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function R(e){let t=e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function E(e,t,n,r=!1){let a,o;"string"==typeof e?a=d(e):(l(!(a={...e}).pathname||!a.pathname.includes("?"),x("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),x("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),x("#","search","hash",a)));let i=""===e||""===a.pathname,u=i?"/":a.pathname;if(null==u)o=n;else{let e=t.length-1;if(!r&&u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t="/"){let{pathname:n,search:r="",hash:a=""}="string"==typeof e?d(e):e;return{pathname:n?(n=n.replace(/\/\/+/g,"/")).startsWith("/")?b(n.substring(1),"/"):b(n,t):t,search:S(r),hash:L(a)}}(a,o),c=u&&"/"!==u&&u.endsWith("/"),h=(i||"."===u)&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||h)&&(s.pathname+="/"),s}var C=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),S=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",L=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",k=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function P(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var _="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function O(e,t){let n=e;if("string"!=typeof n||!w.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(_)try{let e=new URL(window.location.href),r=new URL(n.startsWith("//")?e.protocol+n:n),o=v(r.pathname,t);r.origin===e.origin&&null!=o?n=o+r.search+r.hash:a=!0}catch(e){u(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}Symbol("Uninstrumented"),Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),Symbol("ResetLoaderData");var T=a.createContext(null);T.displayName="DataRouter";var N=a.createContext(null);N.displayName="DataRouterState";var W=a.createContext(!1),A=a.createContext({isTransitioning:!1});A.displayName="ViewTransition",a.createContext(new Map).displayName="Fetchers",a.createContext(null).displayName="Await";var M=a.createContext(null);M.displayName="Navigation";var F=a.createContext(null);F.displayName="Location";var U=a.createContext({outlet:null,matches:[],isDataRoute:!1});U.displayName="Route";var j=a.createContext(null);j.displayName="RouteError";var D="REACT_ROUTER_ERROR";function B(){return null!=a.useContext(F)}function I(){return l(B(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(F).location}var H="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function z(e){a.useContext(M).static||a.useLayoutEffect(e)}function J(){let{isDataRoute:e}=a.useContext(U);return e?function(){let e,{router:t}=(l(e=a.useContext(T),G("useNavigate")),e),n=ee("useNavigate"),r=a.useRef(!1);return z(()=>{r.current=!0}),a.useCallback(async(e,a={})=>{u(r.current,H),r.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:n,...a}))},[t,n])}():function(){l(B(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(T),{basename:t,navigator:n}=a.useContext(M),{matches:r}=a.useContext(U),{pathname:o}=I(),i=JSON.stringify(R(r)),s=a.useRef(!1);return z(()=>{s.current=!0}),a.useCallback((r,a={})=>{if(u(s.current,H),!s.current)return;if("number"==typeof r)return void n.go(r);let l=E(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:C([t,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)},[t,n,i,o,e])}()}function Y(e,{relative:t}={}){let{matches:n}=a.useContext(U),{pathname:r}=I(),o=JSON.stringify(R(n));return a.useMemo(()=>E(e,JSON.parse(o),r,"path"===t),[e,o,r,t])}a.createContext(null);var q=a.createElement(function(){let e,t,n,r=(e=a.useContext(j),t=Q("useRouteError"),n=ee("useRouteError"),void 0!==e?e:t.errors?.[n]),o=P(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),i=r instanceof Error?r.stack:null,l="rgba(200,200,200, 0.5)",u={padding:"2px 4px",backgroundColor:l},s=null;return console.error("Error handled by React Router default ErrorBoundary:",r),s=a.createElement(a.Fragment,null,a.createElement("p",null,"\uD83D\uDCBF Hey developer \uD83D\uDC4B"),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},"ErrorBoundary")," or"," ",a.createElement("code",{style:u},"errorElement")," prop on your route.")),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},o),i?a.createElement("pre",{style:{padding:"0.5rem",backgroundColor:l}},i):null,s)},null),K=class extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${D}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new k(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?a.createElement(U.Provider,{value:this.props.routeContext},a.createElement(j.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?a.createElement(X,{error:e},t):t}};K.contextType=W;var V=new WeakMap;function X({children:e,error:t}){let{basename:n}=a.useContext(M);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${D}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=V.get(t);if(r)throw r;let o=O(e.location,n);if(_&&!V.get(t))if(o.isExternal||e.reloadDocument)window.location.href=o.absoluteURL||o.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw V.set(t,n),n}return a.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Z({routeContext:e,match:t,children:n}){let r=a.useContext(T);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(U.Provider,{value:e},n)}function G(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q(e){let t=a.useContext(N);return l(t,G(e)),t}function ee(e){let t,n=(l(t=a.useContext(U),G(e)),t),r=n.matches[n.matches.length-1];return l(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}var et={};function en(e,t,n){t||et[e]||(et[e]=!0,u(!1,n))}function er({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1,unstable_useTransitions:s}){l(!B(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),h=a.useMemo(()=>({basename:c,navigator:o,static:i,unstable_useTransitions:s,future:{}}),[c,o,i,s]);"string"==typeof n&&(n=d(n));let{pathname:p="/",search:m="",hash:f="",state:g=null,key:y="default",unstable_mask:w}=n,b=a.useMemo(()=>{let e=v(p,c);return null==e?null:{location:{pathname:e,search:m,hash:f,state:g,key:y,unstable_mask:w},navigationType:r}},[c,p,m,f,g,y,r,w]);return(u(null!=b,`<Router basename="${c}"> is not able to match the URL "${p}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),null==b)?null:a.createElement(M.Provider,{value:h},a.createElement(F.Provider,{children:t,value:b}))}(r||(r=n.t(a,2))).useOptimistic,a.memo(function({routes:e,future:t,state:n,isStatic:r,onError:o}){return function(e,t,n){let r;l(B(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=a.useContext(M),{matches:i}=a.useContext(U),s=i[i.length-1],c=s?s.params:{},h=s?s.pathname:"/",p=s?s.pathnameBase:"/",f=s&&s.route;{let e=f&&f.path||"";en(h,!f||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${e}">) 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.
3
-
4
- Please change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let g=I();if(t){let e="string"==typeof t?d(t):t;l("/"===p||e.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${e.pathname}" was given in the \`location\` prop.`),r=e}else r=g;let y=r.pathname||"/",v=y;if("/"!==p){let e=p.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=m(e,{pathname:v});u(f||null!=w,`No routes matched location "${r.pathname}${r.search}${r.hash}" `),u(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${r.pathname}${r.search}${r.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=function(e,t=[],n){let r=n?.state;if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let o=e,i=r?.errors;if(null!=i){let e=o.findIndex(e=>e.route.id&&i?.[e.route.id]!==void 0);l(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let u=!1,s=-1;if(n&&r){u=r.renderFallback;for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||void 0===a[t.route.id]);if(t.route.lazy||i){n.isStatic&&(u=!0),o=s>=0?o.slice(0,s+1):[o[0]];break}}}}let c=n?.onError,h=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:r.matches.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/",errorInfo:t})}:void 0;return o.reduceRight((e,n,l)=>{let c,d=!1,p=null,m=null;r&&(c=i&&n.route.id?i[n.route.id]:void 0,p=n.route.errorElement||q,u&&(s<0&&0===l?(en("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===l&&(d=!0,m=n.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,l+1)),g=()=>{let t;return t=c?p:d?m:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(Z,{match:n,routeContext:{outlet:e,matches:f,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===l)?a.createElement(K,{location:r.location,revalidation:r.revalidation,component:p,error:c,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0},onError:h}):g()},null)}(w&&w.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:C([p,o.encodeLocation?o.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:C([p,o.encodeLocation?o.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),i,n);return t&&b?a.createElement(F.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...r},navigationType:"POP"}},b):b}(e,void 0,{state:n,isStatic:r,onError:o,future:t})}),a.Component;var ea="get",eo="application/x-www-form-urlencoded";function ei(e){return"u">typeof HTMLElement&&e instanceof HTMLElement}var el=null,eu=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function es(e){return null==e||eu.has(e)?e:(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eo}"`),null)}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"u">typeof window&&window;function ec(e,t){if(!1===e||null==e)throw Error(t)}async function eh(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ed(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function ep(e,t,n){var r;let a,o;return r=(await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await eh(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ed).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),r.reduce((e,t)=>{!1;let n=JSON.stringify(function(e){let t={};for(let n of Object.keys(e).sort())t[n]=e[n];return t}(t));return a.has(n)||(a.add(n),e.push({key:n,link:t})),e},[])}function em(e,t,n,r,a,o){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,l=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let u=r.routes[t.route.id];if(!u||!u.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function ef(e,t,{includeHydrateFallback:n}={}){return[...new Set(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))]}function eg(){let e=a.useContext(T);return ec(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ey(){let e=a.useContext(N);return ec(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}Symbol("SingleFetchRedirect");var ev=a.createContext(void 0);function ew(){let e=a.useContext(ev);return ec(e,"You must render this element inside a <HydratedRouter> element"),e}function eb(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ex({page:e,...t}){let{router:n}=eg(),r=a.useMemo(()=>m(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?a.createElement(eR,{page:e,matches:r,...t}):null}function eR({page:e,matches:t,...n}){let r=I(),{future:o,manifest:i,routeModules:l}=ew(),{basename:u}=eg(),{loaderData:s,matches:c}=ey(),h=a.useMemo(()=>em(e,t,c,i,r,"data"),[e,t,c,i,r]),d=a.useMemo(()=>em(e,t,c,i,r,"assets"),[e,t,c,i,r]),p=a.useMemo(()=>{var n,a;let c;if(e===r.pathname+r.search+r.hash)return[];let d=new Set,p=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!h.some(t=>t.route.id===e.route.id)&&e.route.id in s&&l[e.route.id]?.shouldRevalidate||t.hasClientLoader?p=!0:d.add(e.route.id))}),0===d.size)return[];let m=(n=o.unstable_trailingSlashAwareDataRequests,a="data",c="string"==typeof e?new URL(e,"u"<typeof window?"server://singlefetch/":window.location.origin):e,n?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${a}`:c.pathname=`${c.pathname}.${a}`:"/"===c.pathname?c.pathname=`_root.${a}`:u&&"/"===v(c.pathname,u)?c.pathname=`${u.replace(/\/$/,"")}/_root.${a}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${a}`,c);return p&&d.size>0&&m.searchParams.set("_routes",t.filter(e=>d.has(e.route.id)).map(e=>e.route.id).join(",")),[m.pathname+m.search]},[u,o.unstable_trailingSlashAwareDataRequests,s,r,i,h,t,e,l]),m=a.useMemo(()=>ef(d,i),[d,i]),f=function(e){let{manifest:t,routeModules:n}=ew(),[r,o]=a.useState([]);return a.useEffect(()=>{let r=!1;return ep(e,t,n).then(e=>{r||o(e)}),()=>{r=!0}},[e,t,n]),r}(d);return a.createElement(a.Fragment,null,p.map(e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})),m.map(e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...n})),f.map(({key:e,link:t})=>a.createElement("link",{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}ev.displayName="FrameworkContext";a.Component;var eE="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{eE&&(window.__reactRouterVersion="7.13.1")}catch(e){}function eC({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=a.useRef();null==l.current&&(l.current=function(e={}){return function(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:l=!1}=r,u=a.history,h="POP",d=null,m=f();function f(){return(u.state||{idx:null}).idx}function g(){h="POP";let e=f(),t=null==e?null:e-m;m=e,d&&d({action:h,location:y.location,delta:t})}null==m&&(m=0,u.replaceState({...u.state,idx:m},""));let y={get action(){return h},get location(){return e(a,u)},listen(e){if(d)throw Error("A history only accepts one active listener");return a.addEventListener(o,g),d=e,()=>{a.removeEventListener(o,g),d=null}},createHref:e=>t(a,e),createURL:function(e){return p(e)},encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h="PUSH";let r=i(e)?e:c(y.location,e,t);n&&n(r,e);let o=s(r,m=f()+1),p=y.createHref(r.unstable_mask||r);try{u.pushState(o,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(p)}l&&d&&d({action:h,location:y.location,delta:1})},replace:function(e,t){h="REPLACE";let r=i(e)?e:c(y.location,e,t);n&&n(r,e);let a=s(r,m=f()),o=y.createHref(r.unstable_mask||r);u.replaceState(a,"",o),l&&d&&d({action:h,location:y.location,delta:0})},go:e=>u.go(e)};return y}(function(e,t){let{pathname:n="/",search:r="",hash:a=""}=d(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),c("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:h(t))},function(e,t){u("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}({window:r,v5Compat:!0}));let m=l.current,[f,g]=a.useState({action:m.action,location:m.location}),y=a.useCallback(e=>{!1===n?g(e):a.startTransition(()=>g(e))},[n]);return a.useLayoutEffect(()=>m.listen(y),[m,y]),a.createElement(er,{basename:e,children:t,location:f.location,navigationType:f.action,navigator:m,unstable_useTransitions:n})}var e$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eS=a.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:i,unstable_mask:u,state:s,target:c,to:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},y){let{basename:v,navigator:w,unstable_useTransitions:b}=a.useContext(M),x="string"==typeof d&&e$.test(d),R=O(d,v),$=function(e,{relative:t}={}){l(B(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=a.useContext(M),{hash:o,pathname:i,search:u}=Y(e,{relative:t}),s=i;return"/"!==n&&(s="/"===i?n:C([n,i])),r.createHref({pathname:s,search:u,hash:o})}(d=R.to,{relative:r}),S=I(),L=null;if(u){let e=E(u,[],S.unstable_mask?S.unstable_mask.pathname:"/",!0);"/"!==v&&(e.pathname="/"===e.pathname?v:C([v,e.pathname])),L=w.createHref(e)}let[k,P,_]=function(e,t){let n=a.useContext(ev),[r,o]=a.useState(!1),[i,l]=a.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:c,onMouseLeave:h,onTouchStart:d}=t,p=a.useRef(null);a.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),a.useEffect(()=>{if(r){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{o(!0)},f=()=>{o(!1),l(!1)};return n?"intent"!==e?[i,p,{}]:[i,p,{onFocus:eb(u,m),onBlur:eb(s,f),onMouseEnter:eb(c,m),onMouseLeave:eb(h,f),onTouchStart:eb(d,m)}]:[!1,p,{}]}(n,g),T=function(e,{target:t,replace:n,unstable_mask:r,state:o,preventScrollReset:i,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:s,unstable_useTransitions:c}={}){let d=J(),p=I(),m=Y(e,{relative:l});return a.useCallback(f=>{if(0===f.button&&(!t||"_self"===t)&&!(f.metaKey||f.altKey||f.ctrlKey||f.shiftKey)){f.preventDefault();let t=void 0!==n?n:h(p)===h(m),g=()=>d(e,{replace:t,unstable_mask:r,state:o,preventScrollReset:i,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:s});c?a.startTransition(()=>g()):g()}},[p,d,m,n,r,o,t,e,i,l,u,s,c])}(d,{replace:i,unstable_mask:u,state:s,target:c,preventScrollReset:p,relative:r,viewTransition:m,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b}),N=!(R.isExternal||o),W=a.createElement("a",{...g,..._,href:(N?L:void 0)||R.absoluteURL||$,onClick:N?function(t){e&&e(t),t.defaultPrevented||T(t)}:e,ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(y,P),target:c,"data-discover":x||"render"!==t?void 0:"true"});return k&&!x?a.createElement(a.Fragment,null,W,a.createElement(ex,{page:$})):W});eS.displayName="Link",a.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:i,viewTransition:u,children:s,...c},h){let d,p=Y(i,{relative:c.relative}),m=I(),f=a.useContext(N),{navigator:g,basename:w}=a.useContext(M),b=null!=f&&function(e,{relative:t}={}){let n=a.useContext(A);l(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=eL("useViewTransitionState"),o=Y(e,{relative:t});if(!n.isTransitioning)return!1;let i=v(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=v(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=y(o.pathname,u)||null!=y(o.pathname,i)}(p)&&!0===u,x=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,R=m.pathname,E=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(R=R.toLowerCase(),E=E?E.toLowerCase():null,x=x.toLowerCase()),E&&w&&(E=v(E,w)||E);let C="/"!==x&&x.endsWith("/")?x.length-1:x.length,$=R===x||!r&&R.startsWith(x)&&"/"===R.charAt(C),S=null!=E&&(E===x||!r&&E.startsWith(x)&&"/"===E.charAt(x.length)),L={isActive:$,isPending:S,isTransitioning:b},k=$?e:void 0;d="function"==typeof n?n(L):[n,$?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof o?o(L):o;return a.createElement(eS,{...c,"aria-current":k,className:d,ref:h,style:P,to:i,viewTransition:u},"function"==typeof s?s(L):s)}).displayName="NavLink",a.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:u=ea,action:s,onSubmit:c,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:f,...g},y)=>{let{unstable_useTransitions:w}=a.useContext(M),b=function(){let{router:e}=eL("useSubmit"),{basename:t}=a.useContext(M),n=ee("useRouteId"),r=e.fetch,o=e.navigate;return a.useCallback(async(e,a={})=>{let{action:i,method:l,encType:u,formData:s,body:c}=function(e,t){let n,r,a,o,i;if(ei(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?v(i,t):null,n=e.getAttribute("method")||ea,a=es(e.getAttribute("enctype"))||eo,o=new FormData(e)}else if(ei(e)&&"button"===e.tagName.toLowerCase()||ei(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(r=l?v(l,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||ea,a=es(e.getAttribute("formenctype"))||es(i.getAttribute("enctype"))||eo,o=new FormData(i,e),!function(){if(null===el)try{new FormData(document.createElement("form"),0),el=!1}catch(e){el=!0}return el}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else if(ei(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else n=ea,r=null,a=eo,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}(e,t);if(!1===a.navigate){let e=a.fetcherKey||`__${String(++ek)}__`;await r(e,n,a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await o(a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,o,t,n])}(),x=function(e,{relative:t}={}){let{basename:n}=a.useContext(M),r=a.useContext(U);l(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Y(e||".",{relative:t})},u=I();if(null==e){i.search=u.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();i.search=n?`?${n}`:""}}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(i.pathname="/"===i.pathname?n:C([n,i.pathname])),h(i)}(s,{relative:d}),R="get"===u.toLowerCase()?"get":"post",E="string"==typeof s&&e$.test(s);return a.createElement("form",{ref:y,method:R,action:x,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,l=r?.getAttribute("formmethod")||u,s=()=>b(r||e.currentTarget,{fetcherKey:t,method:l,navigate:n,replace:o,state:i,relative:d,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:f});w&&!1!==n?a.startTransition(()=>s()):s()},...g,"data-discover":E||"render"!==e?void 0:"true"})}).displayName="Form";function eL(e){var t;let n=a.useContext(T);return l(n,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),n}var ek=0}}]);