codesesh 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{chunk-HIYT2ZJL.js → chunk-G2BTNW3C.js} +1678 -217
- package/dist/chunk-G2BTNW3C.js.map +1 -0
- package/dist/{chunk-DHNP33L4.js → chunk-KD3DGWZY.js} +2 -2
- package/dist/{dist-DMGLFBW6.js → dist-ALXOBKV2.js} +14 -2
- package/dist/index.js +168 -43
- package/dist/index.js.map +1 -1
- package/dist/scan-refresh-worker.js +243 -24
- package/dist/scan-refresh-worker.js.map +1 -1
- package/dist/search-index-worker.js +2 -2
- package/dist/smart-tag-worker.js +2 -2
- package/dist/web/assets/{AgentIcon-DcUJM198.js → AgentIcon-CEj7HO1m.js} +1 -1
- package/dist/web/assets/BookmarkButton-DLEnIyeE.js +1 -0
- package/dist/web/assets/{Dashboard-wjTLT17d.js → Dashboard-DUG0IFcy.js} +2 -2
- package/dist/web/assets/DialogTitle-Dv6DQPIb.js +1 -0
- package/dist/web/assets/Projects-BMaZc6J5.js +1 -0
- package/dist/web/assets/SearchFilterBar-iP6pzlZo.js +1 -0
- package/dist/web/assets/SearchResultsPanel-RuiLPkbP.js +1 -0
- package/dist/web/assets/{SessionDetail-CgR7ipmi.js → SessionDetail-De1Wl3mu.js} +35 -35
- package/dist/web/assets/{index-DuB6tGoe.css → index-B-CV7pFu.css} +1 -1
- package/dist/web/assets/index-CQI8F_8X.js +1930 -0
- package/dist/web/assets/session-indexes-BuxBafvh.js +4 -0
- package/dist/web/index.html +7 -8
- package/package.json +1 -1
- package/dist/chunk-HIYT2ZJL.js.map +0 -1
- package/dist/web/assets/BookmarkButton-CJjTjyae.js +0 -1
- package/dist/web/assets/DialogTitle-Bz0eXTGu.js +0 -1
- package/dist/web/assets/Projects-DBxubQuM.js +0 -1
- package/dist/web/assets/SearchFilterBar-BG9ah_Po.js +0 -1
- package/dist/web/assets/SearchResultsPanel-Clmf2xKw.js +0 -1
- package/dist/web/assets/index-DR07vs5V.js +0 -1890
- package/dist/web/assets/preload-helper-CmKXJxR3.js +0 -1
- package/dist/web/assets/session-indexes-EHJdYE4j.js +0 -4
- /package/dist/{chunk-DHNP33L4.js.map → chunk-KD3DGWZY.js.map} +0 -0
- /package/dist/{dist-DMGLFBW6.js.map → dist-ALXOBKV2.js.map} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e,n as t}from"./jsx-runtime-n5LQ9ujS.js";var n=e(t(),1);function r(e,t){let n=new Map,r=new Map,i=(e,t)=>`${e}\0${t}`,a=e=>{let t=i(e.reference.agentName,e.reference.sessionId);r.delete(t),n.set(t,e)},o=e=>{let t=i(e.agentName,e.sessionId);n.delete(t),r.set(t,e)};for(let t of e.changedSessionHeads)a(t);for(let t of e.removedSessionRefs)o(t);for(let e of t.changedSessionHeads)a(e);for(let e of t.removedSessionRefs)o(e);return{type:`sessions-updated`,changedAgents:Array.from(new Set([...e.changedAgents,...t.changedAgents])),newSessions:e.newSessions+t.newSessions,updatedSessions:e.updatedSessions+t.updatedSessions,removedSessions:e.removedSessions+t.removedSessions,totalSessions:t.totalSessions,timestamp:t.timestamp,changedSessionHeads:[...n.values()],removedSessionRefs:[...r.values()]}}function i(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function a(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function o(e){let t=new Date(e);return`${String(t.getFullYear()).padStart(4,`0`)}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}var s=new Set([`git_remote`,`git_common_dir`,`manifest_path`,`synthetic`,`path`,`loose`]);function c(e){return s.has(e)}function l(e){return`${e.kind}:${e.key}`}function u(e,t){return`${e}\0${t.toLowerCase()}`}function d(e){return{agentName:e.agentName.trim().toLowerCase(),sessionId:e.sessionId}}function f(e){let t=e.indexOf(`/`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t).trim().toLowerCase();return n?{agentName:n,sessionId:e.slice(t+1)}:null}function p(e){let t=d(e);return`${t.agentName}/${t.sessionId}`}function m(e){return f(e.slug)?.agentName??`unknown`}function h(e){return`/${encodeURIComponent(e.trim().toLowerCase())}`}function g(e){let t=d(e);return`${h(t.agentName)}/${encodeURIComponent(t.sessionId)}`}function _(e){return g({agentName:m(e),sessionId:e.id})}function v(e,t){return(t.time_updated??t.time_created)-(e.time_updated??e.time_created)}function y(e){for(let t=1;t<e.length;t+=1)if(v(e[t-1],e[t])>0)return[...e].sort(v);return[...e]}function b(e,t){return p({agentName:e,sessionId:t})}function x(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}function S(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let n of e){let e=b(m(n),n.id);t.has(e)||t.set(e,n)}let a=y(e);for(let e of a){let t=m(e);x(n,t,e);let a=e.project_identity;if(!a?.key)continue;let o=l(a);x(r,o,e),x(i,u(o,t),e)}return{sourceSessions:e,sessionsByActivity:a,byRouteKey:t,byAgent:n,byProjectIdentityKey:r,byProjectAgentKey:i}}function C(e,t,n){let r=new Map;for(let t of e)r.set(b(m(t),t.id),t);for(let e of n)r.delete(b(e.agentName,e.sessionId));for(let e of t)r.set(b(e.reference.agentName,e.reference.sessionId),e.session);return y([...r.values()])}var w={id:`session-1`,slug:`claudecode/session-1`,title:`Fix flaky search index test`,directory:`/Users/dev/project`,project_identity:{kind:`git_remote`,key:`github.com/example/project`,displayName:`example/project`},time_created:17e11,time_updated:17000036e5,stats:{message_count:12,total_input_tokens:4200,total_output_tokens:1800,total_cost:.042,cost_source:`recorded`,total_tokens:6e3,total_cache_read_tokens:3e3,total_cache_create_tokens:500},model_usage:{"claude-5-sonnet":6e3},smart_tags:[`bugfix`],smart_tags_source_updated_at:17000036e5};w.id,w.id;var T=`modulepreload`,E=function(e){return`/`+e},D={},O=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}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=E(t,n),t=s(t),t in D)return;D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.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)})},k=e=>{throw TypeError(e)},A=(e,t,n)=>t.has(e)||k(`Cannot `+n),j=(e,t,n)=>(A(e,t,`read from private field`),n?n.call(e):t.get(e)),M=(e,t,n)=>t.has(e)?k(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(A(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ee=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,P=/^[\\/]{2}/;function te(e,t){return t+e.replace(/\\/g,`/`)}var ne=`popstate`;function F(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function re(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ae(``,{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:z(t)}return oe(t,n,null,e)}function I(e,t){if(e===!1||e==null)throw Error(t)}function L(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ie(){return Math.random().toString(36).substring(2,10)}function R(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 ae(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?B(t):t,state:n,key:t&&t.key||r||ie(),mask:i}}function z({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 B(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 oe(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=F(e)?e:ae(h.location,e,t);n&&n(r,e),l=u()+1;let d=R(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=F(e)?e:ae(h.location,e,t);n&&n(r,e),l=u();let i=R(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 se(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(ne,d),c=e,()=>{i.removeEventListener(ne,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 se(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),I(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:z(t);return i=i.replace(/ $/,`%20`),!n&&P.test(i)&&(i=r+i),new URL(i,r)}function ce(e){return{defaultValue:e}}var V,le=class{constructor(e){if(M(this,V,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(j(this,V).has(e))return j(this,V).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){j(this,V).set(e,t)}};V=new WeakMap;var ue=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function de(e){return ue.has(e)}var fe=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function H(e){return fe.has(e)}function pe(e){return e.index===!0}function me(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(I(e.index!==!0||!e.children,`Cannot specify children on an index route`),I(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),pe(e)){let n={...e,id:s};return r[s]=he(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=he(n,t(n)),e.children&&(n.children=me(e.children,t,o,r,i)),n}})}function he(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ge(e,t,n=`/`){return U(e,t,n,!1)}function U(e,t,n,r,i){let a=q((typeof t==`string`?B(t):t).pathname||`/`,n);if(a==null)return null;let o=i??W(e),s=null,c=Me(a);for(let e=0;s==null&&e<o.length;++e)s=K(o[e],c,r);return s}function _e(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 W(e){let t=ve(e);return be(t),t}function ve(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;I(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=J([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(I(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ve(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Oe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=je(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ye(e.path))a(e,t,!0,n)}),t}function ye(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=ye(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 be(e){e.sort((e,t)=>e.score===t.score?G(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var xe=/^:[\w-]+$/,Se=3,Ce=2,we=1,Te=10,Ee=-2,De=e=>e===`*`;function Oe(e,t){let n=e.split(`/`),r=n.length;return n.some(De)&&(r+=Ee),t&&(r+=Ce),n.filter(e=>!De(e)).reduce((e,t)=>e+(xe.test(t)?Se:t===``?we:Te),r)}function G(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 K(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={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Ae(u,l,s.matcher,s.compiledParams):ke(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ke({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:J([a,d.pathname]),pathnameBase:Ue(J([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=J([a,d.pathnameBase]))}return o}function ke(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=je(e.path,e.caseSensitive,e.end);return Ae(e,t,n,r)}function Ae(e,t,n,r){let 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 je(e,t=!1,n=!0){L(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 Me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return L(!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 q(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 Ne({basename:e,pathname:t}){return t===`/`?e:J([e,t])}var Pe=e=>ee.test(e);function Fe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?B(e):e,a;return n?(n=Ve(n),a=n.startsWith(`/`)?Ie(n.substring(1),`/`):Ie(n,t)):a=t,{pathname:a,search:We(r),hash:Ge(i)}}function Ie(e,t){let n=He(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Le(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 Re(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ze(e){let t=Re(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Be(e,t,n,r=!1){let i;typeof e==`string`?i=B(e):(i={...e},I(!i.pathname||!i.pathname.includes(`?`),Le(`?`,`pathname`,`search`,i)),I(!i.pathname||!i.pathname.includes(`#`),Le(`#`,`pathname`,`hash`,i)),I(!i.search||!i.search.includes(`#`),Le(`#`,`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=Fe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ve=e=>e.replace(/[\\/]{2,}/g,`/`),J=e=>Ve(e.join(`/`)),He=e=>e.replace(/\/+$/,``),Ue=e=>He(e).replace(/^\/*/,`/`),We=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ke=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],qe=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 Je(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ye(e){return J(e.map(e=>e.route.path).filter(Boolean))||`/`}var Xe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ze(e,t){let n=e;if(typeof n!=`string`||!ee.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Xe)try{let e=new URL(window.location.href),r=P.test(n)?new URL(te(n,e.protocol)):new URL(n),a=q(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{L(!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 Qe=Symbol(`Uninstrumented`);function $e(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=tt(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=tt(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[Qe]??i,a=tt(n[e],t,(...e)=>rt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Qe]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Qe]??e,r=tt(n.middleware,t,(...e)=>rt(e[0]));return r?(r[Qe]=t,r):e})),r}function et(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[Qe]??e.navigate,r=tt(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?z(n):`.`,...it(e,r??{})}});r&&(r[Qe]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Qe]??e.fetch,r=tt(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...it(e,i??{})}});r&&(r[Qe]=t,e.fetch=r)}return e}function tt(e,t,n){return e.length===0?null:async(...r)=>{let i=await nt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function nt(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=nt(e,t,n,r-1),a=await o,I(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 rt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:at(t),params:{...r},pattern:i,context:ot(n)}}function it(e,t){return{currentUrl:z(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 at(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ot(e){if(ct(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var st=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ct(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`)===st}var lt=[`POST`,`PUT`,`PATCH`,`DELETE`],ut=new Set(lt),dt=[`GET`,...lt],ft=new Set(dt),pt=new Set([301,302,303,307,308]),mt=new Set([307,308]),ht={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},gt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_t={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},vt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),yt=`remix-router-transitions`,bt=Symbol(`ResetLoaderData`),xt,St,Ct,wt,Tt=class{constructor(e){M(this,xt),M(this,St),M(this,Ct),M(this,wt),N(this,xt,e),N(this,St,W(e))}get stableRoutes(){return j(this,xt)}get activeRoutes(){return j(this,Ct)??j(this,xt)}get branches(){return j(this,wt)??j(this,St)}get hasHMRRoutes(){return j(this,Ct)!=null}setRoutes(e){N(this,xt,e),N(this,St,W(e))}setHmrRoutes(e){N(this,Ct,e),N(this,wt,W(e))}commitHmrRoutes(){j(this,Ct)&&(N(this,xt,j(this,Ct)),N(this,St,j(this,wt)),N(this,Ct,void 0),N(this,wt,void 0))}};xt=new WeakMap,St=new WeakMap,Ct=new WeakMap,wt=new WeakMap;function Et(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;I(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||vt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...$e(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Tt(me(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Ut,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=U(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Y(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=mn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ke(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ke(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=>jt(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=Mt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:ht,restoreScrollPosition:e.hydrationData==null&&null,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},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,j=null,M=!1,N=!1,ee=new Set,P=new Map,te=0,ne=-1,F=new Map,re=new Set,ie=new Map,R=new Map,z=new Set,oe=new Map,ce,V=null;function ue(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(ce){ce(),ce=void 0;return}L(oe.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=Ve({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ce=e});e.history.go(r*-1),Be(i,{state:`blocked`,location:n,proceed(){Be(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,_t),H({blockers:e})}}),E?.resolve(),E=null;return}return W(t,n)}),n){In(t,A);let e=()=>Ln(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||W(`POP`,w.location,{initialHydration:!0}),C}function de(){d&&d(),j&&j(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>je(w.fetchers,t)),w.blockers.forEach((e,t)=>ze(t))}function fe(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function H(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}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!w.fetchers.has(e)&&!P.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>je(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function pe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Z(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?dn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,_t)));let l=!M&&Ge(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&Z(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),M||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}H({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:ht,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,N=!1,E?.resolve(),E=null,V?.resolve(),V=null}async function he(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Rn();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=kt(!1,Ot(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?B(n.mask):{...w.location.mask,...n.mask}});let s=w.location,l=ae(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&&Z(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ve({currentLocation:s,nextLocation:l,historyAction:d});if(m){Be(m,{state:`blocked`,location:l,proceed(){Be(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),he(t,n)},reset(){let e=new Map(w.blockers);e.set(m,_t),H({blockers:e})}});return}await W(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ge(){V||=Rn(),Oe(),H({revalidation:`loading`});let e=V.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(W(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(W(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function W(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,We(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:U(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!N&&_n(w.location,n)&&!(r&&r.submission&&Z(r.submission.formMethod))){pe(n,{matches:a},{flushSync:o});return}let l=Ke(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=J(n.pathname);pe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=an(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new le,p;if(r&&r.pendingError)p=[pn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Z(r.submission.formMethod)){let i=await ve(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(X(t)&&Je(t.error)&&t.error.status===404){O=null,pe(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=jn(n,a,t,r.submission),o=!1,l.active=!1,d=an(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await ye(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||(O=null,pe(n,{matches:h||a,...fn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ve(t,n,i,l,u,d,f,p,m={}){if(Oe(),H({navigation:Mn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await qe(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}=mn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=pn(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}=J(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=kn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Y(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ee(t,n,Yt(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(Sn(h)){let n;return n=m&&m.replace!=null?m.replace:rn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await Te(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(X(h)){let e=pn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function ye(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||jn(n,i,l,p),x=p||m||An(b),S=!M&&!g;if(d){if(S){let e=be(v);H({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await qe(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}=mn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=pn(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}=J(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=At(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,N,ee,z,ie,re,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ne=++te,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Ie(e);return pe(n,{matches:i,loaderData:{},errors:v&&X(v[1])?{[v[0]]:v[1].error}:null,...fn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=be(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=xe(E)),H(e,{flushSync:_})}E.forEach(e=>{Ne(e.key),e.controller&&P.set(e.key,e.controller)});let D=()=>E.forEach(e=>Ne(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await De(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>P.delete(e.key));let j=hn(k);if(j)return await Te(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=hn(A),j)return re.add(j.key),await Te(t,j.result,!0,{replace:h}),{shortCircuited:!0};let F=new Map(w.fetchers),{loaderData:I,errors:L}=un(w,i,k,v,E,A,F);g&&w.errors&&(L={...w.errors,...L});let R=Ie(F),ae=Le(ne,F),B=R||ae||E.length>0;return{matches:i,loaderData:I,errors:L,...B?{workingFetchers:F}:{}}}function be(e){if(e&&!X(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function xe(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Nn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Se(t,n,r,i){Ne(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=Ot(w.location,w.matches,c,r,n,i?.relative),u=U(o,l,c,!1,s.branches),d=Ke(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){K(t,n,Y(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=kt(!0,l,i);if(m){K(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new le,g=(i&&i.preventScrollReset)===!0;if(p&&Z(p.formMethod)){await Ce(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ie.set(t,{routeId:n,path:f}),await we(t,n,f,u,h,d.active,a,g,p)}async function Ce(t,n,i,l,u,d,f,p,m,h){Oe(),ie.delete(t),G(t,Pn(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=an(e.history,i,g.signal,m);if(d){let e=await qe(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{K(t,n,Y(404,{pathname:i}),{flushSync:f});return}}let v=kn(l,i);if(!v.route.action&&!v.route.lazy){K(t,n,Y(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}P.set(t,g);let y=te,b=Yt(a,o,_,i,l,v,r,u),x=await Ee(_,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){P.get(t)===g&&P.delete(t);return}if(z.has(t)){if(Sn(S)||X(S)){G(t,Fn(void 0));return}}else{if(Sn(S))if(P.delete(t),ne>y){G(t,Fn(void 0));return}else return re.add(t),G(t,Nn(m)),Te(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(X(S)){K(t,n,S.error);return}}let C=w.navigation.location||w.location,E=an(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:U(D,w.navigation.location,c,!1,s.branches);I(k,`Didn't find any matches after fetcher action`);let A=++te;F.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=At(E,u,a,o,e.history,w,k,m,C,r,!1,N,ee,z,ie,re,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),L=Nn(m,S.data),R=new Map(w.fetchers);R.set(t,L),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=R.get(t),r=Nn(void 0,n?n.data:void 0);R.set(t,r),Ne(t),e.controller&&P.set(t,e.controller)}),H({fetchers:R});let ae=()=>M.forEach(e=>Ne(e.key));g.signal.addEventListener(`abort`,ae);let{loaderResults:B,fetcherResults:oe}=await De(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,ae),F.delete(t),P.delete(t),M.forEach(e=>P.delete(e.key));let se=w.fetchers.has(t),ce=e=>{if(!se)return e;let n=new Map(e.fetchers);return n.set(t,Fn(S.data)),{...e,fetchers:n}},V=hn(B);if(V)return w=ce(w),Te(E,V.result,!1,{preventScrollReset:p});if(V=hn(oe),V)return re.add(V.key),w=ce(w),Te(E,V.result,!1,{preventScrollReset:p});let le=new Map(w.fetchers);se&&le.set(t,Fn(S.data));let{loaderData:ue,errors:de}=un(w,k,B,void 0,M,oe,le);Le(A,le),w.navigation.state===`loading`&&A>ne?(I(T,`Expected pending action`),O&&O.abort(),pe(w.navigation.location,{matches:k,loaderData:ue,errors:de,fetchers:le})):(H({errors:de,loaderData:dn(w.loaderData,ue,k,de),fetchers:le}),N=!1)}async function we(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);G(t,Nn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=an(e.history,i,m.signal);if(l){let e=await qe(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{K(t,n,Y(404,{pathname:i}),{flushSync:u});return}}let g=kn(s,i);P.set(t,m);let _=te,v=await Ee(h,i,Yt(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(P.get(t)===m&&P.delete(t),!h.signal.aborted){if(z.has(t)){G(t,Fn(void 0));return}if(Sn(y))if(ne>_){G(t,Fn(void 0));return}else{re.add(t),await Te(h,y,!1,{preventScrollReset:d});return}if(X(y)){K(t,n,y.error);return}G(t,Fn(y.data))}}async function Te(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(N=!0);let d=i.response.headers.get(`Location`);I(d,`Expected a Location header on the redirect Response`),d=rn(d,new URL(r.url),c,e.history);let f=ae(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Pe(d)){let n=se(t,d,!0);e=n.origin!==t.location.origin||q(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=An(w.navigation));let _=o||s;mt.has(i.response.status)&&_&&Z(_.formMethod)?await W(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await W(p,f,{overrideNavigation:jn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function Ee(e,t,n,r,i){let a,o={};try{a=await Xt(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(!Z(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.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(xn(r)){let i=r.result;o[t]={type:`redirect`,response:en(i,e,t,n,c)}}else o[t]=await $t(r);return o}async function De(e,t,n,r,i){let a=Ee(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ee(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:Y(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Oe(){N=!0,ie.forEach((e,t)=>{P.has(t)&&ee.add(t),Ne(t)})}function G(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),H({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=pn(w.matches,t),a=new Map(w.fetchers);je(a,e),H({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function ke(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),w.fetchers.get(e)||gt}function Ae(e,t){Ne(e,t?.reason),G(e,Fn(null))}function je(e,t){let n=w.fetchers.get(t);P.has(t)&&!(n&&n.state===`loading`&&F.has(t))&&Ne(t),ie.delete(t),F.delete(t),re.delete(t),z.delete(t),ee.delete(t),e.delete(t)}function Me(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),H({fetchers:new Map(w.fetchers)})}function Ne(e,t){let n=P.get(e);n&&(n.abort(t),P.delete(e))}function Fe(e,t){for(let n of e){let e=t.get(n);I(e,`Expected fetcher: ${n}`);let r=Fn(e.data);t.set(n,r)}}function Ie(e){let t=[],n=!1;for(let r of re){let i=e.get(r);I(i,`Expected fetcher: ${r}`),i.state===`loading`&&(re.delete(r),t.push(r),n=!0)}return Fe(t,e),n}function Le(e,t){let n=[];for(let[r,i]of F)if(i<e){let e=t.get(r);I(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ne(r),F.delete(r),n.push(r))}return Fe(n,t),n.length>0}function Re(e,t){let n=w.blockers.get(e)||_t;return oe.get(e)!==t&&oe.set(e,t),n}function ze(e){w.blockers.delete(e),oe.delete(e)}function Be(e,t){let n=w.blockers.get(e)||_t;I(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(w.blockers);r.set(e,t),H({blockers:r})}function Ve({currentLocation:e,nextLocation:t,historyAction:n}){if(oe.size===0)return;oe.size>1&&L(!1,`A router only supports one blocker at a time`);let r=Array.from(oe.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function J(e){let t=Y(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=mn(n);return{notFoundMatches:r,route:i,error:t}}function He(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===ht){_=!0;let e=Ge(w.location,w.matches);e!=null&&H({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Ue(e,t){return h&&h(e,t.map(e=>_e(e,w.loaderData)))||e.key}function We(e,t){if(m&&g){let n=Ue(e,t);m[n]=g()}}function Ge(e,t){if(m){let n=Ue(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ke(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:U(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:U(n,r,c,!0,e)}}return{active:!1,matches:null}}async function qe(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||It(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=U(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=U(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ye(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=U(s.activeRoutes,n,c,!0,u),!f||Ye(l,f))return{type:`success`,matches:null};l=f}}function Ye(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Xe(e){o={},s.setHmrRoutes(me(e,a,void 0,o))}function Ze(e,t,n=!1){It(e,t,s,o,a,n),s.hasHMRRoutes||H({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ue,subscribe:fe,enableScrollRestoration:He,navigate:he,fetch:Se,revalidate:ge,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ke,resetFetcher:Ae,deleteFetcher:Me,dispose:de,getBlocker:Re,deleteBlocker:ze,patchRoutes:Ze,_internalFetchControllers:P,_internalSetRoutes:Xe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){H(e)}},e.instrumentations&&(C=et(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Dt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Ot(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=Be(r||`.`,ze(o),q(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=On(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=Ne({basename:n,pathname:c.pathname})),z(c)}function kt(e,t,n){if(!n||!Dt(n))return{path:t};if(n.formMethod&&!Dn(n.formMethod))return{path:t,error:Y(405,{method:n.formMethod})};let r=()=>({path:t,error:Y(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=gn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Z(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(!Z(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()}}}I(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=sn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=sn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=cn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=cn(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(Z(c.formMethod))return{path:t,submission:c};let l=B(t);return e&&l.search&&On(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:z(l),submission:c}}function At(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?X(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&&X(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=Ye(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(!jt(s))f=!1;else if(u){let{shouldLoad:e}=Mt(s,a.loaderData,a.errors);f=e}else Nt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Jt(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?Pt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=Ft(i,m);return Jt(n,r,e,c,k,i,l,t,h,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=U(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=kn(b,e.path),C=new AbortController,w=an(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Yt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Yt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};Ft(S,a)&&(T=Yt(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 jt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Mt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!jt(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 Nt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Pt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Ft(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function It(e,t,n,r,i,a){let o;if(e){let t=r[e];I(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Lt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=me(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]=me([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 Lt(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=>Lt(e,t)))??!1:!1}var Rt=new WeakMap,zt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(I(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Rt.get(i);o||(o={},Rt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=de(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)L(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)L(!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},Bt=new WeakMap;function Vt(e,t,n,r,i){let a=n[e.id];if(I(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Bt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{I(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=H(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?L(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?L(!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 Bt.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=zt({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 Ht(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 Ut(e){return e.matches.some(e=>e.route.middleware)?Wt(e,()=>Ht(e)):Ht(e)}function Wt(e,t){return Gt(e,t,e=>{if(En(e))throw e;return e},yn,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=pn(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 Gt(e,t,n,r,i){let{matches:a,...o}=e;return await Kt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Kt(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 Kt(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 qt(e,t,n,r,i){let a=zt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Vt(r.route,Z(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Jt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=qt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Ft(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Ft(a,{...l,defaultShouldRevalidate:e}):Ft(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Z(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Z(n.method)||!p)?Zt({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 Yt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Jt(e,t,n,r,Ye(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:qt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Xt(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:on(t,n),pattern:Ye(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 Wt(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 Zt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Z(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:on(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 Y(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 Y(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Qt(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 $t(e){let{result:t,type:n}=e;if(wn(t)){let e;try{e=await Qt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new qe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Cn(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:vn(t),statusCode:Je(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Je(t)?t.status:void 0}:Cn(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 en(e,t,n,r,i){let a=e.headers.get(`Location`);if(I(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Pe(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Ot(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var tn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function nn(e){try{return tn.includes(new URL(e).protocol)}catch{return!1}}function rn(e,t,n,r){if(Pe(e)){let r=e,i=P.test(r)?new URL(te(r,t.protocol)):new URL(r);if(nn(i.toString()))throw Error(`Invalid redirect location`);let a=q(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Ve(i.pathname)+i.search+i.hash}try{if(nn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function an(e,t,n,r){let i=e.createURL(gn(t)).toString(),a={signal:n};if(r&&Z(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=sn(r.formData):a.body=r.formData}return new Request(i,a)}function on(e,t){let n=new URL(e.url),r=typeof t==`string`?B(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 sn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function cn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ln(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&X(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(I(!Sn(f),`Cannot handle redirect results in processLoaderData`),X(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=pn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=bt),c||(c=!0,s=Je(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 un(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=ln(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(I(s,`Did not find corresponding fetcher result`),X(s)){let t=pn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Sn(s))I(!1,`Unhandled fetcher revalidation redirect`);else{let e=Fn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function dn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==bt).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 fn(e){return e?X(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function pn(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 mn(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 Y(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 qe(e||500,o,Error(s),!0)}function hn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Sn(r))return{key:n,result:r}}}function gn(e){return z({...typeof e==`string`?B(e):e,hash:``})}function _n(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function vn(e){return new qe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function yn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&bn(t))}function bn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function xn(e){return wn(e.result)&&pt.has(e.result.status)}function X(e){return e.type===`error`}function Sn(e){return(e&&e.type)===`redirect`}function Cn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function wn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Tn(e){return pt.has(e)}function En(e){return wn(e)&&Tn(e.status)&&e.headers.has(`Location`)}function Dn(e){return ft.has(e.toUpperCase())}function Z(e){return ut.has(e.toUpperCase())}function On(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function kn(e,t){let n=typeof t==`string`?B(t).search:t.search;if(e[e.length-1].route.index&&On(n||``))return e[e.length-1];let r=Re(e);return r[r.length-1]}function An(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 jn(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 Mn(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 Nn(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 Pn(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 Fn(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 In(e,t){try{let n=e.sessionStorage.getItem(yt);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 Ln(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(yt,JSON.stringify(n))}catch(e){L(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Rn(){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 zn=n.createContext(null);zn.displayName=`DataRouter`;var Bn=n.createContext(null);Bn.displayName=`DataRouterState`;var Vn=n.createContext(!1);function Hn(){return n.useContext(Vn)}var Un=n.createContext({isTransitioning:!1});Un.displayName=`ViewTransition`;var Wn=n.createContext(new Map);Wn.displayName=`Fetchers`;var Gn=n.createContext(null);Gn.displayName=`Await`;var Q=n.createContext(null);Q.displayName=`Navigation`;var Kn=n.createContext(null);Kn.displayName=`Location`;var qn=n.createContext({outlet:null,matches:[],isDataRoute:!1});qn.displayName=`Route`;var Jn=n.createContext(null);Jn.displayName=`RouteError`;var Yn=`REACT_ROUTER_ERROR`,Xn=`REDIRECT`,Zn=`ROUTE_ERROR_RESPONSE`;function Qn(e){if(e.startsWith(`${Yn}:${Xn}:{`))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 $n(e){if(e.startsWith(`${Yn}:${Zn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new qe(t.status,t.statusText,t.data)}catch{}}function er(e,{relative:t}={}){I(tr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext(Q),{hash:a,pathname:o,search:s}=or(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:J([r,o])),i.createHref({pathname:c,search:s,hash:a})}function tr(){return n.useContext(Kn)!=null}function $(){return I(tr(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(Kn).location}var nr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function rr(e){n.useContext(Q).static||n.useLayoutEffect(e)}function ir(){let{isDataRoute:e}=n.useContext(qn);return e?wr():ar()}function ar(){I(tr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(zn),{basename:t,navigator:r}=n.useContext(Q),{matches:i}=n.useContext(qn),{pathname:a}=$(),o=JSON.stringify(ze(i)),s=n.useRef(!1);return rr(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(L(s.current,nr),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Be(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:J([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function or(e,{relative:t}={}){let{matches:r}=n.useContext(qn),{pathname:i}=$(),a=JSON.stringify(ze(r));return n.useMemo(()=>Be(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function sr(e,t,r){I(tr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext(Q),{matches:a}=n.useContext(qn),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;Er(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
+
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),f;if(t){let e=typeof t==`string`?B(t):t;I(l===`/`||e.pathname?.startsWith(l),`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 "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):ge(e,{pathname:m});L(u||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),L(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=mr(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:J([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:J([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&g?n.createElement(Kn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function cr(){let e=Cr(),t=Je(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=n.createElement(n.Fragment,null,n.createElement(`p`,null,`💿 Hey developer 👋`),n.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,n.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,n.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:a},r):null,s)}var lr=n.createElement(cr,null),ur=class extends n.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=$n(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(qn.Provider,{value:this.props.routeContext},n.createElement(Jn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement(fr,{error:e},t):t}};ur.contextType=Vn;var dr=new WeakMap;function fr({children:e,error:t}){let{basename:r}=n.useContext(Q);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Qn(t.digest);if(e){let i=dr.get(t);if(i)throw i;let a=Ze(e.location,r),o=a.absoluteURL||a.to;if(nn(o))throw Error(`Invalid redirect location`);if(Xe&&!dr.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw dr.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function pr({routeContext:e,match:t,children:r}){let i=n.useContext(zn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(qn.Provider,{value:e},r)}function mr(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);I(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Ye(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||lr,s&&(c<0&&l===0?(Er(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(pr,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(ur,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function hr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gr(e){let t=n.useContext(zn);return I(t,hr(e)),t}function _r(e){let t=n.useContext(Bn);return I(t,hr(e)),t}function vr(e){let t=n.useContext(qn);return I(t,hr(e)),t}function yr(e){let t=vr(e),n=t.matches[t.matches.length-1];return I(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function br(){return yr(`useRouteId`)}function xr(){let e=_r(`useNavigation`);return n.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Sr(){let{matches:e,loaderData:t}=_r(`useMatches`);return n.useMemo(()=>e.map(e=>_e(e,t)),[e,t])}function Cr(){let e=n.useContext(Jn),t=_r(`useRouteError`),r=yr(`useRouteError`);return e===void 0?t.errors?.[r]:e}function wr(){let{router:e}=gr(`useNavigate`),t=yr(`useNavigate`),r=n.useRef(!1);return rr(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{L(r.current,nr),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var Tr={};function Er(e,t,n){!t&&!Tr[e]&&(Tr[e]=!0,L(!1,n))}var Dr={};function Or(e,t){!e&&!Dr[t]&&(Dr[t]=!0,console.warn(t))}var kr=n.useOptimistic,Ar=()=>void 0;function jr(e){return kr?kr(e):[e,Ar]}function Mr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&L(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:n.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&L(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&L(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Nr=[`HydrateFallback`,`hydrateFallbackElement`],Pr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Fr({router:e,flushSync:t,onError:r,useTransitions:i}){i=Hn()||i;let[a,o]=n.useState(e.state),[s,c]=jr(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Ye(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),Or(d===!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(Or(_==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&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>Ir(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Pr)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>Ir(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.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=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(zn.Provider,{value:C},n.createElement(Bn.Provider,{value:s},n.createElement(Wn.Provider,{value:y.current},n.createElement(Un.Provider,{value:d},n.createElement(zr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(Lr,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function Ir(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 Lr=n.memo(Rr);function Rr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return sr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function zr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){I(!tr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=B(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=r,g=n.useMemo(()=>{let e=q(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:i}},[c,u,d,f,p,m,i,h]);return L(g!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:n.createElement(Q.Provider,{value:l},n.createElement(Kn.Provider,{children:t,value:g}))}n.Component;var Br=`get`,Vr=`application/x-www-form-urlencoded`;function Hr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ur(e){return Hr(e)&&e.tagName.toLowerCase()===`button`}function Wr(e){return Hr(e)&&e.tagName.toLowerCase()===`form`}function Gr(e){return Hr(e)&&e.tagName.toLowerCase()===`input`}function Kr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qr(e,t){return e.button===0&&(!t||t===`_self`)&&!Kr(e)}function Jr(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 Yr(e,t){let n=Jr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Xr=null;function Zr(){if(Xr===null)try{new FormData(document.createElement(`form`),0),Xr=!1}catch{Xr=!0}return Xr}var Qr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function $r(e){return e!=null&&!Qr.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vr}"`),null):e}function ei(e,t){let n,r,i,a,o;if(Wr(e)){let o=e.getAttribute(`action`);r=o?q(o,t):null,n=e.getAttribute(`method`)||Br,i=$r(e.getAttribute(`enctype`))||Vr,a=new FormData(e)}else if(Ur(e)||Gr(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?q(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Br,i=$r(e.getAttribute(`formenctype`))||$r(o.getAttribute(`enctype`))||Vr,a=new FormData(o,e),!Zr()){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(Hr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Br,r=null,i=Vr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ti={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ni=/[&><\u2028\u2029]/g;function ri(e){return e.replace(ni,e=>ti[e])}function ii(e,t){if(e===!1||e==null)throw Error(t)}function ai(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&&q(i.pathname,t)===`/`?i.pathname=`${He(t)}/_root.${r}`:i.pathname=`${He(i.pathname)}.${r}`,i}async function oi(e,t){if(e.id in t)return t[e.id];try{let n=await O(()=>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 si(e){return e!=null&&typeof e.page==`string`}function ci(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 li(e,t,n){return mi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await oi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ci).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ui(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,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)=>o(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 di(e,t,{includeHydrateFallback:n}={}){return fi(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 fi(e){return[...new Set(e)]}function pi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function mi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!si(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(pi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function hi(){let e=n.useContext(zn);return ii(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function gi(){let e=n.useContext(Bn);return ii(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var _i=n.createContext(void 0);_i.displayName=`FrameworkContext`;function vi(){let e=n.useContext(_i);return ii(e,`You must render this element inside a <HydratedRouter> element`),e}function yi(e,t){let r=n.useContext(_i),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:bi(c,m),onBlur:bi(l,h),onMouseEnter:bi(u,m),onMouseLeave:bi(d,h),onTouchStart:bi(f,m)}]:[o,p,{}]:[!1,p,{}]}function bi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function xi({page:e,...t}){let r=Hn(),{nonce:i}=vi(),{router:a}=hi(),o=n.useMemo(()=>ge(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(Ci,{page:e,matches:o,...t}):n.createElement(wi,{page:e,matches:o,...t})):null}function Si(e){let{manifest:t,routeModules:r}=vi(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return li(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function Ci({page:e,matches:t,...r}){let i=$(),{future:a}=vi(),{basename:o}=hi(),s=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=ai(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return n.createElement(n.Fragment,null,s.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function wi({page:e,matches:t,...r}){let i=$(),{future:a,manifest:o,routeModules:s}=vi(),{basename:c}=hi(),{loaderData:l,matches:u}=gi(),d=n.useMemo(()=>ui(e,t,u,o,i,`data`),[e,t,u,o,i]),f=n.useMemo(()=>ui(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=ai(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=n.useMemo(()=>di(f,o),[f,o]),h=Si(f);return n.createElement(n.Fragment,null,p.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),m.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),h.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function Ti(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}n.Component;var Ei=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ei&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Di(e,t){return Et({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:re({window:t?.window}),hydrationData:t?.hydrationData||Oi(),routes:e,mapRouteProperties:Mr,hydrationRouteProperties:Nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Oi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ki(e.errors)}),e}function ki(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new qe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ke.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Ai({basename:e,children:t,history:r,useTransitions:i}){let[a,o]=n.useState({action:r.action,location:r.location}),s=n.useCallback(e=>{i===!1?o(e):n.startTransition(()=>o(e))},[i]);return n.useLayoutEffect(()=>r.listen(s),[r,s]),n.createElement(zr,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:r,useTransitions:i})}Ai.displayName=`unstable_HistoryRouter`;var ji=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=n.useContext(Q),y=typeof u==`string`&&ee.test(u),b=Ze(u,g);u=b.to;let x=er(u,{relative:i}),S=$(),C=null;if(s){let e=Be(s,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:J([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=yi(r,m),D=Ri(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||a),A=n.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Ti(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?n.createElement(n.Fragment,null,A,n.createElement(xi,{page:x})):A});ji.displayName=`Link`;var Mi=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=or(o,{relative:l.relative}),f=$(),p=n.useContext(Bn),{navigator:m,basename:h}=n.useContext(Q),g=p!=null&&Yi(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.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=q(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(ji,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Mi.displayName=`NavLink`;var Ni=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=Br,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=n.useContext(Q),_=Hi(),v=Ui(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&ee.test(c);return n.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?n.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Ni.displayName=`Form`;function Pi({getKey:e,storageKey:t,...r}){let i=n.useContext(_i),{basename:a}=n.useContext(Q),o=$(),s=Sr();qi({getKey:e,storageKey:t});let c=n.useMemo(()=>{if(!i||!e)return null;let t=Ki(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((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];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.nonce==null&&i?.nonce&&(r.nonce=i.nonce),n.createElement(`script`,{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${ri(JSON.stringify(t||Wi))}, ${ri(JSON.stringify(c))})`}})}Pi.displayName=`ScrollRestoration`;function Fi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ii(e){let t=n.useContext(zn);return I(t,Fi(e)),t}function Li(e){let t=n.useContext(Bn);return I(t,Fi(e)),t}function Ri(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=ir(),f=$(),p=or(e,{relative:s});return n.useCallback(m=>{if(qr(m,t)){m.preventDefault();let t=r===void 0?z(f)===z(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}function zi(e){L(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=n.useRef(Jr(e)),r=n.useRef(!1),i=$(),a=n.useMemo(()=>Yr(i.search,r.current?null:t.current),[i.search]),o=ir();return[a,n.useCallback((e,t)=>{let n=Jr(typeof e==`function`?e(new URLSearchParams(a)):e);r.current=!0,o(`?`+n,t)},[o,a])]}var Bi=0,Vi=()=>`__${String(++Bi)}__`;function Hi(){let{router:e}=Ii(`useSubmit`),{basename:t}=n.useContext(Q),r=br(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ei(e,t);if(n.navigate===!1){let e=n.fetcherKey||Vi();await i(e,r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync})}else await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ui(e,{relative:t}={}){let{basename:r}=n.useContext(Q),i=n.useContext(qn);I(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...or(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.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();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:J([r,o.pathname])),z(o)}var Wi=`react-router-scroll-positions`,Gi={};function Ki(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:q(e.pathname,n)||e.pathname},t)),i??=e.key,i}function qi({getKey:e,storageKey:t}={}){let{router:r}=Ii(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=Li(`useScrollRestoration`),{basename:o}=n.useContext(Q),s=$(),c=Sr(),l=xr();n.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ji(n.useCallback(()=>{if(l.state===`idle`){let t=Ki(s,c,o,e);Gi[t]=window.scrollY}try{sessionStorage.setItem(t||Wi,JSON.stringify(Gi))}catch(e){L(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(n.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Wi);e&&(Gi=JSON.parse(e))}catch{}},[t]),n.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(Gi,()=>window.scrollY,e?(t,n)=>Ki(t,n,o,e):void 0);return()=>t&&t()},[r,o,e]),n.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{L(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function Ji(e,t){let{capture:r}=t||{};n.useEffect(()=>{let t=r==null?void 0:{capture:r};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,r])}function Yi(e,{relative:t}={}){let r=n.useContext(Un);I(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Ii(`useViewTransitionState`),a=or(e,{relative:t});if(!r.isTransitioning)return!1;let o=q(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=q(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ke(a.pathname,s)!=null||ke(a.pathname,o)!=null}function Xi(e){return{kind:e.identityKind,key:e.identityKey}}function Zi(e){return`/projects/${encodeURIComponent(e.kind)}/${encodeURIComponent(e.key)}`}function Qi(e){return b(m(e),e.id)}function $i(e,t,n){let r=e.get(t);if(r){r.push(n);return}e.set(t,[n])}function ea(e,t){let n=S(e),r=new Map,i=new Map,a=new Map,o=new Map,s=[],c=new Set(t.map(e=>e.name.toLowerCase()));for(let e of c)r.set(e,[]),i.set(e,[]);for(let t of e){let e=m(t),n={...t,agentKey:e,sessionId:t.id,reference:t.slug};s.push(n),c.has(e)&&i.get(e).push(n);let r=t.project_identity;if(!r?.key)continue;let u=l(r);$i(a,u,n);let d=o.get(u);d?d.count+=1:o.set(u,{key:u,identityKind:r.kind,identityKey:r.key,label:r.displayName||t.directory,count:1})}for(let e of c)r.set(e,n.byAgent.get(e)??[]);return{byRouteKey:n.byRouteKey,byAgent:r,byProjectIdentityKey:n.byProjectIdentityKey,byProjectAgentKey:n.byProjectAgentKey,byLandingAgent:i,byLandingProjectIdentityKey:a,landingSessions:s,sessionsByActivity:n.sessionsByActivity,projectOptions:[...o.values()].toSorted((e,t)=>t.count-e.count).slice(0,8)}}function ta(e){let t=new Map,n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],a=Qi(i);t.has(a)||(t.set(a,i),n.set(a,r))}return{byReference:t,indexByReference:n}}export{i as A,m as C,r as D,c as E,d as O,l as S,_ as T,a as _,Zi as a,p as b,Di as c,$ as d,Sr as f,O as g,zi as h,Xi as i,o as j,g as k,ce as l,Cr as m,ta as n,ji as o,ir as p,Qi as r,Fr as s,ea as t,Je as u,h as v,b as w,u as x,C as y};
|
package/dist/web/index.html
CHANGED
|
@@ -209,17 +209,16 @@
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
</style>
|
|
212
|
-
<script type="module" crossorigin src="/assets/index-
|
|
212
|
+
<script type="module" crossorigin src="/assets/index-CQI8F_8X.js"></script>
|
|
213
213
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-n5LQ9ujS.js">
|
|
214
|
-
<link rel="modulepreload" crossorigin href="/assets/AgentIcon-
|
|
215
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
216
|
-
<link rel="modulepreload" crossorigin href="/assets/DialogTitle-
|
|
217
|
-
<link rel="modulepreload" crossorigin href="/assets/session-indexes-EHJdYE4j.js">
|
|
214
|
+
<link rel="modulepreload" crossorigin href="/assets/AgentIcon-CEj7HO1m.js">
|
|
215
|
+
<link rel="modulepreload" crossorigin href="/assets/session-indexes-BuxBafvh.js">
|
|
216
|
+
<link rel="modulepreload" crossorigin href="/assets/DialogTitle-Dv6DQPIb.js">
|
|
218
217
|
<link rel="modulepreload" crossorigin href="/assets/session-title-CNhapdPJ.js">
|
|
219
|
-
<link rel="modulepreload" crossorigin href="/assets/SearchFilterBar-
|
|
220
|
-
<link rel="modulepreload" crossorigin href="/assets/BookmarkButton-
|
|
218
|
+
<link rel="modulepreload" crossorigin href="/assets/SearchFilterBar-iP6pzlZo.js">
|
|
219
|
+
<link rel="modulepreload" crossorigin href="/assets/BookmarkButton-DLEnIyeE.js">
|
|
221
220
|
<link rel="modulepreload" crossorigin href="/assets/useTheme-CwDcVdGz.js">
|
|
222
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
221
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B-CV7pFu.css">
|
|
223
222
|
</head>
|
|
224
223
|
<body>
|
|
225
224
|
<div id="root">
|