@pplancq/react-template 2.6.7 → 2.7.0

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.
@@ -0,0 +1,6 @@
1
+ /*! For license information please see lib-router.539f1a1d.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_pplancq_react_template=self.webpackChunk_pplancq_react_template||[]).push([["535"],{694:function(e,t,r){r.d(t,{N_:()=>t$,Ys:()=>tk,k2:()=>tM,pg:()=>ta,r5:()=>e9,sv:()=>ti});var n,a=r(41),o=e=>{throw TypeError(e)},i=(e,t,r)=>(t.has(e)||o("Cannot read from private field"),r?r.call(e):t.get(e)),l="popstate";function s(e,t){if(!1===e||null==e)throw Error(t)}function u(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function d(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?f(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function h({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function f(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function p(e,t=!1){let r="http://localhost";"undefined"!=typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),s(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:h(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var m=class{constructor(e){if(((e,t,r)=>t.has(e)?o("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r))(this,n,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(i(this,n).has(e))return i(this,n).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){i(this,n).set(e,t)}};n=new WeakMap;var y=new Set(["lazy","caseSensitive","path","id","index","children"]),v=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function g(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(s(!0!==e.index||!e.children,"Cannot specify children on an index route"),s(a||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),!0===e.index){let r={...e,...t(e),id:l};return n[l]=r,r}{let r={...e,...t(e),id:l,children:void 0};return n[l]=r,e.children&&(r.children=g(e.children,t,i,n,a)),r}})}function w(e,t,r="/"){return b(e,t,r,!1)}function b(e,t,r,n){let a=C(("string"==typeof t?f(t):t).pathname||"/",r);if(null==a)return null;let o=function e(t,r=[],n=[],a="",o=!1){let i=(t,i,l=o,u)=>{var c,d;let h,f,p={relativePath:void 0===u?t.path||"":u,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&l)return;s(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let m=$([a,p.relativePath]),y=n.concat(p);t.children&&t.children.length>0&&(s(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),e(t.children,r,y,m,l)),(null!=t.path||t.index)&&r.push({path:m,score:(c=m,d=t.index,f=(h=c.split("/")).length,h.some(x)&&(f+=-2),d&&(f+=2),h.filter(e=>!x(e)).reduce((e,t)=>e+(R.test(t)?3:""===t?1:10),f)),routesMeta:y})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))i(e,t,!0,r);else i(e,t)}),r}(e);o.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.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,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=S({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},u),d=l.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=S({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:$([o,c.pathname]),pathnameBase:M($([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=$([o,c.pathnameBase]))}return i}(o[e],t,n)}return i}function E(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}var R=/^:[\w-]+$/,x=e=>"*"===e;function S(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function C(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function P(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function L(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function k(e){let t=L(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function D(e,t,r,n=!1){let a,o;"string"==typeof e?a=f(e):(s(!(a={...e}).pathname||!a.pathname.includes("?"),P("?","pathname","search",a)),s(!a.pathname||!a.pathname.includes("#"),P("#","pathname","hash",a)),s(!a.search||!a.search.includes("#"),P("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=function(e,t="/"){var r;let n,{pathname:a,search:o="",hash:i=""}="string"==typeof e?f(e):e;return{pathname:a?a.startsWith("/")?a:(r=a,n=t.replace(/\/+$/,"").split("/"),r.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"):t,search:T(o),hash:O(i)}}(a,o),c=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}var $=e=>e.join("/").replace(/\/\/+/g,"/"),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),T=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",A=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function j(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var z=["POST","PUT","PATCH","DELETE"],U=new Set(z),N=new Set(["GET",...z]),F=new Set([301,302,303,307,308]),_=new Set([307,308]),H={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},I={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},W={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},B=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Y=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),q="remix-router-transitions",V=Symbol("ResetLoaderData");function J(e,t,r,n,a,o){let i,l;if(a){for(let e of(i=[],t))if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=D(n||".",k(i),C(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=eO(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:$([e,t])}({basename:r,pathname:s.pathname})),h(s)}function K(e,t,r){var n;let a,o;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!N.has(n.toUpperCase())))return{path:t,error:eS(405,{method:r.formMethod})};let i=()=>({path:t,error:eS(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),u=eP(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!eT(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}
3
+ `,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if("application/json"===r.formEncType){if(!eT(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return i()}}}if(s("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=ev(r.formData),o=r.formData;else if(r.body instanceof FormData)a=ev(r.body),o=r.body;else if(r.body instanceof URLSearchParams)o=eg(a=r.body);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=eg(a)}catch(e){return i()}let c={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(eT(c.formMethod))return{path:t,submission:c};let d=f(t);return e&&d.search&&eO(d.search)&&a.append("index",""),d.search=`?${a}`,{path:h(d),submission:c}}function X(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m,y,v,g,b){let E,R=b?ek(b[1])?b[1].error:b[1].data:void 0,x=a.createURL(o.location),S=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];E=i.findIndex(t=>t.route.id===e)}else if(b&&ek(b[1])){let e=b[0];E=i.findIndex(t=>t.route.id===e)-1}let C=b?b[1].statusCode:void 0,P=C&&C>=400,L={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...l,actionResult:R,actionStatus:C},k=i.map((a,i)=>{var l,s,h,f,p;let m,y,v,{route:g}=a,w=null;if(null!=E&&i>E?w=!1:g.lazy?w=!0:null==g.loader?w=!1:c?w=G(g,o.loaderData,o.errors):(l=o.loaderData,s=o.matches[i],h=a,m=!s||h.route.id!==s.route.id,y=!l.hasOwnProperty(h.route.id),(m||y)&&(w=!0)),null!==w)return eu(r,n,e,a,u,t,w);let b=!P&&(d||x.pathname+x.search===S.pathname+S.search||x.search!==S.search||(f=o.matches[i],p=a,v=f.route.path,f.pathname!==p.pathname||null!=v&&v.endsWith("*")&&f.params["*"]!==p.params["*"])),R={...L,defaultShouldRevalidate:b},C=Q(a,R);return eu(r,n,e,a,u,t,C,R)}),D=[];return p.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),p=s&&"idle"!==s.state&&void 0===s.data,b=w(y,e.path,v);if(!b){if(g&&p)return;D.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(m.has(l))return;let E=eA(b,e.path),R=new AbortController,x=ey(a,e.path,R.signal),S=null;if(h.has(l))h.delete(l),S=ec(r,n,x,b,E,u,t);else if(p)d&&(S=ec(r,n,x,b,E,u,t));else{let e={...L,defaultShouldRevalidate:!P&&d};Q(E,e)&&(S=ec(r,n,x,b,E,u,t,e))}S&&D.push({key:l,routeId:e.routeId,path:e.path,matches:S,match:E,request:x,controller:R})}),{dsMatches:k,revalidatingFetchers:D}}function G(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function Q(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function Z(e,t,r,n,a,o){let i;if(e){let t=n[e];s(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r;let l=[],u=[];if(t.forEach(e=>{let t=i.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>r.children?.some(r=>e(t,r))))})(e,t));t?u.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=g(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&u.length>0)for(let e=0;e<u.length;e++){let{existingRoute:t,newRoute:r}=u[e],[n]=g([r],a,[],{},!0);Object.assign(t,{element:n.element?n.element:t.element,errorElement:n.errorElement?n.errorElement:t.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:t.hydrateFallbackElement})}}var ee=new WeakMap,et=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(s(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=ee.get(a);i||(i={},ee.set(a,i));let l=i[e];if(l)return l;let c=(async()=>{let t=y.has(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)u(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)u(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=c,c},er=new WeakMap;async function en(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function ea(e){return e.matches.some(e=>e.route.middleware)?eo(e,()=>en(e)):en(e)}function eo(e,t){return ei(e,t,e=>e,eL,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=Math.min(n.findIndex(e=>e.route.id===r)||0,n.findIndex(e=>e.unstable_shouldCallHandler())||0);return Promise.resolve({[eR(n,n[a].route.id).route.id]:{type:"error",result:t}})}})}async function ei(e,t,r,n,a){let{matches:o,request:i,params:l,context:s}=e,u=o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await el({request:i,params:l,context:s},u,t,r,n,a)}async function el(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await el(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function es(e,t,r,n,a){let o=et({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o,i=r[e.id];if(s(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=er.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{s("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=v.has(e),o=void 0!==i[e]&&"hasErrorBoundary"!==e;a?u(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):o?u(!o,`Route "${i.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):r[e]=n}Object.assign(i,r),Object.assign(i,{...n(i),lazy:void 0})})();return er.set(i,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let l=Object.keys(e.lazy),c=[];for(let i of l){if(a&&a.includes(i))continue;let l=et({key:i,route:e,manifest:r,mapRouteProperties:n});l&&(c.push(l),i===t&&(o=l))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d?.catch(()=>{}),o?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:o}}(n.route,eT(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function eu(e,t,r,n,a,o,i,l=null){let s=!1,u=es(e,t,r,n,a);return{...n,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:e=>(s=!0,l)?"boolean"==typeof e?Q(n,{...l,defaultShouldRevalidate:e}):Q(n,l):i,resolve:e=>s||i||e&&!eT(r.method)&&(n.route.lazy||n.route.loader)?eh({request:r,match:n,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}function ec(e,t,r,n,a,o,i,l=null){return n.map(n=>n.route.id!==a.route.id?{...n,shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:es(e,t,r,n,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:eu(e,t,r,n,o,i,!0,l))}async function ed(e,t,r,n,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let i={request:t,params:r[0].params,context:a,matches:r},l=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>eo(i,()=>e({...i,fetcherKey:n,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),s=await e({...i,fetcherKey:n,runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return s}async function eh({request:e,match:t,lazyHandlerPromise:r,lazyRoutePromise:n,handlerOverride:a,scopedContext:o}){let i,l,s=eT(e.method),u=s?"action":"loader",c=r=>{let n,i=new Promise((e,t)=>n=t);l=()=>n(),e.signal.addEventListener("abort",l);let s=n=>"function"!=typeof r?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):r({request:e,params:t.params,context:o},...void 0!==n?[n]:[]);return Promise.race([(async()=>{try{let e=await (a?a(e=>s(e)):s());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),i])};try{let a=s?t.route.action:t.route.loader;if(r||n)if(a){let e,[t]=await Promise.all([c(a).catch(t=>{e=t}),r,n]);if(void 0!==e)throw e;i=t}else{await r;let a=s?t.route.action:t.route.loader;if(a)[i]=await Promise.all([c(a),n]);else{if("action"!==u)return{type:"data",result:void 0};let r=new URL(e.url),n=r.pathname+r.search;throw eS(405,{method:e.method,pathname:n,routeId:t.route.id})}}else if(a)i=await c(a);else{let t=new URL(e.url),r=t.pathname+t.search;throw eS(404,{pathname:r})}}catch(e){return{type:"error",result:e}}finally{l&&e.signal.removeEventListener("abort",l)}return i}async function ef(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function ep(e){let{result:t,type:r}=e;if(eM(t)){let e;try{e=await ef(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new A(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r)return e$(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new A(t.init?.status||500,void 0,t.data),statusCode:j(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:j(t)?t.status:void 0};return e$(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function em(e,t,r){if(B.test(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e),a=null!=C(n.pathname,r);if(n.origin===t.origin&&a)return n.pathname+n.search+n.hash}return e}function ey(e,t,r,n){let a=e.createURL(eP(t)).toString(),o={signal:r};if(n&&eT(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=ev(n.formData):o.body=n.formData}return new Request(a,o)}function ev(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eg(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ew(e,t,r,n,a,o){let{loaderData:i,errors:l}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,u=!1,c={},d=r&&ek(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let h=r.route.id,f=t[h];if(s(!eD(f),"Cannot handle redirect results in processLoaderData"),ek(f)){let t=f.error;if(void 0!==d&&(t=d,d=void 0),l=l||{},a)l[h]=t;else{let r=eR(e,h);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[h]=V),u||(u=!0,o=j(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else i[h]=f.data,f.statusCode&&200!==f.statusCode&&!u&&(o=f.statusCode),f.headers&&(c[h]=f.headers)}),void 0!==d&&r&&(l={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:c}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let i=o[r];if(s(i,"Did not find corresponding fetcher result"),ek(i)){let t=eR(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:i.error}),e.fetchers.delete(r)}else if(eD(i))s(!1,"Unhandled fetcher revalidation redirect");else{let t=eN(i.data);e.fetchers.set(r,t)}}),{loaderData:i,errors:l}}function eb(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==V).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eE(e){return e?ek(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function eR(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function ex(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function eS(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new A(e||500,i,Error(l),!0)}function eC(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eD(n))return{key:r,result:n}}}function eP(e){return h({..."string"==typeof e?f(e):e,hash:""})}function eL(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function ek(e){return"error"===e.type}function eD(e){return"redirect"===(e&&e.type)}function e$(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eM(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function eT(e){return U.has(e.toUpperCase())}function eO(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eA(e,t){let r="string"==typeof t?f(t).search:t.search;if(e[e.length-1].route.index&&eO(r||""))return e[e.length-1];let n=L(e);return n[n.length-1]}function ej(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function ez(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eU(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function eN(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}var eF=a.createContext(null);eF.displayName="DataRouter";var e_=a.createContext(null);e_.displayName="DataRouterState";var eH=a.createContext(!1),eI=a.createContext({isTransitioning:!1});eI.displayName="ViewTransition";var eW=a.createContext(new Map);eW.displayName="Fetchers",a.createContext(null).displayName="Await";var eB=a.createContext(null);eB.displayName="Navigation";var eY=a.createContext(null);eY.displayName="Location";var eq=a.createContext({outlet:null,matches:[],isDataRoute:!1});eq.displayName="Route";var eV=a.createContext(null);function eJ(){return null!=a.useContext(eY)}function eK(){return s(eJ(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(eY).location}eV.displayName="RouteError";var eX="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function eG(e){a.useContext(eB).static||a.useLayoutEffect(e)}var eQ=a.createContext(null);function eZ(e,{relative:t}={}){let{matches:r}=a.useContext(eq),{pathname:n}=eK(),o=JSON.stringify(k(r));return a.useMemo(()=>D(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}var e0=a.createElement(function(){let e=e9(),t=j(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=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:o},"ErrorBoundary")," or"," ",a.createElement("code",{style:o},"errorElement")," prop on your route.")),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:{padding:"0.5rem",backgroundColor:n}},r):null,i)},null),e1=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.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return void 0!==this.state.error?a.createElement(eq.Provider,{value:this.props.routeContext},a.createElement(eV.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function e4({routeContext:e,match:t,children:r}){let n=a.useContext(eF);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(eq.Provider,{value:e},r)}function e2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e5(e){let t=a.useContext(e_);return s(t,e2(e)),t}function e3(e){let t,r=(s(t=a.useContext(eq),e2(e)),t),n=r.matches[r.matches.length-1];return s(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function e9(){let e=a.useContext(eV),t=e5("useRouteError"),r=e3("useRouteError");return void 0!==e?e:t.errors?.[r]}var e7={};function e6(e,t,r){t||e7[e]||(e7[e]=!0,u(!1,r))}var e8={};function te(e,t){e||e8[t]||(e8[t]=!0,console.warn(t))}function tt(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&u(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:a.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&u(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&u(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tr=["HydrateFallback","hydrateFallbackElement"],tn=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function ta({router:e,flushSync:t,unstable_onError:r}){let[n,o]=a.useState(e.state),[i,l]=a.useState(),[s,u]=a.useState({isTransitioning:!1}),[c,d]=a.useState(),[h,f]=a.useState(),[p,m]=a.useState(),y=a.useRef(new Map),v=a.useCallback(e=>{o(t=>(e.errors&&r&&Object.entries(e.errors).forEach(([e,n])=>{t.errors?.[e]!==n&&r(n)}),e))},[r]),g=a.useCallback((r,{deletedFetchers:n,flushSync:o,viewTransitionOpts:i})=>{r.fetchers.forEach((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}),n.forEach(e=>y.current.delete(e)),te(!1===o||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let s=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(te(null==i||s,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!i||!s)return void(t&&o?t(()=>v(r)):a.startTransition(()=>v(r)));if(t&&o){t(()=>{h&&(c&&c.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:i.currentLocation,nextLocation:i.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>v(r))});n.finished.finally(()=>{t(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})})}),t(()=>f(n));return}h?(c&&c.resolve(),h.skipTransition(),m({state:r,currentLocation:i.currentLocation,nextLocation:i.nextLocation})):(l(r),u({isTransitioning:!0,flushSync:!1,currentLocation:i.currentLocation,nextLocation:i.nextLocation}))},[e.window,t,h,c,v]);a.useLayoutEffect(()=>e.subscribe(g),[e,g]),a.useEffect(()=>{s.isTransitioning&&!s.flushSync&&d(new tn)},[s]),a.useEffect(()=>{if(c&&i&&e.window){let t=c.promise,r=e.window.document.startViewTransition(async()=>{a.startTransition(()=>v(i)),await t});r.finished.finally(()=>{d(void 0),f(void 0),l(void 0),u({isTransitioning:!1})}),f(r)}},[i,c,e.window,v]),a.useEffect(()=>{c&&i&&n.location.key===i.location.key&&c.resolve()},[c,h,n.location,i]),a.useEffect(()=>{!s.isTransitioning&&p&&(l(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),m(void 0))},[s.isTransitioning,p]);let w=a.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),b=e.basename||"/",E=a.useMemo(()=>({router:e,navigator:w,static:!1,basename:b,unstable_onError:r}),[e,w,b,r]);return a.createElement(a.Fragment,null,a.createElement(eF.Provider,{value:E},a.createElement(e_.Provider,{value:n},a.createElement(eW.Provider,{value:y.current},a.createElement(eI.Provider,{value:s},a.createElement(tl,{basename:b,location:n.location,navigationType:n.historyAction,navigator:w},a.createElement(to,{routes:e.routes,future:e.future,state:n,unstable_onError:r})))))),null)}var to=a.memo(function({routes:e,future:t,state:r,unstable_onError:n}){return function(e,t,r,n,o){let i;s(eJ(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=a.useContext(eB),{matches:c}=a.useContext(eq),d=c[c.length-1],h=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",y=d&&d.route;{let e=y&&y.path||"";e6(p,!y||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (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.
4
+
5
+ Please change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let v=eK();if(t){let e="string"==typeof t?f(t):t;s("/"===m||e.pathname?.startsWith(m),`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 "${m}" but pathname "${e.pathname}" was given in the \`location\` prop.`),i=e}else i=v;let g=i.pathname||"/",b=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let E=w(e,{pathname:b});u(y||null!=E,`No routes matched location "${i.pathname}${i.search}${i.hash}" `),u(null==E||void 0!==E[E.length-1].route.element||void 0!==E[E.length-1].route.Component||void 0!==E[E.length-1].route.lazy,`Matched leaf route at location "${i.pathname}${i.search}${i.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 R=function(e,t=[],r=null,n=null,o=null){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 i=e,l=r?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);s(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,c=-1;if(r)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,i=c>=0?i.slice(0,c+1):[i[0]];break}}}return i.reduceRight((e,o,s)=>{let d,h=!1,f=null,p=null;r&&(d=l&&o.route.id?l[o.route.id]:void 0,f=o.route.errorElement||e0,u&&(c<0&&0===s?(e6("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):c===s&&(h=!0,p=o.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,s+1)),y=()=>{let t;return t=d?f:h?p:o.route.Component?a.createElement(o.route.Component,null):o.route.element?o.route.element:e,a.createElement(e4,{match:o,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===s)?a.createElement(e1,{location:r.location,revalidation:r.revalidation,component:f,error:d,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0},unstable_onError:n}):y()},null)}(E&&E.map(e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:$([m,l.encodeLocation?l.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:$([m,l.encodeLocation?l.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),c,r,n,o);return t&&R?a.createElement(eY.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...i},navigationType:"POP"}},R):R}(e,void 0,r,n,t)});function ti(e){var t;let r;return t=e.context,(r=a.useContext(eq).outlet)?a.createElement(eQ.Provider,{value:t},r):r}function tl({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1}){s(!eJ(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=a.useMemo(()=>({basename:l,navigator:o,static:i,future:{}}),[l,o,i]);"string"==typeof r&&(r=f(r));let{pathname:d="/",search:h="",hash:p="",state:m=null,key:y="default"}=r,v=a.useMemo(()=>{let e=C(d,l);return null==e?null:{location:{pathname:e,search:h,hash:p,state:m,key:y},navigationType:n}},[l,d,h,p,m,y,n]);return(u(null!=v,`<Router basename="${l}"> is not able to match the URL "${d}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),null==v)?null:a.createElement(eB.Provider,{value:c},a.createElement(eY.Provider,{children:t,value:v}))}a.Component;var ts="get",tu="application/x-www-form-urlencoded";function tc(e){return null!=e&&"string"==typeof e.tagName}var td=null,th=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tf(e){return null==e||th.has(e)?e:(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tu}"`),null)}function tp(e,t){if(!1===e||null==e)throw Error(t)}async function tm(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}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 ty(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 tv(e,t,r){var n,a;let o,i;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await tm(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(ty).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),o=new Set,i=new Set(void 0),n.reduce((e,t)=>{if(a&&(null==t||"string"!=typeof t.page)&&"script"===t.as&&t.href&&i.has(t.href))return e;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return o.has(r)||(o.add(r),e.push({key:r,link:t})),e},[])}function tg(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function tw(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]}function tb(){let e=a.useContext(eF);return tp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tE(){let e=a.useContext(e_);return tp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"undefined"!=typeof window&&window,Symbol("SingleFetchRedirect");var tR=a.createContext(void 0);function tx(){let e=a.useContext(tR);return tp(e,"You must render this element inside a <HydratedRouter> element"),e}function tS(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function tC({page:e,...t}){let{router:r}=tb(),n=a.useMemo(()=>w(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?a.createElement(tP,{page:e,matches:n,...t}):null}function tP({page:e,matches:t,...r}){let n=eK(),{manifest:o,routeModules:i}=tx(),{basename:l}=tb(),{loaderData:s,matches:u}=tE(),c=a.useMemo(()=>tg(e,t,u,o,n,"data"),[e,t,u,o,n]),d=a.useMemo(()=>tg(e,t,u,o,n,"assets"),[e,t,u,o,n]),h=a.useMemo(()=>{var r;let a;if(e===n.pathname+n.search+n.hash)return[];let u=new Set,d=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?d=!0:u.add(e.route.id))}),0===u.size)return[];let h=(r="data","/"===(a="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e).pathname?a.pathname=`_root.${r}`:l&&"/"===C(a.pathname,l)?a.pathname=`${l.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a);return d&&u.size>0&&h.searchParams.set("_routes",t.filter(e=>u.has(e.route.id)).map(e=>e.route.id).join(",")),[h.pathname+h.search]},[l,s,n,o,c,t,e,i]),f=a.useMemo(()=>tw(d,o),[d,o]),p=function(e){let{manifest:t,routeModules:r}=tx(),[n,o]=a.useState([]);return a.useEffect(()=>{let n=!1;return tv(e,t,r).then(e=>{n||o(e)}),()=>{n=!0}},[e,t,r]),n}(d);return a.createElement(a.Fragment,null,h.map(e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),f.map(e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),p.map(({key:e,link:t})=>a.createElement("link",{key:e,nonce:r.nonce,...t})))}tR.displayName="FrameworkContext";a.Component;var tL="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tL&&(window.__reactRouterVersion="7.9.1")}catch(e){}function tk(e,t){let r;return(function(e){let t,r,n,a,o,i=e.window?e.window:"undefined"!=typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement;s(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let c=e.hydrationRouteProperties||[],h=e.mapRouteProperties||Y,f={},y=g(e.routes,h,void 0,f),v=e.basename||"/";v.startsWith("/")||(v=`/${v}`);let R=e.dataStrategy||ea,x={...e.future},S=null,P=new Set,L=null,k=null,D=null,$=null!=e.hydrationData,M=w(y,e.history.location,v),T=!1,O=null;if(null!=M||e.patchRoutesOnNavigation)if(M&&!e.hydrationData&&e6(M,y,e.history.location.pathname).active&&(M=null),M)if(M.some(e=>e.route.lazy))r=!1;else if(M.some(e=>e.route.loader)){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=M.findIndex(e=>void 0!==n[e.route.id]);r=M.slice(0,e+1).every(e=>!G(e.route,t,n))}else r=M.every(e=>!G(e.route,t,n))}else r=!0;else{r=!1,M=[];let t=e6(null,y,e.history.location.pathname);t.active&&t.matches&&(T=!0,M=t.matches)}else{let t=eS(404,{pathname:e.history.location.pathname}),{matches:n,route:a}=ex(y);r=!0,M=n,O={[a.id]:t}}let A={historyAction:e.history.action,location:e.history.location,matches:M,initialized:r,navigation:H,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},z="POP",U=!1,N=!1,V=new Map,Q=null,ee=!1,et=!1,er=new Set,en=new Map,eo=0,ei=-1,el=new Map,es=new Set,eu=new Map,eh=new Map,ef=new Set,ev=new Map,eg=null;function eP(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=f[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(A={...A,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(ef.has(t)?r.push(t):n.push(t))}),ef.forEach(e=>{A.fetchers.has(e)||en.has(e)||r.push(e)}),[...P].forEach(e=>e(A,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>eG(e)),n.forEach(e=>A.fetchers.delete(e))}function eL(r,n,{flushSync:a}={}){let o,i,l=null!=A.actionData&&null!=A.navigation.formMethod&&eT(A.navigation.formMethod)&&"loading"===A.navigation.state&&r.state?._isRedirect!==!0;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?A.actionData:null;let s=n.loaderData?eb(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,u=A.blockers;u.size>0&&(u=new Map(u)).forEach((e,t)=>u.set(t,W));let c=!ee&&e7(r,n.matches||A.matches),d=!0===U||null!=A.navigation.formMethod&&eT(A.navigation.formMethod)&&r.state?._isRedirect!==!0;if(t&&(y=t,t=void 0),ee||"POP"===z||("PUSH"===z?e.history.push(r,r.state):"REPLACE"===z&&e.history.replace(r,r.state)),"POP"===z){let e=V.get(A.location.pathname);e&&e.has(r.pathname)?i={currentLocation:A.location,nextLocation:r}:V.has(r.pathname)&&(i={currentLocation:r,nextLocation:A.location})}else if(N){let e=V.get(A.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),V.set(A.location.pathname,e)),i={currentLocation:A.location,nextLocation:r}}eP({...n,actionData:o,loaderData:s,historyAction:z,location:r,initialized:!0,navigation:H,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:u},{viewTransitionOpts:i,flushSync:!0===a}),z="POP",U=!1,N=!1,ee=!1,et=!1,eg?.resolve(),eg=null}async function e$(t,r){if("number"==typeof t)return void e.history.go(t);let{path:n,submission:a,error:o}=K(!1,J(A.location,A.matches,v,t,r?.fromRouteId,r?.relative),r),i=A.location,l=d(A.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let s=r&&null!=r.replace?r.replace:void 0,u="PUSH";!0===s?u="REPLACE":!1===s||null!=a&&eT(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(u="REPLACE");let c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,h=!0===(r&&r.flushSync),f=e5({currentLocation:i,nextLocation:l,historyAction:u});f?e2(f,{state:"blocked",location:l,proceed(){e2(f,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),e$(t,r)},reset(){let e=new Map(A.blockers);e.set(f,W),eP({blockers:e})}}):await eO(u,l,{submission:a,pendingError:o,preventScrollReset:c,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:h})}async function eO(r,n,o){var i,l,s,u;let c;a&&a.abort(),a=null,z=r,ee=!0===(o&&o.startUninterruptedRevalidation),i=A.location,l=A.matches,L&&D&&(L[e9(i,l)]=D()),U=!0===(o&&o.preventScrollReset),N=!0===(o&&o.enableViewTransition);let d=t||y,h=o&&o.overrideNavigation,f=o?.initialHydration&&A.matches&&A.matches.length>0&&!T?A.matches:w(d,n,v),p=!0===(o&&o.flushSync);if(f&&A.initialized&&!et&&(s=A.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash||!1))&&!(o&&o.submission&&eT(o.submission.formMethod)))return void eL(n,{matches:f},{flushSync:p});let g=e6(f,d,n.pathname);if(g.active&&g.matches&&(f=g.matches),!f){let{error:e,notFoundMatches:t,route:r}=e3(n.pathname);eL(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:p});return}a=new AbortController;let b=ey(e.history,n,a.signal,o&&o.submission),E=e.getContext?await e.getContext():new m;if(o&&o.pendingError)c=[eR(f).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&eT(o.submission.formMethod)){let t=await eF(b,n,o.submission,f,E,g.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:p});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(ek(r)&&j(r.error)&&404===r.error.status){a=null,eL(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}f=t.matches||f,c=t.pendingActionResult,h=ez(n,o.submission),p=!1,g.active=!1,b=ey(e.history,b.url,b.signal)}let{shortCircuited:R,matches:x,loaderData:S,errors:C}=await e_(b,n,f,E,g.active,h,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,p,c);R||(a=null,eL(n,{matches:x||f,...eE(c),loaderData:S,errors:C}))}async function eF(e,t,r,n,a,o,i,l={}){var s;let u;if(eV(),eP({navigation:{state:"submitting",location:t,formMethod:(s=r).formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}},{flushSync:!0===l.flushSync}),o){let r=await e8(n,t.pathname,e.signal);if("aborted"===r.type)return{shortCircuited:!0};if("error"===r.type){if(0===r.partialMatches.length){let{matches:e,route:t}=ex(y);return{matches:e,pendingActionResult:[t.id,{type:"error",error:r.error}]}}let e=eR(r.partialMatches).route.id;return{matches:r.partialMatches,pendingActionResult:[e,{type:"error",error:r.error}]}}if(r.matches)n=r.matches;else{let{notFoundMatches:e,error:r,route:n}=e3(t.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:r}]}}}let d=eA(n,t);if(d.route.action||d.route.lazy){let t=ec(h,f,e,n,d,i?[]:c,a),r=await eY(e,t,a,null);if(!(u=r[d.route.id])){for(let e of n)if(r[e.route.id]){u=r[e.route.id];break}}if(e.signal.aborted)return{shortCircuited:!0}}else u={type:"error",error:eS(405,{method:e.method,pathname:t.pathname,routeId:d.route.id})};if(eD(u)){let t;return t=l&&null!=l.replace?l.replace:em(u.response.headers.get("Location"),new URL(e.url),v)===A.location.pathname+A.location.search,await eB(e,u,!0,{submission:r,replace:t}),{shortCircuited:!0}}if(ek(u)){let e=eR(n,d.route.id);return!0!==(l&&l.replace)&&(z="PUSH"),{matches:n,pendingActionResult:[e.route.id,u,d.route.id]}}return{matches:n,pendingActionResult:[d.route.id,u]}}async function e_(r,n,o,i,l,s,u,d,p,m,g,w){let b=s||ez(n,u),E=u||d||ej(b),R=!ee&&!m;if(l){if(R){let e=eH(w);eP({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:g})}let e=await e8(o,n.pathname,r.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=ex(y);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=eR(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)o=e.matches;else{let{error:e,notFoundMatches:t,route:r}=e3(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let x=t||y,{dsMatches:S,revalidatingFetchers:C}=X(r,i,h,f,e.history,A,o,E,n,m?[]:c,!0===m,et,er,ef,eu,es,x,v,null!=e.patchRoutesOnNavigation,w);if(ei=++eo,!e.dataStrategy&&!S.some(e=>e.shouldLoad)&&!S.some(e=>e.route.middleware)&&0===C.length){let e=e0();return eL(n,{matches:o,loaderData:{},errors:w&&ek(w[1])?{[w[0]]:w[1].error}:null,...eE(w),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(R){let e={};if(!l){e.navigation=b;let t=eH(w);void 0!==t&&(e.actionData=t)}C.length>0&&(C.forEach(e=>{let t=A.fetchers.get(e.key),r=eU(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}),e.fetchers=new Map(A.fetchers)),eP(e,{flushSync:g})}C.forEach(e=>{eQ(e.key),e.controller&&en.set(e.key,e.controller)});let P=()=>C.forEach(e=>eQ(e.key));a&&a.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:k}=await eq(S,C,r,i);if(r.signal.aborted)return{shortCircuited:!0};a&&a.signal.removeEventListener("abort",P),C.forEach(e=>en.delete(e.key));let D=eC(L);if(D)return await eB(r,D.result,!0,{replace:p}),{shortCircuited:!0};if(D=eC(k))return es.add(D.key),await eB(r,D.result,!0,{replace:p}),{shortCircuited:!0};let{loaderData:$,errors:M}=ew(A,o,L,w,C,k);m&&A.errors&&(M={...A.errors,...M});let T=e0(),O=e1(ei);return{matches:o,loaderData:$,errors:M,...T||O||C.length>0?{fetchers:new Map(A.fetchers)}:{}}}function eH(e){if(e&&!ek(e[1]))return{[e[0]]:e[1].data};if(A.actionData)if(0===Object.keys(A.actionData).length)return null;else return A.actionData}async function eI(r,n,o,i,l,u,d,p,m){var g,b;eV(),eu.delete(r);let E=A.fetchers.get(r);eJ(r,(g=m,b=E,{state:"submitting",formMethod:g.formMethod,formAction:g.formAction,formEncType:g.formEncType,formData:g.formData,json:g.json,text:g.text,data:b?b.data:void 0}),{flushSync:d});let R=new AbortController,x=ey(e.history,o,R.signal,m);if(u){let e=await e8(i,new URL(x.url).pathname,x.signal,r);if("aborted"===e.type)return;if("error"===e.type)return void eK(r,n,e.error,{flushSync:d});if(!e.matches)return void eK(r,n,eS(404,{pathname:o}),{flushSync:d});i=e.matches}let S=eA(i,o);if(!S.route.action&&!S.route.lazy){let e=eS(405,{method:m.formMethod,pathname:o,routeId:n});eK(r,n,e,{flushSync:d});return}en.set(r,R);let C=eo,P=ec(h,f,x,i,S,c,l),L=(await eY(x,P,l,r))[S.route.id];if(x.signal.aborted){en.get(r)===R&&en.delete(r);return}if(ef.has(r)){if(eD(L)||ek(L))return void eJ(r,eN(void 0))}else{if(eD(L))return(en.delete(r),ei>C)?void eJ(r,eN(void 0)):(es.add(r),eJ(r,eU(m)),eB(x,L,!1,{fetcherSubmission:m,preventScrollReset:p}));if(ek(L))return void eK(r,n,L.error)}let k=A.navigation.location||A.location,D=ey(e.history,k,R.signal),$=t||y,M="idle"!==A.navigation.state?w($,A.navigation.location,v):A.matches;s(M,"Didn't find any matches after fetcher action");let T=++eo;el.set(r,T);let O=eU(m,L.data);A.fetchers.set(r,O);let{dsMatches:j,revalidatingFetchers:U}=X(D,l,h,f,e.history,A,M,m,k,c,!1,et,er,ef,eu,es,$,v,null!=e.patchRoutesOnNavigation,[S.route.id,L]);U.filter(e=>e.key!==r).forEach(e=>{let t=e.key,r=A.fetchers.get(t),n=eU(void 0,r?r.data:void 0);A.fetchers.set(t,n),eQ(t),e.controller&&en.set(t,e.controller)}),eP({fetchers:new Map(A.fetchers)});let N=()=>U.forEach(e=>eQ(e.key));R.signal.addEventListener("abort",N);let{loaderResults:F,fetcherResults:_}=await eq(j,U,D,l);if(R.signal.aborted)return;if(R.signal.removeEventListener("abort",N),el.delete(r),en.delete(r),U.forEach(e=>en.delete(e.key)),A.fetchers.has(r)){let e=eN(L.data);A.fetchers.set(r,e)}let H=eC(F);if(H)return eB(D,H.result,!1,{preventScrollReset:p});if(H=eC(_))return es.add(H.key),eB(D,H.result,!1,{preventScrollReset:p});let{loaderData:I,errors:W}=ew(A,M,F,void 0,U,_);e1(T),"loading"===A.navigation.state&&T>ei?(s(z,"Expected pending action"),a&&a.abort(),eL(A.navigation.location,{matches:M,loaderData:I,errors:W,fetchers:new Map(A.fetchers)})):(eP({errors:W,loaderData:eb(A.loaderData,I,M,W),fetchers:new Map(A.fetchers)}),et=!1)}async function eW(t,r,n,a,o,i,l,s,u){let d=A.fetchers.get(t);eJ(t,eU(u,d?d.data:void 0),{flushSync:l});let p=new AbortController,m=ey(e.history,n,p.signal);if(i){let e=await e8(a,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void eK(t,r,e.error,{flushSync:l});if(!e.matches)return void eK(t,r,eS(404,{pathname:n}),{flushSync:l});a=e.matches}let y=eA(a,n);en.set(t,p);let v=eo,g=ec(h,f,m,a,y,c,o),w=(await eY(m,g,o,t))[y.route.id];if(en.get(t)===p&&en.delete(t),!m.signal.aborted){if(ef.has(t))return void eJ(t,eN(void 0));if(eD(w))if(ei>v)return void eJ(t,eN(void 0));else{es.add(t),await eB(m,w,!1,{preventScrollReset:s});return}if(ek(w))return void eK(t,r,w.error);eJ(t,eN(w.data))}}async function eB(e,t,r,{submission:n,fetcherSubmission:o,preventScrollReset:u,replace:c}={}){t.response.headers.has("X-Remix-Revalidate")&&(et=!0);let h=t.response.headers.get("Location");s(h,"Expected a Location header on the redirect Response"),h=em(h,new URL(e.url),v);let f=d(A.location,h,{_isRedirect:!0});if(l){let e=!1;if(t.response.headers.has("X-Remix-Reload-Document"))e=!0;else{let t;if(t=h,B.test(t)){let t=p(h,!0);e=t.origin!==i.location.origin||null==C(t.pathname,v)}}if(e)return void(c?i.location.replace(h):i.location.assign(h))}a=null;let m=!0===c||t.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:y,formAction:g,formEncType:w}=A.navigation;!n&&!o&&y&&g&&w&&(n=ej(A.navigation));let b=n||o;if(_.has(t.response.status)&&b&&eT(b.formMethod))await eO(m,f,{submission:{...b,formAction:h},preventScrollReset:u||U,enableViewTransition:r?N:void 0});else{let e=ez(f,n);await eO(m,f,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:u||U,enableViewTransition:r?N:void 0})}}async function eY(e,t,r,n){let a,o={};try{a=await ed(R,e,t,n,r,!1)}catch(e){return t.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:"error",error:e}}),o}if(e.signal.aborted)return o;for(let[r,n]of Object.entries(a)){var i;if(eM((i=n).result)&&F.has(i.result.status)){let a=n.result;o[r]={type:"redirect",response:function(e,t,r,n,a){let o,i=e.headers.get("Location");if(s(i,"Redirects returned/thrown from loaders/actions must have a Location header"),o=i,!B.test(o)){let o=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=J(new URL(t.url),o,a,i),e.headers.set("Location",i)}return e}(a,e,r,t,v)}}else o[r]=await ep(n)}return o}async function eq(e,t,r,n){let a=eY(r,e,n,null),o=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:eS(404,{pathname:e.path})}});{let t=(await eY(e.request,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function eV(){et=!0,eu.forEach((e,t)=>{en.has(t)&&er.add(t),eQ(t)})}function eJ(e,t,r={}){A.fetchers.set(e,t),eP({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eK(e,t,r,n={}){let a=eR(A.matches,t);eG(e),eP({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eX(e){return eh.set(e,(eh.get(e)||0)+1),ef.has(e)&&ef.delete(e),A.fetchers.get(e)||I}function eG(e){let t=A.fetchers.get(e);en.has(e)&&!(t&&"loading"===t.state&&el.has(e))&&eQ(e),eu.delete(e),el.delete(e),es.delete(e),ef.delete(e),er.delete(e),A.fetchers.delete(e)}function eQ(e){let t=en.get(e);t&&(t.abort(),en.delete(e))}function eZ(e){for(let t of e){let e=eN(eX(t).data);A.fetchers.set(t,e)}}function e0(){let e=[],t=!1;for(let r of es){let n=A.fetchers.get(r);s(n,`Expected fetcher: ${r}`),"loading"===n.state&&(es.delete(r),e.push(r),t=!0)}return eZ(e),t}function e1(e){let t=[];for(let[r,n]of el)if(n<e){let e=A.fetchers.get(r);s(e,`Expected fetcher: ${r}`),"loading"===e.state&&(eQ(r),el.delete(r),t.push(r))}return eZ(t),t.length>0}function e4(e){A.blockers.delete(e),ev.delete(e)}function e2(e,t){let r=A.blockers.get(e)||W;s("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(A.blockers);n.set(e,t),eP({blockers:n})}function e5({currentLocation:e,nextLocation:t,historyAction:r}){if(0===ev.size)return;ev.size>1&&u(!1,"A router only supports one blocker at a time");let n=Array.from(ev.entries()),[a,o]=n[n.length-1],i=A.blockers.get(a);if((!i||"proceeding"!==i.state)&&o({currentLocation:e,nextLocation:t,historyAction:r}))return a}function e3(e){let r=eS(404,{pathname:e}),{matches:n,route:a}=ex(t||y);return{notFoundMatches:n,route:a,error:r}}function e9(e,t){return k&&k(e,t.map(e=>E(e,A.loaderData)))||e.key}function e7(e,t){if(L){let r=L[e9(e,t)];if("number"==typeof r)return r}return null}function e6(t,r,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:b(r,n,v,!0)||[]};else if(Object.keys(t[0].params).length>0)return{active:!0,matches:b(r,n,v,!0)}}return{active:!1,matches:null}}async function e8(r,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:r};let i=r;for(;;){let r=null==t,l=t||y,s=f;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||Z(e,t,l,s,h,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{r&&!a.aborted&&(y=[...y])}if(a.aborted)return{type:"aborted"};let u=w(l,n,v);if(u)return{type:"success",matches:u};let c=b(l,n,v,!0);if(!c||i.length===c.length&&i.every((e,t)=>e.route.id===c[t].route.id))return{type:"success",matches:null};i=c}}return n={get basename(){return v},get future(){return x},get state(){return A},get routes(){return y},get window(){return i},initialize:function(){if(S=e.history.listen(({action:t,location:r,delta:n})=>{if(o){o(),o=void 0;return}u(0===ev.size||null!=n,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=e5({currentLocation:A.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{o=e});e.history.go(-1*n),e2(a,{state:"blocked",location:r,proceed(){e2(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(A.blockers);e.set(a,W),eP({blockers:e})}});return}return eO(t,r)}),l){var t=i,r=V;try{let e=t.sessionStorage.getItem(q);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch(e){}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(q,JSON.stringify(r))}catch(e){u(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(i,V);i.addEventListener("pagehide",e),Q=()=>i.removeEventListener("pagehide",e)}return A.initialized||eO("POP",A.location,{initialHydration:!0}),n},subscribe:function(e){return P.add(e),()=>P.delete(e)},enableScrollRestoration:function(e,t,r){if(L=e,D=t,k=r||null,!$&&A.navigation===H){$=!0;let e=e7(A.location,A.matches);null!=e&&eP({restoreScrollPosition:e})}return()=>{L=null,D=null,k=null}},navigate:e$,fetch:async function r(r,n,a,o){eQ(r);let i=!0===(o&&o.flushSync),l=t||y,s=J(A.location,A.matches,v,a,n,o?.relative),u=w(l,s,v),c=e6(u,l,s);if(c.active&&c.matches&&(u=c.matches),!u)return void eK(r,n,eS(404,{pathname:s}),{flushSync:i});let{path:d,submission:h,error:f}=K(!0,s,o);if(f)return void eK(r,n,f,{flushSync:i});let p=e.getContext?await e.getContext():new m,g=!0===(o&&o.preventScrollReset);h&&eT(h.formMethod)?await eI(r,n,d,u,p,c.active,i,g,h):(eu.set(r,{routeId:n,path:d}),await eW(r,n,d,u,p,c.active,i,g,h))},revalidate:function(){let e,t,r;eg||(eg={promise:r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{a(e);try{await r}catch(e){}}}),resolve:e,reject:t}),eV(),eP({revalidation:"loading"});let n=eg.promise;return"submitting"===A.navigation.state||("idle"===A.navigation.state?eO(A.historyAction,A.location,{startUninterruptedRevalidation:!0}):eO(z||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:!0===N})),n},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eX,deleteFetcher:function(e){let t=(eh.get(e)||0)-1;t<=0?(eh.delete(e),ef.add(e)):eh.set(e,t),eP({fetchers:new Map(A.fetchers)})},dispose:function(){S&&S(),Q&&Q(),P.clear(),a&&a.abort(),A.fetchers.forEach((e,t)=>eG(t)),A.blockers.forEach((e,t)=>e4(t))},getBlocker:function(e,t){let r=A.blockers.get(e)||W;return ev.get(e)!==t&&ev.set(e,t),r},deleteBlocker:e4,patchRoutes:function(e,r,n=!1){let a=null==t;Z(e,r,t||y,f,h,n),a&&(y=[...y],eP({}))},_internalFetchControllers:en,_internalSetRoutes:function(e){t=g(e,h,void 0,f={})},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eP(e)}}})({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:function(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",u=null,h=f();function f(){return(i.state||{idx:null}).idx}function m(){s="POP";let e=f(),t=null==e?null:e-h;h=e,u&&u({action:s,location:y.location,delta:t})}null==h&&(h=0,i.replaceState({...i.state,idx:h},""));let y={get action(){return s},get location(){return e(a,i)},listen(e){if(u)throw Error("A history only accepts one active listener");return a.addEventListener(l,m),u=e,()=>{a.removeEventListener(l,m),u=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){s="PUSH";let r=d(y.location,e,t);let n=c(r,h=f()+1),l=y.createHref(r);try{i.pushState(n,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(l)}o&&u&&u({action:s,location:y.location,delta:1})},replace:function(e,t){s="REPLACE";let n=d(y.location,e,t);r&&r(n,e);let a=c(n,h=f()),l=y.createHref(n);i.replaceState(a,"",l),o&&u&&u({action:s,location:y.location,delta:0})},go:e=>i.go(e)};return y}(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return d("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:h(t)},null,e)}({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new A(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:tt,hydrationRouteProperties:tr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}var tD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t$=a.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:o,replace:i,state:l,target:c,to:d,preventScrollReset:f,viewTransition:p,...m},y){let v,{basename:g}=a.useContext(eB),w="string"==typeof d&&tD.test(d),b=!1;if("string"==typeof d&&w&&(v=d,tL))try{let e=new URL(window.location.href),t=new URL(d.startsWith("//")?e.protocol+d:d),r=C(t.pathname,g);t.origin===e.origin&&null!=r?d=r+t.search+t.hash:b=!0}catch(e){u(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=function(e,{relative:t}={}){s(eJ(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=a.useContext(eB),{hash:o,pathname:i,search:l}=eZ(e,{relative:t}),u=i;return"/"!==r&&(u="/"===i?r:$([r,i])),n.createHref({pathname:u,search:l,hash:o})}(d,{relative:n}),[R,x,S]=function(e,t){let r=a.useContext(tR),[n,o]=a.useState(!1),[i,l]=a.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,f=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 f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),a.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{o(!0)},m=()=>{o(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:tS(s,p),onBlur:tS(u,m),onMouseEnter:tS(c,p),onMouseLeave:tS(d,m),onTouchStart:tS(h,p)}]:[!1,f,{}]}(r,m),P=function(e,{target:t,replace:r,state:n,preventScrollReset:o,relative:i,viewTransition:l}={}){let c=function(){let{isDataRoute:e}=a.useContext(eq);return e?function(){let e,{router:t}=(s(e=a.useContext(eF),e2("useNavigate")),e),r=e3("useNavigate"),n=a.useRef(!1);return eG(()=>{n.current=!0}),a.useCallback(async(e,a={})=>{u(n.current,eX),n.current&&("number"==typeof e?t.navigate(e):await t.navigate(e,{fromRouteId:r,...a}))},[t,r])}():function(){s(eJ(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(eF),{basename:t,navigator:r}=a.useContext(eB),{matches:n}=a.useContext(eq),{pathname:o}=eK(),i=JSON.stringify(k(n)),l=a.useRef(!1);return eG(()=>{l.current=!0}),a.useCallback((n,a={})=>{if(u(l.current,eX),!l.current)return;if("number"==typeof n)return void r.go(n);let s=D(n,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:$([t,s.pathname])),(a.replace?r.replace:r.push)(s,a.state,a)},[t,r,i,o,e])}()}(),d=eK(),f=eZ(e,{relative:i});return a.useCallback(a=>{0!==a.button||t&&"_self"!==t||a.metaKey||a.altKey||a.ctrlKey||a.shiftKey||(a.preventDefault(),c(e,{replace:void 0!==r?r:h(d)===h(f),state:n,preventScrollReset:o,relative:i,viewTransition:l}))},[d,c,f,r,n,t,e,o,i,l])}(d,{replace:i,state:l,target:c,preventScrollReset:f,relative:n,viewTransition:p}),L=a.createElement("a",{...m,...S,href:v||E,onClick:b||o?e:function(t){e&&e(t),t.defaultPrevented||P(t)},ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(y,x),target:c,"data-discover":w||"render"!==t?void 0:"true"});return R&&!w?a.createElement(a.Fragment,null,L,a.createElement(tC,{page:E})):L});t$.displayName="Link";var tM=a.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:o,to:i,viewTransition:l,children:u,...c},d){let h,f=eZ(i,{relative:c.relative}),p=eK(),m=a.useContext(e_),{navigator:y,basename:v}=a.useContext(eB),g=null!=m&&function(e,{relative:t}={}){let r=a.useContext(eI);s(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=tT("useViewTransitionState"),o=eZ(e,{relative:t});if(!r.isTransitioning)return!1;let i=C(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=C(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=S(o.pathname,l)||null!=S(o.pathname,i)}(f)&&!0===l,w=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=C(E,v)||E);let R="/"!==w&&w.endsWith("/")?w.length-1:w.length,x=b===w||!n&&b.startsWith(w)&&"/"===b.charAt(R),P=null!=E&&(E===w||!n&&E.startsWith(w)&&"/"===E.charAt(w.length)),L={isActive:x,isPending:P,isTransitioning:g},k=x?e:void 0;h="function"==typeof r?r(L):[r,x?"active":null,P?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof o?o(L):o;return a.createElement(t$,{...c,"aria-current":k,className:h,ref:d,style:D,to:i,viewTransition:l},"function"==typeof u?u(L):u)});tM.displayName="NavLink",a.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:l=ts,action:u,onSubmit:c,relative:d,preventScrollReset:f,viewTransition:p,...m},y)=>{let v=function(){let{router:e}=tT("useSubmit"),{basename:t}=a.useContext(eB),r=e3("useRouteId");return a.useCallback(async(n,a={})=>{let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(tc(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?C(i,t):null,r=e.getAttribute("method")||ts,a=tf(e.getAttribute("enctype"))||tu,o=new FormData(e)}else if(tc(e)&&"button"===e.tagName.toLowerCase()||tc(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(n=l?C(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||ts,a=tf(e.getAttribute("formenctype"))||tf(i.getAttribute("enctype"))||tu,o=new FormData(i,e),!function(){if(null===td)try{new FormData(document.createElement("form"),0),td=!1}catch(e){td=!0}return td}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,n)}}else if(tc(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r=ts,n=null,a=tu,i=e;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||`__${String(++tO)}__`;await e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,r])}(),g=function(e,{relative:t}={}){let{basename:r}=a.useContext(eB),n=a.useContext(eq);s(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={...eZ(e||".",{relative:t})},l=eK();if(null==e){i.search=l.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 r=e.toString();i.search=r?`?${r}`:""}}return(!e||"."===e)&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(i.pathname="/"===i.pathname?r:$([r,i.pathname])),h(i)}(u,{relative:d}),w="get"===l.toLowerCase()?"get":"post",b="string"==typeof u&&tD.test(u);return a.createElement("form",{ref:y,method:w,action:g,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,a=n?.getAttribute("formmethod")||l;v(n||e.currentTarget,{fetcherKey:t,method:a,navigate:r,replace:o,state:i,relative:d,preventScrollReset:f,viewTransition:p})},...m,"data-discover":b||"render"!==e?void 0:"true"})}).displayName="Form";function tT(e){var t;let r=a.useContext(eF);return s(r,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),r}var tO=0}}]);
6
+ //# sourceMappingURL=lib-router.539f1a1d.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * react-router v7.9.1
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */