libre-webui 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -15
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +9 -0
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/persistence/postgresMigrationRegistry.d.ts.map +1 -1
- package/backend/dist/persistence/postgresMigrationRegistry.js +2 -0
- package/backend/dist/persistence/postgresMigrationRegistry.js.map +1 -1
- package/backend/dist/persistence/postgresPersonalAutomationsMigration.d.ts +8 -0
- package/backend/dist/persistence/postgresPersonalAutomationsMigration.d.ts.map +1 -0
- package/backend/dist/persistence/postgresPersonalAutomationsMigration.js +98 -0
- package/backend/dist/persistence/postgresPersonalAutomationsMigration.js.map +1 -0
- package/backend/dist/persistence/postgresResourceRepositories.d.ts.map +1 -1
- package/backend/dist/persistence/postgresResourceRepositories.js +274 -0
- package/backend/dist/persistence/postgresResourceRepositories.js.map +1 -1
- package/backend/dist/persistence/resourceTypes.d.ts +83 -2
- package/backend/dist/persistence/resourceTypes.d.ts.map +1 -1
- package/backend/dist/persistence/resourceTypes.js.map +1 -1
- package/backend/dist/persistence/sqliteMigrations.d.ts +1 -0
- package/backend/dist/persistence/sqliteMigrations.d.ts.map +1 -1
- package/backend/dist/persistence/sqliteMigrations.js +181 -0
- package/backend/dist/persistence/sqliteMigrations.js.map +1 -1
- package/backend/dist/persistence/sqliteResourceRepositories.d.ts.map +1 -1
- package/backend/dist/persistence/sqliteResourceRepositories.js +233 -0
- package/backend/dist/persistence/sqliteResourceRepositories.js.map +1 -1
- package/backend/dist/persistence/sqliteToPostgresMigration.d.ts.map +1 -1
- package/backend/dist/persistence/sqliteToPostgresMigration.js +41 -0
- package/backend/dist/persistence/sqliteToPostgresMigration.js.map +1 -1
- package/backend/dist/platform/jobs/domainJobContracts.d.ts +3 -0
- package/backend/dist/platform/jobs/domainJobContracts.d.ts.map +1 -1
- package/backend/dist/platform/jobs/domainJobContracts.js +3 -0
- package/backend/dist/platform/jobs/domainJobContracts.js.map +1 -1
- package/backend/dist/platform/jobs/domainJobHandlers.d.ts.map +1 -1
- package/backend/dist/platform/jobs/domainJobHandlers.js +101 -1
- package/backend/dist/platform/jobs/domainJobHandlers.js.map +1 -1
- package/backend/dist/routes/automations.d.ts +3 -0
- package/backend/dist/routes/automations.d.ts.map +1 -0
- package/backend/dist/routes/automations.js +232 -0
- package/backend/dist/routes/automations.js.map +1 -0
- package/backend/dist/routes/calendar.d.ts +3 -0
- package/backend/dist/routes/calendar.d.ts.map +1 -0
- package/backend/dist/routes/calendar.js +206 -0
- package/backend/dist/routes/calendar.js.map +1 -0
- package/backend/dist/routes/chat.d.ts.map +1 -1
- package/backend/dist/routes/chat.js +99 -7
- package/backend/dist/routes/chat.js.map +1 -1
- package/backend/dist/routes/ollama.d.ts.map +1 -1
- package/backend/dist/routes/ollama.js +4 -1
- package/backend/dist/routes/ollama.js.map +1 -1
- package/backend/dist/routes/search.d.ts.map +1 -1
- package/backend/dist/routes/search.js +5 -3
- package/backend/dist/routes/search.js.map +1 -1
- package/backend/dist/services/automationSchedulerService.d.ts +28 -0
- package/backend/dist/services/automationSchedulerService.d.ts.map +1 -0
- package/backend/dist/services/automationSchedulerService.js +191 -0
- package/backend/dist/services/automationSchedulerService.js.map +1 -0
- package/backend/dist/services/automationService.d.ts +53 -0
- package/backend/dist/services/automationService.d.ts.map +1 -0
- package/backend/dist/services/automationService.js +224 -0
- package/backend/dist/services/automationService.js.map +1 -0
- package/backend/dist/services/chatGenerationService.d.ts.map +1 -1
- package/backend/dist/services/chatGenerationService.js +7 -1
- package/backend/dist/services/chatGenerationService.js.map +1 -1
- package/backend/dist/services/chatService.d.ts +9 -1
- package/backend/dist/services/chatService.d.ts.map +1 -1
- package/backend/dist/services/chatService.js +91 -13
- package/backend/dist/services/chatService.js.map +1 -1
- package/backend/dist/services/contextCompactionService.d.ts +11 -6
- package/backend/dist/services/contextCompactionService.d.ts.map +1 -1
- package/backend/dist/services/contextCompactionService.js +127 -27
- package/backend/dist/services/contextCompactionService.js.map +1 -1
- package/backend/dist/services/durableChatGenerationService.d.ts.map +1 -1
- package/backend/dist/services/durableChatGenerationService.js +15 -3
- package/backend/dist/services/durableChatGenerationService.js.map +1 -1
- package/backend/dist/services/ollamaService.d.ts.map +1 -1
- package/backend/dist/services/ollamaService.js +9 -2
- package/backend/dist/services/ollamaService.js.map +1 -1
- package/backend/dist/services/pluginService.d.ts +10 -0
- package/backend/dist/services/pluginService.d.ts.map +1 -1
- package/backend/dist/services/pluginService.js +42 -7
- package/backend/dist/services/pluginService.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +3 -0
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/services/titleGenerationService.d.ts.map +1 -1
- package/backend/dist/services/titleGenerationService.js +5 -1
- package/backend/dist/services/titleGenerationService.js.map +1 -1
- package/backend/dist/services/webSearchPlanService.d.ts +18 -0
- package/backend/dist/services/webSearchPlanService.d.ts.map +1 -0
- package/backend/dist/services/webSearchPlanService.js +160 -0
- package/backend/dist/services/webSearchPlanService.js.map +1 -0
- package/backend/dist/services/webSearchService.d.ts +9 -3
- package/backend/dist/services/webSearchService.d.ts.map +1 -1
- package/backend/dist/services/webSearchService.js +8 -2
- package/backend/dist/services/webSearchService.js.map +1 -1
- package/backend/dist/storage.d.ts +7 -1
- package/backend/dist/storage.d.ts.map +1 -1
- package/backend/dist/storage.js +65 -1
- package/backend/dist/storage.js.map +1 -1
- package/backend/dist/types/index.d.ts +79 -0
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/dist/types/index.js.map +1 -1
- package/backend/dist/utils/automationSchedule.d.ts +26 -0
- package/backend/dist/utils/automationSchedule.d.ts.map +1 -0
- package/backend/dist/utils/automationSchedule.js +231 -0
- package/backend/dist/utils/automationSchedule.js.map +1 -0
- package/backend/dist/utils/chatContext.d.ts +7 -0
- package/backend/dist/utils/chatContext.d.ts.map +1 -1
- package/backend/dist/utils/chatContext.js +13 -2
- package/backend/dist/utils/chatContext.js.map +1 -1
- package/backend/dist/utils/openAIResponsesAdapter.d.ts.map +1 -1
- package/backend/dist/utils/openAIResponsesAdapter.js +3 -1
- package/backend/dist/utils/openAIResponsesAdapter.js.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.d.ts +1 -0
- package/backend/dist/utils/pluginChatAdapter.d.ts.map +1 -1
- package/backend/dist/utils/pluginChatAdapter.js +82 -19
- package/backend/dist/utils/pluginChatAdapter.js.map +1 -1
- package/backend/dist/utils/pluginModelCatalog.d.ts +20 -0
- package/backend/dist/utils/pluginModelCatalog.d.ts.map +1 -1
- package/backend/dist/utils/pluginModelCatalog.js +101 -9
- package/backend/dist/utils/pluginModelCatalog.js.map +1 -1
- package/backend/dist/utils/resourceLimits.d.ts +7 -0
- package/backend/dist/utils/resourceLimits.d.ts.map +1 -1
- package/backend/dist/utils/resourceLimits.js +7 -0
- package/backend/dist/utils/resourceLimits.js.map +1 -1
- package/backend/dist/utils/thinkingOptions.d.ts +23 -3
- package/backend/dist/utils/thinkingOptions.d.ts.map +1 -1
- package/backend/dist/utils/thinkingOptions.js +35 -9
- package/backend/dist/utils/thinkingOptions.js.map +1 -1
- package/backend/dist/websocketServer.d.ts.map +1 -1
- package/backend/dist/websocketServer.js +9 -3
- package/backend/dist/websocketServer.js.map +1 -1
- package/backend/package.json +1 -1
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/assets/index-6o-Hc2wS.js +41 -0
- package/frontend/dist/assets/index-D-pM957b.css +1 -0
- package/frontend/dist/index.html +12 -12
- package/frontend/dist/js/ArtifactContainer-CpUi6ekF.js +1 -0
- package/frontend/dist/js/{ArtifactDemoPage-TONeQvof.js → ArtifactDemoPage-BeNs3gHp.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-CV2XXu_t.js → ArtifactSandboxFrame-qsj_Y3LV.js} +2 -2
- package/frontend/dist/js/ArtifactSlideOutPanel-CSFRluWA.js +1 -0
- package/frontend/dist/js/AutomationsPage-KUeWoZNv.js +1 -0
- package/frontend/dist/js/CalendarPage-D9I972w8.js +1 -0
- package/frontend/dist/js/ChatPage-CmBx4oAL.js +16 -0
- package/frontend/dist/js/{FirstTimeSetup-smhj0X6o.js → FirstTimeSetup-Df0YJni3.js} +1 -1
- package/frontend/dist/js/GalleryPage-bLCrdJN_.js +1 -0
- package/frontend/dist/js/HomePage-Uc6PEg-U.js +1 -0
- package/frontend/dist/js/{LibreClawPage-CRKei1MM.js → LibreClawPage-CG63DHg1.js} +1 -1
- package/frontend/dist/js/{ModelManagerModals-D0amaOnl.js → ModelManagerModals-DcLGYN3l.js} +1 -1
- package/frontend/dist/js/ModelSelector-yxJC64rM.js +1 -0
- package/frontend/dist/js/ModelsPage-1R_TxgmJ.js +2 -0
- package/frontend/dist/js/NotesPage-L65j5HoW.js +1 -0
- package/frontend/dist/js/PersonasPage-CKeBpHIH.js +13 -0
- package/frontend/dist/js/PluginUsagePage-BX1SKMbW.js +1 -0
- package/frontend/dist/js/{RichMessageContent-Bxi_u0gC.js → RichMessageContent-DiySVYGB.js} +1 -1
- package/frontend/dist/js/SettingsModal-68SG1uZ2.js +1 -0
- package/frontend/dist/js/SystemPage-CytpZiQV.js +1 -0
- package/frontend/dist/js/UserManagementPage-BzJBvZiS.js +1 -0
- package/frontend/dist/js/WorkPage-C8gr0QJe.js +6 -0
- package/frontend/dist/js/api-BDtqBtqw.js +14 -0
- package/frontend/dist/js/{appStore-CJtomipz.js → appStore-0JnCUlEq.js} +2 -2
- package/frontend/dist/js/ar-CSpi37Gr.js +2 -0
- package/frontend/dist/js/{authStore-BckFDL70.js → authStore-DbMdvNgJ.js} +3 -3
- package/frontend/dist/js/{babel-D24oDI9y.js → babel-BsYoxD-7.js} +1 -1
- package/frontend/dist/js/bn-CyH1BeDD.js +2 -0
- package/frontend/dist/js/calendarDates-Co3o_05Y.js +1 -0
- package/frontend/dist/js/chatStore-CHQ2uINS.js +3 -0
- package/frontend/dist/js/{config-CNVNpf_q.js → config-DSOYQ9a3.js} +1 -1
- package/frontend/dist/js/cs-Cv2NfRK5.js +2 -0
- package/frontend/dist/js/da-D6D6IvPK.js +2 -0
- package/frontend/dist/js/de-BNoJJTrT.js +2 -0
- package/frontend/dist/js/es-kzo9C7q_.js +2 -0
- package/frontend/dist/js/{estree-D1TYSBcf.js → estree-BcnBcOAx.js} +7 -7
- package/frontend/dist/js/fr-CjHYvJRp.js +2 -0
- package/frontend/dist/js/hi-BU98AdCQ.js +2 -0
- package/frontend/dist/js/{html-Dmddj0zf.js → html-DkY55Jys.js} +10 -10
- package/frontend/dist/js/id-CpdedejX.js +2 -0
- package/frontend/dist/js/is-Cp5dDWBH.js +2 -0
- package/frontend/dist/js/it-CuH_cK4U.js +2 -0
- package/frontend/dist/js/ja-BWXXXiHn.js +2 -0
- package/frontend/dist/js/ko-DQgv2M1t.js +2 -0
- package/frontend/dist/js/{markdown-Bl_LsHEk.js → markdown-IZSI9DXw.js} +6 -6
- package/frontend/dist/js/{messageCodeStyles-CgKxn4tN.js → messageCodeStyles-BFNR9Wv6.js} +2 -2
- package/frontend/dist/js/ms-DCcRoIcX.js +2 -0
- package/frontend/dist/js/nl-CbKR1_EU.js +2 -0
- package/frontend/dist/js/pl-CRyJZccn.js +2 -0
- package/frontend/dist/js/{postcss-Bx9CTcIc.js → postcss-BJ0okz7n.js} +1 -1
- package/frontend/dist/js/pt-BXYmHFGH.js +2 -0
- package/frontend/dist/js/{router-vendor-CbPDks39.js → router-vendor-DGFGM3EP.js} +1 -1
- package/frontend/dist/js/ru-M9SyZG4b.js +2 -0
- package/frontend/dist/js/{standalone-BWau8hEE.js → standalone-Csw3jfJ_.js} +5 -5
- package/frontend/dist/js/sv-DJ486LTU.js +2 -0
- package/frontend/dist/js/th-Ch7gKtZv.js +2 -0
- package/frontend/dist/js/tr-ClehWhSC.js +2 -0
- package/frontend/dist/js/{typescript-DxGn3Yn-.js → typescript-CnF4UVx7.js} +2 -2
- package/frontend/dist/js/{ui-jlx9WA5A.js → ui-CC-K19wO.js} +2 -2
- package/frontend/dist/js/ui-vendor-B1UgO3vd.js +177 -0
- package/frontend/dist/js/uk-BqAd5zHF.js +2 -0
- package/frontend/dist/js/{vi-BgRaIrQC.js → vi-D9gjlDVB.js} +2 -2
- package/frontend/dist/js/{workApi-DWRpZ_cq.js → workApi-C3uy9EDT.js} +3 -3
- package/frontend/dist/js/{yaml-DioTxVLA.js → yaml-DzT5hBSH.js} +5 -5
- package/frontend/dist/js/zh-DKTyHkiR.js +2 -0
- package/package.json +2 -2
- package/frontend/dist/assets/index-BlTbxYPP.js +0 -33
- package/frontend/dist/assets/index-CbiWSGOj.css +0 -1
- package/frontend/dist/js/ArtifactContainer-C-n1vPsA.js +0 -1
- package/frontend/dist/js/ArtifactSlideOutPanel-2exw7YqL.js +0 -1
- package/frontend/dist/js/ChatPage-wnyG_TyC.js +0 -23
- package/frontend/dist/js/GalleryPage-BZfeWlBg.js +0 -1
- package/frontend/dist/js/HomePage-gf4GgI6z.js +0 -1
- package/frontend/dist/js/ModelSelector-C5Tn6y0p.js +0 -1
- package/frontend/dist/js/ModelsPage-Rbags4Xq.js +0 -2
- package/frontend/dist/js/NotesPage-9NR9HZZ8.js +0 -1
- package/frontend/dist/js/PersonasPage-DYP67Qiy.js +0 -13
- package/frontend/dist/js/PluginUsagePage-QtCgymRu.js +0 -1
- package/frontend/dist/js/SettingsModal-B4RelkLP.js +0 -1
- package/frontend/dist/js/SystemPage-xFSTYdBS.js +0 -1
- package/frontend/dist/js/UserManagementPage-Cp430WCP.js +0 -1
- package/frontend/dist/js/WorkPage-DFES41Qm.js +0 -6
- package/frontend/dist/js/api-DUUxxx_B.js +0 -14
- package/frontend/dist/js/ar-DMH3qbt6.js +0 -2
- package/frontend/dist/js/bn-CGDX8khx.js +0 -2
- package/frontend/dist/js/chatStore-DK-_wd-j.js +0 -3
- package/frontend/dist/js/cs-CJLgUk3m.js +0 -2
- package/frontend/dist/js/da-DnZMnCVM.js +0 -2
- package/frontend/dist/js/de-CWpguVQ5.js +0 -2
- package/frontend/dist/js/es-DVU1vjm0.js +0 -2
- package/frontend/dist/js/fr-pWnSnypD.js +0 -2
- package/frontend/dist/js/hi-B6xDfxA5.js +0 -2
- package/frontend/dist/js/id-BThSTUAG.js +0 -2
- package/frontend/dist/js/is-BOohDFie.js +0 -2
- package/frontend/dist/js/it-BdRArcCC.js +0 -2
- package/frontend/dist/js/ja-5Cq35sMr.js +0 -2
- package/frontend/dist/js/ko-BlzNRtpQ.js +0 -2
- package/frontend/dist/js/ms-CtGeurkZ.js +0 -2
- package/frontend/dist/js/nl-MKPHGjVF.js +0 -2
- package/frontend/dist/js/pl-BwBrqCey.js +0 -2
- package/frontend/dist/js/pt-CKzoHWBB.js +0 -2
- package/frontend/dist/js/ru-BQC4jh0Y.js +0 -2
- package/frontend/dist/js/sv-Cm0qXxzM.js +0 -2
- package/frontend/dist/js/th-DUPbiRI2.js +0 -2
- package/frontend/dist/js/tr-AsFu_Br5.js +0 -2
- package/frontend/dist/js/ui-vendor-54SgntkX.js +0 -177
- package/frontend/dist/js/uk-DrMMOZ17.js +0 -2
- package/frontend/dist/js/zh-B4rcgcAy.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{m as t}from"./markdown-core-BmPPZiuD.js";var n=e(t(),1);function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function o(e,t,n){return e.set(a(e,t),n),n}function s(e,t){return e.get(a(e,t))}var c=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l=/^[\\/]{2}/;function u(e,t){return t+e.replace(/\\/g,`/`)}var d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return y(``,{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:b(t)}return S(t,n,null,e)}function m(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=x(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),y(``,{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:b(t))}function r(e,t){g(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return S(t,n,r,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(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 y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({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 x(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 S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),p=_.createHref(r.mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&l.test(i)&&(i=r+i),new URL(i,r)}function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,k=(O=new WeakMap,class{constructor(e){if(i(this,O,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(s(O,this).has(e))return s(O,this).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){s(O,this).set(e,t)}}),A=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function j(e){return A.has(e)}var M=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ee(e){return M.has(e)}function N(e){return e.index===!0}function P(e){let t={};return e.Component&&Object.assign(t,{element:n.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function te(e,t=P,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(h(e.index!==!0||!e.children,`Cannot specify children on an index route`),h(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),N(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=te(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ne(e,t,n=`/`){return re(e,t,n,!1)}function re(e,t,n,r,i){let a=H((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??I(e),s=null,c=ve(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function ie(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 I(e){let t=ae(e);return L(t),t}function ae(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;h(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]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=_e(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(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=oe(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 L(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=/^:[\w-]+/,le=3.5,ue=3,de=2,R=1,z=10,B=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=B),t&&(r+=de),n.filter(e=>!fe(e)).reduce((e,t)=>e+(se.test(t)?ue:ce.test(t)?le:t===``?R:z),r)}function me(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 he(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?V(u,l,s.matcher,s.compiledParams):ge(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ge({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:ke(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t=!1,n=!0){g(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 ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ye({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var be=e=>c.test(e);function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=De(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function Se(e,t){let n=Oe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(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 we(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Te(e){let t=we(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ee(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),Ce(`#`,`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=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var De=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>De(e.join(`/`)),Oe=e=>e.replace(/\/+$/,``),ke=e=>Oe(e).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],W=class{constructor(e,t,n,r=!1){D(this,`status`,void 0),D(this,`statusText`,void 0),D(this,`data`,void 0),D(this,`error`,void 0),D(this,`internal`,void 0),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Pe(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function Fe(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?x(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 Ie=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Le(e,t){let n=e;if(typeof n!=`string`||!c.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ie)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var G=Symbol(`Uninstrumented`),Re=new WeakMap;function ze(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)=>K(await q(n.lazy,void 0,()=>e(...t),J))}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)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),J))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),J))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),J))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ve(t.loader),i=async(...t)=>K(await q(n.loader,Ge(t[0]),()=>e(...t),J));e.hydrate===!0&&(i.hydrate=!0),He(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ve(t.action),i=async(...t)=>K(await q(n.action,Ge(t[0]),()=>e(...t),J));He(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ve(e),r=async(...e)=>K(await q(n.middleware,Ge(e[0]),()=>t(...e),J));return He(r,t),r})),r}function Be(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=Ve(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?b(i):`.`,...Ke(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Ue(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:o})))};He(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ve(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...Ke(e,s??{})},async()=>{let n=Ue(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:c})))};He(r,t),e.fetch=r}return e}function Ve(e){return e[G]??e}function He(e,t){e[G]=t}function Ue(e,t){return Re.set(e,t),()=>{Re.get(e)===t&&Re.delete(e)}}function We(e){let t=Re.get(e);return Re.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(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=q(e,t,n,r,i,a-1),await s,h(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 J(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Ge(e){let{request:t,context:n,params:r}=e;return{...e,request:qe(t),params:{...r},context:Je(n)}}function Ke(e,t){return{currentUrl:b(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 qe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Je(e){return{get:t=>e.get(t)}}var Ye,Xe,Y,Ze,Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},st=`remix-router-transitions`,ct=Symbol(`ResetLoaderData`),lt=(Ye=new WeakMap,Xe=new WeakMap,Y=new WeakMap,Ze=new WeakMap,class{constructor(e){i(this,Ye,void 0),i(this,Xe,void 0),i(this,Y,void 0),i(this,Ze,void 0),o(Ye,this,e),o(Xe,this,I(e))}get stableRoutes(){return s(Ye,this)}get activeRoutes(){return s(Y,this)??s(Ye,this)}get branches(){return s(Ze,this)??s(Xe,this)}get hasHMRRoutes(){return s(Y,this)!=null}setRoutes(e){o(Ye,this,e),o(Xe,this,I(e))}setHmrRoutes(e){o(Y,this,e),o(Ze,this,I(e))}commitHmrRoutes(){s(Y,this)&&(o(Ye,this,s(Y,this)),o(Xe,this,s(Ze,this)),o(Y,this,void 0),o(Ze,this,void 0))}});function ut(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;h(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...ze(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new lt(te(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Dt,u={...e.future},d=null,f=new Set,p=null,m=null,_=null,v=null,b=e.hydrationData!=null,S=re(s.activeRoutes,e.history.location,c,!1,s.branches),w=!1,T=null,E,D;if(S==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Xt(s.activeRoutes);E=!0,D=!E,S=n,T={[r.id]:t}}else if(S&&!e.hydrationData&&Xe(S,s.activeRoutes,e.history.location.pathname).active&&(S=null),!S){E=!1,D=!E,S=[];let t=Xe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(w=!0,S=t.matches)}else if(S.some(e=>e.route.lazy))E=!1,D=!E;else if(!S.some(e=>ht(e.route)))E=!0,D=!E;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=S;if(n){let e=S.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}D=!1,E=!0,r.forEach(e=>{let r=gt(e.route,t,n);D=D||r.renderFallback,E=E&&!r.shouldLoad})}let O,A={historyAction:e.history.action,location:e.history.location,matches:S,initialized:E,renderFallback:D,navigation:it,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||T,fetchers:new Map,blockers:new Map},j=`POP`,M=null,ee=!1,N,P=!1,F=new Map,ne=null,I=!1,ae=!1,oe=new Set,L=new Map,se=0,ce=-1,le=new Map,ue=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}g(B.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=J({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),q(i,{state:`blocked`,location:n,proceed(){q(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,ot),V({blockers:e})}}),M?.resolve(),M=null;return}return xe(t,n)}),n){bn(t,F);let e=()=>xn(t,F);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||xe(`POP`,A.location,{initialHydration:!0}),O}function he(){d&&d(),ne&&ne(),f.clear(),N&&N.abort(),A.fetchers.forEach((e,t)=>Ie(A.fetchers,t)),A.blockers.forEach((e,t)=>K(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(A,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!A.fetchers.has(e)&&!L.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ie(A.fetchers,e)),r.forEach(e=>A.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?qt(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,c=A.blockers;c.size>0&&!I&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=!I&&Ye(t,n.matches||A.matches),u=ee===!0||A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),I||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=F.get(A.location.pathname);e&&e.has(t.pathname)?d={currentLocation:A.location,nextLocation:t}:F.has(t.pathname)&&(d={currentLocation:t,nextLocation:A.location})}else if(P){let e=F.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(A.location.pathname,e)),d={currentLocation:A.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,ee=!1,P=!1,I=!1,ae=!1,M?.resolve(),M=null,pe?.resolve(),pe=null}async function ve(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||(M=Sn());let n=M.promise;return e.history.go(t),n}let r=We(O),{path:i,submission:a,error:o}=pt(!1,ft(A.location,A.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?x(n.mask):{...A.location.mask,...n.mask}});let l=A.location,u=y(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=J({currentLocation:l,nextLocation:u,historyAction:f});if(h){q(h,{state:`blocked`,location:u,proceed(){q(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ve(t,n)},reset(){let e=new Map(A.blockers);e.set(h,ot),V({blockers:e})}});return}await xe(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ye(){pe||(pe=Sn()),je(),V({revalidation:`loading`});let e=pe.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(xe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(xe(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:P===!0}),e)}async function xe(t,n,r){N&&N.abort(),N=null,j=t,I=(r&&r.startUninterruptedRevalidation)===!0,Je(A.location,A.matches),ee=(r&&r.preventScrollReset)===!0,P=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:re(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&A.initialized&&!ae&&$t(A.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Xe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=pn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;N=new AbortController;let d=Ht(e.history,n,N.signal,r&&r.submission),f=e.getContext?await e.getContext():new k,p;if(r&&r.pendingError)p=[Yt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let i=await Se(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Z(t)&&Ne(t.error)&&t.error.status===404){N=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=hn(n,a,t,r.submission),o=!1,l.active=!1,d=Ht(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ce(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(N=null,_e(n,{matches:h||a,...Jt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Se(t,n,i,l,u,d,f,p,m={}){if(je(),V({navigation:gn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Y(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ge(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=fn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:X(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Nt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(an(h)){let n;return n=m&&m.replace!=null?m.replace:Vt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===A.location.pathname+A.location.search,await Oe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Z(h)){let e=Yt(l,g.route.id);return(m&&m.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ce(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||hn(n,i,l,p),x=p||m||mn(b),S=!I&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Y(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}=Xt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Yt(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}=Ge(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=mt(t,u,a,o,e.history,A,i,x,n,g?[]:r,g===!0,ae,oe,z,de,ue,C,c,e.patchRoutesOnNavigation!=null,s.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(A.fetchers),t=Ve(e);return _e(n,{matches:i,loaderData:{},errors:v&&Z(v[1])?{[v[0]]:v[1].error}:null,...Jt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{G(e.key),e.controller&&L.set(e.key,e.controller)});let E=()=>T.forEach(e=>G(e.key));N&&N.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ae(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener(`abort`,E),T.forEach(e=>L.delete(e.key));let k=Zt(D);if(k)return await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Zt(O),k)return ue.add(k.key),await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(A.fetchers),{loaderData:M,errors:ee}=Kt(A,i,D,v,T,O,j);g&&A.errors&&(ee={...A.errors,...ee});let P=Ve(j),te=He(ce,j),F=P||te||T.length>0;return{matches:i,loaderData:M,errors:ee,...F?{workingFetchers:j}:{}}}function we(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){let t=new Map(A.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=_n(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=We(O),l=s.activeRoutes,u=ft(A.location,A.matches,c,r,n,i?.relative),d=re(l,u,c,!1,s.branches),f=Xe(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(pn(e.history,u,d)),!d){W(t,n,X(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=pt(!0,u,i);if(h){W(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new k,_=(i&&i.preventScrollReset)===!0;if(m&&Q(m.formMethod)){await De(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:p}),await U(t,n,p,d,g,f.active,a,_,m)}async function De(t,n,i,l,u,d,f,p,m,g){je(),de.delete(t),Me(t,vn(m,A.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Ht(e.history,i,_.signal,m);if(d){let e=await Y(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:f});return}}let y=fn(l,i);if(!y.route.action&&!y.route.lazy){W(t,n,X(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}L.set(t,_);let b=se,x=Nt(a,o,v,i,l,y,r,u),S=await ke(v,i,x,u,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){L.get(t)===_&&L.delete(t);return}if(z.has(t)){if(an(C)||Z(C)){Me(t,yn(void 0));return}}else{if(an(C)){if(L.delete(t),ce>b){Me(t,yn(void 0));return}return ue.add(t),Me(t,_n(m)),Oe(v,C,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Z(C)){W(t,n,C.error);return}}let w=A.navigation.location||A.location,T=Ht(e.history,w,_.signal),E=s.activeRoutes,D=A.navigation.state===`idle`?A.matches:re(E,A.navigation.location,c,!1,s.branches);h(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let{dsMatches:k,revalidatingFetchers:M}=mt(T,u,a,o,e.history,A,D,m,w,r,!1,ae,oe,z,de,ue,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),ee=_n(m,C.data),P=new Map(A.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=_n(void 0,n?n.data:void 0);P.set(t,r),G(t),e.controller&&L.set(t,e.controller)}),V({fetchers:P});let te=()=>M.forEach(e=>G(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Ae(k,M,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),le.delete(t),L.delete(t),M.forEach(e=>L.delete(e.key));let ie=A.fetchers.has(t),I=e=>{if(!ie)return e;let n=new Map(e.fetchers);return n.set(t,yn(C.data)),{...e,fetchers:n}},R=Zt(F);if(R)return A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});if(R=Zt(ne),R)return ue.add(R.key),A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});let B=new Map(A.fetchers);ie&&B.set(t,yn(C.data));let{loaderData:fe,errors:pe}=Kt(A,D,F,void 0,M,ne,B);He(O,B),A.navigation.state===`loading`&&O>ce?(h(j,`Expected pending action`),N&&N.abort(),_e(A.navigation.location,{matches:D,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:qt(A.loaderData,fe,D,pe),fetchers:B}),ae=!1)}async function U(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);Me(t,_n(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ht(e.history,i,m.signal);if(l){let e=await Y(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:u});return}}let g=fn(s,i);L.set(t,m);let _=se,v=await ke(h,i,Nt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(L.get(t)===m&&L.delete(t),!h.signal.aborted){if(z.has(t)){Me(t,yn(void 0));return}if(an(y))if(ce>_){Me(t,yn(void 0));return}else{ue.add(t),await Oe(h,y,!1,{preventScrollReset:d});return}if(Z(y)){W(t,n,y.error);return}Me(t,yn(y.data))}}async function Oe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);h(d,`Expected a Location header on the redirect Response`),d=Vt(d,new URL(r.url),c,e.history);let f=y(A.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(be(d)){let n=C(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}N=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:g,formEncType:_}=A.navigation;!o&&!s&&m&&g&&_&&(o=mn(A.navigation));let v=o||s;rt.has(i.response.status)&&v&&Q(v.formMethod)?await xe(p,f,{submission:{...v,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?P:void 0}):await xe(p,f,{overrideNavigation:hn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?P:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await Pt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.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(rn(r)){let i=r.result;o[t]={type:`redirect`,response:Rt(i,e,t,n,c)}}else o[t]=await Lt(r);return o}async function Ae(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function je(){ae=!0,de.forEach((e,t)=>{L.has(t)&&oe.add(t),G(t)})}function Me(e,t,n={}){let r=new Map(A.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function W(e,t,n,r={}){let i=Yt(A.matches,t),a=new Map(A.fetchers);Ie(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Pe(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),A.fetchers.get(e)||at}function Fe(e,t){G(e,t?.reason),Me(e,yn(null))}function Ie(e,t){let n=A.fetchers.get(t);L.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&G(t),de.delete(t),le.delete(t),ue.delete(t),z.delete(t),oe.delete(t),e.delete(t)}function Le(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(A.fetchers)})}function G(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);h(e,`Expected fetcher: ${n}`);let r=yn(e.data);t.set(n,r)}}function Ve(e){let t=[],n=!1;for(let r of ue){let i=e.get(r);h(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ue.delete(r),t.push(r),n=!0)}return Re(t,e),n}function He(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);h(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),le.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ue(e,t){let n=A.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function K(e){A.blockers.delete(e),B.delete(e)}function q(e,t){let n=A.blockers.get(e)||ot;h(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(A.blockers);r.set(e,t),V({blockers:r})}function J({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&g(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ge(e){let t=X(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Xt(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,v=t,_=n||null,!b&&A.navigation===it){b=!0;let e=Ye(A.location,A.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,v=null,_=null}}function qe(e,t){return _&&_(e,t.map(e=>ie(e,A.loaderData)))||e.key}function Je(e,t){if(m&&v){let n=qe(e,t);m[n]=v()}}function Ye(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Xe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:re(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:re(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Y(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||bt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=re(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=re(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ze(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||(f=re(s.activeRoutes,n,c,!0,u)),!f||Ze(l,f))return{type:`success`,matches:null};l=f}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){o={},s.setHmrRoutes(te(e,a,void 0,o))}function $e(e,t,n=!1){bt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return O={get basename(){return c},get future(){return u},get state(){return A},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Ke,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,resetFetcher:Fe,deleteFetcher:Le,dispose:he,getBlocker:Ue,deleteBlocker:K,patchRoutes:$e,_internalFetchControllers:L,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(O=Be(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function dt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ft(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=Ee(r||`.`,Te(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=dn(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=ye({basename:n,pathname:c.pathname})),b(c)}function pt(e,t,n){if(!n||!dt(n))return{path:t};if(n.formMethod&&!un(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Qt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(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(!Q(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()}}}h(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ut(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ut(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Wt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Wt(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(Q(c.formMethod))return{path:t,submission:c};let l=x(t);return e&&l.search&&dn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:b(l),submission:c}}function mt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Z(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&&Z(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=Pe(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ht(s))f=!1;else if(u){let{shouldLoad:e}=gt(s,a.loaderData,a.errors);f=e}else _t(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Mt(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?vt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Mt(n,r,e,c,k,i,l,t,yt(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=re(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=fn(b,e.path),C=new AbortController,w=Ht(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Nt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Nt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};yt(S,a)&&(T=Nt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ht(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function gt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ht(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 _t(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function vt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function yt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function bt(e,t,n,r,i,a){let o;if(e){let t=r[e];h(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>xt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=te(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]=te([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 xt(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=>xt(e,t)))??!1}var St=new WeakMap,Ct=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(h(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=St.get(i);o||(o={},St.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=j(e),n=i[e]!==void 0;if(t)g(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)g(!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},wt=new WeakMap;function Tt(e,t,n,r,i){let a=n[e.id];if(h(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=wt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{h(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=ee(e),o=a[e]!==void 0;i?g(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?g(!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 wt.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=Ct({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 Et(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 Dt(e){return e.matches.some(e=>e.route.middleware)?Ot(e,()=>Et(e)):Et(e)}function Ot(e,t){return kt(e,t,e=>{if(ln(e))throw e;return e},tn,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{[Yt(r,a).route.id]:{type:`error`,result:t}}}}}async function kt(e,t,n,r,i){let{matches:a,...o}=e;return await At(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function At(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 At(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 jt(e,t,n,r,i){let a=Ct({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Tt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Mt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=jt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?yt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?yt(a,{...l,defaultShouldRevalidate:e}):yt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Ft({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 Nt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Mt(e,t,n,r,Pe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:jt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Pt(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:Fe(t,n),pattern:Pe(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 Ot(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 Ft({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(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:Fe(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 X(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 X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function It(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 Lt(e){let{result:t,type:n}=e;if(sn(t)){let e;try{e=await It(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?on(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:en(t),statusCode:Ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ne(t)?t.status:void 0}:on(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 Rt(e,t,n,r,i){let a=e.headers.get(`Location`);if(h(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!be(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ft(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var zt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Bt(e){try{return zt.includes(new URL(e).protocol)}catch{return!1}}function Vt(e,t,n,r){if(be(e)){let r=e,i=l.test(r)?new URL(u(r,t.protocol)):new URL(r);if(Bt(i.toString()))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return De(i.pathname)+i.search+i.hash}try{if(Bt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ht(e,t,n,r){let i=e.createURL(Qt(t)).toString(),a={signal:n};if(r&&Q(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?Ut(r.formData):r.formData}return new Request(i,a)}function Ut(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Wt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Gt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(h(!an(f),`Cannot handle redirect results in processLoaderData`),Z(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let n=Yt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=ct),c||(c=!0,s=Ne(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Kt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Gt(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(h(s,`Did not find corresponding fetcher result`),Z(s)){let t=Yt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(an(s))h(!1,`Unhandled fetcher revalidation redirect`);else{let e=yn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==ct).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 Jt(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yt(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 Xt(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 X(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 W(e||500,o,Error(s),!0)}function Zt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(an(r))return{key:n,result:r}}}function Qt(e){return b({...typeof e==`string`?x(e):e,hash:``})}function $t(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function en(e){return new W(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function tn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&nn(t))}function nn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function rn(e){return sn(e.result)&&nt.has(e.result.status)}function Z(e){return e.type===`error`}function an(e){return(e&&e.type)===`redirect`}function on(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function sn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function cn(e){return nt.has(e)}function ln(e){return sn(e)&&cn(e.status)&&e.headers.has(`Location`)}function un(e){return tt.has(e.toUpperCase())}function Q(e){return $e.has(e.toUpperCase())}function dn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function fn(e,t){let n=typeof t==`string`?x(t).search:t.search;if(e[e.length-1].route.index&&dn(n||``))return e[e.length-1];let r=we(e);return r[r.length-1]}function pn(e,t,n){return{url:Fe(e.createURL(t),t),pattern:n?Pe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function mn(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 hn(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 gn(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 _n(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 vn(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 yn(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 bn(e,t){try{let n=e.sessionStorage.getItem(st);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 xn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(st,JSON.stringify(n))}catch(e){g(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Sn(){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 Cn=n.createContext(null);Cn.displayName=`DataRouter`;var wn=n.createContext(null);wn.displayName=`DataRouterState`;var Tn=n.createContext(!1);function En(){return n.useContext(Tn)}var Dn=n.createContext({isTransitioning:!1});Dn.displayName=`ViewTransition`;var On=n.createContext(new Map);On.displayName=`Fetchers`;var kn=n.createContext(null);kn.displayName=`Await`;var $=n.createContext(null);$.displayName=`Navigation`;var An=n.createContext(null);An.displayName=`Location`;var jn=n.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName=`Route`;var Mn=n.createContext(null);Mn.displayName=`RouteError`;var Nn=`REACT_ROUTER_ERROR`,Pn=`REDIRECT`,Fn=`ROUTE_ERROR_RESPONSE`;function In(e){if(e.startsWith(`${Nn}:${Pn}:{`))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 Ln(e){if(e.startsWith(`${Nn}:${Fn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new W(t.status,t.statusText,t.data)}catch{}}var Rn;function zn(e,{relative:t}={}){h(Bn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext($),{hash:a,pathname:o,search:s}=Kn(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:U([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Bn(){return n.useContext(An)!=null}function Vn(){return h(Bn(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(An).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(){let{isDataRoute:e}=n.useContext(jn);return e?dr():Wn()}function Wn(){h(Bn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(Cn),{basename:t,navigator:r}=n.useContext($),{matches:i}=n.useContext(jn),{pathname:a}=Vn(),o=JSON.stringify(Te(i)),s=n.useRef(!1);return n.useLayoutEffect(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(g(s.current,Hn),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ee(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Gn(){let{matches:e}=n.useContext(jn);return e[e.length-1]?.params??{}}function Kn(e,{relative:t}={}){let{matches:r}=n.useContext(jn),{pathname:i}=Vn(),a=JSON.stringify(Te(r));return n.useMemo(()=>Ee(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qn(e,t){return Jn(e,t)}function Jn(e,t,r){h(Bn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext($),{matches:a}=n.useContext(jn),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Vn(),u;if(t){let e=typeof t==`string`?x(t):t;h(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):ne(e,{pathname:f}),m=tr(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([c,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:U([c,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&m?n.createElement(An.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Yn(){let e=cr(),t=Ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},r):null,null)}var Xn=n.createElement(Yn,null),Zn=(Rn=class extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(jn.Provider,{value:this.props.routeContext},n.createElement(Mn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement($n,{error:e},t):t}},D(Rn,`contextType`,Tn),Rn),Qn=new WeakMap;function $n({children:e,error:t}){let{basename:r}=n.useContext($);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=In(t.digest);if(e){let i=Qn.get(t);if(i)throw i;let a=Le(e.location,r),o=a.absoluteURL||a.to;if(Bt(o))throw Error(`Invalid redirect location`);if(Ie&&!Qn.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 Qn.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function er({routeContext:e,match:t,children:r}){let i=n.useContext(Cn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(jn.Provider,{value:e},r)}function tr(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);h(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Pe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Xn,s&&(c<0&&l===0?(pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(er,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rr(e){let t=n.useContext(Cn);return h(t,nr(e)),t}function ir(e){let t=n.useContext(wn);return h(t,nr(e)),t}function ar(e){let t=n.useContext(jn);return h(t,nr(e)),t}function or(e){let t=ar(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sr(){return or(`useRouteId`)}function cr(){let e=n.useContext(Mn),t=ir(`useRouteError`),r=or(`useRouteError`);return e===void 0?t.errors?.[r]:e}var lr=0;function ur(e){let{router:t,basename:r}=rr(`useBlocker`),i=ir(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:H(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:H(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++lr);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):ot}function dr(){let{router:e}=rr(`useNavigate`),t=or(`useNavigate`),r=n.useRef(!1);return n.useLayoutEffect(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{g(r.current,Hn),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var fr={};function pr(e,t,n){!t&&!fr[e]&&(fr[e]=!0,g(!1,n))}var mr={};function hr(e,t){!e&&!mr[t]&&(mr[t]=!0,console.warn(t))}var gr=[`HydrateFallback`,`hydrateFallbackElement`],_r=class{constructor(){D(this,`status`,`pending`),D(this,`promise`,void 0),D(this,`resolve`,void 0),D(this,`reject`,void 0),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 vr({router:e,flushSync:t,onError:r,useTransitions:i}){i=En()||i;let[a,o]=n.useState(e.state),[s,c]=(0,n.useOptimistic)(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Pe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),hr(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(hr(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>yr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new _r)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>yr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(Cn.Provider,{value:C},n.createElement(wn.Provider,{value:s},n.createElement(On.Provider,{value:y.current},n.createElement(Dn.Provider,{value:d},n.createElement(wr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(br,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function yr(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 br=n.memo(xr);function xr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Jn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Sr({to:e,replace:t,state:r,relative:i}){h(Bn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=n.useContext($);g(!a,`<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}=n.useContext(jn),{pathname:s}=Vn(),c=Un(),l=Ee(e,Te(o),s,i===`path`),u=JSON.stringify(l);return n.useEffect(()=>{c(JSON.parse(u),{replace:t,state:r,relative:i})},[c,u,i,t,r]),null}function Cr(e){h(!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 wr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!Bn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=x(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=r,v=n.useMemo(()=>{let e=H(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:i}},[c,u,d,f,p,m,i,_]);return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement($.Provider,{value:l},n.createElement(An.Provider,{children:t,value:v}))}function Tr({children:e,location:t}){return qn(Er(e),t)}n.Component;function Er(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Er(e.props.children,a));return}h(e.type===Cr,`[${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 o=e.props;h(!o.index||!o.children,`An index route cannot have child routes.`);let s={id:o.id||a.join(`-`),caseSensitive:o.caseSensitive,element:o.element,Component:o.Component,index:o.index,path:o.path,middleware:o.middleware,loader:o.loader,action:o.action,hydrateFallbackElement:o.hydrateFallbackElement,HydrateFallback:o.HydrateFallback,errorElement:o.errorElement,ErrorBoundary:o.ErrorBoundary,shouldRevalidate:o.shouldRevalidate,handle:o.handle,lazy:o.lazy};o.children&&(s.children=Er(o.children,a)),r.push(s)}),r}var Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}var Pr=null;function Fr(){if(Pr===null)try{new FormData(document.createElement(`form`),0),Pr=!1}catch{Pr=!0}return Pr}var Ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Lr(e){return e!=null&&!Ir.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Rr(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`formenctype`))||Lr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Fr()){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(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function zr(e,t){if(e===!1||e==null)throw Error(t)}function Br(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}var Vr=`modulepreload`,Hr=function(e){return`/`+e},Ur={},Wr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hr(t,n),t=s(t),t in Ur)return;Ur[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Gr(e,t){if(e.id in t)return t[e.id];try{let n=await Wr(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Kr(e){return e!=null&&typeof e.page==`string`}function qr(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 Jr(e,t,n){return $r((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Gr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(qr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Yr(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 Xr(e,t,{includeHydrateFallback:n}={}){return Zr(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 Zr(e){return[...new Set(e)]}function Qr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $r(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Kr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Qr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ei(){let e=n.useContext(Cn);return zr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ti(){let e=n.useContext(wn);return zr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ni=n.createContext(void 0);ni.displayName=`FrameworkContext`;function ri(){let e=n.useContext(ni);return zr(e,`You must render this element inside a <HydratedRouter> element`),e}function ii(e,t){let r=n.useContext(ni),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ai(c,m),onBlur:ai(l,h),onMouseEnter:ai(u,m),onMouseLeave:ai(d,h),onTouchStart:ai(f,m)}]:[o,p,{}]:[!1,p,{}]}function ai(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oi({page:e,...t}){let r=En(),{nonce:i}=ri(),{router:a}=ei(),o=n.useMemo(()=>ne(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(ci,{page:e,matches:o,...t}):n.createElement(li,{page:e,matches:o,...t})):null}function si(e){let{manifest:t,routeModules:r}=ri(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Jr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function ci({page:e,matches:t,...r}){let i=Vn(),a=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Br(e,`rsc`),r=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:a.push(e.route.id);return r&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,i,t]);return n.createElement(n.Fragment,null,a.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function li({page:e,matches:t,...r}){let i=Vn(),{manifest:a,routeModules:o}=ri(),{loaderData:s,matches:c}=ti(),l=n.useMemo(()=>Yr(e,t,c,a,i,`data`),[e,t,c,a,i]),u=n.useMemo(()=>Yr(e,t,c,a,i,`assets`),[e,t,c,a,i]),d=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!l.some(t=>t.route.id===e.route.id)&&e.route.id in s&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let c=Br(e,`data`);return r&&n.size>0&&c.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[c.pathname+c.search]},[s,i,a,l,t,e,o]),f=n.useMemo(()=>Xr(u,a),[u,a]),p=si(u);return n.createElement(n.Fragment,null,d.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),f.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),p.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ui(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var di=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{di&&(window.__reactRouterVersion=`8.3.0`)}catch{}function fi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function pi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function mi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:hi(e.errors)}),e}function hi(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 W(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Me.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 gi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext($),b=typeof d==`string`&&c.test(d),x=Le(d,_);d=x.to;let S=zn(d,{relative:i}),C=Vn(),w=null;if(s){let e=Ee(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ii(r,h),O=xi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),j=n.createElement(`a`,{...h,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:ui(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,j,n.createElement(oi,{page:S})):j});gi.displayName=`Link`;var _i=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Kn(o,{relative:l.relative}),f=Vn(),p=n.useContext(wn),{navigator:m,basename:h}=n.useContext($),g=p!=null&&Ei(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(gi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});_i.displayName=`NavLink`;var vi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext($),v=wi(),y=Ti(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});vi.displayName=`Form`;function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=n.useContext(Cn);return h(t,yi(e)),t}function xi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Un(),f=Vn(),p=Kn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?b(f)===b(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}var Si=0,Ci=()=>`__${String(++Si)}__`;function wi(){let{router:e}=bi(`useSubmit`),{basename:t}=n.useContext($),r=sr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rr(e,t);n.navigate===!1?await i(n.fetcherKey||Ci(),r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync}):await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ti(e,{relative:t}={}){let{basename:r}=n.useContext($),i=n.useContext(jn);h(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Kn(e||`.`,{relative:t})},s=Vn();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),b(o)}function Ei(e,{relative:t}={}){let r=n.useContext(Dn);h(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=bi(`useViewTransitionState`),a=Kn(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=H(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ge(a.pathname,s)!=null||ge(a.pathname,o)!=null}export{i as _,Sr as a,Tr as c,Un as d,Gn as f,a as g,o as h,Wr as i,ur as l,s as m,fi as n,Cr as o,D as p,pi as r,vr as s,gi as t,Vn as u,r as v};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{m as t}from"./markdown-core-BmPPZiuD.js";var n=e(t(),1);function r(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function i(e,t,n){r(e,t),t.set(e,n)}function a(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function o(e,t,n){return e.set(a(e,t),n),n}function s(e,t){return e.get(a(e,t))}var c=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l=/^[\\/]{2}/;function u(e,t){return t+e.replace(/\\/g,`/`)}var d=`popstate`;function f(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function p(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return y(``,{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:b(t)}return S(t,n,null,e)}function m(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=x(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),y(``,{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:b(t))}function r(e,t){g(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return S(t,n,r,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(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 y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({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 x(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 S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),p=_.createHref(r.mask||r);try{o.pushState(d,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=f(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(d,p),c=e,()=>{i.removeEventListener(d,p),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&l.test(i)&&(i=r+i),new URL(i,r)}function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,k=(O=new WeakMap,class{constructor(e){if(i(this,O,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(s(O,this).has(e))return s(O,this).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){s(O,this).set(e,t)}}),A=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function j(e){return A.has(e)}var M=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ee(e){return M.has(e)}function N(e){return e.index===!0}function P(e){let t={};return e.Component&&Object.assign(t,{element:n.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function te(e,t=P,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(h(e.index!==!0||!e.children,`Cannot specify children on an index route`),h(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),N(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=te(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ne(e,t,n=`/`){return re(e,t,n,!1)}function re(e,t,n,r,i){let a=H((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??I(e),s=null,c=ve(a);for(let e=0;s==null&&e<o.length;++e)s=he(o[e],c,r);return s}function ie(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 I(e){let t=ae(e);return L(t),t}function ae(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;h(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]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:pe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=_e(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(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=oe(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 L(e){e.sort((e,t)=>e.score===t.score?me(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var se=/^:[\w-]+$/,ce=/^:[\w-]+/,le=3.5,ue=3,de=2,R=1,z=10,B=-2,fe=e=>e===`*`;function pe(e,t){let n=e.split(`/`),r=n.length;return n.some(fe)&&(r+=B),t&&(r+=de),n.filter(e=>!fe(e)).reduce((e,t)=>e+(se.test(t)?ue:ce.test(t)?le:t===``?R:z),r)}function me(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 he(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?V(u,l,s.matcher,s.compiledParams):ge(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ge({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:ke(U([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=U([a,d.pathnameBase]))}return o}function ge(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_e(e.path,e.caseSensitive,e.end);return V(e,t,n,r)}function V(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function _e(e,t=!1,n=!0){g(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 ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ye({basename:e,pathname:t}){return t===`/`?e:U([e,t])}var be=e=>c.test(e);function xe(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=De(n),a=n.startsWith(`/`)?Se(n.substring(1),`/`):Se(n,t)):a=t,{pathname:a,search:Ae(r),hash:je(i)}}function Se(e,t){let n=Oe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ce(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 we(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Te(e){let t=we(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Ee(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),Ce(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),Ce(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),Ce(`#`,`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=xe(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var De=e=>e.replace(/[\\/]{2,}/g,`/`),U=e=>De(e.join(`/`)),Oe=e=>e.replace(/\/+$/,``),ke=e=>Oe(e).replace(/^\/*/,`/`),Ae=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Me=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],W=class{constructor(e,t,n,r=!1){D(this,`status`,void 0),D(this,`statusText`,void 0),D(this,`data`,void 0),D(this,`error`,void 0),D(this,`internal`,void 0),this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ne(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Pe(e){return U(e.map(e=>e.route.path).filter(Boolean))||`/`}function Fe(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?x(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 Ie=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Le(e,t){let n=e;if(typeof n!=`string`||!c.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ie)try{let e=new URL(window.location.href),r=l.test(n)?new URL(u(n,e.protocol)):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var G=Symbol(`Uninstrumented`),Re=new WeakMap;function ze(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)=>K(await q(n.lazy,void 0,()=>e(...t),J))}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)=>K(await q(n[`lazy.middleware`],void 0,()=>t(...e),J))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>K(await q(n[`lazy.loader`],void 0,()=>t(...e),J))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>K(await q(n[`lazy.action`],void 0,()=>t(...e),J))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Ve(t.loader),i=async(...t)=>K(await q(n.loader,Ge(t[0]),()=>e(...t),J));e.hydrate===!0&&(i.hydrate=!0),He(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Ve(t.action),i=async(...t)=>K(await q(n.action,Ge(t[0]),()=>e(...t),J));He(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Ve(e),r=async(...e)=>K(await q(n.middleware,Ge(e[0]),()=>t(...e),J));return He(r,t),r})),r}function Be(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=Ve(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?b(i):`.`,...Ke(e,a??{})};return K(await q(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=Ue(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:o})))};He(r,t),e.navigate=r}if(n.fetch.length>0){let t=Ve(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return K(await q(n.fetch,{href:o??`.`,fetcherKey:i,...Ke(e,s??{})},async()=>{let n=Ue(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...J(e),meta:c})))};He(r,t),e.fetch=r}return e}function Ve(e){return e[G]??e}function He(e,t){e[G]=t}function Ue(e,t){return Re.set(e,t),()=>{Re.get(e)===t&&Re.delete(e)}}function We(e){let t=Re.get(e);return Re.delete(e),t}function K(e){if(e.type===`error`)throw e.value;return e.value}async function q(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=q(e,t,n,r,i,a-1),await s,h(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 J(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Ge(e){let{request:t,context:n,params:r}=e;return{...e,request:qe(t),params:{...r},context:Je(n)}}function Ke(e,t){return{currentUrl:b(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 qe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Je(e){return{get:t=>e.get(t)}}var Ye,Xe,Y,Ze,Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},st=`remix-router-transitions`,ct=Symbol(`ResetLoaderData`),lt=(Ye=new WeakMap,Xe=new WeakMap,Y=new WeakMap,Ze=new WeakMap,class{constructor(e){i(this,Ye,void 0),i(this,Xe,void 0),i(this,Y,void 0),i(this,Ze,void 0),o(Ye,this,e),o(Xe,this,I(e))}get stableRoutes(){return s(Ye,this)}get activeRoutes(){return s(Y,this)??s(Ye,this)}get branches(){return s(Ze,this)??s(Xe,this)}get hasHMRRoutes(){return s(Y,this)!=null}setRoutes(e){o(Ye,this,e),o(Xe,this,I(e))}setHmrRoutes(e){o(Y,this,e),o(Ze,this,I(e))}commitHmrRoutes(){s(Y,this)&&(o(Ye,this,s(Y,this)),o(Xe,this,s(Ze,this)),o(Y,this,void 0),o(Ze,this,void 0))}});function ut(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;h(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...ze(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new lt(te(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Dt,u={...e.future},d=null,f=new Set,p=null,m=null,_=null,v=null,b=e.hydrationData!=null,S=re(s.activeRoutes,e.history.location,c,!1,s.branches),w=!1,T=null,E,D;if(S==null&&!e.patchRoutesOnNavigation){let t=X(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Xt(s.activeRoutes);E=!0,D=!E,S=n,T={[r.id]:t}}else if(S&&!e.hydrationData&&Xe(S,s.activeRoutes,e.history.location.pathname).active&&(S=null),!S){E=!1,D=!E,S=[];let t=Xe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(w=!0,S=t.matches)}else if(S.some(e=>e.route.lazy))E=!1,D=!E;else if(!S.some(e=>ht(e.route)))E=!0,D=!E;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=S;if(n){let e=S.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}D=!1,E=!0,r.forEach(e=>{let r=gt(e.route,t,n);D=D||r.renderFallback,E=E&&!r.shouldLoad})}let O,A={historyAction:e.history.action,location:e.history.location,matches:S,initialized:E,renderFallback:D,navigation:it,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||T,fetchers:new Map,blockers:new Map},j=`POP`,M=null,ee=!1,N,P=!1,F=new Map,ne=null,I=!1,ae=!1,oe=new Set,L=new Map,se=0,ce=-1,le=new Map,ue=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}g(B.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=J({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),q(i,{state:`blocked`,location:n,proceed(){q(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,ot),V({blockers:e})}}),M?.resolve(),M=null;return}return xe(t,n)}),n){bn(t,F);let e=()=>xn(t,F);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||xe(`POP`,A.location,{initialHydration:!0}),O}function he(){d&&d(),ne&&ne(),f.clear(),N&&N.abort(),A.fetchers.forEach((e,t)=>Ie(A.fetchers,t)),A.blockers.forEach((e,t)=>K(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(A,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!A.fetchers.has(e)&&!L.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ie(A.fetchers,e)),r.forEach(e=>A.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?qt(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,c=A.blockers;c.size>0&&!I&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=!I&&Ye(t,n.matches||A.matches),u=ee===!0||A.navigation.formMethod!=null&&Q(A.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),I||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=F.get(A.location.pathname);e&&e.has(t.pathname)?d={currentLocation:A.location,nextLocation:t}:F.has(t.pathname)&&(d={currentLocation:t,nextLocation:A.location})}else if(P){let e=F.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(A.location.pathname,e)),d={currentLocation:A.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,ee=!1,P=!1,I=!1,ae=!1,M?.resolve(),M=null,pe?.resolve(),pe=null}async function ve(t,n){if(M?.resolve(),M=null,typeof t==`number`){M||(M=Sn());let n=M.promise;return e.history.go(t),n}let r=We(O),{path:i,submission:a,error:o}=pt(!1,ft(A.location,A.matches,c,t,n?.fromRouteId,n?.relative),n),s;n?.mask&&(s={pathname:``,search:``,hash:``,...typeof n.mask==`string`?x(n.mask):{...A.location.mask,...n.mask}});let l=A.location,u=y(l,i,n&&n.state,void 0,s);u={...u,...e.history.encodeLocation(u)};let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Q(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=J({currentLocation:l,nextLocation:u,historyAction:f});if(h){q(h,{state:`blocked`,location:u,proceed(){q(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),ve(t,n)},reset(){let e=new Map(A.blockers);e.set(h,ot),V({blockers:e})}});return}await xe(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ye(){pe||(pe=Sn()),je(),V({revalidation:`loading`});let e=pe.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(xe(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(xe(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:P===!0}),e)}async function xe(t,n,r){N&&N.abort(),N=null,j=t,I=(r&&r.startUninterruptedRevalidation)===!0,Je(A.location,A.matches),ee=(r&&r.preventScrollReset)===!0,P=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:re(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&A.initialized&&!ae&&$t(A.location,n)&&!(r&&r.submission&&Q(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Xe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),r?.instrumentationNavigateMetaReceiver){let t=pn(e.history,n,a);r.instrumentationNavigateMetaReceiver(t)}if(!a){let{error:e,notFoundMatches:t,route:r}=Ge(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;N=new AbortController;let d=Ht(e.history,n,N.signal,r&&r.submission),f=e.getContext?await e.getContext():new k,p;if(r&&r.pendingError)p=[Yt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Q(r.submission.formMethod)){let i=await Se(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Z(t)&&Ne(t.error)&&t.error.status===404){N=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=hn(n,a,t,r.submission),o=!1,l.active=!1,d=Ht(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Ce(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(N=null,_e(n,{matches:h||a,...Jt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Se(t,n,i,l,u,d,f,p,m={}){if(je(),V({navigation:gn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Y(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Yt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ge(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=fn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:X(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Nt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(an(h)){let n;return n=m&&m.replace!=null?m.replace:Vt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===A.location.pathname+A.location.search,await Oe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Z(h)){let e=Yt(l,g.route.id);return(m&&m.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Ce(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||hn(n,i,l,p),x=p||m||mn(b),S=!I&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Y(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}=Xt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Yt(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}=Ge(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=mt(t,u,a,o,e.history,A,i,x,n,g?[]:r,g===!0,ae,oe,z,de,ue,C,c,e.patchRoutesOnNavigation!=null,s.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(A.fetchers),t=Ve(e);return _e(n,{matches:i,loaderData:{},errors:v&&Z(v[1])?{[v[0]]:v[1].error}:null,...Jt(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{G(e.key),e.controller&&L.set(e.key,e.controller)});let E=()=>T.forEach(e=>G(e.key));N&&N.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ae(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener(`abort`,E),T.forEach(e=>L.delete(e.key));let k=Zt(D);if(k)return await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Zt(O),k)return ue.add(k.key),await Oe(t,k.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(A.fetchers),{loaderData:M,errors:ee}=Kt(A,i,D,v,T,O,j);g&&A.errors&&(ee={...A.errors,...ee});let P=Ve(j),te=He(ce,j),F=P||te||T.length>0;return{matches:i,loaderData:M,errors:ee,...F?{workingFetchers:j}:{}}}function we(e){if(e&&!Z(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){let t=new Map(A.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=_n(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=We(O),l=s.activeRoutes,u=ft(A.location,A.matches,c,r,n,i?.relative),d=re(l,u,c,!1,s.branches),f=Xe(d,l,u);if(f.active&&f.matches&&(d=f.matches),o&&o(pn(e.history,u,d)),!d){W(t,n,X(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=pt(!0,u,i);if(h){W(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new k,_=(i&&i.preventScrollReset)===!0;if(m&&Q(m.formMethod)){await De(t,n,p,d,g,f.active,a,_,m,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:p}),await U(t,n,p,d,g,f.active,a,_,m)}async function De(t,n,i,l,u,d,f,p,m,g){je(),de.delete(t),Me(t,vn(m,A.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Ht(e.history,i,_.signal,m);if(d){let e=await Y(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:f});return}}let y=fn(l,i);if(!y.route.action&&!y.route.lazy){W(t,n,X(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}L.set(t,_);let b=se,x=Nt(a,o,v,i,l,y,r,u),S=await ke(v,i,x,u,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){L.get(t)===_&&L.delete(t);return}if(z.has(t)){if(an(C)||Z(C)){Me(t,yn(void 0));return}}else{if(an(C)){if(L.delete(t),ce>b){Me(t,yn(void 0));return}return ue.add(t),Me(t,_n(m)),Oe(v,C,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Z(C)){W(t,n,C.error);return}}let w=A.navigation.location||A.location,T=Ht(e.history,w,_.signal),E=s.activeRoutes,D=A.navigation.state===`idle`?A.matches:re(E,A.navigation.location,c,!1,s.branches);h(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let{dsMatches:k,revalidatingFetchers:M}=mt(T,u,a,o,e.history,A,D,m,w,r,!1,ae,oe,z,de,ue,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),ee=_n(m,C.data),P=new Map(A.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=_n(void 0,n?n.data:void 0);P.set(t,r),G(t),e.controller&&L.set(t,e.controller)}),V({fetchers:P});let te=()=>M.forEach(e=>G(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Ae(k,M,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),le.delete(t),L.delete(t),M.forEach(e=>L.delete(e.key));let ie=A.fetchers.has(t),I=e=>{if(!ie)return e;let n=new Map(e.fetchers);return n.set(t,yn(C.data)),{...e,fetchers:n}},R=Zt(F);if(R)return A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});if(R=Zt(ne),R)return ue.add(R.key),A=I(A),Oe(T,R.result,!1,{preventScrollReset:p});let B=new Map(A.fetchers);ie&&B.set(t,yn(C.data));let{loaderData:fe,errors:pe}=Kt(A,D,F,void 0,M,ne,B);He(O,B),A.navigation.state===`loading`&&O>ce?(h(j,`Expected pending action`),N&&N.abort(),_e(A.navigation.location,{matches:D,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:qt(A.loaderData,fe,D,pe),fetchers:B}),ae=!1)}async function U(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);Me(t,_n(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ht(e.history,i,m.signal);if(l){let e=await Y(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){W(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{W(t,n,X(404,{pathname:i}),{flushSync:u});return}}let g=fn(s,i);L.set(t,m);let _=se,v=await ke(h,i,Nt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(L.get(t)===m&&L.delete(t),!h.signal.aborted){if(z.has(t)){Me(t,yn(void 0));return}if(an(y))if(ce>_){Me(t,yn(void 0));return}else{ue.add(t),await Oe(h,y,!1,{preventScrollReset:d});return}if(Z(y)){W(t,n,y.error);return}Me(t,yn(y.data))}}async function Oe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(M?.resolve(),M=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);h(d,`Expected a Location header on the redirect Response`),d=Vt(d,new URL(r.url),c,e.history);let f=y(A.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(be(d)){let n=C(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}N=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:g,formEncType:_}=A.navigation;!o&&!s&&m&&g&&_&&(o=mn(A.navigation));let v=o||s;rt.has(i.response.status)&&v&&Q(v.formMethod)?await xe(p,f,{submission:{...v,formAction:d},preventScrollReset:l||ee,enableViewTransition:a?P:void 0}):await xe(p,f,{overrideNavigation:hn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||ee,enableViewTransition:a?P:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await Pt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Q(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.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(rn(r)){let i=r.result;o[t]={type:`redirect`,response:Rt(i,e,t,n,c)}}else o[t]=await Lt(r);return o}async function Ae(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:X(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function je(){ae=!0,de.forEach((e,t)=>{L.has(t)&&oe.add(t),G(t)})}function Me(e,t,n={}){let r=new Map(A.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function W(e,t,n,r={}){let i=Yt(A.matches,t),a=new Map(A.fetchers);Ie(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Pe(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),A.fetchers.get(e)||at}function Fe(e,t){G(e,t?.reason),Me(e,yn(null))}function Ie(e,t){let n=A.fetchers.get(t);L.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&G(t),de.delete(t),le.delete(t),ue.delete(t),z.delete(t),oe.delete(t),e.delete(t)}function Le(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(A.fetchers)})}function G(e,t){let n=L.get(e);n&&(n.abort(t),L.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);h(e,`Expected fetcher: ${n}`);let r=yn(e.data);t.set(n,r)}}function Ve(e){let t=[],n=!1;for(let r of ue){let i=e.get(r);h(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ue.delete(r),t.push(r),n=!0)}return Re(t,e),n}function He(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);h(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),le.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ue(e,t){let n=A.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function K(e){A.blockers.delete(e),B.delete(e)}function q(e,t){let n=A.blockers.get(e)||ot;h(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(A.blockers);r.set(e,t),V({blockers:r})}function J({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&g(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ge(e){let t=X(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Xt(n);return{notFoundMatches:r,route:i,error:t}}function Ke(e,t,n){if(m=e,v=t,_=n||null,!b&&A.navigation===it){b=!0;let e=Ye(A.location,A.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,v=null,_=null}}function qe(e,t){return _&&_(e,t.map(e=>ie(e,A.loaderData)))||e.key}function Je(e,t){if(m&&v){let n=qe(e,t);m[n]=v()}}function Ye(e,t){if(m){let n=qe(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Xe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:re(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:re(n,r,c,!0,e)}}return{active:!1,matches:null}}async function Y(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||bt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=re(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=re(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&Ze(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||(f=re(s.activeRoutes,n,c,!0,u)),!f||Ze(l,f))return{type:`success`,matches:null};l=f}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){o={},s.setHmrRoutes(te(e,a,void 0,o))}function $e(e,t,n=!1){bt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return O={get basename(){return c},get future(){return u},get state(){return A},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Ke,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,resetFetcher:Fe,deleteFetcher:Le,dispose:he,getBlocker:Ue,deleteBlocker:K,patchRoutes:$e,_internalFetchControllers:L,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(O=Be(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function dt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function ft(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=Ee(r||`.`,Te(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=dn(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=ye({basename:n,pathname:c.pathname})),b(c)}function pt(e,t,n){if(!n||!dt(n))return{path:t};if(n.formMethod&&!un(n.formMethod))return{path:t,error:X(405,{method:n.formMethod})};let r=()=>({path:t,error:X(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Qt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Q(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(!Q(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()}}}h(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ut(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ut(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Wt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Wt(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(Q(c.formMethod))return{path:t,submission:c};let l=x(t);return e&&l.search&&dn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:b(l),submission:c}}function mt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Z(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&&Z(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=Pe(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!ht(s))f=!1;else if(u){let{shouldLoad:e}=gt(s,a.loaderData,a.errors);f=e}else _t(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Mt(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?vt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Mt(n,r,e,c,k,i,l,t,yt(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=re(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=fn(b,e.path),C=new AbortController,w=Ht(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Nt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Nt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};yt(S,a)&&(T=Nt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function ht(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function gt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!ht(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 _t(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function vt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function yt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function bt(e,t,n,r,i,a){let o;if(e){let t=r[e];h(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>xt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=te(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]=te([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 xt(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=>xt(e,t)))??!1}var St=new WeakMap,Ct=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(h(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=St.get(i);o||(o={},St.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=j(e),n=i[e]!==void 0;if(t)g(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)g(!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},wt=new WeakMap;function Tt(e,t,n,r,i){let a=n[e.id];if(h(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=wt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{h(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=ee(e),o=a[e]!==void 0;i?g(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?g(!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 wt.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=Ct({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 Et(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 Dt(e){return e.matches.some(e=>e.route.middleware)?Ot(e,()=>Et(e)):Et(e)}function Ot(e,t){return kt(e,t,e=>{if(ln(e))throw e;return e},tn,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{[Yt(r,a).route.id]:{type:`error`,result:t}}}}}async function kt(e,t,n,r,i){let{matches:a,...o}=e;return await At(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function At(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 At(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 jt(e,t,n,r,i){let a=Ct({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Tt(r.route,Q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Mt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=jt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?yt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?yt(a,{...l,defaultShouldRevalidate:e}):yt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Q(n.method)||!p)?Ft({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 Nt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Mt(e,t,n,r,Pe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:jt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Pt(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:Fe(t,n),pattern:Pe(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 Ot(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 Ft({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Q(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:Fe(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 X(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 X(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function It(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 Lt(e){let{result:t,type:n}=e;if(sn(t)){let e;try{e=await It(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?on(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:en(t),statusCode:Ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ne(t)?t.status:void 0}:on(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 Rt(e,t,n,r,i){let a=e.headers.get(`Location`);if(h(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!be(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=ft(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var zt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Bt(e){try{return zt.includes(new URL(e).protocol)}catch{return!1}}function Vt(e,t,n,r){if(be(e)){let r=e,i=l.test(r)?new URL(u(r,t.protocol)):new URL(r);if(Bt(i.toString()))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return De(i.pathname)+i.search+i.hash}try{if(Bt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ht(e,t,n,r){let i=e.createURL(Qt(t)).toString(),a={signal:n};if(r&&Q(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?Ut(r.formData):r.formData}return new Request(i,a)}function Ut(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Wt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Gt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Z(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(h(!an(f),`Cannot handle redirect results in processLoaderData`),Z(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let n=Yt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=ct),c||(c=!0,s=Ne(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Kt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Gt(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(h(s,`Did not find corresponding fetcher result`),Z(s)){let t=Yt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(an(s))h(!1,`Unhandled fetcher revalidation redirect`);else{let e=yn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==ct).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 Jt(e){return e?Z(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yt(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 Xt(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 X(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 W(e||500,o,Error(s),!0)}function Zt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(an(r))return{key:n,result:r}}}function Qt(e){return b({...typeof e==`string`?x(e):e,hash:``})}function $t(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function en(e){return new W(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function tn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&nn(t))}function nn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function rn(e){return sn(e.result)&&nt.has(e.result.status)}function Z(e){return e.type===`error`}function an(e){return(e&&e.type)===`redirect`}function on(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function sn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function cn(e){return nt.has(e)}function ln(e){return sn(e)&&cn(e.status)&&e.headers.has(`Location`)}function un(e){return tt.has(e.toUpperCase())}function Q(e){return $e.has(e.toUpperCase())}function dn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function fn(e,t){let n=typeof t==`string`?x(t).search:t.search;if(e[e.length-1].route.index&&dn(n||``))return e[e.length-1];let r=we(e);return r[r.length-1]}function pn(e,t,n){return{url:Fe(e.createURL(t),t),pattern:n?Pe(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function mn(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 hn(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 gn(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 _n(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 vn(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 yn(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 bn(e,t){try{let n=e.sessionStorage.getItem(st);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 xn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(st,JSON.stringify(n))}catch(e){g(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Sn(){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 Cn=n.createContext(null);Cn.displayName=`DataRouter`;var wn=n.createContext(null);wn.displayName=`DataRouterState`;var Tn=n.createContext(!1);function En(){return n.useContext(Tn)}var Dn=n.createContext({isTransitioning:!1});Dn.displayName=`ViewTransition`;var On=n.createContext(new Map);On.displayName=`Fetchers`;var kn=n.createContext(null);kn.displayName=`Await`;var $=n.createContext(null);$.displayName=`Navigation`;var An=n.createContext(null);An.displayName=`Location`;var jn=n.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName=`Route`;var Mn=n.createContext(null);Mn.displayName=`RouteError`;var Nn=`REACT_ROUTER_ERROR`,Pn=`REDIRECT`,Fn=`ROUTE_ERROR_RESPONSE`;function In(e){if(e.startsWith(`${Nn}:${Pn}:{`))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 Ln(e){if(e.startsWith(`${Nn}:${Fn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new W(t.status,t.statusText,t.data)}catch{}}var Rn;function zn(e,{relative:t}={}){h(Bn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:r,navigator:i}=n.useContext($),{hash:a,pathname:o,search:s}=Kn(e,{relative:t}),c=o;return r!==`/`&&(c=o===`/`?r:U([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Bn(){return n.useContext(An)!=null}function Vn(){return h(Bn(),`useLocation() may be used only in the context of a <Router> component.`),n.useContext(An).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(){let{isDataRoute:e}=n.useContext(jn);return e?dr():Wn()}function Wn(){h(Bn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=n.useContext(Cn),{basename:t,navigator:r}=n.useContext($),{matches:i}=n.useContext(jn),{pathname:a}=Vn(),o=JSON.stringify(Te(i)),s=n.useRef(!1);return n.useLayoutEffect(()=>{s.current=!0}),n.useCallback((n,i={})=>{if(g(s.current,Hn),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ee(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:U([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}n.createContext(null);function Gn(){let{matches:e}=n.useContext(jn);return e[e.length-1]?.params??{}}function Kn(e,{relative:t}={}){let{matches:r}=n.useContext(jn),{pathname:i}=Vn(),a=JSON.stringify(Te(r));return n.useMemo(()=>Ee(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qn(e,t){return Jn(e,t)}function Jn(e,t,r){h(Bn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=n.useContext($),{matches:a}=n.useContext(jn),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Vn(),u;if(t){let e=typeof t==`string`?x(t):t;h(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):ne(e,{pathname:f}),m=tr(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:U([c,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:U([c,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,r);return t&&m?n.createElement(An.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...u},navigationType:`POP`}},m):m}function Yn(){let e=cr(),t=Ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null;return n.createElement(n.Fragment,null,n.createElement(`h2`,null,`Unexpected Application Error!`),n.createElement(`h3`,{style:{fontStyle:`italic`}},t),r?n.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},r):null,null)}var Xn=n.createElement(Yn,null),Zn=(Rn=class extends n.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:n.createElement(jn.Provider,{value:this.props.routeContext},n.createElement(Mn.Provider,{value:e,children:this.props.component}));return this.context?n.createElement($n,{error:e},t):t}},D(Rn,`contextType`,Tn),Rn),Qn=new WeakMap;function $n({children:e,error:t}){let{basename:r}=n.useContext($);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=In(t.digest);if(e){let i=Qn.get(t);if(i)throw i;let a=Le(e.location,r),o=a.absoluteURL||a.to;if(Bt(o))throw Error(`Invalid redirect location`);if(Ie&&!Qn.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 Qn.set(t,n),n}return n.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function er({routeContext:e,match:t,children:r}){let i=n.useContext(Cn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),n.createElement(jn.Provider,{value:e},r)}function tr(e,t=[],r){let i=r?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);h(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(r&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||n[t.route.id]===void 0);if(t.route.lazy||o){r.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=r?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Pe(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&r.route.id?o[r.route.id]:void 0,p=r.route.errorElement||Xn,s&&(c<0&&l===0?(pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:r.route.Component?n.createElement(r.route.Component,null):r.route.element?r.route.element:e,n.createElement(er,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(r.route.ErrorBoundary||r.route.errorElement||l===0)?n.createElement(Zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rr(e){let t=n.useContext(Cn);return h(t,nr(e)),t}function ir(e){let t=n.useContext(wn);return h(t,nr(e)),t}function ar(e){let t=n.useContext(jn);return h(t,nr(e)),t}function or(e){let t=ar(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sr(){return or(`useRouteId`)}function cr(){let e=n.useContext(Mn),t=ir(`useRouteError`),r=or(`useRouteError`);return e===void 0?t.errors?.[r]:e}var lr=0;function ur(e){let{router:t,basename:r}=rr(`useBlocker`),i=ir(`useBlocker`),[a,o]=n.useState(``),s=n.useCallback(t=>{if(typeof e!=`function`)return!!e;if(r===`/`)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:H(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:H(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return n.useEffect(()=>{let e=String(++lr);return o(e),()=>t.deleteBlocker(e)},[t]),n.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):ot}function dr(){let{router:e}=rr(`useNavigate`),t=or(`useNavigate`),r=n.useRef(!1);return n.useLayoutEffect(()=>{r.current=!0}),n.useCallback(async(n,i={})=>{g(r.current,Hn),r.current&&(typeof n==`number`?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var fr={};function pr(e,t,n){!t&&!fr[e]&&(fr[e]=!0,g(!1,n))}var mr={};function hr(e,t){!e&&!mr[t]&&(mr[t]=!0,console.warn(t))}var gr=[`HydrateFallback`,`hydrateFallbackElement`],_r=class{constructor(){D(this,`status`,`pending`),D(this,`promise`,void 0),D(this,`resolve`,void 0),D(this,`reject`,void 0),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 vr({router:e,flushSync:t,onError:r,useTransitions:i}){i=En()||i;let[a,o]=n.useState(e.state),[s,c]=(0,n.useOptimistic)(a),[l,u]=n.useState(),[d,f]=n.useState({isTransitioning:!1}),[p,m]=n.useState(),[h,g]=n.useState(),[_,v]=n.useState(),y=n.useRef(new Map),b=n.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Pe(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),hr(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(hr(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):n.startTransition(()=>{i===!0&&c(e=>yr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,r]);n.useLayoutEffect(()=>e.subscribe(b),[e,b]),n.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new _r)},[d]),n.useEffect(()=>{if(p&&l&&e.window){let t=l,r=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):n.startTransition(()=>{i===!0&&c(e=>yr(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),n.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),n.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=n.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=n.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:r}),[e,x,S,r]);return n.createElement(n.Fragment,null,n.createElement(Cn.Provider,{value:C},n.createElement(wn.Provider,{value:s},n.createElement(On.Provider,{value:y.current},n.createElement(Dn.Provider,{value:d},n.createElement(wr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},n.createElement(br,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function yr(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 br=n.memo(xr);function xr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Jn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Sr({to:e,replace:t,state:r,relative:i}){h(Bn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=n.useContext($);g(!a,`<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}=n.useContext(jn),{pathname:s}=Vn(),c=Un(),l=Ee(e,Te(o),s,i===`path`),u=JSON.stringify(l);return n.useEffect(()=>{c(JSON.parse(u),{replace:t,state:r,relative:i})},[c,u,i,t,r]),null}function Cr(e){h(!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 wr({basename:e=`/`,children:t=null,location:r,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!Bn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=n.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof r==`string`&&(r=x(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=r,v=n.useMemo(()=>{let e=H(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:i}},[c,u,d,f,p,m,i,_]);return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:n.createElement($.Provider,{value:l},n.createElement(An.Provider,{children:t,value:v}))}function Tr({children:e,location:t}){return qn(Er(e),t)}n.Component;function Er(e,t=[]){let r=[];return n.Children.forEach(e,(e,i)=>{if(!n.isValidElement(e))return;let a=[...t,i];if(e.type===n.Fragment){r.push.apply(r,Er(e.props.children,a));return}h(e.type===Cr,`[${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 o=e.props;h(!o.index||!o.children,`An index route cannot have child routes.`);let s={id:o.id||a.join(`-`),caseSensitive:o.caseSensitive,element:o.element,Component:o.Component,index:o.index,path:o.path,middleware:o.middleware,loader:o.loader,action:o.action,hydrateFallbackElement:o.hydrateFallbackElement,HydrateFallback:o.HydrateFallback,errorElement:o.errorElement,ErrorBoundary:o.ErrorBoundary,shouldRevalidate:o.shouldRevalidate,handle:o.handle,lazy:o.lazy};o.children&&(s.children=Er(o.children,a)),r.push(s)}),r}var Dr=`application/x-www-form-urlencoded`;function Or(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function kr(e){return Or(e)&&e.tagName.toLowerCase()===`button`}function Ar(e){return Or(e)&&e.tagName.toLowerCase()===`form`}function jr(e){return Or(e)&&e.tagName.toLowerCase()===`input`}function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nr(e,t){return e.button===0&&(!t||t===`_self`)&&!Mr(e)}var Pr=null;function Fr(){if(Pr===null)try{new FormData(document.createElement(`form`),0),Pr=!1}catch{Pr=!0}return Pr}var Ir=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Lr(e){return e!=null&&!Ir.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dr}"`),null):e}function Rr(e,t){let n,r,i,a,o;if(Ar(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`enctype`))||Dr,a=new FormData(e)}else if(kr(e)||jr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Lr(e.getAttribute(`formenctype`))||Lr(o.getAttribute(`enctype`))||Dr,a=new FormData(o,e),!Fr()){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(Or(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Dr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function zr(e,t){if(e===!1||e==null)throw Error(t)}function Br(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}var Vr=`modulepreload`,Hr=function(e){return`/`+e},Ur={},Wr=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hr(t,n),t=s(t),t in Ur)return;Ur[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Gr(e,t){if(e.id in t)return t[e.id];try{let n=await Wr(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Kr(e){return e!=null&&typeof e.page==`string`}function qr(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 Jr(e,t,n){return $r((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Gr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(qr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Yr(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 Xr(e,t,{includeHydrateFallback:n}={}){return Zr(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 Zr(e){return[...new Set(e)]}function Qr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function $r(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Kr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Qr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ei(){let e=n.useContext(Cn);return zr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ti(){let e=n.useContext(wn);return zr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ni=n.createContext(void 0);ni.displayName=`FrameworkContext`;function ri(){let e=n.useContext(ni);return zr(e,`You must render this element inside a <HydratedRouter> element`),e}function ii(e,t){let r=n.useContext(ni),[i,a]=n.useState(!1),[o,s]=n.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=n.useRef(null);n.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),n.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return r?e===`intent`?[o,p,{onFocus:ai(c,m),onBlur:ai(l,h),onMouseEnter:ai(u,m),onMouseLeave:ai(d,h),onTouchStart:ai(f,m)}]:[o,p,{}]:[!1,p,{}]}function ai(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oi({page:e,...t}){let r=En(),{nonce:i}=ri(),{router:a}=ei(),o=n.useMemo(()=>ne(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),r?n.createElement(ci,{page:e,matches:o,...t}):n.createElement(li,{page:e,matches:o,...t})):null}function si(e){let{manifest:t,routeModules:r}=ri(),[i,a]=n.useState([]);return n.useEffect(()=>{let n=!1;return Jr(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),i}function ci({page:e,matches:t,...r}){let i=Vn(),a=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Br(e,`rsc`),r=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:a.push(e.route.id);return r&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,i,t]);return n.createElement(n.Fragment,null,a.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})))}function li({page:e,matches:t,...r}){let i=Vn(),{manifest:a,routeModules:o}=ri(),{loaderData:s,matches:c}=ti(),l=n.useMemo(()=>Yr(e,t,c,a,i,`data`),[e,t,c,a,i]),u=n.useMemo(()=>Yr(e,t,c,a,i,`assets`),[e,t,c,a,i]),d=n.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!l.some(t=>t.route.id===e.route.id)&&e.route.id in s&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let c=Br(e,`data`);return r&&n.size>0&&c.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[c.pathname+c.search]},[s,i,a,l,t,e,o]),f=n.useMemo(()=>Xr(u,a),[u,a]),p=si(u);return n.createElement(n.Fragment,null,d.map(e=>n.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...r})),f.map(e=>n.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...r})),p.map(({key:e,link:t})=>n.createElement(`link`,{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}function ui(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var di=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{di&&(window.__reactRouterVersion=`8.3.0`)}catch{}function fi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function pi(e,t){return ut({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:m({window:t?.window}),hydrationData:t?.hydrationData||mi(),routes:e,mapRouteProperties:P,hydrationRouteProperties:gr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function mi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:hi(e.errors)}),e}function hi(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 W(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Me.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 gi=n.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=n.useContext($),b=typeof d==`string`&&c.test(d),x=Le(d,_);d=x.to;let S=zn(d,{relative:i}),C=Vn(),w=null;if(s){let e=Ee(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:U([_,e.pathname])),w=v.createHref(e)}let[T,E,D]=ii(r,h),O=xi(d,{replace:o,mask:s,state:l,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(x.isExternal||a),j=n.createElement(`a`,{...h,...D,href:(A?w:void 0)||x.absoluteURL||S,onClick:A?k:e,ref:ui(g,E),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?n.createElement(n.Fragment,null,j,n.createElement(oi,{page:S})):j});gi.displayName=`Link`;var _i=n.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:r=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Kn(o,{relative:l.relative}),f=Vn(),p=n.useContext(wn),{navigator:m,basename:h}=n.useContext($),g=p!=null&&Ei(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof r==`function`?r(C):[r,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return n.createElement(gi,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});_i.displayName=`NavLink`;var vi=n.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:r,reloadDocument:i,replace:a,state:o,method:s=`get`,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=n.useContext($),v=wi(),y=Ti(l,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&c.test(l);return n.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:r,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&r!==!1?n.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});vi.displayName=`Form`;function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=n.useContext(Cn);return h(t,yi(e)),t}function xi(e,{target:t,replace:r,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Un(),f=Vn(),p=Kn(e,{relative:s});return n.useCallback(m=>{if(Nr(m,t)){m.preventDefault();let t=r===void 0?b(f)===b(p):r,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?n.startTransition(()=>h()):h()}},[f,d,p,r,i,a,t,e,o,s,c,l,u])}var Si=0,Ci=()=>`__${String(++Si)}__`;function wi(){let{router:e}=bi(`useSubmit`),{basename:t}=n.useContext($),r=sr(),i=e.fetch,a=e.navigate;return n.useCallback(async(e,n={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Rr(e,t);n.navigate===!1?await i(n.fetcherKey||Ci(),r,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,flushSync:n.flushSync}):await a(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:l,body:u,formMethod:n.method||s,formEncType:n.encType||c,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[i,a,t,r])}function Ti(e,{relative:t}={}){let{basename:r}=n.useContext($),i=n.useContext(jn);h(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Kn(e||`.`,{relative:t})},s=Vn();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(o.pathname=o.pathname===`/`?r:U([r,o.pathname])),b(o)}function Ei(e,{relative:t}={}){let r=n.useContext(Dn);h(r!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=bi(`useViewTransitionState`),a=Kn(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,i)||r.currentLocation.pathname,s=H(r.nextLocation.pathname,i)||r.nextLocation.pathname;return ge(a.pathname,s)!=null||ge(a.pathname,o)!=null}export{o as _,Sr as a,r as b,Tr as c,Un as d,Gn as f,s as g,D as h,Wr as i,ur as l,Ne as m,fi as n,Cr as o,cr as p,pi as r,vr as s,gi as t,Vn as u,a as v,i as y};
|