libre-webui 0.34.0 → 0.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +20 -31
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/middleware/cors.d.ts +12 -7
- package/backend/dist/middleware/cors.d.ts.map +1 -1
- package/backend/dist/middleware/cors.js +27 -26
- package/backend/dist/middleware/cors.js.map +1 -1
- package/backend/dist/middleware/preferencesBody.d.ts +4 -0
- package/backend/dist/middleware/preferencesBody.d.ts.map +1 -0
- package/backend/dist/middleware/preferencesBody.js +43 -0
- package/backend/dist/middleware/preferencesBody.js.map +1 -0
- package/backend/dist/routes/preferences.d.ts.map +1 -1
- package/backend/dist/routes/preferences.js +2 -1
- package/backend/dist/routes/preferences.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +7 -10
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/types/index.d.ts +1 -0
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/dist/types/index.js.map +1 -1
- package/backend/dist/utils/backgroundSettings.d.ts +7 -0
- package/backend/dist/utils/backgroundSettings.d.ts.map +1 -0
- package/backend/dist/utils/backgroundSettings.js +39 -0
- package/backend/dist/utils/backgroundSettings.js.map +1 -0
- package/backend/package.json +3 -3
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/artifact-runtime/framer-motion.js +3 -3
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -1
- package/frontend/dist/assets/index-C59a0tht.css +1 -0
- package/frontend/dist/assets/index-Cyi10ekV.js +43 -0
- package/frontend/dist/assets/{markdown-math-Ddr6Z9Sf.css → markdown-math-B3MBJsZb.css} +1 -1
- package/frontend/dist/index.html +22 -21
- package/frontend/dist/js/{ArtifactContainer-8ZacPNwg.js → ArtifactContainer-CQjqR9G1.js} +1 -1
- package/frontend/dist/js/{ArtifactDemoPage-DvvT45ZJ.js → ArtifactDemoPage-DbbqglMU.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-Dbp1bB_9.js → ArtifactSandboxFrame-DI2b9BW5.js} +1 -1
- package/frontend/dist/js/{ArtifactSlideOutPanel-Ct9nlG_6.js → ArtifactSlideOutPanel-B_UX92CK.js} +1 -1
- package/frontend/dist/js/{AutomationModal-Ie_MxC18.js → AutomationModal-CNiy1Dxm.js} +1 -1
- package/frontend/dist/js/{AutomationsPage-Czg-rMEr.js → AutomationsPage-CeAsldk_.js} +1 -1
- package/frontend/dist/js/{AvatarUpload-DgyIHr7P.js → AvatarUpload-xCWQm3_w.js} +1 -1
- package/frontend/dist/js/CalendarPage-Cwk0X00z.js +1 -0
- package/frontend/dist/js/ChannelsPage-BG3n4ElV.js +1 -0
- package/frontend/dist/js/ChatPage-wSRfAOeh.js +14 -0
- package/frontend/dist/js/{ConnectModels-Cg7Wp-43.js → ConnectModels-D7ZTGihA.js} +1 -1
- package/frontend/dist/js/{EvaluationsPage-BBafHC8o.js → EvaluationsPage-C795TI_6.js} +2 -2
- package/frontend/dist/js/{FirstTimeSetup-Cd9cLLz6.js → FirstTimeSetup-C4C5GLjW.js} +1 -1
- package/frontend/dist/js/{GalleryPage-6aa0A9fS.js → GalleryPage-DVWl3LaC.js} +1 -1
- package/frontend/dist/js/{HomePage-1vKjY6Aw.js → HomePage-BljB9ZMN.js} +1 -1
- package/frontend/dist/js/LanguageSwitcher-BuS3i6u5.js +1 -0
- package/frontend/dist/js/{LibreClawPage-DXxJP96Q.js → LibreClawPage-OD6iZtiy.js} +1 -1
- package/frontend/dist/js/ModelManagerModals-DdL3LeGl.js +1 -0
- package/frontend/dist/js/NotesPage-rqL0zS8z.js +3 -0
- package/frontend/dist/js/{PasswordStrengthMeter-DLQ5jaO_.js → PasswordStrengthMeter-H0Os6XbX.js} +1 -1
- package/frontend/dist/js/{PersonasPage-HYkaAXAe.js → PersonasPage-Babix8IA.js} +1 -1
- package/frontend/dist/js/{PluginUsagePage-B2MRIZme.js → PluginUsagePage-CudDkMxy.js} +1 -1
- package/frontend/dist/js/RichMessageContent-B-U0EcyW.js +1 -0
- package/frontend/dist/js/{RichMessageContent-BnpRgouz.js → RichMessageContent-CcKn_kcQ.js} +3 -3
- package/frontend/dist/js/SettingsModal-CXU60RIf.js +19 -0
- package/frontend/dist/js/{ShareDialog-BdFJRfxV.js → ShareDialog-CnU4ptx7.js} +1 -1
- package/frontend/dist/js/{SystemPage-DkKnu35i.js → SystemPage-BzpTjdQY.js} +1 -1
- package/frontend/dist/js/{UserManagementPage-DdpcN4-Q.js → UserManagementPage-BHEMaK5a.js} +1 -1
- package/frontend/dist/js/{UserManagementPanel-Dpn15Nyr.js → UserManagementPanel-pbtLqF8X.js} +1 -1
- package/frontend/dist/js/{WhatsNewModal-BH-kE-Wb.js → WhatsNewModal-TuDrBWKj.js} +1 -1
- package/frontend/dist/js/WorkPage-DCeqm0BN.js +7 -0
- package/frontend/dist/js/api-BIVGtaZy.js +1 -0
- package/frontend/dist/js/{api-HgGU3dII.js → api-CgnEj5Jc.js} +1 -1
- package/frontend/dist/js/{appNavigation-DAd7SkU_.js → appNavigation-DySHcEGS.js} +1 -1
- package/frontend/dist/js/appStore-DrTsJPfh.js +2 -0
- package/frontend/dist/js/appVersion-CAidQlBP.js +1 -0
- package/frontend/dist/js/{ar-CM3oZcHT.js → ar-DNI77Stn.js} +1 -1
- package/frontend/dist/js/authStore-CieFdk4S.js +4 -0
- package/frontend/dist/js/authStore-GaOHAAsM.js +1 -0
- package/frontend/dist/js/{bn-BuYroL_j.js → bn-u6oyZr4U.js} +1 -1
- package/frontend/dist/js/{chatStore-DYm9cXVV.js → chatStore-BvZkd8Un.js} +3 -3
- package/frontend/dist/js/composerStyles-BjJm_BgC.js +1 -0
- package/frontend/dist/js/{config-BH2zUU2X.js → config-D7WLbWrW.js} +1 -1
- package/frontend/dist/js/{cs-D3NqP5wD.js → cs-BIkJ6jwb.js} +1 -1
- package/frontend/dist/js/{da-BGpE68rg.js → da-DV3V6XJ_.js} +1 -1
- package/frontend/dist/js/{de-BjYUQYNL.js → de-DdcTQ-vn.js} +1 -1
- package/frontend/dist/js/{es-vNJrO8Lj.js → es-Cw-ozFaX.js} +1 -1
- package/frontend/dist/js/{evaluationsApi-v6Qj2fFv.js → evaluationsApi-Dn-WNzzH.js} +1 -1
- package/frontend/dist/js/{fr-BvtHFXNM.js → fr-Y2NfnlYR.js} +1 -1
- package/frontend/dist/js/{hi-CUfuHlbY.js → hi-BKU62_1Y.js} +1 -1
- package/frontend/dist/js/{i18next-ChipS_AK.js → i18next-Dq_6N9uy.js} +1 -1
- package/frontend/dist/js/{id-B4CE64s6.js → id-q6wo4InR.js} +1 -1
- package/frontend/dist/js/{is-Dr6Is7-Q.js → is-_B6QblCu.js} +1 -1
- package/frontend/dist/js/{it-Cj4NfoeU.js → it-NUupXhzK.js} +1 -1
- package/frontend/dist/js/{ja-DByiJVO0.js → ja-BUvl9RXq.js} +1 -1
- package/frontend/dist/js/{ko-DqBvZqIv.js → ko-df4leR83.js} +1 -1
- package/frontend/dist/js/markdownMath-BW8RNkEl.js +1 -0
- package/frontend/dist/js/{messageCodeStyles-ERvWXB7Y.js → messageCodeStyles-C0pbLr0L.js} +2 -2
- package/frontend/dist/js/{ms-DobJ-R5X.js → ms-CN-7Q9S2.js} +1 -1
- package/frontend/dist/js/{nl-D4tVIakl.js → nl-OEm4uNIo.js} +1 -1
- package/frontend/dist/js/{pl-BIoYiVJA.js → pl-B9pHpjg7.js} +1 -1
- package/frontend/dist/js/{pt-Bzww3XtB.js → pt-D3uaEKud.js} +1 -1
- package/frontend/dist/js/router-vendor-Epc3_KZ_.js +1 -0
- package/frontend/dist/js/{ru-lqQ-JuMd.js → ru-z9H07lhi.js} +1 -1
- package/frontend/dist/js/{sv-9dcksSEJ.js → sv-GkQDA4wx.js} +1 -1
- package/frontend/dist/js/{teamEventStream-CTyr4r5f.js → teamEventStream-CI_GSbae.js} +1 -1
- package/frontend/dist/js/{th-DuOX28lk.js → th-0hzCkDzt.js} +1 -1
- package/frontend/dist/js/{tr-Dz7bMTi1.js → tr-CZDobfHQ.js} +1 -1
- package/frontend/dist/js/ui-CgokQU6I.js +2 -0
- package/frontend/dist/js/ui-vendor-Dt9hfsGD.js +177 -0
- package/frontend/dist/js/{uk-aTAky5l4.js → uk-BwspIPCI.js} +1 -1
- package/frontend/dist/js/{useChat-CXcosgJB.js → useChat-DIGuMg5j.js} +1 -1
- package/frontend/dist/js/useDialogFocus-BQLdAGYH.js +1 -0
- package/frontend/dist/js/{vi-CHcYXhCs.js → vi-Dipdv5ta.js} +1 -1
- package/frontend/dist/js/{workApi-CntsmsAA.js → workApi-C-WfyZSs.js} +2 -2
- package/frontend/dist/js/workApi-CApikuye.js +1 -0
- package/frontend/dist/js/{zh-DvvksD8_.js → zh-CgdWmtP_.js} +1 -1
- package/package.json +8 -4
- package/frontend/dist/assets/index-By_-fwuh.css +0 -1
- package/frontend/dist/assets/index-D3XhYdgN.js +0 -108
- package/frontend/dist/js/CalendarPage-D1ZeHpZ0.js +0 -1
- package/frontend/dist/js/ChannelsPage-DgXZdSLa.js +0 -1
- package/frontend/dist/js/ChatPage-ov4Xlf8Q.js +0 -14
- package/frontend/dist/js/ModelManagerModals-BBGWbTTi.js +0 -1
- package/frontend/dist/js/NotesPage-DCLkl9a9.js +0 -3
- package/frontend/dist/js/RichMessageContent-2fzm0XIM.js +0 -1
- package/frontend/dist/js/SettingsModal-4ITUSJqi.js +0 -19
- package/frontend/dist/js/WorkPage-CCyCPnwr.js +0 -7
- package/frontend/dist/js/api-DOlirnw_.js +0 -1
- package/frontend/dist/js/appStore-DefVAJAx.js +0 -2
- package/frontend/dist/js/appVersion-RvElMU1Q.js +0 -1
- package/frontend/dist/js/authStore-AE-cc9PJ.js +0 -1
- package/frontend/dist/js/authStore-DbDFBMx0.js +0 -4
- package/frontend/dist/js/markdownMath-CoDj1i7z.js +0 -1
- package/frontend/dist/js/router-vendor-CMbYTGdh.js +0 -1
- package/frontend/dist/js/ui-CHgZA8lG.js +0 -2
- package/frontend/dist/js/ui-vendor-BvD5yGW1.js +0 -177
- package/frontend/dist/js/useDictation-BGlY44fp.js +0 -1
- package/frontend/dist/js/webauthnClient-B1yv1m81.js +0 -1
- package/frontend/dist/js/workApi-nKavXIsg.js +0 -1
- /package/frontend/dist/js/{markdown-math-Dg-WB9ui.js → markdown-math-gtdBxaM5.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./react-vendor-D0Ec-185.js";import{o as n}from"./logger-DnuT4jgB.js";var r=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,i=/^[\\/]{2}/;function a(e,t){return t+e.replace(/\\/g,`/`)}var o=`popstate`;function s(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function c(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{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:h(t)}return _(t,n,null,e)}function l(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=g(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),m(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:h(t))}function r(e,t){d(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return _(t,n,r,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(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 m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),mask:i}}function h({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function g(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 _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,c=i.history,l=`POP`,u=null,d=f();d??(d=0,c.replaceState({...c.state,idx:d},``));function f(){return(c.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=s(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let o=p(r,d),h=b.createHref(r.mask||r);try{c.pushState(o,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=s(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),o=b.createHref(r.mask||r);c.replaceState(i,``,o),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(i,e)}let b={get action(){return l},get location(){return e(i,c)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(o,h),u=e,()=>{i.removeEventListener(o,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return c.go(e)}};return b}function v(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),u(r,`No window.location.(origin|href) available to create URL`);let a=typeof t==`string`?t:h(t);return a=a.replace(/ $/,`%20`),!n&&i.test(a)&&(a=r+a),new URL(a,r)}var y=e(t(),1),b=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},x=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function S(e){return x.has(e)}var C=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function w(e){return C.has(e)}function T(e){return e.index===!0}function E(e){let t={};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function D(e,t=E,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(u(e.index!==!0||!e.children,`Cannot specify children on an index route`),u(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),T(e)){let n={...e,id:s};return r[s]=O(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=O(n,t(n)),e.children&&(n.children=D(e.children,t,o,r,i)),n}})}function O(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function k(e,t,n=`/`){return A(e,t,n,!1)}function A(e,t,n,r,i){let a=V((typeof t==`string`?g(t):t).pathname||`/`,n);if(a==null)return null;let o=i??j(e),s=null,c=ue(a);for(let e=0;s==null&&e<o.length;++e)s=se(o[e],c,r);return s}function ee(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function j(e){let t=M(e);return P(t),t}function M(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;u(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=U([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),M(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:oe(l,e.index),routesMeta:d.map((e,t)=>{let[n,r]=B(e.relativePath,e.caseSensitive,t===d.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 N(e.path))a(e,t,!0,n)}),t}function N(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=N(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 P(e){e.sort((e,t)=>e.score===t.score?z(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var F=/^:[\w-]+$/,I=/^:[\w-]+/,te=3.5,L=3,ne=2,re=1,ie=10,R=-2,ae=e=>e===`*`;function oe(e,t){let n=e.split(`/`),r=n.length;return n.some(ae)&&(r+=R),t&&(r+=ne),n.filter(e=>!ae(e)).reduce((e,t)=>e+(F.test(t)?L:I.test(t)?te:t===``?re:ie),r)}function z(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 se(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?le(u,l,s.matcher,s.compiledParams):ce(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ce({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:U([a,d.pathname]),pathnameBase:be(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function ce(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=B(e.path,e.caseSensitive,e.end);return le(e,t,n,r)}function le(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ye(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ye(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function B(e,t=!1,n=!0){d(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)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ue(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!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 V(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function de({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var fe=e=>r.test(e);function H(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=ve(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?pe(n.substring(1),`/`):pe(n,t)):a=t,{pathname:a,search:xe(r),hash:Se(i)}}function pe(e,t){let n=ye(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function me(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 he(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ge(e){let t=he(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function _e(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),me(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),me(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),me(`#`,`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=H(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var ve=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>ve(e.join(`/`));function ye(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var be=e=>ye(e).replace(/^\/*/,`/`),xe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Se=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ce=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],we=class{status;statusText;data;error;internal;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 Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function De(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?g(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);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var Oe=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ke(e,t){let n=e;if(typeof n!=`string`||!r.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,s=!1;if(Oe)try{let e=new URL(window.location.href),r=i.test(n)?new URL(a(n,e.protocol)):new URL(n),o=V(r.pathname,t);r.origin===e.origin&&o!=null?n=o+r.search+r.hash:s=!0}catch{d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:s,to:n}}var Ae=Symbol(`Uninstrumented`),W=new WeakMap;function je(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){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>G(await K(n.lazy,void 0,()=>e(...t),Le))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>G(await K(n[`lazy.middleware`],void 0,()=>t(...e),Le))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>G(await K(n[`lazy.loader`],void 0,()=>t(...e),Le))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>G(await K(n[`lazy.action`],void 0,()=>t(...e),Le))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ne(t.loader),i=async(...t)=>G(await K(n.loader,Re(t[0]),()=>e(...t),Le));e.hydrate===!0&&(i.hydrate=!0),Pe(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ne(t.action),i=async(...t)=>G(await K(n.action,Re(t[0]),()=>e(...t),Le));Pe(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ne(e),r=async(...e)=>G(await K(n.middleware,Re(e[0]),()=>t(...e),Le));return Pe(r,t),r})),r}function Me(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Ne(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?h(i):`.`,...ze(e,a??{})};return G(await K(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Fe(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Le(e),meta:o})))};Pe(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ne(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return G(await K(n.fetch,{href:o??`.`,fetcherKey:i,...ze(e,s??{})},async()=>{let n=Fe(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Le(e),meta:c})))};Pe(r,t),e.fetch=r}return e}function Ne(e){return e[Ae]??e}function Pe(e,t){e[Ae]=t}function Fe(e,t){return W.set(e,t),()=>{W.get(e)===t&&W.delete(e)}}function Ie(e){let t=W.get(e);return W.delete(e),t}function G(e){if(e.type===`error`)throw e.value;return e.value}async function K(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=K(e,t,n,r,i,a-1),await s,u(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function Le(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Re(e){let{request:t,context:n,params:r}=e;return{...e,request:Be(t),params:{...r},context:q(n)}}function ze(e,t){return{currentUrl:h(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 Be(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function q(e){return{get:t=>e.get(t)}}var Ve=new URL(`http://localhost`);function He(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ve)}catch{return Ve}}function Ue(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function We(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ge(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ue(i,n),s=!Ue(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!We(e,i)||!Ue(i,a)))throw Error(`External navigation is not allowed`)}var Ke=[`POST`,`PUT`,`PATCH`,`DELETE`],qe=new Set(Ke),Je=[`GET`,...Ke],Ye=new Set(Je),Xe=new Set([301,302,303,307,308]),Ze=new Set([307,308]),Qe={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},$e={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},et={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},tt=`remix-router-transitions`,nt=Symbol(`ResetLoaderData`),rt=class{#e;#t;#n;#r;constructor(e){this.#e=e,this.#t=j(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#n??this.#e}get branches(){return this.#r??this.#t}get hasHMRRoutes(){return this.#n!=null}setRoutes(e){this.#e=e,this.#t=j(e)}setHmrRoutes(e){this.#n=e,this.#r=j(e)}commitHmrRoutes(){this.#n&&(this.#e=this.#n,this.#t=this.#r,this.#n=void 0,this.#r=void 0)}};function it(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;u(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties,o=a||(()=>({}));if(e.instrumentations){let t=e.instrumentations;o=e=>({...a?.(e),...je(t.map(e=>e.route).filter(Boolean),e)})}let s={},c=new rt(D(e.routes,o,void 0,s)),l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let f=e.dataStrategy||xt,p={...e.future},_=null,y=new Set,x=null,S=null,C=null,w=null,T=e.hydrationData!=null,E=A(c.activeRoutes,e.history.location,l,!1,c.branches),O=!1,k=null,j,M;if(E==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wt(c.activeRoutes);j=!0,M=!j,E=n,k={[r.id]:t}}else if(E&&!e.hydrationData&&at(E,c.activeRoutes,e.history.location.pathname).active&&(E=null),!E){j=!1,M=!j,E=[];let t=at(null,c.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(O=!0,E=t.matches)}else if(E.some(e=>e.route.lazy))j=!1,M=!j;else if(!E.some(e=>lt(e.route)))j=!0,M=!j;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=E;if(n){let e=E.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}M=!1,j=!0,r.forEach(e=>{let r=ut(e.route,t,n);M||=r.renderFallback,j&&=!r.shouldLoad})}let N,P={historyAction:e.history.action,location:e.history.location,matches:E,initialized:j,renderFallback:M,navigation:Qe,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||k,fetchers:new Map,blockers:new Map},F=`POP`,I=null,te=!1,L,ne=!1,re=new Map,ie=null,R=!1,ae=!1,oe=new Set,z=new Map,se=0,ce=-1,le=new Map,B=new Set,ue=new Map,de=new Map,H=new Set,pe=new Map,me,he=null;function ge(){if(_=e.history.listen(({action:t,location:n,delta:r})=>{if(me){me(),me=void 0;return}d(pe.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=Je({currentLocation:P.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{me=e});e.history.go(r*-1),qe(i,{state:`blocked`,location:n,proceed(){qe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(P.blockers);e.set(i,et),U({blockers:e})}}),I?.resolve(),I=null;return}return Se(t,n)}),n){mn(t,re);let e=()=>hn(t,re);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return P.initialized||Se(`POP`,P.location,{initialHydration:!0}),N}function _e(){_&&_(),ie&&ie(),y.clear(),L&&L.abort(),P.fetchers.forEach((e,t)=>ze(P.fetchers,t)),P.blockers.forEach((e,t)=>Ke(t))}function ve(e){if(y.add(e),x){let{newErrors:t}=x;x=null,e(P,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>y.delete(e)}function U(e,t={}){e.matches&&=e.matches.map(e=>{let t=s[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),P={...P,...e};let n=[],r=[];P.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?n.push(t):r.push(t))}),H.forEach(e=>{!P.fetchers.has(e)&&!z.has(e)&&n.push(e)}),y.size===0&&(x={newErrors:e.errors??null}),[...y].forEach(r=>r(P,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>ze(P.fetchers,e)),r.forEach(e=>P.fetchers.delete(e))}function ye(t,n,{flushSync:r}={}){let i=P.actionData!=null&&P.navigation.formMethod!=null&&X(P.navigation.formMethod)&&P.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?P.actionData:null;let o=n.loaderData?Vt(P.loaderData,n.loaderData,n.matches||[],n.errors):P.loaderData,s=P.blockers;s.size>0&&!R&&(s=new Map(s),s.forEach((e,t)=>s.set(t,et)));let l=!R&&it(t,n.matches||P.matches),u=te===!0||P.navigation.formMethod!=null&&X(P.navigation.formMethod)&&t.state?._isRedirect!==!0;c.commitHmrRoutes(),R||F===`POP`||(F===`PUSH`?e.history.push(t,t.state):F===`REPLACE`&&e.history.replace(t,t.state));let d;if(F===`POP`){let e=re.get(P.location.pathname);e&&e.has(t.pathname)?d={currentLocation:P.location,nextLocation:t}:re.has(t.pathname)&&(d={currentLocation:t,nextLocation:P.location})}else if(ne){let e=re.get(P.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(P.location.pathname,e)),d={currentLocation:P.location,nextLocation:t}}U({...n,actionData:a,loaderData:o,historyAction:F,location:t,initialized:!0,renderFallback:!1,navigation:Qe,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),F=`POP`,te=!1,ne=!1,R=!1,ae=!1,I?.resolve(),I=null,he?.resolve(),he=null}async function be(t,n){if(I?.resolve(),I=null,typeof t==`number`){I||=gn();let n=I.promise;return e.history.go(t),n}let r=Ie(N),{path:a,submission:o,error:s}=st(!1,ot(P.location,P.matches,l,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?g(n.mask):{...P.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},i.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ge(typeof n.mask==`string`?n.mask:h(n.mask),h(c),e.history.createURL(`/`),`reject`)}let u=P.location,d=m(u,a,n&&n.state,void 0,c);d={...d,...e.history.encodeLocation(d)},Ge(t==null?e.history.createHref(P.location):typeof t==`string`?t:h(t),e.history.createHref(d.mask||d),e.history.createURL(`/`),`reject`);let f=n&&n.replace!=null?n.replace:void 0,p=`PUSH`;f===!0?p=`REPLACE`:f===!1||o!=null&&X(o.formMethod)&&o.formAction===P.location.pathname+P.location.search&&(p=`REPLACE`);let _=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,v=(n&&n.flushSync)===!0,y=Je({currentLocation:u,nextLocation:d,historyAction:p});if(y){qe(y,{state:`blocked`,location:d,proceed(){qe(y,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),be(t,n)},reset(){let e=new Map(P.blockers);e.set(y,et),U({blockers:e})}});return}await Se(p,d,{submission:o,pendingError:s,preventScrollReset:_,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:v,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function xe(){he||=gn(),Fe(),U({revalidation:`loading`});let e=he.promise;return P.navigation.state===`submitting`?e:P.navigation.state===`idle`?(Se(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),e):(Se(F||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:ne===!0}),e)}async function Se(t,n,r){L&&L.abort(),L=null,F=t,R=(r&&r.startUninterruptedRevalidation)===!0,nt(P.location,P.matches),te=(r&&r.preventScrollReset)===!0,ne=(r&&r.enableViewTransition)===!0;let i=c.activeRoutes,a=r?.initialHydration&&P.matches&&P.matches.length>0&&!O?P.matches:A(i,n,l,!1,c.branches),o=(r&&r.flushSync)===!0;if(a&&P.initialized&&!ae&&qt(P.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){ye(n,{matches:a},{flushSync:o});return}let s=at(a,i,n.pathname);if(s.active&&s.matches&&(a=s.matches),r?.instrumentationNavigateMetaReceiver){let t=sn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);ye(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;L=new AbortController;let d=It(e.history,n,L.signal,r&&r.submission),f=e.getContext?await e.getContext():new b,p;if(r&&r.pendingError)p=[Ut(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let i=await Ce(d,n,r.submission,a,t,f,s.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Y(t)&&Te(t.error)&&t.error.status===404){L=null,ye(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=ln(n,a,t,r.submission),o=!1,s.active=!1,d=It(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await we(d,n,a,t,f,s.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(L=null,ye(n,{matches:h||a,...Ht(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ce(t,n,i,a,u,d,f,p,m={}){if(Fe(),U({navigation:un(n,a,u,i)},{flushSync:m.flushSync===!0}),f){let e=await dt(a,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}=Wt(c.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ye(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=on(a,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:J(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Ne(t,n,Dt(o,s,t,n,a,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of a)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Qt(h)){let n;return n=m&&m.replace!=null?m.replace:Ft(h.response.headers.get(`Location`),new URL(t.url),l,e.history)===P.location.pathname+P.location.search,await W(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(h)){let e=Ut(a,g.route.id);return(m&&m.replace)!==!0&&(F=`PUSH`),{matches:a,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:a,pendingActionResult:[g.route.id,h]}}async function we(t,n,i,a,u,d,f,p,m,h,g,_,v,y){let b=f||ln(n,i,a,p),x=p||m||cn(b),S=!R&&!g;if(d){if(S){let e=Ee(v);U({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await dt(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}=Wt(c.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Ut(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=ct(t,u,o,s,e.history,P,i,x,n,g?[]:r,g===!0,ae,oe,H,ue,B,C,l,e.patchRoutesOnNavigation!=null,c.branches,v,y);if(ce=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(P.fetchers),t=He(e);return ye(n,{matches:i,loaderData:{},errors:v&&Y(v[1])?{[v[0]]:v[1].error}:null,...Ht(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Ee(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=De(T)),U(e,{flushSync:_})}T.forEach(e=>{q(e.key),e.controller&&z.set(e.key,e.controller)});let E=()=>T.forEach(e=>q(e.key));L&&L.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Pe(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener(`abort`,E),T.forEach(e=>z.delete(e.key));let k=Gt(D);if(k)return await W(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Gt(O),k)return B.add(k.key),await W(t,k.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(P.fetchers),{loaderData:ee,errors:j}=Bt(P,i,D,v,T,O,A);g&&P.errors&&(j={...P.errors,...j});let M=He(A),N=Ue(ce,A),F=M||N||T.length>0;return{matches:i,loaderData:ee,errors:j,...F?{workingFetchers:A}:{}}}function Ee(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function De(e){let t=new Map(P.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=dn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Oe(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=Ie(N),s=c.activeRoutes,u=ot(P.location,P.matches,l,r,n,i?.relative),d=A(s,u,l,!1,c.branches),f=at(d,s,u);if(f.active&&f.matches&&(d=f.matches),o&&o(sn(e.history,u,d)),!d){K(t,n,J(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=st(!0,u,i);if(h){K(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new b,_=(i&&i.preventScrollReset)===!0;if(m&&X(m.formMethod)){await ke(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}ue.set(t,{routeId:n,path:p}),await Ae(t,n,p,d,g,f.active,a,_,m)}async function ke(t,n,i,a,d,f,p,m,h,g){Fe(),ue.delete(t),G(t,fn(h,P.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=It(e.history,i,_.signal,h);if(f){let e=await dt(a,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:p});return}if(e.matches)a=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:p});return}}let y=on(a,i);if(!y.route.action&&!y.route.lazy){K(t,n,J(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}z.set(t,_);let b=se,x=Dt(o,s,v,i,a,y,r,d),S=await Ne(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){z.get(t)===_&&z.delete(t);return}if(H.has(t)){if(Qt(C)||Y(C)){G(t,pn(void 0));return}}else{if(Qt(C)){if(z.delete(t),ce>b){G(t,pn(void 0));return}return B.add(t),G(t,dn(h)),W(v,C,!1,{fetcherSubmission:h,preventScrollReset:m})}if(Y(C)){K(t,n,C.error);return}}let w=P.navigation.location||P.location,T=It(e.history,w,_.signal),E=c.activeRoutes,D=P.navigation.state===`idle`?P.matches:A(E,P.navigation.location,l,!1,c.branches);u(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let{dsMatches:k,revalidatingFetchers:ee}=ct(T,d,o,s,e.history,P,D,h,w,r,!1,ae,oe,H,ue,B,E,l,e.patchRoutesOnNavigation!=null,c.branches,[y.route.id,C],g),j=dn(h,C.data),M=new Map(P.fetchers);M.set(t,j),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=M.get(t),r=dn(void 0,n?n.data:void 0);M.set(t,r),q(t),e.controller&&z.set(t,e.controller)}),U({fetchers:M});let N=()=>ee.forEach(e=>q(e.key));_.signal.addEventListener(`abort`,N);let{loaderResults:I,fetcherResults:te}=await Pe(k,ee,T,w,d);if(_.signal.aborted){le.get(t)===O&&le.delete(t);return}_.signal.removeEventListener(`abort`,N),le.delete(t),z.delete(t),ee.forEach(e=>z.delete(e.key));let ne=P.fetchers.has(t),re=e=>{if(!ne)return e;let n=new Map(e.fetchers);return n.set(t,pn(C.data)),{...e,fetchers:n}},ie=Gt(I);if(ie)return P=re(P),W(T,ie.result,!1,{preventScrollReset:m});if(ie=Gt(te),ie)return B.add(ie.key),P=re(P),W(T,ie.result,!1,{preventScrollReset:m});let R=new Map(P.fetchers);ne&&R.set(t,pn(C.data));let{loaderData:V,errors:de}=Bt(P,D,I,void 0,ee,te,R);Ue(O,R),P.navigation.state===`loading`&&O>ce?(u(F,`Expected pending action`),L&&L.abort(),ye(P.navigation.location,{matches:D,loaderData:V,errors:de,fetchers:R})):(U({errors:de,loaderData:Vt(P.loaderData,V,D,de),fetchers:R}),ae=!1)}async function Ae(t,n,i,a,c,l,u,d,f){let p=P.fetchers.get(t);G(t,dn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=It(e.history,i,m.signal);if(l){let e=await dt(a,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}if(e.matches)a=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=on(a,i);z.set(t,m);let _=se,v=await Ne(h,i,Dt(o,s,h,i,a,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of a)if(v[e.route.id]){y=v[e.route.id];break}}if(z.get(t)===m&&z.delete(t),!h.signal.aborted){if(H.has(t)){G(t,pn(void 0));return}if(Qt(y)){if(ce>_){G(t,pn(void 0));return}B.add(t),await W(h,y,!1,{preventScrollReset:d});return}if(Y(y)){K(t,n,y.error);return}G(t,pn(y.data))}}async function W(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:d}={}){a||(I?.resolve(),I=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let f=i.response.headers.get(`Location`);u(f,`Expected a Location header on the redirect Response`);let p=f,h=new URL(r.url);f=Ft(f,h,l,e.history),Ge(p,f,h,`allow-explicit`);let g=m(P.location,f,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(fe(f)){let n=v(t,f,!0);e=n.origin!==t.location.origin||V(n.pathname,l)==null}if(e){d?t.location.replace(f):t.location.assign(f);return}}L=null;let _=d===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:y,formAction:b,formEncType:x}=P.navigation;!o&&!s&&y&&b&&x&&(o=cn(P.navigation));let S=o||s;Ze.has(i.response.status)&&S&&X(S.formMethod)?await Se(_,g,{submission:{...S,formAction:f},preventScrollReset:c||te,enableViewTransition:a?ne:void 0}):await Se(_,g,{overrideNavigation:ln(g,[],_,o),fetcherSubmission:s,preventScrollReset:c||te,enableViewTransition:a?ne:void 0})}async function Ne(e,t,n,r,i){let a,o={};try{a=await Ot(f,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(!X(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!P.loaderData.hasOwnProperty(e.route.id)&&(!P.errors||!P.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(Zt(r)){let i=r.result;o[t]={type:`redirect`,response:Mt(i,e,t,n,l)}}else o[t]=await jt(r);return o}async function Pe(e,t,n,r,i){let a=Ne(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Ne(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){ae=!0,ue.forEach((e,t)=>{z.has(t)&&oe.add(t),q(t)})}function G(e,t,n={}){let r=new Map(P.fetchers);r.set(e,t),U({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=Ut(P.matches,t),a=new Map(P.fetchers);ze(a,e),U({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Le(e){return de.set(e,(de.get(e)||0)+1),H.has(e)&&H.delete(e),P.fetchers.get(e)||$e}function Re(e,t){q(e,t?.reason),G(e,pn(null))}function ze(e,t){let n=P.fetchers.get(t);z.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&q(t),ue.delete(t),le.delete(t),B.delete(t),H.delete(t),oe.delete(t),e.delete(t)}function Be(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),H.add(e)):de.set(e,t),U({fetchers:new Map(P.fetchers)})}function q(e,t){let n=z.get(e);n&&(n.abort(t),z.delete(e))}function Ve(e,t){for(let n of e){let e=t.get(n);u(e,`Expected fetcher: ${n}`);let r=pn(e.data);t.set(n,r)}}function He(e){let t=[],n=!1;for(let r of B){let i=e.get(r);u(i,`Expected fetcher: ${r}`),i.state===`loading`&&(B.delete(r),t.push(r),n=!0)}return Ve(t,e),n}function Ue(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);u(e,`Expected fetcher: ${r}`),e.state===`loading`&&(q(r),le.delete(r),n.push(r))}return Ve(n,t),n.length>0}function We(e,t){let n=P.blockers.get(e)||et;return pe.get(e)!==t&&pe.set(e,t),n}function Ke(e){P.blockers.delete(e),pe.delete(e)}function qe(e,t){let n=P.blockers.get(e)||et;u(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(P.blockers);r.set(e,t),U({blockers:r})}function Je({currentLocation:e,nextLocation:t,historyAction:n}){if(pe.size===0)return;pe.size>1&&d(!1,`A router only supports one blocker at a time`);let r=Array.from(pe.entries()),[i,a]=r[r.length-1],o=P.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ye(e){let t=J(404,{pathname:e}),n=c.activeRoutes,{matches:r,route:i}=Wt(n);return{notFoundMatches:r,route:i,error:t}}function Xe(e,t,n){if(S=e,w=t,C=n||null,!T&&P.navigation===Qe){T=!0;let e=it(P.location,P.matches);e!=null&&U({restoreScrollPosition:e})}return()=>{S=null,w=null,C=null}}function tt(e,t){return C&&C(e,t.map(e=>ee(e,P.loaderData)))||e.key}function nt(e,t){if(S&&w){let n=tt(e,t);S[n]=w()}}function it(e,t){if(S){let n=tt(e,t),r=S[n];if(typeof r==`number`)return r}return null}function at(t,n,r){if(e.patchRoutesOnNavigation){let e=c.branches;if(!t)return{active:!0,matches:A(n,r,l,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:A(n,r,l,!0,e)}}return{active:!1,matches:null}}async function dt(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let a=t;for(;;){let t=s;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:a,fetcherKey:i,patch:(e,n)=>{r.aborted||mt(e,n,c,t,o,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:a}}if(r.aborted)return{type:`aborted`};let u=c.branches,d=A(c.activeRoutes,n,l,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=A(c.activeRoutes,n,l,!0,u),!(f&&a.length<f.length&&ft(a,f.slice(0,a.length))))))return{type:`success`,matches:d};if(f||=A(c.activeRoutes,n,l,!0,u),!f||ft(a,f))return{type:`success`,matches:null};a=f}}function ft(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function pt(e){s={},c.setHmrRoutes(D(e,o,void 0,s))}function ht(e,t,n=!1){mt(e,t,c,s,o,n),c.hasHMRRoutes||U({})}return N={get basename(){return l},get future(){return p},get state(){return P},get routes(){return c.stableRoutes},get branches(){return c.branches},get manifest(){return s},get window(){return t},initialize:ge,subscribe:ve,enableScrollRestoration:Xe,navigate:be,fetch:Oe,revalidate:xe,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Le,resetFetcher:Re,deleteFetcher:Be,dispose:_e,getBlocker:We,deleteBlocker:Ke,patchRoutes:ht,_internalFetchControllers:z,_internalSetRoutes:pt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){U(e)}},e.instrumentations&&(N=Me(N,e.instrumentations.map(e=>e.router).filter(Boolean))),N}function at(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=_e(r||`.`,ge(o),V(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=an(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=de({basename:n,pathname:c.pathname})),h(c)}function st(e,t,n){if(!n||!at(n))return{path:t};if(n.formMethod&&!rn(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Kt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(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}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!X(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()}}}u(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Lt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Lt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rt(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(X(c.formMethod))return{path:t,submission:c};let l=g(t);return e&&l.search&&an(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:h(l),submission:c}}function ct(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Y(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&&Y(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=Ee(o),ee=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(!lt(s))f=!1;else if(u){let{shouldLoad:e}=ut(s,a.loaderData,a.errors);f=e}else dt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Et(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?ft(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Et(n,r,e,c,k,i,l,t,pt(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=A(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=on(b,e.path),C=new AbortController,w=It(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Dt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Dt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};pt(S,a)&&(T=Dt(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:ee,revalidatingFetchers:j}}function lt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ut(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lt(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 dt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function ft(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function pt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function mt(e,t,n,r,i,a){let o;if(e){let t=r[e];u(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=>ht(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=D(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]=D([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 ht(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?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>ht(e,t)))??!1}var gt=new WeakMap,_t=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(u(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=gt.get(i);o||(o={},gt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=S(e),n=i[e]!==void 0;if(t)d(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)d(!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},vt=new WeakMap;function yt(e,t,n,r,i){let a=n[e.id];if(u(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=vt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{u(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=w(e),o=a[e]!==void 0;i?d(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?d(!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 vt.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=_t({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 bt(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 xt(e){return e.matches.some(e=>e.route.middleware)?St(e,()=>bt(e)):bt(e)}function St(e,t){return Ct(e,t,e=>{if(nn(e))throw e;return e},Yt,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Ut(r,a).route.id]:{type:`error`,result:t}}}}}async function Ct(e,t,n,r,i){let{matches:a,...o}=e;return await wt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function wt(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 wt(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 Tt(e,t,n,r,i){let a=_t({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=yt(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Et(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Tt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?pt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?pt(a,{...l,defaultShouldRevalidate:e}):pt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?kt({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 Dt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Et(e,t,n,r,Ee(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Tt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ot(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:De(t,n),pattern:Ee(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 St(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 kt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(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:De(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 J(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 J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function At(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 jt(e){let{result:t,type:n}=e;if(en(t)){let e;try{e=await At(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new we(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?$t(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:Jt(t),statusCode:Te(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Te(t)?t.status:void 0}:$t(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 Mt(e,t,n,r,i){let a=e.headers.get(`Location`);if(u(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!fe(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 Nt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Pt(e){try{return Nt.includes(new URL(e).protocol)}catch{return!1}}function Ft(e,t,n,r){if(fe(e)){let r=e,o=i.test(r)?new URL(a(r,t.protocol)):new URL(r);if(Pt(o.toString()))throw Error(`Invalid redirect location`);let s=V(o.pathname,n)!=null;if(o.origin===t.origin&&s)return ve(o.pathname)+o.search+o.hash}try{if(Pt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function It(e,t,n,r){let i=e.createURL(Kt(t)).toString(),a={signal:n};if(r&&X(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)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Lt(r.formData):r.formData}return new Request(i,a)}function Lt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},d=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(u(!Qt(p),`Cannot handle redirect results in processLoaderData`),Y(p)){let t=p.error;if(d!==void 0&&(t=d,d=void 0),o||={},i)o[f]=t;else{let n=Ut(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=nt),c||(c=!0,s=Te(p.error)?p.error.status:500),p.headers&&(l[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[f]=p.headers)}),d!==void 0&&n&&(o={[n[0]]:d},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Bt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=zt(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(u(s,`Did not find corresponding fetcher result`),Y(s)){let t=Ut(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Qt(s))u(!1,`Unhandled fetcher revalidation redirect`);else{let e=pn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Vt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==nt).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 Ht(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ut(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Wt(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 J(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 we(e||500,o,Error(s),!0)}function Gt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Qt(r))return{key:n,result:r}}}function Kt(e){return h({...typeof e==`string`?g(e):e,hash:``})}function qt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Jt(e){return new we(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Yt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Xt(t))}function Xt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Zt(e){return en(e.result)&&Xe.has(e.result.status)}function Y(e){return e.type===`error`}function Qt(e){return(e&&e.type)===`redirect`}function $t(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function en(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function tn(e){return Xe.has(e)}function nn(e){return en(e)&&tn(e.status)&&e.headers.has(`Location`)}function rn(e){return Ye.has(e.toUpperCase())}function X(e){return qe.has(e.toUpperCase())}function an(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function on(e,t){let n=typeof t==`string`?g(t).search:t.search;if(e[e.length-1].route.index&&an(n||``))return e[e.length-1];let r=he(e);return r[r.length-1]}function sn(e,t,n){return{url:De(e.createURL(t),t),pattern:n?Ee(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function cn(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 ln(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 un(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 dn(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 fn(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 pn(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 mn(e,t){try{let n=e.sessionStorage.getItem(tt);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 hn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(tt,JSON.stringify(n))}catch(e){d(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function gn(){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 _n=y.createContext(null);_n.displayName=`DataRouter`;var vn=y.createContext(null);vn.displayName=`DataRouterState`;var yn=y.createContext(!1);function bn(){return y.useContext(yn)}var xn=y.createContext({isTransitioning:!1});xn.displayName=`ViewTransition`;var Sn=y.createContext(new Map);Sn.displayName=`Fetchers`;var Cn=y.createContext(null);Cn.displayName=`Await`;var Z=y.createContext(null);Z.displayName=`Navigation`;var wn=y.createContext(null);wn.displayName=`Location`;var Q=y.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var Tn=y.createContext(null);Tn.displayName=`RouteError`;var En=`REACT_ROUTER_ERROR`,Dn=`REDIRECT`,On=`ROUTE_ERROR_RESPONSE`;function kn(e){if(e.startsWith(`${En}:${Dn}:{`))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 An(e){if(e.startsWith(`${En}:${On}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function jn(e,{relative:t}={}){u(Mn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=y.useContext(Z),{hash:i,pathname:a,search:o}=Ln(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:U([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Mn(){return y.useContext(wn)!=null}function $(){return u(Mn(),`useLocation() may be used only in the context of a <Router> component.`),y.useContext(wn).location}var Nn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Pn(){let{isDataRoute:e}=y.useContext(Q);return e?nr():Fn()}function Fn(){u(Mn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=y.useContext(_n),{basename:t,navigator:n}=y.useContext(Z),{matches:r}=y.useContext(Q),{pathname:i}=$(),a=JSON.stringify(ge(r)),o=y.useRef(!1);return y.useLayoutEffect(()=>{o.current=!0}),y.useCallback((r,s={})=>{if(d(o.current,Nn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=_e(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),Ge(typeof r==`string`?r:h(r),n.createHref(c),He(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}y.createContext(null);function In(){let{matches:e}=y.useContext(Q);return e[e.length-1]?.params??{}}function Ln(e,{relative:t}={}){let{matches:n}=y.useContext(Q),{pathname:r}=$(),i=JSON.stringify(ge(n));return y.useMemo(()=>_e(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Rn(e,t){return zn(e,t)}function zn(e,t,n){u(Mn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=y.useContext(Z),{matches:i}=y.useContext(Q),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=$(),l;if(t){let e=typeof t==`string`?g(t):t;u(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let d=l.pathname||`/`,f=d;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):k(e,{pathname:f}),m=Kn(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:U([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:U([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&m?y.createElement(wn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},m):m}function Bn(){let e=$n(),t=Te(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Vn=y.createElement(Bn,null),Hn=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=yn;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=An(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Q.Provider,{value:this.props.routeContext},y.createElement(Tn.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(Wn,{error:e},t):t}},Un=new WeakMap;function Wn({children:e,error:t}){let{basename:n,navigator:r}=y.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=kn(t.digest);if(e){let i=Un.get(t);if(i)throw i;let a=ke(e.location,n),o=a.absoluteURL||a.to;if(Ge(e.location,o,He(r),`allow-explicit`),Pt(o))throw Error(`Invalid redirect location`);if(Oe&&!Un.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 Un.set(t,n),n}}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Gn({routeContext:e,match:t,children:n}){let r=y.useContext(_n);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Q.Provider,{value:e},n)}function Kn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ee(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Vn,o&&(s<0&&c===0?(ir(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?y.createElement(n.route.Component,null):n.route.element?n.route.element:e,y.createElement(Gn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?y.createElement(Hn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function qn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jn(e){let t=y.useContext(_n);return u(t,qn(e)),t}function Yn(e){let t=y.useContext(vn);return u(t,qn(e)),t}function Xn(e){let t=y.useContext(Q);return u(t,qn(e)),t}function Zn(e){let t=Xn(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Qn(){return Zn(`useRouteId`)}function $n(){let e=y.useContext(Tn),t=Yn(`useRouteError`),n=Zn(`useRouteError`);return e===void 0?t.errors?.[n]:e}var er=0;function tr(e){let{router:t,basename:n}=Jn(`useBlocker`),r=Yn(`useBlocker`),[i,a]=y.useState(``),o=y.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:V(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:V(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return y.useEffect(()=>{let e=String(++er);return a(e),()=>t.deleteBlocker(e)},[t]),y.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):et}function nr(){let{router:e}=Jn(`useNavigate`),t=Zn(`useNavigate`),n=y.useRef(!1);return y.useLayoutEffect(()=>{n.current=!0}),y.useCallback(async(r,i={})=>{d(n.current,Nn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var rr={};function ir(e,t,n){!t&&!rr[e]&&(rr[e]=!0,d(!1,n))}var ar={};function or(e,t){!e&&!ar[t]&&(ar[t]=!0,console.warn(t))}var sr=[`HydrateFallback`,`hydrateFallbackElement`],cr=class{status=`pending`;promise;resolve;reject;constructor(){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 lr({router:e,flushSync:t,onError:n,useTransitions:r}){r=bn()||r;let[i,a]=y.useState(e.state),[o,s]=(0,y.useOptimistic)(i),[c,l]=y.useState(),[u,d]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,h]=y.useState(),[g,_]=y.useState(),v=y.useRef(new Map),b=y.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ee(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),or(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(or(g==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."),!g||!b){t&&u?t(()=>a(i)):r===!1?a(i):y.startTransition(()=>{r===!0&&s(e=>ur(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);y.useLayoutEffect(()=>e.subscribe(b),[e,b]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new cr)},[u]),y.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):y.startTransition(()=>{r===!0&&s(e=>ur(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),y.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),y.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=y.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,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=y.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return y.createElement(y.Fragment,null,y.createElement(_n.Provider,{value:C},y.createElement(vn.Provider,{value:o},y.createElement(Sn.Provider,{value:v.current},y.createElement(xn.Provider,{value:u},y.createElement(hr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},y.createElement(dr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function ur(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 dr=y.memo(fr);function fr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return zn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function pr({to:e,replace:t,state:n,relative:r}){u(Mn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=y.useContext(Z);d(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=y.useContext(Q),{pathname:s}=$(),c=Pn(),l=_e(e,ge(o),s,r===`path`);Ge(typeof e==`string`?e:h(e),a.createHref(l),He(a),`reject`);let f=JSON.stringify(l);return y.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function mr(e){u(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function hr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){u(!Mn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=y.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=g(n));let{pathname:l=`/`,search:f=``,hash:p=``,state:m=null,key:h=`default`,mask:_}=n,v=y.useMemo(()=>{let e=V(l,s);return e==null?null:{location:{pathname:e,search:f,hash:p,state:m,key:h,mask:_},navigationType:r}},[s,l,f,p,m,h,r,_]);return d(v!=null,`<Router basename="${s}"> is not able to match the URL "${l}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:y.createElement(Z.Provider,{value:c},y.createElement(wn.Provider,{children:t,value:v}))}function gr({children:e,location:t}){return Rn(_r(e),t)}y.Component;function _r(e,t=[]){let n=[];return y.Children.forEach(e,(e,r)=>{if(!y.isValidElement(e))return;let i=[...t,r];if(e.type===y.Fragment){n.push.apply(n,_r(e.props.children,i));return}u(e.type===mr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;u(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=_r(a.children,i)),n.push(o)}),n}var vr=`application/x-www-form-urlencoded`;function yr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function br(e){return yr(e)&&e.tagName.toLowerCase()===`button`}function xr(e){return yr(e)&&e.tagName.toLowerCase()===`form`}function Sr(e){return yr(e)&&e.tagName.toLowerCase()===`input`}function Cr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wr(e,t){return e.button===0&&(!t||t===`_self`)&&!Cr(e)}function Tr(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 Er(e,t){let n=Tr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Dr=null;function Or(){if(Dr===null)try{new FormData(document.createElement(`form`),0),Dr=!1}catch{Dr=!0}return Dr}var kr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ar(e){return e!=null&&!kr.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vr}"`),null):e}function jr(e,t){let n,r,i,a,o;if(xr(e)){let o=e.getAttribute(`action`);r=o?V(o,t):null,n=e.getAttribute(`method`)||`get`,i=Ar(e.getAttribute(`enctype`))||vr,a=new FormData(e)}else if(br(e)||Sr(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?V(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Ar(e.getAttribute(`formenctype`))||Ar(o.getAttribute(`enctype`))||vr,a=new FormData(o,e),!Or()){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(yr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,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}}function Mr(e,t){if(e===!1||e==null)throw Error(t)}function Nr(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}async function Pr(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Fr(e){return e!=null&&typeof e.page==`string`}function Ir(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 Lr(e,t,n){return Hr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ir).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Rr(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 zr(e,t,{includeHydrateFallback:n}={}){return Br(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 Br(e){return[...new Set(e)]}function Vr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Hr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Fr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Vr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ur(){let e=y.useContext(_n);return Mr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Wr(){let e=y.useContext(vn);return Mr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Gr=y.createContext(void 0);Gr.displayName=`FrameworkContext`;function Kr(){let e=y.useContext(Gr);return Mr(e,`You must render this element inside a <HydratedRouter> element`),e}function qr(e,t){let n=y.useContext(Gr),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=y.useRef(null);y.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),y.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Jr(s,p),onBlur:Jr(c,m),onMouseEnter:Jr(l,p),onMouseLeave:Jr(u,m),onTouchStart:Jr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Jr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Yr({page:e,...t}){let n=bn(),{nonce:r}=Kr(),{router:i}=Ur(),a=y.useMemo(()=>k(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?y.createElement(Zr,{page:e,matches:a,...t}):y.createElement(Qr,{page:e,matches:a,...t})):null}function Xr(e){let{manifest:t,routeModules:n}=Kr(),[r,i]=y.useState([]);return y.useEffect(()=>{let r=!1;return Lr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Zr({page:e,matches:t,...n}){let r=$(),i=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Nr(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return y.createElement(y.Fragment,null,i.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Qr({page:e,matches:t,...n}){let r=$(),{manifest:i,routeModules:a}=Kr(),{loaderData:o,matches:s}=Wr(),c=y.useMemo(()=>Rr(e,t,s,i,r,`data`),[e,t,s,i,r]),l=y.useMemo(()=>Rr(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=Nr(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=y.useMemo(()=>zr(l,i),[l,i]),f=Xr(l);return y.createElement(y.Fragment,null,u.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>y.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>y.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function $r(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var ei=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ei&&(window.__reactRouterVersion=`8`)}catch{}function ti(e,t){return it({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:c({window:t?.window}),hydrationData:t?.hydrationData||ri(),routes:e,mapRouteProperties:E,hydrationRouteProperties:sr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ni(e,t){return it({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:l({window:t?.window}),hydrationData:t?.hydrationData||ri(),routes:e,mapRouteProperties:E,hydrationRouteProperties:sr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ri(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ii(e.errors)}),e}function ii(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 we(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ce.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}var ai=y.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`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}=y.useContext(Z),b=typeof u==`string`&&r.test(u),x=ke(u,g);u=x.to;let S=jn(u,{relative:i}),C=$(),w=null;if(s){let e=_e(s,[],C.mask?C.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:U([g,e.pathname])),w=_.createHref(e)}let[T,E,D]=qr(n,m),O=ui(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),ee=y.createElement(`a`,{...m,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:$r(h,E),target:l,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?y.createElement(y.Fragment,null,ee,y.createElement(Yr,{page:S})):ee});ai.displayName=`Link`;var oi=y.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ln(a,{relative:c.relative}),d=$(),f=y.useContext(vn),{navigator:p,basename:m}=y.useContext(Z),h=f!=null&&gi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=V(v,m)||v);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return y.createElement(ai,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});oi.displayName=`NavLink`;var si=y.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=y.useContext(Z),_=mi(),v=hi(c,{relative:u}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&r.test(c);return y.createElement(`form`,{ref:h,method:b,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute(`formmethod`)||s,c=()=>_(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?y.startTransition(()=>c()):c()},...m,"data-discover":!x&&e===`render`?`true`:void 0})});si.displayName=`Form`;function ci(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function li(e){let t=y.useContext(_n);return u(t,ci(e)),t}function ui(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Pn(),d=$(),f=Ln(e,{relative:o});return y.useCallback(p=>{if(wr(p,t)){p.preventDefault();let t=n===void 0?h(d)===h(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?y.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function di(e){d(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=y.useRef(Tr(e)),n=y.useRef(!1),r=$(),i=y.useMemo(()=>Er(r.search,n.current?null:t.current),[r.search]),a=Pn();return[i,y.useCallback((e,t)=>{let r=Tr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var fi=0,pi=()=>`__${String(++fi)}__`;function mi(){let{router:e}=li(`useSubmit`),{basename:t}=y.useContext(Z),n=Qn(),r=e.fetch,i=e.navigate;return y.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=jr(e,t);a.navigate===!1?await r(a.fetcherKey||pi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function hi(e,{relative:t}={}){let{basename:n}=y.useContext(Z),r=y.useContext(Q);u(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ln(e||`.`,{relative:t})},o=$();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:U([n,a.pathname])),h(a)}function gi(e,{relative:t}={}){let n=y.useContext(xn);u(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=li(`useViewTransitionState`),i=Ln(e,{relative:t});if(!n.isTransitioning)return!1;let a=V(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=V(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ce(i.pathname,o)!=null||ce(i.pathname,a)!=null}export{pr as a,gr as c,Pn as d,In as f,di as i,tr as l,Te as m,ti as n,mr as o,$n as p,ni as r,lr as s,ai as t,$ as u};
|