vendor: 7,960 bytes, line 1
1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ne={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
1,e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=`modulepreload`,p=function(e){return`/`+e},m={},h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=p(t,n),t in m)return;m[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:f,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},g=e=>{throw TypeError(e)},_=(e,t,n)=>t.has(e)||g(`Cannot `+n),v=(e,t,n)=>(_(e,t,`read from private field`),n?n.call(e):t.get(e)),y=(e,t,n)=>t.has(e)?g(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),b=(e,t,n,r)=>(_(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return j(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||E(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function j(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&i.startsWith(`//`)&&(i=r+i),new URL(i,r)}function M(e){return{defaultValue:e}}var N,te=class{constructor(e){if(y(this,N,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(v(this,N).has(e))return v(this,N).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){v(this,N).set(e,t)}};N=new WeakMap;var P=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ne(e){return P.has(e)}var re=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ie(e){return re.has(e)}function ae(e){return e.index===!0}function oe(e,t,n=[],r={},i=!1){return e.map((e,a)=>
1{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(w(e.index!==!0||!e.children,`Cannot specify children on an index route`),w(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ae(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=oe(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function se(e,t,n=`/`){return I(e,t,n,!1)}function I(e,t,n,r,i){let a=H((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??le(e),s=null,c=be(a);for(let e=0;s==null&&e<o.length;++e)s=_e(o[e],c,r);return s}function ce(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function le(e){let t=ue(e);return de(t),t}function ue(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ue(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ge(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);
1else for(let n of L(e.path))a(e,t,!0,n)}),t}function L(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=L(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function de(e){e.sort((e,t)=>e.score===t.score?V(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var R=/^:[\w-]+$/,z=3,B=2,fe=1,pe=10,me=-2,he=e=>e===`*`;function ge(e,t){let n=e.split(`/`),r=n.length;return n.some(he)&&(r+=me),t&&(r+=B),n.filter(e=>!he(e)).reduce((e,t)=>e+(R.test(t)?z:t===``?fe:pe),r)}function V(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function _e(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
1Object.assign(i,u.params),o.push({params:i,pathname:W([a,u.pathname]),pathnameBase:je(W([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=W([a,u.pathnameBase]))}return o}function ve(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ye(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ye(e,t=!1,n=!0){T(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function be(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!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}}function H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function xe({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var Se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ce=e=>Se.test(e);function we(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=ke(n),a=n.startsWith(`/`)?Te(n.substring(1),`/`):Te(n,t)):a=t,{pathname:a,search:Me(r),hash:Ne(i)}}function Te(e,t){let n=Ae(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ee(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function De(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Oe(e){let t=De(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function U(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Ee(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Ee(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Ee(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=we(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ke=e=>e.replace(/\/\/+/g,`/`),W=e=>ke(e.join(`/`)),Ae=e=>e.replace(/\/+$/,``),je=e=>Ae(e).replace(/^\/*/,`/`),Me=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ne=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Pe=class{constructor(e,t){this.type=`DataWithResponseInit`,this.data=e,this.init=t||null}};function Fe(e,t){return new Pe(e,typeof t==`number`?{status:t}:t)}var Ie=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},G=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Le(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Re(e){return W(e.map(e=>
1e.route.path).filter(Boolean))||`/`}var ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Be(e,t){let n=e;if(typeof n!=`string`||!Se.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ze)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Ve=Symbol(`Uninstrumented`);function He(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=We(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=We(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Ve]??i,a=We(n[e],t,(...e)=>Ke(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ve]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ve]??e,r=We(n.middleware,t,(...e)=>Ke(e[0]));return r?(r[Ve]=t,r):e})),r}function Ue(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Ve]??e.navigate,r=We(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?k(n):`.`,...qe(e,r??{})}});r&&(r[Ve]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ve]??e.fetch,r=We(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...qe(e,i??{})}});r&&(r[Ve]=t,e.fetch=r)}return e}function We(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ge(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ge(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ge(e,t,n,r-1),a=await o,w(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function Ke(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Je(t),params:{...r},pattern:i,context:Ye(n)}}function qe(e,t){return{currentUrl:k(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Je(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ye(e){if(Ze(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Xe=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ze(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Xe}var Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},st=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ct=`remix-router-transitions`,lt=Symbol(`ResetLoaderData`),ut,dt,ft,pt,mt=class{constructor(e){y(this,ut),y(this,dt),y(this,ft),y(this,pt),b(this,ut,e),b(this,dt,le(e))}get stableRoutes(){return v(this,ut)}get activeRoutes(){return v(this,ft)??v(this,ut)}get branches(){return v(this,pt)??v(this,dt)}get hasHMRRoutes(){return v(this,ft)!=null}setRoutes(e){b(this,ut,e),b(this,dt,le(e))}setHmrRoutes(e){b(this,ft,e),b(this,pt,le(e))}commitHmrRoutes(){v(this,ft)&&(b(this,ut,v(this,ft)),b(this,dt,v(this,pt)),b(this,ft,void 0),b(this,pt,void 0))}};ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=new WeakMap;function ht(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;w(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||st,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...He(t.map(e=>
1e.route).filter(Boolean),e)})}let o={},s=new mt(oe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Mt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=I(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=K(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=tn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Qe(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Qe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>bt(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=xt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,E={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:it,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},D=`POP`,k=null,j=!1,M,N=!1,P=new Map,ne=null,re=!1,ie=!1,ae=new Set,F=new Map,se=0,le=-1,ue=new Map,L=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}T(B.size===0||r!=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 i=Ke({currentLocation:E.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),Ge(i,{state:`blocked`,location:n,proceed(){Ge(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(E.blockers);e.set(i,ot),V({blockers:e})}}),k?.resolve(),k=null;return}return be(t,n)}),n){Cn(t,P);let e=()=>wn(t,P);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return E.initialized||be(`POP`,E.location,{initialHydration:!0}),C}function he(){d&&d(),ne&&ne(),f.clear(),M&&M.abort(),E.fetchers.forEach((e,t)=>Fe(E.fetchers,t)),E.blockers.forEach((e,t)=>We(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(E,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),E={...E,...e};let n=[],r=[];E.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!E.fetchers.has(e)&&!F.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(E,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Fe(E.fetchers,e)),r.forEach(e=>E.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=E.actionData!=null&&E.navigation.formMethod!=null&&J(E.navigation.formMethod)&&E.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?E.actionData:null;let o=n.loaderData?Qt(E.loaderData,n.loaderData,n.matches||[],n.errors):E.loaderData,c=E.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=re?!1:Ze(t,n.matches||E.matches),u=j===!0||E.navigation.formMethod!=null&&J(E.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),re||D===`POP`||(D===`PUSH`?e.history.push(t,t.state):D===`REPLACE`&&e.history.replace(t,t.state));let d;if(D===`POP`){let e=P.get(E.location.pathname);e&&e.has(t.pathname)?d={currentLocation:E.location,nextLocation:t}:P.has(t.pathname)&&(d={currentLocation:t,nextLocation:E.location})}else if(N){let e=P.get(E.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),P.set(E.location.pathname,e)),d={currentLocation:E.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:D,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),D=`POP`,j=!1,N=!1,re=!1,ie=!1,k?.resolve(),k=null,pe?.resolve(),pe=null}async function ve(t,n){if(k?.resolve(),k=null,typeof t==`number`){k||=Tn();let n=k.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=vt(!1,_t(E.location,E.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?A(n.mask):{...E.location.mask,...n.mask}});let s=E.location,l=O(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&J(i.formMethod)&&i.formAction===E.location.pathname+E.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ke({currentLocation:s,nextLocation:l,historyAction:d});if(m){Ge(m,{state:`blocked`,location:l,proceed(){Ge(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),ve(t,n)},reset(){let e=new Map(E.blockers);e.set(m,ot),V({blockers:e})}});return}await be(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ye(){pe||=Tn(),Ae(),V({revalidation:`loading`});let e=pe.promise;return E.navigation.state===`submitting`?e:E.navigation.state===`idle`?(be(E.historyAction,E.location,{startUninterruptedRevalidation:!0}
1),e):(be(D||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:N===!0}),e)}async function be(t,n,r){M&&M.abort(),M=null,D=t,re=(r&&r.startUninterruptedRevalidation)===!0,Xe(E.location,E.matches),j=(r&&r.preventScrollReset)===!0,N=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&E.matches&&E.matches.length>0&&!y?E.matches:I(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&E.initialized&&!ie&&an(E.location,n)&&!(r&&r.submission&&J(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Qe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=qe(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;M=new AbortController;let d=Kt(e.history,n,M.signal,r&&r.submission),f=e.getContext?await e.getContext():new te,p;if(r&&r.pendingError)p=[en(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&J(r.submission.formMethod)){let i=await xe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(q(t)&&Le(t.error)&&t.error.status===404){M=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=yn(n,a,t,r.submission),o=!1,l.active=!1,d=Kt(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Se(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(M=null,_e(n,{matches:h||a,...$t(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function xe(t,n,i,l,u,d,f,p,m={}){if(Ae(),V({navigation:bn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await $e(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=tn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=en(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=qe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=_n(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:K(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Rt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(un(h)){let n;return n=m&&m.replace!=null?m.replace:Gt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===E.location.pathname+E.location.search,await U(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(q(h)){let e=en(l,g.route.id);return(m&&m.replace)!==!0&&(D=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Se(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||yn(n,i,l,p),x=p||m||vn(b),S=!re&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await $e(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=tn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=en(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=qe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=yt(t,u,a,o,e.history,E,i,x,n,g?[]:r,g===!0,ie,ae,z,de,L,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(E.fetchers),t=ze(e);return _e(n,{matches:i,loaderData:{},errors:v&&q(v[1])?{[v[0]]:v[1].error}:null,...$t(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}
1T.forEach(e=>{G(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>T.forEach(e=>G(e.key));M&&M.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:k}=await W(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener(`abort`,D),T.forEach(e=>F.delete(e.key));let A=nn(O);if(A)return await U(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=nn(k),A)return L.add(A.key),await U(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(E.fetchers),{loaderData:ee,errors:N}=Zt(E,i,O,v,T,k,j);g&&E.errors&&(N={...E.errors,...N});let te=ze(j),P=Be(le,j),ne=te||P||T.length>0;return{matches:i,loaderData:ee,errors:N,...ne?{workingFetchers:j}:{}}}function we(e){if(e&&!q(e[1]))return{[e[0]]:e[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Te(e){let t=new Map(E.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=xn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=_t(E.location,E.matches,c,r,n,i?.relative),u=I(o,l,c,!1,s.branches),d=Qe(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Me(t,n,K(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=vt(!0,l,i);if(m){Me(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new te,g=(i&&i.preventScrollReset)===!0;if(p&&J(p.formMethod)){await De(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:f}),await Oe(t,n,f,u,h,d.active,a,g,p)}async function De(t,n,i,l,u,d,f,p,m,h){Ae(),de.delete(t),je(t,Sn(m,E.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Kt(e.history,i,g.signal,m);if(d){let e=await $e(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Me(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Me(t,n,K(404,{pathname:i}),{flushSync:f});return}}let v=_n(l,i);if(!v.route.action&&!v.route.lazy){Me(t,n,K(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}F.set(t,g);let y=se,b=Rt(a,o,_,i,l,v,r,u),x=await ke(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){F.get(t)===g&&F.delete(t);return}if(z.has(t)){if(un(S)||q(S)){je(t,Y(void 0));return}}else{if(un(S))if(F.delete(t),le>y){je(t,Y(void 0));return}else return L.add(t),je(t,xn(m)),U(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(q(S)){Me(t,n,S.error);return}}let C=E.navigation.location||E.location,T=Kt(e.history,C,g.signal),O=s.activeRoutes,k=E.navigation.state===`idle`?E.matches:I(O,E.navigation.location,c,!1,s.branches);w(k,`Didn't find any matches after fetcher action`);let A=++se;ue.set(t,A);let{dsMatches:j,revalidatingFetchers:ee}=yt(T,u,a,o,e.history,E,k,m,C,r,!1,ie,ae,z,de,L,O,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),N=xn(m,S.data),te=new Map(E.fetchers);te.set(t,N),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=te.get(t),r=xn(void 0,n?n.data:void 0);te.set(t,r),G(t),e.controller&&F.set(t,e.controller)}),V({fetchers:te});let P=()=>ee.forEach(e=>G(e.key));g.signal.addEventListener(`abort`,P);let{loaderResults:ne,fetcherResults:re}=await W(j,ee,T,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,P),ue.delete(t),F.delete(t),ee.forEach(e=>F.delete(e.key));let oe=E.fetchers.has(t),ce=e=>{if(!oe)return e;let n=new Map(e.fetchers);return n.set(t,Y(S.data)),{...e,fetchers:n}},R=nn(ne);if(R)return E=ce(E),U(T,R.result,!1,{preventScrollReset:p});if(R=nn(re),R)return L.add(R.key),E=ce(E),U(T,R.result,!1,{preventScrollReset:p});let B=new Map(E.fetchers);oe&&B.set(t,Y(S.data));let{loaderData:fe,errors:pe}=Zt(E,k,ne,void 0,ee,re,B);Be(A,B),E.navigation.state===`loading`&&A>le?(w(D,`Expected pending action`),M&&M.abort(),_e(E.navigation.location,{matches:k,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:Qt(E.loaderData,fe,k,pe),fetchers:B}),ie=!1)}async function Oe(t,n,i,s,c,l,u,d,f){let p=E.fetchers.get(t);je(t,xn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Kt(e.history,i,m.signal);if(l){let e=await $e(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Me(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Me(t,n,K(404,{pathname:i}),{flushSync:u});return}}let g=_n(s,i);F.set(t,m);let _=se,v=await ke(h,i,Rt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(z.has(t)){je(t,Y(void 0));return}if(un(y))if(le>_){je(t,Y(void 0));return}else{L.add(t),await U(h,y,!1,{preventScrollReset:d});return}if(q(y)){Me(t,n,y.error);return}je(t,Y(y.data))}}async function U(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(k?.resolve(),k=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ie=!0);let d=i.response.headers.get(`Location`);w(d,`Expected a Location header on the redirect Response`),d=Gt(d,new URL(r.url),c,e.history);let f=O(E.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;
1else if(Ce(d)){let n=ee(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}M=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=E.navigation;!o&&!s&&m&&h&&g&&(o=vn(E.navigation));let _=o||s;rt.has(i.response.status)&&_&&J(_.formMethod)?await be(p,f,{submission:{..._,formAction:d},preventScrollReset:l||j,enableViewTransition:a?N:void 0}):await be(p,f,{overrideNavigation:yn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||j,enableViewTransition:a?N:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await zt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!J(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!E.loaderData.hasOwnProperty(e.route.id)&&(!E.errors||!E.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(ln(r)){let i=r.result;o[t]={type:`redirect`,response:Ut(i,e,t,n,c)}}else o[t]=await Ht(r);return o}async function W(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:K(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ae(){ie=!0,de.forEach((e,t)=>{F.has(t)&&ae.add(t),G(t)})}function je(e,t,n={}){let r=new Map(E.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Me(e,t,n,r={}){let i=en(E.matches,t),a=new Map(E.fetchers);Fe(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ne(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),E.fetchers.get(e)||at}function Pe(e,t){G(e,t?.reason),je(e,Y(null))}function Fe(e,t){let n=E.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&G(t),de.delete(t),ue.delete(t),L.delete(t),z.delete(t),ae.delete(t),e.delete(t)}function Ie(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(E.fetchers)})}function G(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);w(e,`Expected fetcher: ${n}`);let r=Y(e.data);t.set(n,r)}}function ze(e){let t=[],n=!1;for(let r of L){let i=e.get(r);w(i,`Expected fetcher: ${r}`),i.state===`loading`&&(L.delete(r),t.push(r),n=!0)}return Re(t,e),n}function Be(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);w(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),ue.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ve(e,t){let n=E.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function We(e){E.blockers.delete(e),B.delete(e)}function Ge(e,t){let n=E.blockers.get(e)||ot;w(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(E.blockers);r.set(e,t),V({blockers:r})}function Ke({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&T(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=E.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function qe(e){let t=K(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=tn(n);return{notFoundMatches:r,route:i,error:t}}function Je(e,t,n){if(m=e,g=t,h=n||null,!_&&E.navigation===it){_=!0;let e=Ze(E.location,E.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Ye(e,t){return h&&h(e,t.map(e=>ce(e,E.loaderData)))||e.key}function Xe(e,t){if(m&&g){let n=Ye(e,t);m[n]=g()}}function Ze(e,t){if(m){let n=Ye(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Qe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:I(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:I(n,r,c,!0,e)}}return{active:!1,matches:null}}async function $e(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Tt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=I(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=I(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&et(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=I(s.activeRoutes,n,c,!0,u),!f||et(l,f))return{type:`success`,matches:null};l=f}}function et(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function tt(e){o={},s.setHmrRoutes(oe(e,a,void 0,o))}function nt(e,t,n=!1){Tt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return C={get basename(){return c},get future(){return u},get state(){return E},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Je,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ne,resetFetcher:Pe,deleteFetcher:Ie,dispose:he,getBlocker:Ve,deleteBlocker:We,patchRoutes:nt,_internalFetchControllers:F,_internalSetRoutes:tt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(C=Ue(C,e.instrumentations.map(e=>
1e.router).filter(Boolean))),C}function gt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function _t(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=U(r||`.`,Oe(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=gn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=xe({basename:n,pathname:c.pathname})),k(c)}function vt(e,t,n){if(!n||!gt(n))return{path:t};if(n.formMethod&&!hn(n.formMethod))return{path:t,error:K(405,{method:n.formMethod})};let r=()=>({path:t,error:K(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=rn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!J(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} 2`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!J(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}w(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Jt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Jt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Yt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Yt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(J(c.formMethod))return{path:t,submission:c};let l=A(t);return e&&l.search&&gn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:k(l),submission:c}}function yt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?q(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&q(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Re(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!bt(s))f=!1;else if(u){let{shouldLoad:e}=xt(s,a.loaderData,a.errors);f=e}else St(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Lt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?Ct(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Lt(n,r,e,c,k,i,l,t,wt(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=I(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=_n(b,e.path),C=new AbortController,w=Kt(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Rt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Rt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:D?!1:d;let a={...O,defaultShouldRevalidate:i};wt(S,a)&&(T=Rt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function bt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function xt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!bt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function St(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ct(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function wt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Tt(e,t,n,r,i,a){let o;if(e){let t=r[e];w(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];
2if(t.forEach(e=>{let t=o.find(t=>Et(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=oe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=oe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Et(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((e,n)=>t.children?.some(t=>Et(e,t)))??!1:!1}var Dt=new WeakMap,Ot=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(w(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Dt.get(i);o||(o={},Dt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ne(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)T(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)T(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},kt=new WeakMap;function At(e,t,n,r,i){let a=n[e.id];if(w(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=kt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{w(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ie(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?T(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?T(!o,`Route "${a.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.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return kt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Ot({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function jt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Mt(e){return e.matches.some(e=>e.route.middleware)?Nt(e,()=>jt(e)):jt(e)}function Nt(e,t){return Pt(e,t,e=>{if(mn(e))throw e;return e},sn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=en(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Pt(e,t,n,r,i){let{matches:a,...o}=e;return await Ft(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Ft(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Ft(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function It(e,t,n,r,i){let a=Ot({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=At(r.route,J(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Lt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=It(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?wt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?wt(a,{...l,defaultShouldRevalidate:e}
2):wt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!J(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(J(n.method)||!p)?Bt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Rt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Lt(e,t,n,r,Re(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:It(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function zt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:qt(t,n),pattern:Re(r),params:r[0].params,context:a,matches:r},c=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=>{let t=s;return Nt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Bt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=J(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:qt(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw K(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw K(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Vt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ht(e){let{result:t,type:n}=e;if(fn(t)){let e;try{e=await Vt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new G(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?dn(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:on(t),statusCode:Le(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Le(t)?t.status:void 0}:dn(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 Ut(e,t,n,r,i){let a=e.headers.get(`Location`);if(w(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ce(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=_t(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Wt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Gt(e,t,n,r){if(Ce(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Wt.includes(i.protocol))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ke(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Wt.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Kt(e,t,n,r){let i=e.createURL(rn(t)).toString(),a={signal:n};if(r&&J(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Jt(r.formData):a.body=r.formData}
2return new Request(i,a)}function qt(e,t){let n=new URL(e.url),r=typeof t==`string`?A(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Jt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Yt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Xt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&q(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(w(!un(f),`Cannot handle redirect results in processLoaderData`),q(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=en(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=lt),c||(c=!0,s=Le(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Zt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Xt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(w(s,`Did not find corresponding fetcher result`),q(s)){let t=en(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(un(s))w(!1,`Unhandled fetcher revalidation redirect`);else{let e=Y(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==lt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function $t(e){return e?q(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function en(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function tn(e){let t=e.length===1?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 K(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new G(e||500,o,Error(s),!0)}function nn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(un(r))return{key:n,result:r}}}function rn(e){return k({...typeof e==`string`?A(e):e,hash:``})}function an(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function on(e){return new G(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function sn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&cn(t))}function cn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function ln(e){return fn(e.result)&&nt.has(e.result.status)}function q(e){return e.type===`error`}function un(e){return(e&&e.type)===`redirect`}function dn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function fn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function pn(e){return nt.has(e)}function mn(e){return fn(e)&&pn(e.status)&&e.headers.has(`Location`)}function hn(e){return tt.has(e.toUpperCase())}function J(e){return $e.has(e.toUpperCase())}function gn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function _n(e,t){let n=typeof t==`string`?A(t).search:t.search;if(e[e.length-1].route.index&&gn(n||``))return e[e.length-1];let r=De(e);return r[r.length-1]}function vn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function yn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function xn(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 Sn(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 Y(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 Cn(e,t){try{let n=e.sessionStorage.getItem(ct);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function wn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(ct,JSON.stringify(n))}catch(e){T(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Tn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var En=d.createContext(null);En.displayName=`DataRouter`;var Dn=d.createContext(null);Dn.displayName=`DataRouterState`;var On=d.createContext(!1);function kn(){return d.useContext(On)}var An=d.createContext({isTransitioning:!1});An.displayName=`ViewTransition`;var jn=d.createContext(new Map);jn.displayName=`Fetchers`;var Mn=d.createContext(null);Mn.displayName=`Await`;var X=d.createContext(null);X.displayName=`Navigation`;var Nn=d.createContext(null);Nn.displayName=`Location`;var Z=d.createContext({outlet:null,matches:[],isDataRoute:!1});Z.displayName=`Route`;var Pn=d.createContext(null);Pn.displayName=`RouteError`;var Fn=`REACT_ROUTER_ERROR`,In=`REDIRECT`,Ln=`ROUTE_ERROR_RESPONSE`;function Rn(e){if(e.startsWith(`${Fn}:${In}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function zn(e){if(e.startsWith(`${Fn}:${Ln}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new G(t.status,t.statusText,t.data)}catch{}}function Bn(e,{relative:t}={}){w(Vn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=d.useContext(X),{hash:i,pathname:a,search:o}=Xn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:W([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Vn(){return d.useContext(Nn)!=null}
2function Q(){return w(Vn(),`useLocation() may be used only in the context of a <Router> component.`),d.useContext(Nn).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(e){d.useContext(X).static||d.useLayoutEffect(e)}function Wn(){let{isDataRoute:e}=d.useContext(Z);return e?vr():Gn()}function Gn(){w(Vn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=d.useContext(En),{basename:t,navigator:n}=d.useContext(X),{matches:r}=d.useContext(Z),{pathname:i}=Q(),a=JSON.stringify(Oe(r)),o=d.useRef(!1);return Un(()=>{o.current=!0}),d.useCallback((r,s={})=>{if(T(o.current,Hn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=U(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Kn=d.createContext(null);function qn(){return d.useContext(Kn)}function Jn(e){let t=d.useContext(Z).outlet;return d.useMemo(()=>t&&d.createElement(Kn.Provider,{value:e},t),[t,e])}function Yn(){let{matches:e}=d.useContext(Z);return e[e.length-1]?.params??{}}function Xn(e,{relative:t}={}){let{matches:n}=d.useContext(Z),{pathname:r}=Q(),i=JSON.stringify(Oe(n));return d.useMemo(()=>U(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Zn(e,t,n){w(Vn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=d.useContext(X),{matches:i}=d.useContext(Z),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;br(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 3 4Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Q(),f;if(t){let e=typeof t==`string`?A(t):t;w(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=u;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):se(e,{pathname:m});T(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),T(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 g=ir(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:W([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:W([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?d.createElement(Nn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function Qn(){let e=_r(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=d.createElement(d.Fragment,null,d.createElement(`p`,null,`ð¿ Hey developer ð`),d.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,d.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,d.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),d.createElement(d.Fragment,null,d.createElement(`h2`,null,`Unexpected Application
4Error!`),d.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?d.createElement(`pre`,{style:i},n):null,o)}var $n=d.createElement(Qn,null),er=class extends d.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||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=zn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:d.createElement(Z.Provider,{value:this.props.routeContext},d.createElement(Pn.Provider,{value:e,children:this.props.component}));return this.context?d.createElement(nr,{error:e},t):t}};er.contextType=On;var tr=new WeakMap;function nr({children:e,error:t}){let{basename:n}=d.useContext(X);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Rn(t.digest);if(e){let r=tr.get(t);if(r)throw r;let i=Be(e.location,n);if(ze&&!tr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw tr.set(t,n),n}return d.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function rr({routeContext:e,match:t,children:n}){let r=d.useContext(En);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Z.Provider,{value:e},n)}function ir(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,f=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||$n,o&&(s<0&&c===0?(br(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:e,d.createElement(rr,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?d.createElement(er,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function ar(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function or(e){let t=d.useContext(En);return w(t,ar(e)),t}function sr(e){let t=d.useContext(Dn);return w(t,ar(e)),t}function cr(e){let t=d.useContext(Z);return w(t,ar(e)),t}function lr(e){let t=cr(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ur(){return lr(`useRouteId`)}function dr(){let e=sr(`useNavigation`);return d.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function fr(){let e=or(`useRevalidator`),t=sr(`useRevalidator`),n=d.useCallback(async()=>{await e.router.revalidate()},[e.router]);return d.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function pr(){let{matches:e,loaderData:t}=sr(`useMatches`);return d.useMemo(()=>e.map(e=>ce(e,t)),[e,t])}function mr(){let e=sr(`useLoaderData`),t=lr(`useLoaderData`);return e.loaderData[t]}function hr(e){return sr(`useRouteLoaderData`).loaderData[e]}function gr(){let e=sr(`useActionData`),t=lr(`useLoaderData`);return e.actionData?e.actionData[t]:void 0}function _r(){let e=d.useContext(Pn),t=sr(`useRouteError`),n=lr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function vr(){let{router:e}=or(`useNavigate`),t=lr(`useNavigate`),n=d.useRef(!1);return Un(()=>{n.current=!0}),d.useCallback(async(r,i={})=>{T(n.current,Hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var yr={};function br(e,t,n){!t&&!yr[e]&&(yr[e]=!0,T(!1,n))}var xr={};function Sr(e,t){!e&&!xr[t]&&(xr[t]=!0,console.warn(t))}var Cr=d.useOptimistic,wr=()=>void 0;function Tr(e){return Cr?Cr(e):[e,wr]}function Er(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&T(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&T(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&T(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Dr=[`HydrateFallback`,`hydrateFallbackElement`],Or=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>
4{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function kr({router:e,flushSync:t,onError:n,useTransitions:r}){r=kn()||r;let[i,a]=d.useState(e.state),[o,s]=Tr(i),[c,l]=d.useState(),[u,f]=d.useState({isTransitioning:!1}),[p,m]=d.useState(),[h,g]=d.useState(),[_,v]=d.useState(),y=d.useRef(new Map),b=d.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Re(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Sr(u===!1||t!=null,'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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Sr(_==null||b,"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."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):d.startTransition(()=>{r===!0&&s(e=>Ar(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),l(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);d.useLayoutEffect(()=>e.subscribe(b),[e,b]),d.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new Or)},[u]),d.useEffect(()=>{if(p&&c&&e.window){let t=c,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):d.startTransition(()=>{r===!0&&s(e=>Ar(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),l(void 0),f({isTransitioning:!1})}),g(i)}},[c,p,e.window,r,s]),d.useEffect(()=>{p&&c&&o.location.key===c.location.key&&p.resolve()},[p,h,o.location,c]),d.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=d.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return d.createElement(d.Fragment,null,d.createElement(En.Provider,{value:C},d.createElement(Dn.Provider,{value:o},d.createElement(jn.Provider,{value:y.current},d.createElement(An.Provider,{value:u},d.createElement(Pr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},d.createElement(jr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Ar(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var jr=d.memo(Mr);function Mr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Zn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Nr(e){return Jn(e.context)}function Pr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!Vn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=d.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=d.useMemo(()=>{let e=H(l,s);
4return e==null?null:{location:{pathname:e,search:u,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,l,u,f,p,m,r,h]);return T(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(X.Provider,{value:c},d.createElement(Nn.Provider,{children:t,value:g}))}d.Component;function Fr(){return{params:Yn(),loaderData:mr(),actionData:gr(),matches:pr()}}function Ir(e){return function(){let t=Fr();return d.createElement(e,t)}}function Lr(){return{params:Yn(),loaderData:mr(),actionData:gr(),error:_r()}}function Rr(e){return function(){let t=Lr();return d.createElement(e,t)}}var zr=`get`,Br=`application/x-www-form-urlencoded`;function Vr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Hr(e){return Vr(e)&&e.tagName.toLowerCase()===`button`}function Ur(e){return Vr(e)&&e.tagName.toLowerCase()===`form`}function Wr(e){return Vr(e)&&e.tagName.toLowerCase()===`input`}function Gr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kr(e,t){return e.button===0&&(!t||t===`_self`)&&!Gr(e)}function qr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Jr(e,t){let n=qr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Yr=null;function Xr(){if(Yr===null)try{new FormData(document.createElement(`form`),0),Yr=!1}catch{Yr=!0}return Yr}var Zr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Qr(e){return e!=null&&!Zr.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Br}"`),null):e}function $r(e,t){let n,r,i,a,o;if(Ur(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||zr,i=Qr(e.getAttribute(`enctype`))||Br,a=new FormData(e)}else if(Hr(e)||Wr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||zr,i=Qr(e.getAttribute(`formenctype`))||Qr(o.getAttribute(`enctype`))||Br,a=new FormData(o,e),!Xr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Vr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=zr,r=null,i=Br,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ei=-1,ti=-2,ni=-3,ri=-4,ii=-5,ai=-6,oi=-7,si=`B`,ci=`D`,li=`E`,ui=`M`,di=`N`,fi=`P`,pi=`R`,mi=`S`,hi=`Y`,gi=`U`,_i=`Z`,vi=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],yi=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function bi(){let e=new TextDecoder,t=``;return new TransformStream({transform(n,r){let i=e.decode(n,{stream:!0}),a=(t+i).split(` 5`);t=a.pop()||``;for(let e of a)r.enqueue(e)},flush(e){t&&e.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var xi=typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0;function Si(e){let{hydrated:t,values:n}=this;if(typeof e==`number`)return Ci.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();let r=n.length;for(let t of e)n.push(t);return t.length=n.length,Ci.call(this,r)}function Ci(e){let{hydrated:t,values:n,deferred:r,plugins:i}=this,a,o=[[e,e=>{a=e}]],s=[];for(;o.length>0;){let[e,a]=o.pop();switch(e){case oi:a(void 0);continue;case ii:a(null);continue;case ti:a(NaN);continue;case ai:a(1/0);continue;case ni:a(-1/0);continue;case ri:a(-0);continue}if(t[e]){a(t[e]);continue}let c=n[e];if(!c||typeof c!=`object`){t[e]=c,a(c);continue}if(Array.isArray(c))if(typeof c[0]==`string`){let[n,l,u]=c;switch(n){case ci:a(t[e]=new Date(l));continue;case gi:a(t[e]=new URL(l));continue;case si:a(t[e]=BigInt(l));continue;case pi:a(t[e]=new RegExp(l,u));continue;case hi:a(t[e]=Symbol.for(l));continue;case mi:let n=new Set;t[e]=n;for(let e=c.length-1;e>0;e--)o.push([c[e],e=>{n.add(e)}]);a(n);continue;case ui:let d=new Map;t[e]=d;for(let e=c.length-2;e>0;e-=2){let t=[];o.push([c[e+1],e=>{t[1]=e}]),o.push([c[e],e=>{t[0]=e}]),s.push(()=>{d.set(t[0],t[1])})}a(d);continue;case di:let f=Object.create(null);t[e]=f;for(let e of Object.keys(l).reverse()){let t=[];o.push([l[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{f[t[0]]=t[1]})}a(f);continue;case fi:if(t[l])a(t[e]=t[l]);else{let n=new yi;r[l]=n,a(t[e]=n.promise)}continue;case li:let[,p,m]=c,h=m&&xi&&vi.includes(m)&&m in xi&&typeof xi[m]==`function`?new xi[m](p):Error(p);t[e]=h,a(h);continue;case _i:a(t[e]=t[l]);continue;default:if(Array.isArray(i)){let n=[],r=c.slice(1);for(let e=0;e<r.length;e++){let t=r[e];o.push([t,t=>{n[e]=t}])}s.push(()=>{for(let r of i){let i=r(c[0],...n);if(i){a(t[e]=i.value);return}}throw SyntaxError()});continue}throw SyntaxError()}}else{let n=[];t[e]=n;for(let e=0;e<c.length;e++){let t=c[e];t!==ei&&o.push([t,t=>{n[e]=t}])}a(n);continue}else{let n={};t[e]=n;for(let e of Object.keys(c).reverse()){let t=[];o.push([c[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{n[t[0]]=t[1]})}a(n);continue}}for(;s.length>0;)s.pop()();return a}
5async function wi(e,t){let{plugins:n}=t??{},r=new yi,i=e.pipeThrough(bi()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:n},o=await Ti.call(a,i),s=r.promise;return o.done?r.resolve():s=Ei.call(a,i).then(r.resolve).catch(e=>{for(let t of Object.values(a.deferred))t.reject(e);r.reject(e)}),{done:s.then(()=>i.closed),value:o.value}}async function Ti(e){let t=await e.read();if(!t.value)throw SyntaxError();let n;try{n=JSON.parse(t.value)}catch{throw SyntaxError()}return{done:t.done,value:Si.call(this,n)}}async function Ei(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;let n=t.value;switch(n[0]){case fi:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=Si.call(this,a);r.resolve(o);break}case li:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=Si.call(this,a);r.reject(o);break}default:throw SyntaxError()}t=await e.read()}}async function Di(e){let t={signal:e.signal};if(e.method!==`GET`){t.method=e.method;let n=e.headers.get(`Content-Type`);n&&/\bapplication\/json\b/.test(n)?(t.headers={"Content-Type":n},t.body=JSON.stringify(await e.json())):n&&/\btext\/plain\b/.test(n)?(t.headers={"Content-Type":n},t.body=await e.text()):n&&/\bapplication\/x-www-form-urlencoded\b/.test(n)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var Oi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ki=/[&><\u2028\u2029]/g;function Ai(e){return e.replace(ki,e=>Oi[e])}function $(e,t){if(e===!1||e==null)throw Error(t)}var ji=Symbol(`SingleFetchRedirect`),Mi=class extends Error{},Ni=new Set([100,101,204,205]);function Pi(e,t,n,r,i,a){let o=Fi(e,e=>{let n=t.routes[e.route.id];return $(n,`Route not found in manifest`),{hasLoader:n.hasLoader,hasClientLoader:n.hasClientLoader}},Ui,r,i,a);return async e=>e.runClientMiddleware(o)}function Fi(e,t,n,r,i,a,o=()=>!0){return async s=>{let{request:c,matches:l,fetcherKey:u}=s,d=e();if(c.method!==`GET`)return Ii(s,n,i,a);let f=l.some(e=>{let{hasLoader:n,hasClientLoader:r}=t(e);return e.shouldCallHandler()&&n&&!r});return!r&&!f?Li(s,t,n,i,a):u?Bi(s,n,i,a):Ri(s,d,t,n,r,i,a,o)}}async function Ii(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No action match found`);let a,o=await i.resolve(async o=>await o(async()=>{let{data:o,status:s}=await t(e,n,r,[i.route.id]);return a=s,Gi(o,i.route.id)}));return fn(o.result)||Le(o.result)||dn(o.result)?{[i.route.id]:o}:{[i.route.id]:{type:o.type,result:Fe(o.result,a)}}}async function Li(e,t,n,r,i){let a=e.matches.filter(e=>e.shouldCallHandler()),o={};return await Promise.all(a.map(a=>a.resolve(async s=>{try{let{hasClientLoader:c}=t(a),l=a.route.id,u=c?await s(async()=>{let{data:t}=await n(e,r,i,[l]);return Gi(t,l)}):await s();o[a.route.id]={type:`data`,result:u}}catch(e){o[a.route.id]={type:`error`,result:e}}}))),o}async function Ri(e,t,n,r,i,a,o,s=()=>!0){let c=new Set,l=!1,u=e.matches.map(()=>Ki()),d=Ki(),f={},p=Promise.all(e.matches.map(async(t,i)=>t.resolve(async p=>{u[i].resolve();let m=t.route.id,{hasLoader:h,hasClientLoader:g}=n(t),_=!t.shouldRevalidateArgs||t.shouldRevalidateArgs.actionStatus==null||t.shouldRevalidateArgs.actionStatus<400;if(!t.shouldCallHandler(_)){l||=t.shouldRevalidateArgs!=null&&h;return}if(s(t)&&g){h&&(l=!0);try{f[m]={type:`data`,result:await p(async()=>{let{data:t}=await r(e,a,o,[m]);return Gi(t,m)})}}catch(e){f[m]={type:`error`,result:e}}return}h&&c.add(m);try{f[m]={type:`data`,result:await p(async()=>Gi(await d.promise,m))}}catch(e){f[m]={type:`error`,result:e}}})));if(await Promise.all(u.map(e=>e.promise)),(!t.state.initialized&&t.state.navigation.state===`idle`||c.size===0)&&!window.__reactRouterHdrActive)d.resolve({routes:{}});else{let t=i&&l&&c.size>0?[...c.keys()]:void 0;try{let n=await r(e,a,o,t);d.resolve(n.data)}catch(e){d.reject(e)}}return await p,await zi(d.promise,e.matches,c,f),f}async function zi(e,t,n,r){try{let i,a=await e;if(`routes`in a){for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if(`error`in t){i=t.error,r[e.route.id]?.result??(r[e.route.id]={type:`error`,result:i});break}}}
5i!==void 0&&Array.from(n.values()).forEach(e=>{r[e].result instanceof Mi&&(r[e].result=i)})}catch{}}async function Bi(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No fetcher match found`);let a=i.route.id,o=await i.resolve(async i=>i(async()=>{let{data:i}=await t(e,n,r,[a]);return Gi(i,a)}));return{[i.route.id]:o}}function Vi(e){let t=e.searchParams.getAll(`index`);e.searchParams.delete(`index`);let n=[];for(let e of t)e&&n.push(e);for(let t of n)e.searchParams.append(`index`,t);return e}function Hi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&H(i.pathname,t)===`/`?i.pathname=`${Ae(t)}/_root.${r}`:i.pathname=`${Ae(i.pathname)}.${r}`,i}async function Ui(e,t,n,r){let{request:i}=e,a=Hi(i.url,t,n,`data`);i.method===`GET`&&(a=Vi(a),r&&a.searchParams.set(`_routes`,r.join(`,`)));let o=await fetch(a,await Di(i));if(o.status>=400&&!o.headers.has(`X-Remix-Response`))throw new G(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has(`X-Remix-Redirect`))return{status:202,data:{redirect:{redirect:o.headers.get(`X-Remix-Redirect`),status:Number(o.headers.get(`X-Remix-Status`)||`302`),revalidate:o.headers.get(`X-Remix-Revalidate`)===`true`,reload:o.headers.get(`X-Remix-Reload-Document`)===`true`,replace:o.headers.get(`X-Remix-Replace`)===`true`}}};if(Ni.has(o.status)){let e={};return r&&i.method!==`GET`&&(e[r[0]]={data:void 0}),{status:o.status,data:{routes:e}}}$(o.body,`No response body to decode`);try{let e=await Wi(o.body,window),t;if(i.method===`GET`){let n=e.value;t=ji in n?{redirect:n[ji]}:{routes:n}}else{let n=e.value,i=r?.[0];$(i,`No routeId found for single fetch call decoding`),t=`redirect`in n?{redirect:n}:{routes:{[i]:n}}}return{status:o.status,data:t}}catch{throw Error(`Unable to decode turbo-stream response`)}}function Wi(e,t){return wi(e,{plugins:[(e,...n)=>{if(e===`SanitizedError`){let[e,r,i]=n,a=Error;e&&vi.includes(e)&&e in t&&typeof t[e]==`function`&&(a=t[e]);let o=new a(r);return o.stack=i,{value:o}}if(e===`ErrorResponse`){let[e,t,r]=n;return{value:new G(t,r,e)}}if(e===`SingleFetchRedirect`)return{value:{[ji]:n[0]}};if(e===`SingleFetchClassInstance`)return{value:n[0]};if(e===`SingleFetchFallback`)return{value:void 0}}]})}function Gi(e,t){if(`redirect`in e){let{redirect:t,revalidate:n,reload:r,replace:i,status:a}=e.redirect;throw Ie(t,{status:a,headers:{...n?{"X-Remix-Revalidate":`yes`}:null,...r?{"X-Remix-Reload-Document":`yes`}:null,...i?{"X-Remix-Replace":`yes`}:null}})}let n=e.routes[t];if(n==null)throw new Mi(`No result found for routeId "${t}"`);if(`error`in n)throw n.error;if(`data`in n)return n.data;throw Error(`Invalid response found for routeId "${t}"`)}function Ki(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}async function qi(e,t){if(e.id in t)return t[e.id];try{let n=await h(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ji(e,t,n){return oa(e.map(e=>{let r=t[e.route.id],i=n.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:`stylesheet`,href:e})):[],r?.links?.()||[]]}).flat(2),ra(e,n))}function Yi(e){return e.css?e.css.map(e=>({rel:`stylesheet`,href:e})):[]}async function Xi(e){if(!e.css)return;let t=Yi(e);await Promise.all(t.map(Qi))}async function Zi(e,t){if(!e.css&&!t.links||!ca())return;let n=[];if(e.css&&n.push(...Yi(e)),t.links&&n.push(...t.links()),n.length===0)return;let r=[];for(let e of n)!$i(e)&&e.rel===`stylesheet`&&r.push({...e,rel:`preload`,as:`style`});await Promise.all(r.map(Qi))}async function Qi(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let n=document.createElement(`link`);Object.assign(n,e);function r(){document.head.contains(n)&&document.head.removeChild(n)}n.onload=()=>{r(),t()},n.onerror=()=>{r(),t()},document.head.appendChild(n)})}function $i(e){return e!=null&&typeof e.page==`string`}function ea(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ta(e,t,n){return oa((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await qi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ea).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function na(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>
5o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ra(e,t,{includeHydrateFallback:n}={}){return ia(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ia(e){return[...new Set(e)]}function aa(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function oa(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!$i(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(aa(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var sa;function ca(){if(sa!==void 0)return sa;let e=document.createElement(`link`);return sa=e.relList.supports(`preload`),e=null,sa}function la(){return d.createElement(eo,{title:`Loading...`,renderScripts:!0},d.createElement(`script`,{dangerouslySetInnerHTML:{__html:` 6 console.log( 7 "ð¿ Hey developer ð. You can provide a way better UX than this " + 8 "when your app is loading JS modules and/or running \`clientLoader\` " + 9 "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " + 10 "for more information." 11 ); 12 `}}))}function ua(e){let t={};return Object.values(e).forEach(e=>{if(e){let n=e.parentId||``;t[n]||(t[n]=[]),t[n].push(e)}}),t}function da(e,t,n){let r=ya(t),i=t.HydrateFallback&&(!n||e.id===`root`)?t.HydrateFallback:e.id===`root`?la:void 0,a=t.ErrorBoundary?t.ErrorBoundary:e.id===`root`?()=>d.createElement($a,{error:_r()}):void 0;return e.id===`root`&&t.Layout?{...r?{element:d.createElement(t.Layout,null,d.createElement(r,null))}:{Component:r},...a?{errorElement:d.createElement(t.Layout,null,d.createElement(a,null))}:{ErrorBoundary:a},...i?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(i,null))}:{HydrateFallback:i}}:{Component:r,ErrorBoundary:a,HydrateFallback:i}}function fa(e,t,n,r,i,a){return ha(t,n,r,i,a,``,ua(t),e)}function pa(e,t){if(e===`loader`&&!t.hasLoader||e===`action`&&!t.hasAction){let n=`You are trying to call ${e===`action`?`serverAction()`:`serverLoader()`} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new G(400,`Bad Request`,Error(n),!0)}}function ma(e,t){let n=e===`clientAction`?`a`:`an`,r=`Route "${t}" does not have ${n} ${e}, but you are trying to submit to it. To fix this, please add ${n} \`${e}\` function to the route`;throw console.error(r),new G(405,`Method Not Allowed`,Error(r),!0)}function ha(e,t,n,r,i,a=``,o=ua(e),s){return(o[a]||[]).map(a=>{let c=t[a.id];function l(e){return $(typeof e==`function`,`No single fetch function available for route handler`),e()}function u(e){return a.hasLoader?l(e):Promise.resolve(null)}function d(e){if(!a.hasAction)throw ma(`action`,a.id);return l(e)}function f(e){h(()=>import(e),[])}function p(e){e.clientActionModule&&f(e.clientActionModule),e.clientLoaderModule&&f(e.clientLoaderModule)}async function m(e){let n=t[a.id],r=n?Zi(a,n):Promise.resolve();try{return e()}finally{await r}}let g={id:a.id,index:a.index,path:a.path};if(c){Object.assign(g,{...g,...da(a,c,i),middleware:c.clientMiddleware,handle:c.handle,shouldRevalidate:ga(g.path,c,a,r,s)});let e=n&&n.loaderData&&a.id in n.loaderData,t=e?n?.loaderData?.[a.id]:void 0,o=n&&n.errors&&a.id in n.errors,l=o?n?.errors?.[a.id]:void 0,f=s==null&&(c.clientLoader?.hydrate===!0||!a.hasLoader);g.loader=async({request:n,params:r,context:i,pattern:s,url:d},p)=>{let h=f;return f=!1,await m(async()=>($(c,"No `routeModule` available for critical-route loader"),c.clientLoader?c.clientLoader({request:n,params:r,context:i,pattern:s,url:d,async serverLoader(){if
12(pa(`loader`,a),h){if(e)return t;if(o)throw l}return u(p)}}):u(p)))},g.loader.hydrate=ba(a.id,c.clientLoader,a.hasLoader,i),g.action=({request:e,params:t,context:n,pattern:r,url:o},s)=>m(async()=>{if($(c,"No `routeModule` available for critical-route action"),!c.clientAction){if(i)throw ma(`clientAction`,a.id);return d(s)}return c.clientAction({request:e,params:t,context:n,pattern:r,url:o,async serverAction(){return pa(`action`,a),d(s)}})})}else{a.hasClientLoader||(g.loader=(e,t)=>m(()=>u(t))),a.hasClientAction||(g.action=(e,t)=>m(()=>{if(i)throw ma(`clientAction`,a.id);return d(t)}));let e;async function n(){return e||=(async()=>{(a.clientLoaderModule||a.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=va(a,t);return p(a),await e})(),await e}g.lazy={loader:a.hasClientLoader?async()=>{let{clientLoader:e}=a.clientLoaderModule?await h(()=>import(a.clientLoaderModule),[]):await n();return $(e,"No `clientLoader` export found"),(t,n)=>e({...t,async serverLoader(){return pa(`loader`,a),u(n)}})}:void 0,action:a.hasClientAction?async()=>{let e=a.clientActionModule?h(()=>import(a.clientActionModule),[]):n();p(a);let{clientAction:t}=await e;return $(t,"No `clientAction` export found"),(e,n)=>t({...e,async serverAction(){return pa(`action`,a),d(n)}})}:void 0,middleware:a.hasClientMiddleware?async()=>{let{clientMiddleware:e}=a.clientMiddlewareModule?await h(()=>import(a.clientMiddlewareModule),[]):await n();return $(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await n();return ga(g.path,e,a,r,s)},handle:async()=>(await n()).handle,Component:async()=>(await n()).Component,ErrorBoundary:a.hasErrorBoundary?async()=>(await n()).ErrorBoundary:void 0}}let _=ha(e,t,n,r,i,a.id,o,s);return _.length>0&&(g.children=_),g})}function ga(e,t,n,r,i){if(i)return _a(n.id,t.shouldRevalidate,i);if(!r&&n.hasLoader&&!n.hasClientLoader){let n=e?ye(e)[1].map(e=>e.paramName):[],r=e=>n.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:r(t)})}else return e=>r(e)}return t.shouldRevalidate}function _a(e,t,n){let r=!1;return i=>r?t?t(i):i.defaultShouldRevalidate:(r=!0,n.has(e))}async function va(e,t){let n=qi(e,t),r=Xi(e),i=await n;return await Promise.all([r,Zi(e,i)]),{Component:ya(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}function ya(e){if(e.default!=null&&!(typeof e.default==`object`&&Object.keys(e.default).length===0))return e.default}function ba(e,t,n,r){return r&&e!==`root`||t!=null&&(t.hydrate===!0||n!==!0)}var xa=new Set,Sa=1e3,Ca=new Set;function wa(e,t){return e.mode===`lazy`&&t===!0}function Ta({sri:e,...t},n){let r=new Set(n.state.matches.map(e=>e.route.id)),i=n.state.location.pathname.split(`/`).filter(Boolean),a=[`/`];for(i.pop();i.length>0;)a.push(`/${i.join(`/`)}`),i.pop();a.forEach(e=>{let t=I(n.routes,e,n.basename||`/`,!1,n.branches);t&&t.forEach(e=>r.add(e.route.id))});let o=[...r].reduce((e,n)=>Object.assign(e,{[n]:t.routes[n]}),{});return{...t,routes:o,sri:e?!0:void 0}}function Ea(e,t,n,r,i,a,o){if(wa(i,r))return async({path:s,patch:c,signal:l,fetcherKey:u})=>{if(Ca.has(s))return;let{state:d}=e();await Aa([s],u?window.location.href:k(d.navigation.location||d.location),t,n,r,a,o,i.manifestPath,c,l)}}function Da(e,t,n,r,i,a){d.useEffect(()=>{if(!wa(i,r)||window.navigator?.connection?.saveData===!0)return;function o(e){let t=e.tagName===`FORM`?e.getAttribute(`action`):e.getAttribute(`href`);if(!t)return;let n=e.tagName===`A`?e.pathname:new URL(t,window.location.origin).pathname;Ca.has(n)||xa.add(n)}async function s(){document.querySelectorAll(`a[data-discover], form[data-discover]`).forEach(o);let s=Array.from(xa.keys()).filter(e=>Ca.has(e)?(xa.delete(e),!1):!0);if(s.length!==0)try{await Aa(s,null,t,n,r,a,e.basename,i.manifestPath,e.patchRoutes)}catch(e){console.error(`Failed to fetch manifest patches`,e)}}let c=Ma(s,100);s();let l=new MutationObserver(()=>c());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-discover`,`href`,`action`]}),()=>l.disconnect()},[r,a,t,n,e,i])}function Oa(e,t){let n=e||`/__manifest`;return t==null?n:W([t,n])}var ka=`react-router-manifest-version`;async function Aa(e,t,n,r,i,a,o,s,c,l){let u=new URLSearchParams;u.set(`paths`,e.sort().join(`,`)),u.set(`version`,n.version);let d=new URL(Oa(s,o),window.location.origin);if(d.search=u.toString(),d.toString().length>7680){xa.clear();return}let f;try{let e=await fetch(d,{signal:l});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);if(e.status===204&&e.headers.has(`X-Remix-Reload-Document`)){if(!t){console.warn(`Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a
12new document navigation to sync up with the latest manifest.`);return}try{if(sessionStorage.getItem(ka)===n.version){console.error(`Unable to discover routes due to manifest version mismatch.`);return}sessionStorage.setItem(ka,n.version)}catch{}window.location.href=t,console.warn(`Detected manifest version mismatch, reloading...`),await new Promise(()=>{})}else if(e.status>=400)throw Error(await e.text());try{sessionStorage.removeItem(ka)}catch{}f=await e.json()}catch(e){if(l?.aborted)return;throw e}let p=new Set(Object.keys(n.routes)),m=Object.values(f).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(n.routes,m),e.forEach(e=>ja(e,Ca));let h=new Set;Object.values(m).forEach(e=>{e&&(!e.parentId||!m[e.parentId])&&h.add(e.parentId)}),h.forEach(e=>c(e||null,ha(m,r,null,i,a,e)))}function ja(e,t){if(t.size>=Sa){let e=t.values().next().value;t.delete(e)}t.add(e)}function Ma(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function Na(){let e=d.useContext(En);return $(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Pa(){let e=d.useContext(Dn);return $(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Fa=d.createContext(void 0);Fa.displayName=`FrameworkContext`;function Ia(){let e=d.useContext(Fa);return $(e,`You must render this element inside a <HydratedRouter> element`),e}function La(e,t){let n=d.useContext(Fa),[r,i]=d.useState(!1),[a,o]=d.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),d.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Ra(s,m),onBlur:Ra(c,h),onMouseEnter:Ra(l,m),onMouseLeave:Ra(u,h),onTouchStart:Ra(f,m)}]:[a,p,{}]:[!1,p,{}]}function Ra(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function za(e,t,n){if(n&&!Ja)return[e[0]];if(t){let n=e.findIndex(e=>t[e.route.id]!==void 0);return e.slice(0,n+1)}return e}var Ba=`data-react-router-critical-css`;function Va({nonce:e,crossOrigin:t}){let{isSpaMode:n,manifest:r,routeModules:i,criticalCss:a}=Ia(),{errors:o,matches:s}=Pa(),c=za(s,o,n),l=d.useMemo(()=>Ji(c,i,r),[c,i,r]);return d.createElement(d.Fragment,null,typeof a==`string`?d.createElement(`style`,{[Ba]:``,nonce:e,dangerouslySetInnerHTML:{__html:a}}):null,typeof a==`object`?d.createElement(`link`,{[Ba]:``,rel:`stylesheet`,href:a.href,nonce:e,crossOrigin:t}):null,l.map(({key:n,link:r})=>$i(r)?d.createElement(Ha,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t}):d.createElement(`link`,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t})))}function Ha({page:e,...t}){let n=kn(),{router:r}=Na(),i=d.useMemo(()=>se(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?d.createElement(Wa,{page:e,matches:i,...t}):d.createElement(Ga,{page:e,matches:i,...t}):null}function Ua(e){let{manifest:t,routeModules:n}=Ia(),[r,i]=d.useState([]);return d.useEffect(()=>{let r=!1;return ta(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Wa({page:e,matches:t,...n}){let r=Q(),{future:i}=Ia(),{basename:a}=Na(),o=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Hi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return d.createElement(d.Fragment,null,o.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ga({page:e,matches:t,...n}){let r=Q(),{future:i,manifest:a,routeModules:o}=Ia(),{basename:s}=Na(),{loaderData:c,matches:l}=Pa(),u=d.useMemo(()=>na(e,t,l,a,r,`data`),[e,t,l,a,r]),f=d.useMemo(()=>na(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;
12if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Hi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=d.useMemo(()=>ra(f,a),[f,a]),h=Ua(f);return d.createElement(d.Fragment,null,p.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>d.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>d.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ka(){let{isSpaMode:e,routeModules:t}=Ia(),{errors:n,matches:r,loaderData:i}=Pa(),a=Q(),o=za(r,n,e),s=null;n&&(s=n[o[o.length-1].route.id]);let c=[],l=null,u=[];for(let e=0;e<o.length;e++){let n=o[e],r=n.route.id,d=i[r],f=n.params,p=t[r],m=[],h={id:r,data:d,loaderData:d,meta:[],params:n.params,pathname:n.pathname,handle:n.route.handle,error:s};if(u[e]=h,p?.meta?m=typeof p.meta==`function`?p.meta({data:d,loaderData:d,params:f,location:a,matches:u,error:s}):Array.isArray(p.meta)?[...p.meta]:p.meta:l&&(m=[...l]),m||=[],!Array.isArray(m))throw Error(`The route at `+n.route.path+` returns an invalid value. All route meta functions must return an array of meta objects. 13 14To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);h.meta=m,u[e]=h,c=[...m],l=c}return d.createElement(d.Fragment,null,c.flat().map(e=>{if(!e)return null;if(`tagName`in e){let{tagName:t,...n}=e;if(!qa(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let r=t;return d.createElement(r,{key:JSON.stringify(n),...n})}if(`title`in e)return d.createElement(`title`,{key:`title`},String(e.title));if(`charset`in e&&(e.charSet??=e.charset,delete e.charset),`charSet`in e&&e.charSet!=null)return typeof e.charSet==`string`?d.createElement(`meta`,{key:`charSet`,charSet:e.charSet}):null;if(`script:ld+json`in e)try{let t=JSON.stringify(e[`script:ld+json`]);return d.createElement(`script`,{key:`script:ld+json:${t}`,type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Ai(t)}})}catch{return null}return d.createElement(`meta`,{key:JSON.stringify(e),...e})}))}function qa(e){return typeof e==`string`&&/^(meta|link)$/.test(e)}var Ja=!1;function Ya(){Ja=!0}function Xa(e){let{manifest:t,serverHandoffString:n,isSpaMode:r,renderMeta:i,routeDiscovery:a,ssr:o}=Ia(),{router:s,static:c,staticContext:l}=Na(),{matches:u}=Pa(),f=kn(),p=wa(a,o);i&&(i.didRenderScripts=!0);let m=za(u,null,r);d.useEffect(()=>{Ya()},[]);let h=d.useMemo(()=>{if(f)return null;let r=l?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:` `,i=c?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:``}${p?``:`import ${JSON.stringify(t.url)}`}; 15${m.map((e,n)=>{let r=`route${n}`,i=t.routes[e.route.id];$(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:o,clientMiddlewareModule:s,hydrateFallbackModule:c,module:l}=i,u=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...o?[{module:o,varName:`${r}_clientLoader`}]:[],...s?[{module:s,varName:`${r}_clientMiddleware`}]:[],...c?[{module:c,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return u.length===1?`import * as ${r} from ${JSON.stringify(l)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join(` 16`),`const ${r} = {${u.map(e=>`...${e.varName}`).join(`,`)}};`].join(` 17`)}).join(` 18`)} 19 ${p?`window.__reactRouterManifest = ${JSON.stringify(Ta(t,s),null,2)};`:``} 20 window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(`,`)}}; 21 22import(${JSON.stringify(t.entry.module)});`:` `;return d.createElement(d.Fragment,null,d.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r},type:void 0}),d.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:`module`,async:!0}))},[]),g=Ja||f?[]:[...new Set(t.entry.imports.concat(ra(m,t,{includeHydrateFallback:!0})))],_=typeof t.sri==`object`?t.sri:{};return Sr(!f,`The <Scripts /> element is a no-op when using RSC and can be safely removed.`),Ja||f?null:d.createElement(d.Fragment,null,typeof t.sri==`object`?d.createElement(`script`,{...e,"rr-importmap":``,type:`importmap`,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:_})}}):null,p?null:d.createElement(`link`,{rel:`modulepreload`,href:t.url,crossOrigin:e.crossOrigin,integrity:_[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),d.createElement(`link`,{rel:`modulepreload`,href:t.entry.module,crossOrigin:e.crossOrigin,integrity:_[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),g.map(t=>d.createElement(`link`,{key:t,rel:`modulepreload`,href:t,crossOrigin:e.crossOrigin,integrity:_[t],nonce:e.nonce,suppressHydrationWarning:!0})),h)}function Za(...e){return t=>
22{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Qa=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location===e.location?{error:e.error||t.error,location:t.location}:{error:e.error||null,location:e.location}}render(){return this.state.error?d.createElement($a,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function $a({error:e,isOutsideRemixApp:t}){console.error(e);let n=d.createElement(`script`,{dangerouslySetInnerHTML:{__html:` 23 console.log( 24 "ð¿ Hey developer ð. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information." 25 ); 26 `}});if(Le(e))return d.createElement(eo,{title:`Unhandled Thrown Response!`},d.createElement(`h1`,{style:{fontSize:`24px`}},e.status,` `,e.statusText),n);let r;if(e instanceof Error)r=e;else{let t=e==null?`Unknown Error`:typeof e==`object`&&`toString`in e?e.toString():JSON.stringify(e);r=Error(t)}return d.createElement(eo,{title:`Application Error!`,isOutsideRemixApp:t},d.createElement(`h1`,{style:{fontSize:`24px`}},`Application Error`),d.createElement(`pre`,{style:{padding:`2rem`,background:`hsla(10, 50%, 50%, 0.1)`,color:`red`,overflow:`auto`}},r.stack),n)}function eo({title:e,renderScripts:t,isOutsideRemixApp:n,children:r}){let{routeModules:i}=Ia();return i.root?.Layout&&!n?r:d.createElement(`html`,{lang:`en`},d.createElement(`head`,null,d.createElement(`meta`,{charSet:`utf-8`}),d.createElement(`meta`,{name:`viewport`,content:`width=device-width,initial-scale=1,viewport-fit=cover`}),d.createElement(`title`,null,e)),d.createElement(`body`,null,d.createElement(`main`,{style:{fontFamily:`system-ui, sans-serif`,padding:`2rem`}},r,t?d.createElement(Xa,null):null)))}var to=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{to&&(window.__reactRouterVersion=`7.17.0`)}catch{}function no({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=d.useState({action:n.action,location:n.location}),o=d.useCallback(e=>{r===!1?a(e):d.startTransition(()=>a(e))},[r]);return d.useLayoutEffect(()=>n.listen(o),[n,o]),d.createElement(Pr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}no.displayName=`unstable_HistoryRouter`;var ro=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,io=d.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=d.useContext(X),y=typeof l==`string`&&ro.test(l),b=Be(l,g);l=b.to;let x=Bn(l,{relative:r}),S=Q(),C=null;if(o){let e=U(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:W([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=La(n,m),D=fo(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=d.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Za(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?d.createElement(d.Fragment,null,A,d.createElement(Ha,{page:x})):A});io.displayName=`Link`;var ao=d.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Xn(a,{relative:c.relative}),f=Q(),p=d.useContext(Dn),{navigator:m,basename:h}=d.useContext(X),g=p!=null&&wo(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(
26Boolean).join(` `);let E=typeof i==`function`?i(C):i;return d.createElement(io,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ao.displayName=`NavLink`;var oo=d.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=zr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=d.useContext(X),_=go(),v=_o(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ro.test(s);return d.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?d.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});oo.displayName=`Form`;function so({getKey:e,storageKey:t,...n}){let r=d.useContext(Fa),{basename:i}=d.useContext(X),a=Q(),o=pr();So({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!r||!e)return null;let t=xo(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
26typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return d.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ai(JSON.stringify(t||yo))}, ${Ai(JSON.stringify(s))})`}})}so.displayName=`ScrollRestoration`;function co(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lo(e){let t=d.useContext(En);return w(t,co(e)),t}function uo(e){let t=d.useContext(Dn);return w(t,co(e)),t}function fo(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Wn(),f=Q(),p=Xn(e,{relative:o});return d.useCallback(m=>{if(Kr(m,t)){m.preventDefault();let t=n===void 0?k(f)===k(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?d.startTransition(()=>h()):h()}},[f,u,p,n,r,i,t,e,a,o,s,c,l])}function po(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(qr(e)),n=d.useRef(!1),r=Q(),i=d.useMemo(()=>Jr(r.search,n.current?null:t.current),[r.search]),a=Wn();return[i,d.useCallback((e,t)=>{let r=qr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var mo=0,ho=()=>`__${String(++mo)}__`;function go(){let{router:e}=lo(`useSubmit`),{basename:t}=d.useContext(X),n=ur(),r=e.fetch,i=e.navigate;return d.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=$r(e,t);a.navigate===!1?await r(a.fetcherKey||ho(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function _o(e,{relative:t}={}){let{basename:n}=d.useContext(X),r=d.useContext(Z);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Xn(e||`.`,{relative:t})},o=Q();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:W([n,a.pathname])),k(a)}function vo({key:e}={}){let{router:t}=lo(`useFetcher`),n=uo(`useFetcher`),r=d.useContext(jn),i=d.useContext(Z),a=i.matches[i.matches.length-1]?.route.id;w(r,`useFetcher must be used inside a FetchersContext`),w(i,`useFetcher must be used inside a RouteContext`),w(a!=null,`useFetcher can only be used on routes that contain a unique "id"`);let o=d.useId(),[s,c]=d.useState(e||o);e&&e!==s&&c(e);let{deleteFetcher:l,getFetcher:u,resetFetcher:f,fetch:p}=t;d.useEffect(()=>(u(s),()=>l(s)),[l,u,s]);let m=d.useCallback(async(e,t)=>{w(a,`No routeId available for fetcher.load()`),await p(s,a,e,t)},[s,a,p]),h=go(),g=d.useCallback(async(e,t)=>{await h(e,{...t,navigate:!1,fetcherKey:s})},[s,h]),_=d.useCallback(e=>f(s,e),[f,s]),v=d.useMemo(()=>{let e=d.forwardRef((e,t)=>d.createElement(oo,{...e,navigate:!1,fetcherKey:s,ref:t}));return e.displayName=`fetcher.Form`,e},[s]),y=n.fetchers.get(s)||at,b=r.get(s);return d.useMemo(()=>({Form:v,submit:g,load:m,reset:_,...y,data:b}),[v,g,m,_,y,b])}var yo=`react-router-scroll-positions`,bo={};function xo(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:H(e.pathname,n)||e.pathname},t)),i??=e.key,i}function So({getKey:e,storageKey:t}={}){let{router:n}=lo(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=uo(`useScrollRestoration`),{basename:a}=d.useContext(X),o=Q(),s=pr(),c=dr();d.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Co(d.useCallback(()=>
26{if(c.state===`idle`){let t=xo(o,s,a,e);bo[t]=window.scrollY}try{sessionStorage.setItem(t||yo,JSON.stringify(bo))}catch(e){T(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(d.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||yo);e&&(bo=JSON.parse(e))}catch{}},[t]),d.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(bo,()=>window.scrollY,e?(t,n)=>xo(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),d.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{T(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Co(e,t){let{capture:n}=t||{};d.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wo(e,{relative:t}={}){let n=d.useContext(An);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=lo(`useViewTransitionState`),i=Xn(e,{relative:t});if(!n.isTransitioning)return!1;let a=H(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=H(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ve(i.pathname,o)!=null||ve(i.pathname,a)!=null}export{Da as A,Rr as B,w as C,ba as D,se as E,fr as F,u as H,_r as I,hr as L,Wn as M,dr as N,gr as O,qn as P,po as R,Dr as S,Er as T,o as U,h as V,c as W,M as _,Va as a,Ea as b,ao as c,kr as d,Xa as f,fa as g,ha as h,io as i,Q as j,vo as k,Nr as l,C as m,oo as n,Ka as o,so as p,Fa as r,Ni as s,G as t,Qa as u,ht as v,Le as w,Pi as x,Wi as y,Ir as z};
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.