PageSourceSearch

https://khachhang.superai.vn/assets/@remix-run-19936117.js

js superai.vn collected 2026-09-24 15:14:49 UTC 47,723 bytes, 11 lines download raw bytes

1/**
2 * @remix-run/router v1.23.0
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 */function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},z.apply(this,arguments)}var k;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(k||(k={}));const Ut="popstate";function ya(e){e===void 0&&(e={});function t(a,i){let{pathname:u,search:s,hash:c}=a.location;return Ve("",{pathname:u,search:s,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(a,i){return typeof i=="string"?i:ke(i)}return Dr(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ce(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rr(){return Math.random().toString(36).substr(2,8)}function jt(e,t){return{usr:e.state,key:e.key,idx:t}}function Ve(e,t,r,a){return r===void 0&&(r=null),z({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Re(t):t,{state:r,key:t&&t.key||a||Rr()})}function ke(e){let{pathname:t="/",search:r="",hash:a=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function Re(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function Dr(e,t,r,a){a===void 0&&(a={});let{window:i=document.defaultView,v5Compat:u=!1}=a,s=i.history,c=k.Pop,d=null,p=y();p==null&&(p=0,s.replaceState(z({},s.state,{idx:p}),""));function y(){return(s.state||{idx:null}).idx}function m(){c=k.Pop;let F=y(),H=F==null?null:F-p;p=F,d&&d({action:c,location:x.location,delta:H})}function w(F,H){c=k.Push;let L=Ve(x.location,F,H);r&&r(L,F),p=y()+1;let ne=jt(L,p),q=x.createHref(L);try{s.pushState(ne,"",q)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;i.location.assign(q)}u&&d&&d({action:c,location:x.location,delta:1})}function S(F,H){c=k.Replace;let L=Ve(x.location,F,H);r&&r(L,F),p=y();let ne=jt(L,p),q=x.createHref(L);s.replaceState(ne,"",q),u&&d&&d({action:c,location:x.location,delta:0})}function T(F){let H=i.location.origin!=="null"?i.location.origin:i.location.href,L=typeof F=="string"?F:ke(F);return L=L.replace(/ $/,"%20"),O(H,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,H)}let x={get action(){return c},get location(){return e(i,s)},listen(F){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(Ut,m),d=F,()=>{i.removeEventListener(Ut,m),d=null}},createHref(F){return t(i,F)},createURL:T,encodeLocation(F){let H=T(F);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:w,replace:S,go(F){return s.go(F)}};return x}var I;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(I||(I={}));const Sr=new Set(["lazy","caseSensitive","path","id","index","children"]);function Er(e){return e.index===!0}function at(e,t,r,a){return r===void 0&&(r=[]),a===void 0&&(a={}),e.map((i,u)=>{let s=[...r,String(u)],c=typeof i.id=="string"?i.id:s.join("-");if(O(i.index!==!0||!i.children,"Cannot specify children on an index route"),O(!a[c],'Found a route id collision on i
10d "'+c+`".  Route id's must be globally unique within Data Router usages`),Er(i)){let d=z({},i,t(i),{id:c});return a[c]=d,d}else{let d=z({},i,t(i),{id:c,children:void 0});return a[c]=d,i.children&&(d.children=at(i.children,t,s,a)),d}})}function Fe(e,t,r){return r===void 0&&(r="/"),rt(e,t,r,!1)}function rt(e,t,r,a){let i=typeof t=="string"?Re(t):t,u=it(i.pathname||"/",r);if(u==null)return null;let s=Jt(e);Pr(s);let c=null;for(let d=0;c==null&&d<s.length;++d){let p=_r(u);c=Ar(s[d],p,a)}return c}function Mr(e,t){let{route:r,pathname:a,params:i}=e;return{id:r.id,pathname:a,params:i,data:t[r.id],handle:r.handle}}function Jt(e,t,r,a){t===void 0&&(t=[]),r===void 0&&(r=[]),a===void 0&&(a="");let i=(u,s,c)=>{let d={relativePath:c===void 0?u.path||"":c,caseSensitive:u.caseSensitive===!0,childrenIndex:s,route:u};d.relativePath.startsWith("/")&&(O(d.relativePath.startsWith(a),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(a.length));let p=We([a,d.relativePath]),y=r.concat(d);u.children&&u.children.length>0&&(O(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),Jt(u.children,t,y,p)),!(u.path==null&&!u.index)&&t.push({path:p,score:jr(p,u.index),routesMeta:y})};return e.forEach((u,s)=>{var c;if(u.path===""||!((c=u.path)!=null&&c.includes("?")))i(u,s);else for(let d of Xt(u.path))i(u,s,d)}),t}function Xt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,i=r.endsWith("?"),u=r.replace(/\?$/,"");if(a.length===0)return i?[u,""]:[u];let s=Xt(a.join("/")),c=[];return c.push(...s.map(d=>d===""?u:[u,d].join("/"))),i&&c.push(...s),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Pr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Ir(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}const xr=/^:[\w-]+$/,Lr=3,Tr=2,Fr=1,Cr=10,Ur=-2,It=e=>e==="*";function jr(e,t){let r=e.split("/"),a=r.length;return r.some(It)&&(a+=Ur),t&&(a+=Tr),r.filter(i=>!It(i)).reduce((i,u)=>i+(xr.test(u)?Lr:u===""?Fr:Cr),a)}function Ir(e,t){return e.length===t.length&&e.slice(0,-1).every((a,i)=>a===t[i])?e[e.length-1]-t[t.length-1]:0}function Ar(e,t,r){r===void 0&&(r=!1);let{routesMeta:a}=e,i={},u="/",s=[];for(let c=0;c<a.length;++c){let d=a[c],p=c===a.length-1,y=u==="/"?t:t.slice(u.length)||"/",m=At({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},y),w=d.route;if(!m&&p&&r&&!a[a.length-1].route.index&&(m=At({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},y)),!m)return null;
10Object.assign(i,m.params),s.push({params:i,pathname:We([u,m.pathname]),pathnameBase:Wr(We([u,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(u=We([u,m.pathnameBase]))}return s}function At(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Or(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let u=i[0],s=u.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:a.reduce((p,y,m)=>{let{paramName:w,isOptional:S}=y;if(w==="*"){let x=c[m]||"";s=u.slice(0,u.length-x.length).replace(/(.)\/+$/,"$1")}const T=c[m];return S&&!T?p[w]=void 0:p[w]=(T||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:s,pattern:e}}function Or(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Ce(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 a=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,c,d)=>(a.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),a]}function _r(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ce(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function it(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Nr(e,t){t===void 0&&(t="/");let{pathname:r,search:a="",hash:i=""}=typeof e=="string"?Re(e):e;return{pathname:r?r.startsWith("/")?r:zr(r,t):t,search:Vr(a),hash:kr(i)}}function zr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function ut(e,t,r,a){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(a)+"].  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 Qt(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Hr(e,t){let r=Qt(e);return t?r.map((a,i)=>i===r.length-1?a.pathname:a.pathnameBase):r.map(a=>a.pathnameBase)}function Br(e,t,r,a){a===void 0&&(a=!1);let i;typeof e=="string"?i=Re(e):(i=z({},e),O(!i.pathname||!i.pathname.includes("?"),ut("?","pathname","search",i)),O(!i.pathname||!i.pathname.includes("#"),ut("#","pathname","hash",i)),O(!i.search||!i.search.includes("#"),ut("#","search","hash",i)));let u=e===""||i.pathname==="",s=u?"/":i.pathname,c;if(s==null)c=r;else{let m=t.length-1;if(!a&&s.startsWith("..")){let w=s.split("/");for(;w[0]==="..";)w.shift(),m-=1;i.pathname=w.join("/")}c=m>=0?t[m]:"/"}let d=Nr(i,c),p=s&&s!=="/"&&s.endsWith("/"),y=(u||s===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(p||y)&&(d.pathname+="/"),d}const We=e=>e.join("/").replace(/\/\/+/g,"/"),Wr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class ht{constructor(t,r,a,i){i===void 0&&(i=!1),this.status=t,this.statusText=r||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}}function nt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zt=["post","put","patch","delete"],$r=new Set(Zt),Kr=["get",...Zt],Yr=new Set(Kr),Gr=new Set([301,302,303,307,308]),Jr=new Set([307,308]),ft={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ze={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},yt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qr=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),qt="remix-router-transitions";function va(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",a=!r;O(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let n=e.detectErrorBoundary;i=o=>({hasErrorBoundary:n(o)})}else i=Qr;let u={},s=at(e.routes,i,void 0,u),c,d=e.basename||"/",p=e.dataStrategy||ta,y=e.patchRoutesOnNavigation,m=z({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prepe
10ndBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),w=null,S=new Set,T=null,x=null,F=null,H=e.hydrationData!=null,L=Fe(s,e.history.location,d),ne=!1,q=null;if(L==null&&!y){let n=X(404,{pathname:e.history.location.pathname}),{matches:o,route:l}=Kt(s);L=o,q={[l.id]:n}}L&&!e.hydrationData&&Qe(L,s,e.history.location.pathname).active&&(L=null);let J;if(L)if(L.some(n=>n.route.lazy))J=!1;else if(!L.some(n=>n.route.loader))J=!0;else if(m.v7_partialHydration){let n=e.hydrationData?e.hydrationData.loaderData:null,o=e.hydrationData?e.hydrationData.errors:null;if(o){let l=L.findIndex(h=>o[h.route.id]!==void 0);J=L.slice(0,l+1).every(h=>!mt(h.route,n,o))}else J=L.every(l=>!mt(l.route,n,o))}else J=e.hydrationData!=null;else if(J=!1,L=[],m.v7_partialHydration){let n=Qe(null,s,e.history.location.pathname);n.active&&n.matches&&(ne=!0,L=n.matches)}let Ue,f={historyAction:e.history.action,location:e.history.location,matches:L,initialized:J,navigation:ft,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||q,fetchers:new Map,blockers:new Map},_=k.Pop,Y=!1,N,Q=!1,ee=new Map,te=null,De=!1,he=!1,$e=[],Ke=new Set,$=new Map,Ye=0,je=-1,Se=new Map,oe=new Set,Ee=new Map,Ie=new Map,re=new Set,pe=new Map,me=new Map,Ge;function nr(){if(w=e.history.listen(n=>{let{action:o,location:l,delta:h}=n;if(Ge){Ge(),Ge=void 0;return}Ce(me.size===0||h!=null,"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 g=Lt({currentLocation:f.location,nextLocation:l,historyAction:o});if(g&&h!=null){let E=new Promise(M=>{Ge=M});e.history.go(h*-1),Xe(g,{state:"blocked",location:l,proceed(){Xe(g,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),E.then(()=>e.history.go(h))},reset(){let M=new Map(f.blockers);M.set(g,ze),G({blockers:M})}});return}return ge(o,l)}),r){ma(t,ee);let n=()=>ga(t,ee);t.addEventListener("pagehide",n),te=()=>t.removeEventListener("pagehide",n)}return f.initialized||ge(k.Pop,f.location,{initialHydration:!0}),Ue}function ir(){w&&w(),te&&te(),S.clear(),N&&N.abort(),f.fetchers.forEach((n,o)=>Je(o)),f.blockers.forEach((n,o)=>xt(o))}function or(n){return S.add(n),()=>S.delete(n)}function G(n,o){o===void 0&&(o={}),f=z({},f,n);let l=[],h=[];m.v7_fetcherPersist&&f.fetchers.forEach((g,E)=>{g.state==="idle"&&(re.has(E)?h.push(E):l.push(E))}),re.forEach(g=>{!f.fetchers.has(g)&&!$.has(g)&&h.push(g)}),[...S].forEach(g=>g(f,{deletedFetchers:h,viewTransitionOpts:o.viewTransitionOpts,flushSync:o.flushSync===!0})),m.v7_fetcherPersist?(l.forEach(g=>f.fetchers.delete(g)),h.forEach(g=>Je(g))):h.forEach(g=>re.delete(g))}function Me(n,o,l){var h,g;let{flushSync:E}=l===void 0?{}:l,M=f.actionData!=null&&f.navigation.formMethod!=null&&ae(f.navigation.formMethod)&&f.navigation.state==="loading"&&((h=n.state)==null?void 0:h._isRedirect)!==!0,b;o.actionData?Object.keys(o.actionData).length>
100?b=o.actionData:b=null:M?b=f.actionData:b=null;let R=o.loaderData?kt(f.loaderData,o.loaderData,o.matches||[],o.errors):f.loaderData,v=f.blockers;v.size>0&&(v=new Map(v),v.forEach((C,K)=>v.set(K,ze)));let D=Y===!0||f.navigation.formMethod!=null&&ae(f.navigation.formMethod)&&((g=n.state)==null?void 0:g._isRedirect)!==!0;c&&(s=c,c=void 0),De||_===k.Pop||(_===k.Push?e.history.push(n,n.state):_===k.Replace&&e.history.replace(n,n.state));let P;if(_===k.Pop){let C=ee.get(f.location.pathname);C&&C.has(n.pathname)?P={currentLocation:f.location,nextLocation:n}:ee.has(n.pathname)&&(P={currentLocation:n,nextLocation:f.location})}else if(Q){let C=ee.get(f.location.pathname);C?C.add(n.pathname):(C=new Set([n.pathname]),ee.set(f.location.pathname,C)),P={currentLocation:f.location,nextLocation:n}}G(z({},o,{actionData:b,loaderData:R,historyAction:_,location:n,initialized:!0,navigation:ft,revalidation:"idle",restoreScrollPosition:Ft(n,o.matches||f.matches),preventScrollReset:D,blockers:v}),{viewTransitionOpts:P,flushSync:E===!0}),_=k.Pop,Y=!1,Q=!1,De=!1,he=!1,$e=[]}async function bt(n,o){if(typeof n=="number"){e.history.go(n);return}let l=pt(f.location,f.matches,d,m.v7_prependBasename,n,m.v7_relativeSplatPath,o==null?void 0:o.fromRouteId,o==null?void 0:o.relative),{path:h,submission:g,error:E}=Ot(m.v7_normalizeFormMethod,!1,l,o),M=f.location,b=Ve(f.location,h,o&&o.state);b=z({},b,e.history.encodeLocation(b));let R=o&&o.replace!=null?o.replace:void 0,v=k.Push;R===!0?v=k.Replace:R===!1||g!=null&&ae(g.formMethod)&&g.formAction===f.location.pathname+f.location.search&&(v=k.Replace);let D=o&&"preventScrollReset"in o?o.preventScrollReset===!0:void 0,P=(o&&o.flushSync)===!0,C=Lt({currentLocation:M,nextLocation:b,historyAction:v});if(C){Xe(C,{state:"blocked",location:b,proceed(){Xe(C,{state:"proceeding",proceed:void 0,reset:void 0,location:b}),bt(n,o)},reset(){let K=new Map(f.blockers);K.set(C,ze),G({blockers:K})}});return}return await ge(v,b,{submission:g,pendingError:E,preventScrollReset:D,replace:o&&o.replace,enableViewTransition:o&&o.viewTransition,flushSync:P})}function lr(){if(ot(),G({revalidation:"loading"}),f.navigation.state!=="submitting"){if(f.navigation.state==="idle"){ge(f.historyAction,f.location,{startUninterruptedRevalidation:!0});return}ge(_||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation,enableViewTransition:Q===!0})}}async function ge(n,o,l){N&&N.abort(),N=null,_=n,De=(l&&l.startUninterruptedRevalidation)===!0,yr(f.location,f.matches),Y=(l&&l.preventScrollReset)===!0,Q=(l&&l.enableViewTransition)===!0;let h=c||s,g=l&&l.overrideNavigation,E=l!=null&&l.initialHydration&&f.matches&&f.matches.length>0&&!ne?f.matches:Fe(h,o,d),M=(l&&l.flushSync)===!0;if(E&&f.initialized&&!he&&la(f.location,o)&&!(l&&l.submission&&ae(l.submission.formMethod))){Me(o,{matches:E},{flushSync:M});return}let b=Qe(E,h,o.pathname);if(b.active&&b.matches&&(E=b.matches),!E){let{error:A,notFoundMatches:j,route:B}=lt(o.pathname);Me(o,{matches:j,loaderData:{},errors:{[B.id]:A}},{flushSync:M});return}N=new AbortController;let R=Te(e.history,o,N.signal,l&&l.submission),v;if(l&&l.pendingError)v=[we(E).route.id,{type:I.error,error:l.pendingError}];else if(l&&l.submission&&ae(l.submission.formMethod)){let A=await sr(R,o,l.submission,E,b.active,{replace:l.replace,flushSync:M});if(A.shortCircuited)return;if(A.pendingActionResult){let[j,B]=A.pendingActionResult;if(Z(B)&&nt(B.error)&&B.error.status===404){N=null,Me(o,{matches:A.matches,loaderData:{},errors:{[j]:B.error}});return}}E=A.matches||E,v=A.pendingActionResult,g=ct(o,l.submission),M=!1,b.active=!1,R=Te(e.history,R.url,R.signal)}let{shortCircuited:D,matches:P,loaderData:C,errors:K}=await dr(R,o,E,b.active,g,l&&l.submission,l&&l.fetcherSubmission,l&&l.replace,l&&l.initialHydration===!0,M,v);D||(N=null,Me(o,z({matches:P||E},$t(v),{loaderData:C,errors:K})))}async function sr(n,o,l,h,g,E){E===void 0&&(E={}),ot();let M=ha(o,l);if(G({navigation:M},{flushSync:E.flushSync===!0}),g){let v=await Ze(h,o.pathname,n.signal);if(v.type==="aborted")return{shortCircuited:!0};if(v.type==="error"){let D=we(v.partialMatches).route.id;return{matches:v.partialMatches,pendingActionResult:[D,{type:I.error,error:v.error}]}}else if(v.matches)h=v.matches;else{let{notFoundMatches:D,error:P,route:C}=lt(o.pathname);return{matches:D,pendingActionResult:[C.id,{type:I.error,error:P}]}}}let b,R=Be(h,o);if(!R.route.action&&!R.route.lazy)b={type:I.error,error:X(405,{method:n.method,pathname:o.pathname,routeId:R.route.id})};else if(b=(await Ae("action",f,n,[R],h,null))[R.route.id],n.signal.aborted)return{shortCircuited:!0};if(be(b)){let v;return E&&E.replace!=null?v=E.replace:v=Bt(b.response.headers.get("Location"),new URL(n.url),d)===f.location.pathname+f.location.search,await ye(n,b,!0,{submission:l,replace:v}),{shortCircuited:!0}}if(ce(b))throw X(400,{type:"defer-action"});if(Z(b)){let v=we(h,R.route.id);return(E&&E.replace)!==!0&&(_=k.Push),{matches:h,pendingActionResult:[v.route.id,b]}}return{matches:h,pendingActionResult:[R.route.id,b]}}async function dr(n,o,l,h,g,E,M,b,R,v,D){let P=g||ct(o,E),C=E||M||Gt(P),K=!De&&(!m.v7_partialHydration||!R);if(h){if(K){let W=Rt(D);G(z({navigation:P},W!==void 0?{actionData:W}:{}),{flushSync:v})}let U=await Ze(l,o.pathname,n.signal);if(U.type==="aborted")return{shortCircuited:!0};if(U.type==="error"){let W=we(U.partialMatches).route.id;return{matches:U.partialMatches,loaderData:{},errors:{[W]:U.error}}}else if(U.matches)l=U.matches;else{let{error:W,notFoundMatches:xe,route:Ne}=lt(o.pathname);return{matches:xe,loaderData:{},errors:{[Ne.id]:W}}}}let A=c||s,[j,B]=Nt(e.history,f,l,C,o,m.v7_partialHydration&&R===!0,m.v7_skipActionErrorRevalidation,he,$e,Ke,re,Ee,oe,A,d,D);if(st(U=>!(l&&l.some(W=>W.route.id===U))||j&&j.some(W=>
10W.route.id===U)),je=++Ye,j.length===0&&B.length===0){let U=Mt();return Me(o,z({matches:l,loaderData:{},errors:D&&Z(D[1])?{[D[0]]:D[1].error}:null},$t(D),U?{fetchers:new Map(f.fetchers)}:{}),{flushSync:v}),{shortCircuited:!0}}if(K){let U={};if(!h){U.navigation=P;let W=Rt(D);W!==void 0&&(U.actionData=W)}B.length>0&&(U.fetchers=ur(B)),G(U,{flushSync:v})}B.forEach(U=>{ue(U.key),U.controller&&$.set(U.key,U.controller)});let Pe=()=>B.forEach(U=>ue(U.key));N&&N.signal.addEventListener("abort",Pe);let{loaderResults:Oe,fetcherResults:se}=await Dt(f,l,j,B,n);if(n.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Pe),B.forEach(U=>$.delete(U.key));let ie=tt(Oe);if(ie)return await ye(n,ie.result,!0,{replace:b}),{shortCircuited:!0};if(ie=tt(se),ie)return oe.add(ie.key),await ye(n,ie.result,!0,{replace:b}),{shortCircuited:!0};let{loaderData:dt,errors:_e}=Vt(f,l,Oe,D,B,se,pe);pe.forEach((U,W)=>{U.subscribe(xe=>{(xe||U.done)&&pe.delete(W)})}),m.v7_partialHydration&&R&&f.errors&&(_e=z({},f.errors,_e));let ve=Mt(),qe=Pt(je),et=ve||qe||B.length>0;return z({matches:l,loaderData:dt,errors:_e},et?{fetchers:new Map(f.fetchers)}:{})}function Rt(n){if(n&&!Z(n[1]))return{[n[0]]:n[1].data};if(f.actionData)return Object.keys(f.actionData).length===0?null:f.actionData}function ur(n){return n.forEach(o=>{let l=f.fetchers.get(o.key),h=He(void 0,l?l.data:void 0);f.fetchers.set(o.key,h)}),new Map(f.fetchers)}function fr(n,o,l,h){if(a)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ue(n);let g=(h&&h.flushSync)===!0,E=c||s,M=pt(f.location,f.matches,d,m.v7_prependBasename,l,m.v7_relativeSplatPath,o,h==null?void 0:h.relative),b=Fe(E,M,d),R=Qe(b,E,M);if(R.active&&R.matches&&(b=R.matches),!b){le(n,o,X(404,{pathname:M}),{flushSync:g});return}let{path:v,submission:D,error:P}=Ot(m.v7_normalizeFormMethod,!0,M,h);if(P){le(n,o,P,{flushSync:g});return}let C=Be(b,v),K=(h&&h.preventScrollReset)===!0;if(D&&ae(D.formMethod)){cr(n,o,v,C,b,R.active,g,K,D);return}Ee.set(n,{routeId:o,path:v}),hr(n,o,v,C,b,R.active,g,K,D)}async function cr(n,o,l,h,g,E,M,b,R){ot(),Ee.delete(n);function v(V){if(!V.route.action&&!V.route.lazy){let Le=X(405,{method:R.formMethod,pathname:l,routeId:o});return le(n,o,Le,{flushSync:M}),!0}return!1}if(!E&&v(h))return;let D=f.fetchers.get(n);de(n,pa(R,D),{flushSync:M});let P=new AbortController,C=Te(e.history,l,P.signal,R);if(E){let V=await Ze(g,new URL(C.url).pathname,C.signal,n);if(V.type==="aborted")return;if(V.type==="error"){le(n,o,V.error,{flushSync:M});return}else if(V.matches){if(g=V.matches,h=Be(g,l),v(h))return}else{le(n,o,X(404,{pathname:l}),{flushSync:M});return}}$.set(n,P);let K=Ye,j=(await Ae("action",f,C,[h],g,n))[h.route.id];if(C.signal.aborted){$.get(n)===P&&$.delete(n);return}if(m.v7_fetcherPersist&&re.has(n)){if(be(j)||Z(j)){de(n,fe(void 0));return}}else{if(be(j))if($.delete(n),je>K){de(n,fe(void 0));return}else return oe.add(n),de(n,He(R)),ye(C,j,!1,{fetcherSubmission:R,preventScrollReset:b});if(Z(j)){le(n,o,j.error);return}}if(ce(j))throw X(400,{type:"defer-action"});let B=f.navigation.location||f.location,Pe=Te(e.history,B,P.signal),Oe=c||s,se=f.navigation.state!=="idle"?Fe(Oe,f.navigation.location,d):f.matches;O(se,"Didn't find any matches after fetcher action");let ie=++Ye;Se.set(n,ie);let dt=He(R,j.data);f.fetchers.set(n,dt);let[_e,ve]=Nt(e.history,f,se,R,B,!1,m.v7_skipActionErrorRevalidation,he,$e,Ke,re,Ee,oe,Oe,d,[h.route.id,j]);ve.filter(V=>V.key!==n).forEach(V=>{let Le=V.key,Ct=f.fetchers.get(Le),br=He(void 0,Ct?Ct.data:void 0);f.fetchers.set(Le,br),ue(Le),V.controller&&$.set(Le,V.controller)}),G({fetchers:new Map(f.fetchers)});let qe=()=>ve.forEach(V=>ue(V.key));P.signal.addEventListener("abort",qe);let{loaderResults:et,fetcherResults:U}=await Dt(f,se,_e,ve,Pe);if(P.signal.aborted)return;P.signal.removeEventListener("abort",qe),Se.delete(n),$.delete(n),ve.forEach(V=>$.delete(V.key));let W=tt(et);if(W)return ye(Pe,W.result,!1,{preventScrollReset:b});if(W=tt(U),W)return oe.add(W.key),ye(Pe,W.result,!1,{preventScrollReset:b});let{loaderData:xe,errors:Ne}=Vt(f,se,et,void 0,ve,U,pe);if(f.fetchers.has(n)){let V=fe(j.data);f.fetchers.set(n,V)}Pt(ie),f.navigation.state==="loading"&&ie>je?(O(_,"Expected pending action"),N&&N.abort(),Me(f.navigation.location,{matches:se,loaderData:xe,errors:Ne,fetchers:new Map(f.fetchers)})):(G({errors:Ne,loaderData:kt(f.loaderData,xe,se,Ne),fetchers:new Map(f.fetchers)}),he=!1)}async function hr(n,o,l,h,g,E,M,b,R){let v=f.fetchers.get(n);de(n,He(R,v?v.data:void 0),{flushSync:M});let D=new AbortController,P=Te(e.history,l,D.signal);if(E){let j=await Ze(g,new URL(P.url).pathname,P.signal,n);if(j.type==="aborted")return;if(j.type==="error"){le(n,o,j.error,{flushSync:M});return}else if(j.matches)g=j.matches,h=Be(g,l);else{le(n,o,X(404,{pathname:l}),{flushSync:M});return}}$.set(n,D);let C=Ye,A=(await Ae("loader",f,P,[h],g,n))[h.route.id];if(ce(A)&&(A=await vt(A,P.signal,!0)||A),$.get(n)===D&&$.delete(n),!P.signal.aborted){if(re.has(n)){de(n,fe(void 0));return}if(be(A))if(je>C){de(n,fe(void 0));return}else{oe.add(n),await ye(P,A,!1,{preventScrollReset:b});return}if(Z(A)){le(n,o,A.error);return}O(!ce(A),"Unhandled fetcher deferred data"),de(n,fe(A.data))}}async function ye(n,o,l,h){let{submission:g,fetcherSubmission:E,preventScrollReset:M,replace:b}=h===void 0?{}:h;o.response.headers.has("X-Remix-Revalidate")&&(he=!0);let R=o.response.headers.get("Location");O(R,"Expected a Location header on the redirect Response"),R=Bt(R,new URL(n.url),d);let v=Ve(f.location,R,{_isRedirect:!0});if(r){let j=!1;if(o.response.headers.has("X-Remix-Reload-Document"))j=!0;else if(yt.test(R)){const B=e.history.createURL(R);j=B.origin!==t.location.origin||it(B.pathname,d)==null}if(j){b?t.location.replace(R):t.location.assign(R);return}}N=null;let D=b===!0||o.response.headers.has("X-Remix-Replace")?k.Replace:k.Push,{formMethod:P,formAction:C,formEncType:K}=f.navigation;!g&&!E&&P&&C&&K&&(g=Gt(f.navigation));let A=g||E;if(Jr.has(o.response.status)&&A&&ae(A.formMethod))await ge(D,v,{submission:z({},A,{formAction:R}),preventScrollReset:M||Y,enableViewTransition:l?Q:void 0});else{let j=ct(v,g);await ge(D,v,{overrideNavigation:j,fetcherSubmission:E,preventScrollReset:M||Y,enableViewTransition:l?Q:void 0})}}async function Ae(n,o,l,h,g,E){let M,b={};try{M=await ra(p,n,o,l,h,g,E,u,i)}catch(R){return h.forEach(v=>{b[v.route.id]={type:I.error,error:R}}),b}for(let[R,v]of Object.entries(M))if(sa(v)){let D=v.result;b[R]={type:I.redirect,response:ia(D,l,R,g,d,m.v7_relativeSplatPath)}}else b[R]=await na(v);return b}async function Dt(n,o,l,h,g){let E=n.matches,M=Ae("loader",n,g,l,o,null),b=Promise.all(h.map(async D=>{if(D.matches&&D.match&&D.controller){let C=(await Ae("loader",n,Te(e.history,D.path,D.controller.signal),[D.match],D.matches,D.key))[D.match.route.id];return{[D.key]:C}}else return Promise.resolve({[D.key]:{type:I.error,error:X(404,{pathname:D.path})}})})),R=await M,v=(await b).reduce((D,P)=>Object.assign(D,P),{});return await Promise.all([fa(o,R,g.signal,E,n.loaderData),ca(o,v,h)]),{loaderResults:R,fetcherResults:v}}function ot(){he=!0,$e.push(...st()),Ee.forEach((n,o)=>{$.has(o)&&Ke.add(o),ue(o)})}function de(n,o,l){l===void 0&&(l={}),f.fetchers.set(n,o),G({fetchers:new Map(f.fetchers)},{flushSync:(l&&l.flushSync)===!0})}function le(n,o,l,h){h===void 0&&(h={});let g=we(f.matches,o);Je(n),G({errors:{[g.route.id]:l},fetchers:new Map(f.fetchers)},{flushSync:(h&&h.flushSync)===!0})}function St(n){return Ie.set(n,(Ie.get(n)||0)+1),re.has(n)&&re.delete(n),f.fetchers.get(n)||Xr}function Je(n){let o=f.fetchers.get(n);$.has(n)&&!(o&&o.state==="loading"&&Se.has(n))&&ue(n),Ee.delete(n),Se.delete(n),oe.delete(n),m.v7_fetcherPersist&&re.delete(n),Ke.delete(n),f.fetchers.delete(n)}function pr(n){let o=(Ie.get(n)||0)-1;o<=0?(Ie.delete(n),re.add(n),m.v7_fetcherPersist||Je(n)):Ie.set(n,o),G({fetchers:new Map(f.fetchers)})}function ue(n){let o=$.get(n);o&&(o.abort(),$.delete(n))}function Et(n){for(let o of n){let l=St(o),h=fe(l.data);f.fetchers.set(o,h)}}function Mt(){let n=[],o=!1;for(let l of oe){let h=f.fetchers.get(l);O(h,"Expected fetcher: "+l),h.state==="loading"&&(oe.delete(l),n.push(l),o=!0)}return Et(n),o}function Pt(n){let o=[];for(let[l,h]of Se)if(h<n){let g=f.fetchers.get(l);O(g,"Expected fetcher: "+l),g.state==="loading"&&(ue(l),Se.delete(l),o.push(l))}return Et(o),o.length>0}function mr(n,o){let l=f.blockers.get(n)||ze;return me.get(n)!==o&&me.set(n,o),l}function xt(n){f.blockers.delete(n),me.delete(n)}function Xe(n,o){let l=f.blockers.get(n)||ze;O(l.state==="unblocked"&&o.state==="blocked"||l.state==="blocked"&&o.state==="blocked"||l.state==="blocked"&&o.state==="proceeding"||l.state==="blocked"&&o.state==="unblocked"||l.state==="proceeding"&&o.state==="unblocked","Invalid blocker state transition: "+l.state+" -> "+o.state);let h=new Map(f.blockers);h.set(n,o),G({blockers:h})}function Lt(n){let{currentLocation:o,nextLocation:l,historyAction:h}=n;
10if(me.size===0)return;me.size>1&&Ce(!1,"A router only supports one blocker at a time");let g=Array.from(me.entries()),[E,M]=g[g.length-1],b=f.blockers.get(E);if(!(b&&b.state==="proceeding")&&M({currentLocation:o,nextLocation:l,historyAction:h}))return E}function lt(n){let o=X(404,{pathname:n}),l=c||s,{matches:h,route:g}=Kt(l);return st(),{notFoundMatches:h,route:g,error:o}}function st(n){let o=[];return pe.forEach((l,h)=>{(!n||n(h))&&(l.cancel(),o.push(h),pe.delete(h))}),o}function gr(n,o,l){if(T=n,F=o,x=l||null,!H&&f.navigation===ft){H=!0;let h=Ft(f.location,f.matches);h!=null&&G({restoreScrollPosition:h})}return()=>{T=null,F=null,x=null}}function Tt(n,o){return x&&x(n,o.map(h=>Mr(h,f.loaderData)))||n.key}function yr(n,o){if(T&&F){let l=Tt(n,o);T[l]=F()}}function Ft(n,o){if(T){let l=Tt(n,o),h=T[l];if(typeof h=="number")return h}return null}function Qe(n,o,l){if(y)if(n){if(Object.keys(n[0].params).length>0)return{active:!0,matches:rt(o,l,d,!0)}}else return{active:!0,matches:rt(o,l,d,!0)||[]};return{active:!1,matches:null}}async function Ze(n,o,l,h){if(!y)return{type:"success",matches:n};let g=n;for(;;){let E=c==null,M=c||s,b=u;try{await y({signal:l,path:o,matches:g,fetcherKey:h,patch:(D,P)=>{l.aborted||Ht(D,P,M,b,i)}})}catch(D){return{type:"error",error:D,partialMatches:g}}finally{E&&!l.aborted&&(s=[...s])}if(l.aborted)return{type:"aborted"};let R=Fe(M,o,d);if(R)return{type:"success",matches:R};let v=rt(M,o,d,!0);if(!v||g.length===v.length&&g.every((D,P)=>D.route.id===v[P].route.id))return{type:"success",matches:null};g=v}}function vr(n){u={},c=at(n,i,void 0,u)}function wr(n,o){let l=c==null;Ht(n,o,c||s,u,i),l&&(s=[...s],G({}))}return Ue={get basename(){return d},get future(){return m},get state(){return f},get routes(){return s},get window(){return t},initialize:nr,subscribe:or,enableScrollRestoration:gr,navigate:bt,fetch:fr,revalidate:lr,createHref:n=>e.history.createHref(n),encodeLocation:n=>e.history.encodeLocation(n),getFetcher:St,deleteFetcher:pr,dispose:ir,getBlocker:mr,deleteBlocker:xt,patchRoutes:wr,_internalFetchControllers:$,_internalActiveDeferreds:pe,_internalSetRoutes:vr},Ue}function Zr(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function pt(e,t,r,a,i,u,s,c){let d,p;if(s){d=[];for(let m of t)if(d.push(m),m.route.id===s){p=m;break}}else d=t,p=t[t.length-1];let y=Br(i||".",Hr(d,u),it(e.pathname,r)||e.pathname,c==="path");if(i==null&&(y.search=e.search,y.hash=e.hash),(i==null||i===""||i===".")&&p){let m=wt(y.search);if(p.route.index&&!m)y.search=y.search?y.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&m){let w=new URLSearchParams(y.search),S=w.getAll("index");w.delete("index"),S.filter(x=>x).forEach(x=>w.append("index",x));let T=w.toString();y.search=T?"?"+T:""}}return a&&r!=="/"&&(y.pathname=y.pathname==="/"?r:We([r,y.pathname])),ke(y)}function Ot(e,t,r,a){if(!a||!Zr(a))return{path:r};if(a.formMethod&&!ua(a.formMethod))return{path:r,error:X(405,{method:a.formMethod})};let i=()=>({path:r,error:X(400,{type:"invalid-body"})}),u=a.formMethod||"get",s=e?u.toUpperCase():u.toLowerCase(),c=rr(r);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!ae(s))return i();let w=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((S,T)=>{let[x,F]=T;return""+S+x+"="+F+`
11`},""):String(a.body);return{path:r,submission:{formMethod:s,formAction:c,formEncType:a.formEncType,formData:void 0,json:void 0,text:w}}}else if(a.formEncType==="application/json"){if(!ae(s))return i();try{let w=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:r,submission:{formMethod:s,formAction:c,formEncType:a.formEncType,formData:void 0,json:w,text:void 0}}}catch{return i()}}}O(typeof FormData=="function","FormData is not available in this environment");let d,p;if(a.formData)d=gt(a.formData),p=a.formData;else if(a.body instanceof FormData)d=gt(a.body),p=a.body;else if(a.body instanceof URLSearchParams)d=a.body,p=Wt(d);else if(a.body==null)d=new URLSearchParams,p=new FormData;else try{d=new URLSearchParams(a.body),p=Wt(d)}catch{return i()}let y={formMethod:s,formAction:c,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(ae(y.formMethod))return{path:r,submission:y};let m=Re(r);return t&&m.search&&wt(m.search)&&d.append("index",""),m.search="?"+d,{path:ke(m),submission:y}}function _t(e,t,r){r===void 0&&(r=!1);let a=e.findIndex(i=>i.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function Nt(e,t,r,a,i,u,s,c,d,p,y,m,w,S,T,x){let F=x?Z(x[1])?x[1].error:x[1].data:void 0,H=e.createURL(t.location),L=e.createURL(i),ne=r;u&&t.errors?ne=_t(r,Object.keys(t.errors)[0],!0):x&&Z(x[1])&&(ne=_t(r,x[0]));let q=x?x[1].statusCode:void 0,J=s&&q&&q>=400,Ue=ne.filter((_,Y)=>{let{route:N}=_;if(N.lazy)return!0;
11if(N.loader==null)return!1;if(u)return mt(N,t.loaderData,t.errors);if(qr(t.loaderData,t.matches[Y],_)||d.some(te=>te===_.route.id))return!0;let Q=t.matches[Y],ee=_;return zt(_,z({currentUrl:H,currentParams:Q.params,nextUrl:L,nextParams:ee.params},a,{actionResult:F,actionStatus:q,defaultShouldRevalidate:J?!1:c||H.pathname+H.search===L.pathname+L.search||H.search!==L.search||er(Q,ee)}))}),f=[];return m.forEach((_,Y)=>{if(u||!r.some(De=>De.route.id===_.routeId)||y.has(Y))return;let N=Fe(S,_.path,T);if(!N){f.push({key:Y,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let Q=t.fetchers.get(Y),ee=Be(N,_.path),te=!1;w.has(Y)?te=!1:p.has(Y)?(p.delete(Y),te=!0):Q&&Q.state!=="idle"&&Q.data===void 0?te=c:te=zt(ee,z({currentUrl:H,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},a,{actionResult:F,actionStatus:q,defaultShouldRevalidate:J?!1:c})),te&&f.push({key:Y,routeId:_.routeId,path:_.path,matches:N,match:ee,controller:new AbortController})}),[Ue,f]}function mt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&t[e.id]!==void 0,i=r!=null&&r[e.id]!==void 0;return!a&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!i}function qr(e,t,r){let a=!t||r.route.id!==t.route.id,i=e[r.route.id]===void 0;return a||i}function er(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function zt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Ht(e,t,r,a,i){var u;let s;if(e){let p=a[e];O(p,"No route found to patch children into: routeId = "+e),p.children||(p.children=[]),s=p.children}else s=r;let c=t.filter(p=>!s.some(y=>tr(p,y))),d=at(c,i,[e||"_","patch",String(((u=s)==null?void 0:u.length)||"0")],a);s.push(...d)}function tr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>{var i;return(i=t.children)==null?void 0:i.some(u=>tr(r,u))}):!1}async function ea(e,t,r){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let i=r[e.id];O(i,"No route found in manifest");let u={};for(let s in a){let d=i[s]!==void 0&&s!=="hasErrorBoundary";Ce(!d,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!d&&!Sr.has(s)&&(u[s]=a[s])}Object.assign(i,u),Object.assign(i,z({},t(i),{lazy:void 0}))}async function ta(e){let{matches:t}=e,r=t.filter(i=>i.shouldLoad);return(await Promise.all(r.map(i=>i.resolve()))).reduce((i,u,s)=>Object.assign(i,{[r[s].route.id]:u}),{})}async function ra(e,t,r,a,i,u,s,c,d,p){let y=u.map(S=>S.route.lazy?ea(S.route,d,c):void 0),m=u.map((S,T)=>{let x=y[T],F=i.some(L=>L.route.id===S.route.id);return z({},S,{shouldLoad:F,resolve:async L=>(L&&a.method==="GET"&&(S.route.lazy||S.route.loader)&&(F=!0),F?aa(t,a,S,x,L,p):Promise.resolve({type:I.data,result:void 0}))})}),w=await e({matches:m,request:a,params:u[0].params,fetcherKey:s,context:p});try{await Promise.all(y)}catch{}return w}async function aa(e,t,r,a,i,u){let s,c,d=p=>{let y,m=new Promise((T,x)=>y=x);c=()=>y(),t.signal.addEventListener("abort",c);let w=T=>typeof p!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):p({request:t,params:r.params,context:u},...T!==void 0?[T]:[]),S=(async()=>{try{return{type:"data",result:await(i?i(x=>w(x)):w())}}catch(T){return{type:"error",result:T}}})();return Promise.race([S,m])};try{let p=r.route[e];if(a)if(p){let y,[m]=await Promise.all([d(p).catch(w=>{y=w}),a]);if(y!==void 0)throw y;s=m}else if(await a,p=r.route[e],p)s=await d(p);else if(e==="action"){let y=new URL(t.url),m=y.pathname+y.search;throw X(405,{method:t.method,pathname:m,routeId:r.route.id})}else return{type:I.data,result:void 0};else if(p)s=await d(p);else{let y=new URL(t.url),m=y.pathname+y.search;throw X(404,{pathname:m})}O(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(p){return{type:I.error,result:p}}finally{c&&t.signal.removeEventListener("abort",c)}return s}async function na(e){let{result:t,type:r}=e;if(ar(t)){let m;try{let w=t.headers.get("Content-Type");w&&/\bapplication\/json\b/.test(w)?t.body==null?m=null:m=await t.json():m=await t.text()}catch(w){return{type:I.error,error:w}}return r===I.error?{type:I.error,error:new ht(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:I.data,data:m,statusCode:t.status,headers:t.headers}}if(r===I.error){if(Yt(t)){var a,i;if(t.data instanceof Error){var u,s;return{type:I.error,error:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:I.error,error:new ht(((a=t.init)==null?void 0:a.status)||500,void 0,t.data),statusCode:nt(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:I.error,error:t,statusCode:nt(t)?t.status:void 0}}if(da(t)){var c,d;return{type:I.deferred,deferredData:t,statusCode:(c=t.init)==null?void 0:c.status,headers:((d=t.init)==null?void 0:d.headers)&&new Headers(t.init.headers)}}if(Yt(t)){var p,y;
11return{type:I.data,data:t.data,statusCode:(p=t.init)==null?void 0:p.status,headers:(y=t.init)!=null&&y.headers?new Headers(t.init.headers):void 0}}return{type:I.data,data:t}}function ia(e,t,r,a,i,u){let s=e.headers.get("Location");if(O(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!yt.test(s)){let c=a.slice(0,a.findIndex(d=>d.route.id===r)+1);s=pt(new URL(t.url),c,i,!0,s,u),e.headers.set("Location",s)}return e}function Bt(e,t,r){if(yt.test(e)){let a=e,i=a.startsWith("//")?new URL(t.protocol+a):new URL(a),u=it(i.pathname,r)!=null;if(i.origin===t.origin&&u)return i.pathname+i.search+i.hash}return e}function Te(e,t,r,a){let i=e.createURL(rr(t)).toString(),u={signal:r};if(a&&ae(a.formMethod)){let{formMethod:s,formEncType:c}=a;u.method=s.toUpperCase(),c==="application/json"?(u.headers=new Headers({"Content-Type":c}),u.body=JSON.stringify(a.json)):c==="text/plain"?u.body=a.text:c==="application/x-www-form-urlencoded"&&a.formData?u.body=gt(a.formData):u.body=a.formData}return new Request(i,u)}function gt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Wt(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function oa(e,t,r,a,i){let u={},s=null,c,d=!1,p={},y=r&&Z(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let w=m.route.id,S=t[w];if(O(!be(S),"Cannot handle redirect results in processLoaderData"),Z(S)){let T=S.error;if(y!==void 0&&(T=y,y=void 0),s=s||{},i)s[w]=T;else{let x=we(e,w);s[x.route.id]==null&&(s[x.route.id]=T)}u[w]=void 0,d||(d=!0,c=nt(S.error)?S.error.status:500),S.headers&&(p[w]=S.headers)}else ce(S)?(a.set(w,S.deferredData),u[w]=S.deferredData.data,S.statusCode!=null&&S.statusCode!==200&&!d&&(c=S.statusCode),S.headers&&(p[w]=S.headers)):(u[w]=S.data,S.statusCode&&S.statusCode!==200&&!d&&(c=S.statusCode),S.headers&&(p[w]=S.headers))}),y!==void 0&&r&&(s={[r[0]]:y},u[r[0]]=void 0),{loaderData:u,errors:s,statusCode:c||200,loaderHeaders:p}}function Vt(e,t,r,a,i,u,s){let{loaderData:c,errors:d}=oa(t,r,a,s,!1);return i.forEach(p=>{let{key:y,match:m,controller:w}=p,S=u[y];if(O(S,"Did not find corresponding fetcher result"),!(w&&w.signal.aborted))if(Z(S)){let T=we(e.matches,m==null?void 0:m.route.id);d&&d[T.route.id]||(d=z({},d,{[T.route.id]:S.error})),e.fetchers.delete(y)}else if(be(S))O(!1,"Unhandled fetcher revalidation redirect");else if(ce(S))O(!1,"Unhandled fetcher deferred data");else{let T=fe(S.data);e.fetchers.set(y,T)}}),{loaderData:c,errors:d}}function kt(e,t,r,a){let i=z({},t);for(let u of r){let s=u.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(i[s]=t[s]):e[s]!==void 0&&u.route.loader&&(i[s]=e[s]),a&&a.hasOwnProperty(s))break}return i}function $t(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function we(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Kt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function X(e,t){let{pathname:r,routeId:a,method:i,type:u,message:s}=t===void 0?{}:t,c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",i&&r&&a?d="You made a "+i+' request to "'+r+'" but '+('did not provide a `loader` for route "'+a+'", ')+"so there is no way to handle the request.":u==="defer-action"?d="defer() is not supported in actions":u==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d='Route "'+a+'" does not match URL "'+r+'"'):e===404?(c="Not Found",d='No route matches URL "'+r+'"'):e===405&&(c="Method Not Allowed",i&&r&&a?d="You made a "+i.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+a+'", ')+"so there is no way to handle the request.":i&&(d='Invalid request method "'+i.toUpperCase()+'"')),new ht(e||500,c,new Error(d),!0)}function tt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,i]=t[r];if(be(i))return{key:a,result:i}}}function rr(e){let t=typeof e=="string"?Re(e):e;return ke(z({},t,{hash:""}))}function la(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function sa(e){return ar(e.result)&&Gr.has(e.result.status)}function ce(e){return e.type===I.deferred}function Z(e){return e.type===I.error}function be(e){return(e&&e.type)===I.redirect}function Yt(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function da(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function ar(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ua(e){return Yr.has(e.toLowerCase())}function ae(e){return $r.has(e.toLowerCase())}async function fa(e,t,r,a,i){let u=Object.entries(t);for(let s=0;s<u.length;s++){let[c,d]=u[s],p=e.find(w=>(w==null?void 0:w.route.id)===c);if(!p)continue;let y=a.find(w=>w.route.id===p.route.id),m=y!=null&&!er(y,p)&&(i&&i[p.route.id])!==void 0;ce(d)&&m&&await vt(d,r,!1).then(w=>
11{w&&(t[c]=w)})}}async function ca(e,t,r){for(let a=0;a<r.length;a++){let{key:i,routeId:u,controller:s}=r[a],c=t[i];e.find(p=>(p==null?void 0:p.route.id)===u)&&ce(c)&&(O(s,"Expected an AbortController for revalidating fetcher deferred result"),await vt(c,s.signal,!0).then(p=>{p&&(t[i]=p)}))}}async function vt(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:I.data,data:e.deferredData.unwrappedData}}catch(i){return{type:I.error,error:i}}return{type:I.data,data:e.deferredData.data}}}function wt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Be(e,t){let r=typeof t=="string"?Re(t).search:t.search;if(e[e.length-1].route.index&&wt(r||""))return e[e.length-1];let a=Qt(e);return a[a.length-1]}function Gt(e){let{formMethod:t,formAction:r,formEncType:a,text:i,formData:u,json:s}=e;if(!(!t||!r||!a)){if(i!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:i};if(u!=null)return{formMethod:t,formAction:r,formEncType:a,formData:u,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:s,text:void 0}}}function ct(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 ha(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function He(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 pa(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function fe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ma(e,t){try{let r=e.sessionStorage.getItem(qt);if(r){let a=JSON.parse(r);for(let[i,u]of Object.entries(a||{}))u&&Array.isArray(u)&&t.set(i,new Set(u||[]))}}catch{}}function ga(e,t){if(t.size>0){let r={};for(let[a,i]of t)r[a]=[...i];try{e.sessionStorage.setItem(qt,JSON.stringify(r))}catch(a){Ce(!1,"Failed to save applied view transitions in sessionStorage ("+a+").")}}}export{k as A,ht as E,ze as I,nt as a,ya as b,va as c,ke as d,At as e,Hr as g,O as i,We as j,Fe as m,Re as p,Br as r,it as s};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.