From 561abf708535a265ac3d8710a54a931619fc1540 Mon Sep 17 00:00:00 2001 From: Debasis Ghosh <65386308+debdevops@users.noreply.github.com> Date: Thu, 26 Mar 2026 11:50:43 +0530 Subject: [PATCH] feat: gate FAB and Replay behind Manage SAS permission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MainLayout: FAB now requires both non-Production environment AND hasSendPermission (Manage SAS policy) to be visible - MessageDetailPanel: Replay button shows 'Manage Required' state when namespace lacks Send permission - ConnectPage: Updated SAS policy instructions with two-tier guidance (Listen for read-only, Manage for full FAB/replay operations) - ConnectPage: Permission toasts now mention FAB requires Manage - helpContent: Updated all FAB tooltips, FAQs, and glossary entries to document Manage permission requirement - helpContent: Added new 'Permissions & Security' FAQ section with guidance on SAS policies, FAB visibility, and Scalar API docs - Fixed Swagger β†’ Scalar URL references across 6 documentation files - Updated production build assets --- REMOTE_ACCESS.md | 2 +- apps/web/src/components/layout/MainLayout.tsx | 7 +- .../messages/MessageDetailPanel.tsx | 16 + apps/web/src/lib/helpContent.ts | 58 +- apps/web/src/pages/ConnectPage.tsx | 31 +- services/api/DEPLOYMENT_OPERATIONS.md | 2 +- services/api/DOCUMENTATION_INDEX.md | 2 +- services/api/README.md | 2 +- services/api/run-api.sh | 2 +- .../wwwroot/assets/index-BL6didGD.js | 628 ----------------- .../wwwroot/assets/index-CrHvnwPo.css | 1 + .../wwwroot/assets/index-DpNkwzSs.css | 1 - .../wwwroot/assets/index-usJZ_qGb.js | 637 ++++++++++++++++++ .../api/src/ServiceHub.Api/wwwroot/index.html | 5 +- 14 files changed, 729 insertions(+), 665 deletions(-) delete mode 100644 services/api/src/ServiceHub.Api/wwwroot/assets/index-BL6didGD.js create mode 100644 services/api/src/ServiceHub.Api/wwwroot/assets/index-CrHvnwPo.css delete mode 100644 services/api/src/ServiceHub.Api/wwwroot/assets/index-DpNkwzSs.css create mode 100644 services/api/src/ServiceHub.Api/wwwroot/assets/index-usJZ_qGb.js diff --git a/REMOTE_ACCESS.md b/REMOTE_ACCESS.md index 00ebde7..257a483 100644 --- a/REMOTE_ACCESS.md +++ b/REMOTE_ACCESS.md @@ -44,7 +44,7 @@ The startup banner will show all access URLs automatically: πŸ“ API Endpoints: β€’ HTTP: http://localhost:5153 β€’ Remote: http://192.168.1.50:5153 - β€’ Swagger: http://localhost:5153/swagger + β€’ API Docs: http://localhost:5153/scalar/v1 ``` ### 2. Access from Your Laptop diff --git a/apps/web/src/components/layout/MainLayout.tsx b/apps/web/src/components/layout/MainLayout.tsx index 6605aa5..08cf527 100644 --- a/apps/web/src/components/layout/MainLayout.tsx +++ b/apps/web/src/components/layout/MainLayout.tsx @@ -35,10 +35,11 @@ export function MainLayout() { const subscriptionName = searchParams.get('subscription'); const isMessagesPage = window.location.pathname === '/messages'; - // Resolve current namespace to check environment + // Resolve current namespace to check environment and permissions const { data: namespaces } = useNamespaces(); const currentNamespace = namespaces?.find(ns => ns.id === namespaceId); const isProd = currentNamespace?.environment === 'Prod'; + const canUseFab = !isProd && currentNamespace?.hasSendPermission !== false; // Determine entity type and names for FAB const entityType: 'queue' | 'topic' = topicName ? 'topic' : 'queue'; @@ -78,8 +79,8 @@ export function MainLayout() { - {/* FAB - Only show on messages page and NOT in production */} - {isMessagesPage && !isProd && ( + {/* FAB - Only show on messages page, NOT in production, and only with Send permission */} + {isMessagesPage && canUseFab && ( ns.id === namespaceId); const isProd = currentNs?.environment === 'Prod'; + const hasSendPermission = currentNs?.hasSendPermission !== false; // const purgeMessage = usePurgeMessage(); // Removed - Azure Service Bus limitation const [searchParams] = useSearchParams(); @@ -226,6 +227,21 @@ function ActionButtons({ message, namespaceId, forensicSafety }: ActionButtonsPr ); } + // Send permission guard β€” block replay without Manage SAS policy + if (!hasSendPermission) { + return ( + + ); + } + if (!isFromDeadLetter) { return ( <> diff --git a/apps/web/src/lib/helpContent.ts b/apps/web/src/lib/helpContent.ts index 7c454d2..df956ce 100644 --- a/apps/web/src/lib/helpContent.ts +++ b/apps/web/src/lib/helpContent.ts @@ -43,7 +43,7 @@ export const glossary: Record = { environment: { term: 'Environment', definition: - 'Classifies a namespace as Development, UAT, or Production. Production namespaces have safety guards β€” send and replay actions are disabled to prevent accidental data modification.', + 'Classifies a namespace as Development, UAT, or Production. Production namespaces have safety guards β€” the Quick Actions button (FAB), send, dead-letter, and replay actions are all disabled to prevent accidental data modification.', }, }; @@ -66,13 +66,13 @@ export const tooltips = { connectionString: { text: 'Azure Service Bus connection string', detail: - 'Paste your Service Bus connection string from the Azure Portal β†’ Shared access policies. We recommend a "Listen-only" policy for read access. An admin key (RootManageSharedAccessKey) will trigger a security warning.', + 'Paste your Service Bus connection string from the Azure Portal β†’ Shared access policies. Use a Listen-only policy for read-only browsing, or a Manage policy for full Quick Actions (FAB) functionality including sending messages, generating test data, and dead-lettering.', action: 'Go to Azure Portal β†’ Service Bus β†’ Shared access policies β†’ Copy the connection string.', } as TooltipContent, environment: { text: "Classify this namespace\u2019s environment", detail: - 'Production namespaces have safety guards: the send-message and replay actions are disabled to prevent accidental data changes. Dev and UAT allow full operations.', + 'Production namespaces have safety guards: the Quick Actions button (FAB) is hidden, and send, generate, dead-letter, and replay actions are all disabled. Dev and UAT allow full operations when the SAS policy has Manage permission.', action: 'Select "Prod" for live namespaces, "Dev" or "Uat" for lower environments.', } as TooltipContent, savedConnections: { @@ -217,19 +217,19 @@ export const tooltips = { mainButton: { text: 'Quick actions menu', detail: - 'Open the floating action menu to send test messages, generate sample data, move messages to the DLQ for testing, or refresh all data. This menu is hidden in Production environments for safety.', + 'Open the floating action menu to send test messages, generate sample data, move messages to the DLQ for testing, or refresh all data. Hidden in Production environments and when the SAS policy lacks Manage permission.', } as TooltipContent, sendMessage: { text: 'Send a test message to this queue/topic', - detail: 'Compose and send a JSON message for testing. Only available in Dev/UAT.', + detail: 'Compose and send a JSON message for testing. Requires Manage SAS permission. Only available in Dev/UAT.', } as TooltipContent, generateMessages: { text: 'Generate random sample messages', - detail: 'Creates multiple test messages with realistic payloads for load testing and demo purposes.', + detail: 'Creates multiple test messages with realistic payloads for load testing and demo purposes. Requires Manage SAS permission.', } as TooltipContent, testDlq: { text: 'Move messages to dead-letter queue', - detail: 'Dead-letters up to 3 active messages β€” useful for testing DLQ monitoring and auto-replay rules.', + detail: 'Dead-letters up to 3 active messages β€” useful for testing DLQ monitoring and auto-replay rules. Requires Manage SAS permission.', } as TooltipContent, }, @@ -329,12 +329,12 @@ export const helpSections: HelpSection[] = [ { question: 'What connection string format is required?', answer: - 'The format is: Endpoint=sb://.servicebus.windows.net/;SharedAccessKeyName=;SharedAccessKey=. We recommend a "Listen-only" policy for safety.', + 'The format is: Endpoint=sb://.servicebus.windows.net/;SharedAccessKeyName=;SharedAccessKey=. Use a Listen-only policy for read-only browsing, or a Manage policy for full Quick Actions (FAB) functionality.', }, { question: 'What does the environment selector do?', answer: - 'It classifies the namespace as Dev, UAT, or Prod. Production namespaces have safety guards β€” the send-message, generate-messages, and replay actions are all disabled to prevent accidental data modification.', + 'It classifies the namespace as Dev, UAT, or Prod. Production namespaces have strict safety guards β€” the Quick Actions button (FAB) is completely hidden, and send, generate, dead-letter, and replay actions are all disabled. Dev and UAT allow full operations when the SAS policy has Manage permission.', }, { question: 'How do I navigate between namespaces?', @@ -371,7 +371,7 @@ export const helpSections: HelpSection[] = [ { question: 'How does Replay / Resubmit work?', answer: - 'Replay sends a dead-lettered message back to the original queue for reprocessing. It copies the body and properties. Only available in Dev/UAT β€” Production blocks replays.', + 'Replay sends a dead-lettered message back to the original queue for reprocessing. It copies the body and properties. Requires a SAS policy with Send permission. Only available in Dev/UAT β€” Production blocks replays.', }, ], }, @@ -442,17 +442,17 @@ export const helpSections: HelpSection[] = [ { question: 'Where is the + button / quick actions menu?', answer: - 'The floating action button (FAB) appears in the bottom-right corner on the Messages page. It\'s hidden in Production environments as a safety measure.', + 'The floating action button (FAB) appears in the bottom-right corner on the Messages page. It requires: (1) a non-Production namespace, and (2) a SAS policy with Manage permission. If either condition is not met, the FAB is hidden.', }, { question: 'Why don\'t I see the + button?', answer: - 'The FAB is hidden in two cases: (1) you\'re not on the Messages page, or (2) your namespace is classified as Production. Switch to a Dev/UAT namespace to see it.', + 'The FAB is hidden in three cases: (1) you\'re not on the Messages page, (2) your namespace is classified as Production, or (3) your SAS policy lacks Manage permission. Switch to a Dev/UAT namespace with a Manage policy to see it.', }, { question: 'What can I do from the FAB?', answer: - 'Send a test message, generate random sample messages, move messages to the DLQ for testing, or refresh all data. These actions are for development and testing only.', + 'Send a test message, generate random sample messages (realistic business scenarios), move messages to the DLQ for testing, or refresh all data. These actions require a Manage SAS policy and are disabled in Production.', }, ], }, @@ -473,6 +473,38 @@ export const helpSections: HelpSection[] = [ }, ], }, + { + id: 'permissions', + title: 'Permissions & Security', + icon: 'πŸ”’', + items: [ + { + question: 'What SAS permissions does ServiceHub need?', + answer: + 'It depends on your use case. Listen-only is sufficient for browsing messages, inspecting DLQ, and viewing metrics. Manage permission enables the Quick Actions (FAB) button for sending messages, generating test data, dead-lettering, and replay operations.', + }, + { + question: 'Why is the Quick Actions (FAB) button hidden?', + answer: + 'The FAB requires two conditions: (1) the namespace must be Dev or UAT (not Production), and (2) the SAS policy must have Manage permission. This prevents accidental modification of production data and ensures only authorized users can perform write operations.', + }, + { + question: 'What is the difference between Listen, Send, and Manage?', + answer: + 'Listen: Read messages without removing them (peek). Send: Write messages to queues/topics and replay from DLQ. Manage: Full control including Send + Listen + administrative operations. ServiceHub recommends Manage for Dev/UAT and Listen-only for Production.', + }, + { + question: 'Is it safe to use ServiceHub with production namespaces?', + answer: + 'Yes. When a namespace is classified as Production, ServiceHub operates in strict read-only mode β€” the FAB is hidden, send/dead-letter/replay actions are all blocked both in the UI and at the API level. A Listen-only SAS policy is all you need for Production.', + }, + { + question: 'What is Scalar API Docs (/scalar/v1)?', + answer: + 'Scalar is an interactive API documentation viewer, only available in Development mode. It lets developers explore and test all API endpoints. It is automatically disabled in Production deployments for security.', + }, + ], + }, { id: 'glossary', title: 'Azure Service Bus Glossary', diff --git a/apps/web/src/pages/ConnectPage.tsx b/apps/web/src/pages/ConnectPage.tsx index 4d01a3f..05d0224 100644 --- a/apps/web/src/pages/ConnectPage.tsx +++ b/apps/web/src/pages/ConnectPage.tsx @@ -94,17 +94,17 @@ export function ConnectPage() { // The backend attempts to detect permissions from the SAS policy name, but this is not always accurate // since Azure doesn't enforce naming conventions. We show a warning if permissions appear limited. if (createdNamespace.hasManagePermission === false && createdNamespace.hasSendPermission === false) { - // Listen-only β€” this is the recommended setup for read-only inspection + // Listen-only β€” read-only inspection mode toast.success( 'βœ“ Connected with Listen-only access. Perfect for DLQ inspection and message browsing. ' + - 'Note: Replay operations require a policy with Send permission.', + 'Quick Actions (FAB) require a Manage policy for send, generate, and dead-letter operations.', { duration: 8000 } ); } else if (createdNamespace.hasManagePermission === false) { - // Has Listen + Send but not Manage β€” good enough for most operations + // Has Listen + Send but not Manage toast( - 'βœ“ Connected. All DLQ inspection and replay features are available. ' + - 'Some administrative operations (queue creation) require Manage permission.', + 'βœ“ Connected with Send + Listen access. Replay and send operations are available. ' + + 'Some Quick Actions may require Manage permission.', { duration: 6000, style: { background: '#f0fdf4', color: '#166534', border: '1px solid #86efac' }, @@ -254,21 +254,26 @@ export function ConnectPage() {

- Recommended: Create a dedicated Listen-only policy (60 seconds, no admin required) + Create a dedicated SAS policy for ServiceHub

  1. Azure Portal β†’ your Service Bus namespace
  2. Shared access policies β†’ + Add policy
  3. -
  4. Name it servicehub β†’ tick Listen only
  5. +
  6. Name it servicehub
  7. Save β†’ copy Primary Connection String β†’ paste above
-

- Listen permission is all ServiceHub needs. No Manage, no admin role, no IT ticket required. +

+

+ Listen only β€” Browse messages, inspect DLQ, view metrics (read-only) +

+

+ Manage β€” Full access: send messages, generate test data, dead-letter, replay (Dev/UAT only) +

+
+

+ ⚠️ The Quick Actions button (FAB) requires a policy with Manage permission. Production namespaces always hide the FAB for safety.

-

- Also accepts Manage + Send + Listen policies if you already have one configured. -

@@ -287,7 +292,7 @@ export function ConnectPage() {

- Production namespaces have additional safety guards β€” message sending and dead-lettering are disabled. + Production namespaces have safety guards β€” Quick Actions (FAB), message sending, dead-lettering, and replay are all disabled.

diff --git a/services/api/DEPLOYMENT_OPERATIONS.md b/services/api/DEPLOYMENT_OPERATIONS.md index 3f72bd0..9b343e2 100644 --- a/services/api/DEPLOYMENT_OPERATIONS.md +++ b/services/api/DEPLOYMENT_OPERATIONS.md @@ -196,7 +196,7 @@ dotnet watch run --project src/ServiceHub.Api/ServiceHub.Api.csproj # 4. Access API # http://localhost:5000 -# http://localhost:5000/swagger +# http://localhost:5153/scalar/v1 ``` --- diff --git a/services/api/DOCUMENTATION_INDEX.md b/services/api/DOCUMENTATION_INDEX.md index c19a92b..f32fb34 100644 --- a/services/api/DOCUMENTATION_INDEX.md +++ b/services/api/DOCUMENTATION_INDEX.md @@ -431,7 +431,7 @@ A: See [DEPLOYMENT_OPERATIONS.md](./DEPLOYMENT_OPERATIONS.md) Performance Tuning A: See [ARCHITECTURE.md](./ARCHITECTURE.md) diagram 6 (Security Architecture) and [IMPLEMENTATION_PATTERNS.md](./IMPLEMENTATION_PATTERNS.md) section 5 (Security Implementation). **Q: Are there example requests?** -A: Yes! See [README.md](./README.md) section "First API Calls" with curl examples, or use Swagger UI at `/swagger` +A: Yes! See [README.md](./README.md) section "First API Calls" with curl examples, or use the API docs at `/scalar/v1` --- diff --git a/services/api/README.md b/services/api/README.md index 2143b1e..1236df3 100644 --- a/services/api/README.md +++ b/services/api/README.md @@ -70,7 +70,7 @@ dotnet watch --project src/ServiceHub.Api/ServiceHub.Api.csproj ### Access Points - **API**: http://localhost:5000 -- **Swagger UI**: http://localhost:5000/swagger +- **API Docs (Scalar)**: http://localhost:5153/scalar/v1 - **Health Check**: http://localhost:5000/health - **Ready Check**: http://localhost:5000/health/ready - **Live Check**: http://localhost:5000/health/live diff --git a/services/api/run-api.sh b/services/api/run-api.sh index de8d046..59c8543 100755 --- a/services/api/run-api.sh +++ b/services/api/run-api.sh @@ -40,7 +40,7 @@ echo -e "${YELLOW}API will be available at:${NC}" echo -e " β€’ ${GREEN}http://localhost:5153${NC} (local)" echo -e " β€’ ${GREEN}http://0.0.0.0:5153${NC} (all interfaces)" echo "" -echo -e "${YELLOW}Swagger UI: ${GREEN}http://localhost:5153/swagger${NC}" +echo -e "${YELLOW}API Docs: ${GREEN}http://localhost:5153/scalar/v1${NC}" echo "" echo -e "${YELLOW}Ctrl+C to stop the server${NC}" echo "" diff --git a/services/api/src/ServiceHub.Api/wwwroot/assets/index-BL6didGD.js b/services/api/src/ServiceHub.Api/wwwroot/assets/index-BL6didGD.js deleted file mode 100644 index ae068ec..0000000 --- a/services/api/src/ServiceHub.Api/wwwroot/assets/index-BL6didGD.js +++ /dev/null @@ -1,628 +0,0 @@ -var gv=Object.defineProperty;var ap=t=>{throw TypeError(t)};var yv=(t,r,s)=>r in t?gv(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var od=(t,r,s)=>yv(t,typeof r!="symbol"?r+"":r,s),ld=(t,r,s)=>r.has(t)||ap("Cannot "+s);var R=(t,r,s)=>(ld(t,r,"read from private field"),s?s.call(t):r.get(t)),Me=(t,r,s)=>r.has(t)?ap("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,s),ue=(t,r,s,i)=>(ld(t,r,"write to private field"),i?i.call(t,s):r.set(t,s),s),$e=(t,r,s)=>(ld(t,r,"access private method"),s);var Hl=(t,r,s,i)=>({set _(l){ue(t,r,l,s)},get _(){return R(t,r,i)}});function xv(t,r){for(var s=0;si[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function s(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=s(l);fetch(l.href,u)}})();function vv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cd={exports:{}},Zi={},ud={exports:{}},Ue={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ip;function bv(){if(ip)return Ue;ip=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=x&&T[x]||T["@@iterator"],typeof T=="function"?T:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function E(T,I,he){this.props=T,this.context=I,this.refs=S,this.updater=he||j}E.prototype.isReactComponent={},E.prototype.setState=function(T,I){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,I,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function D(){}D.prototype=E.prototype;function _(T,I,he){this.props=T,this.context=I,this.refs=S,this.updater=he||j}var A=_.prototype=new D;A.constructor=_,N(A,E.prototype),A.isPureReactComponent=!0;var U=Array.isArray,B=Object.prototype.hasOwnProperty,te={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function ee(T,I,he){var pe,G={},ge=null,Oe=null;if(I!=null)for(pe in I.ref!==void 0&&(Oe=I.ref),I.key!==void 0&&(ge=""+I.key),I)B.call(I,pe)&&!P.hasOwnProperty(pe)&&(G[pe]=I[pe]);var De=arguments.length-2;if(De===1)G.children=he;else if(1>>1,I=V[T];if(0>>1;Tl(G,J))gel(Oe,G)?(V[T]=Oe,V[ge]=J,T=ge):(V[T]=G,V[pe]=J,T=pe);else if(gel(Oe,J))V[T]=Oe,V[ge]=J,T=ge;else break e}}return le}function l(V,le){var J=V.sortIndex-le.sortIndex;return J!==0?J:V.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();t.unstable_now=function(){return d.now()-f}}var p=[],g=[],y=1,x=null,b=3,j=!1,N=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(V){for(var le=s(g);le!==null;){if(le.callback===null)i(g);else if(le.startTime<=V)i(g),le.sortIndex=le.expirationTime,r(p,le);else break;le=s(g)}}function U(V){if(S=!1,A(V),!N)if(s(p)!==null)N=!0,ie(B);else{var le=s(g);le!==null&&ve(U,le.startTime-V)}}function B(V,le){N=!1,S&&(S=!1,D(ee),ee=-1),j=!0;var J=b;try{for(A(le),x=s(p);x!==null&&(!(x.expirationTime>le)||V&&!Q());){var T=x.callback;if(typeof T=="function"){x.callback=null,b=x.priorityLevel;var I=T(x.expirationTime<=le);le=t.unstable_now(),typeof I=="function"?x.callback=I:x===s(p)&&i(p),A(le)}else i(p);x=s(p)}if(x!==null)var he=!0;else{var pe=s(g);pe!==null&&ve(U,pe.startTime-le),he=!1}return he}finally{x=null,b=J,j=!1}}var te=!1,P=null,ee=-1,W=5,K=-1;function Q(){return!(t.unstable_now()-KV||125T?(V.sortIndex=J,r(g,V),s(p)===null&&V===s(g)&&(S?(D(ee),ee=-1):S=!0,ve(U,J-T))):(V.sortIndex=I,r(p,V),N||j||(N=!0,ie(B))),V},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(V){var le=b;return function(){var J=b;b=le;try{return V.apply(this,arguments)}finally{b=J}}}})(hd)),hd}var dp;function Cv(){return dp||(dp=1,fd.exports=Ev()),fd.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var fp;function kv(){if(fp)return Xt;fp=1;var t=cf(),r=Cv();function s(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},x={};function b(e){return p.call(x,e)?!0:p.call(y,e)?!1:g.test(e)?x[e]=!0:(y[e]=!0,!1)}function j(e,n,o,c){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function N(e,n,o,c){if(n===null||typeof n>"u"||j(e,n,o,c))return!0;if(c)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function S(e,n,o,c,h,m,v){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=m,this.removeEmptyString=v}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){E[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];E[n]=new S(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){E[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){E[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){E[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){E[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){E[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){E[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){E[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function _(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(D,_);E[n]=new S(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(D,_);E[n]=new S(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(D,_);E[n]=new S(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){E[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),E.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){E[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function A(e,n,o,c){var h=E.hasOwnProperty(n)?E[n]:null;(h!==null?h.type!==0:c||!(2C||h[v]!==m[C]){var M=` -`+h[v].replace(" at new "," at ");return e.displayName&&M.includes("")&&(M=M.replace("",e.displayName)),M}while(1<=v&&0<=C);break}}}finally{he=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?I(e):""}function G(e){switch(e.tag){case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return e=pe(e.type,!1),e;case 11:return e=pe(e.type.render,!1),e;case 1:return e=pe(e.type,!0),e;default:return""}}function ge(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case te:return"Portal";case W:return"Profiler";case ee:return"StrictMode";case oe:return"Suspense";case de:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Q:return(e.displayName||"Context")+".Consumer";case K:return(e._context.displayName||"Context")+".Provider";case Re:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return n=e.displayName||null,n!==null?n:ge(e.type)||"Memo";case ie:n=e._payload,e=e._init;try{return ge(e(n))}catch{}}return null}function Oe(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(n);case 8:return n===ee?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function De(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ct(e){var n=Ze(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,m=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(v){c=""+v,m.call(this,v)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return c},setValue:function(v){c=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function An(e){e._valueTracker||(e._valueTracker=Ct(e))}function ct(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),c="";return e&&(c=Ze(e)?e.checked?"true":"false":e.value),e=c,e!==o?(n.setValue(e),!0):!1}function nr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _n(e,n){var o=n.checked;return J({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function pa(e,n){var o=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;o=De(n.value!=null?n.value:o),e._wrapperState={initialChecked:c,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function sr(e,n){n=n.checked,n!=null&&A(e,"checked",n,!1)}function Rs(e,n){sr(e,n);var o=De(n.value),c=n.type;if(o!=null)c==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?In(e,n.type,o):n.hasOwnProperty("defaultValue")&&In(e,n.type,De(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function ga(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function In(e,n,o){(n!=="number"||nr(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var sn=Array.isArray;function fe(e,n,o,c){if(e=e.options,n){n={};for(var h=0;h"+n.valueOf().toString()+"",n=Qt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function $n(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Ts={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pi=["Webkit","ms","Moz","O"];Object.keys(Ts).forEach(function(e){pi.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Ts[n]=Ts[e]})});function Fo(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Ts.hasOwnProperty(e)&&Ts[e]?(""+n).trim():n+"px"}function hr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var c=o.indexOf("--")===0,h=Fo(o,n[o],c);o==="float"&&(o="cssFloat"),c?e.setProperty(o,h):e[o]=h}}var $o=J({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ya(e,n){if(n){if($o[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function xa(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gi=null;function va(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zn=null,an=null,Hr=null;function zo(e){if(e=Fi(e)){if(typeof zn!="function")throw Error(s(280));var n=e.stateNode;n&&(n=sl(n),zn(e.stateNode,e.type,n))}}function yi(e){an?Hr?Hr.push(e):Hr=[e]:an=e}function Uo(){if(an){var e=an,n=Hr;if(Hr=an=null,zo(e),n)for(e=0;e>>=0,e===0?32:31-(Hn(e)/ln|0)|0}var cn=64,As=4194304;function _s(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function qo(e,n){var o=e.pendingLanes;if(o===0)return 0;var c=0,h=e.suspendedLanes,m=e.pingedLanes,v=o&268435455;if(v!==0){var C=v&~h;C!==0?c=_s(C):(m&=v,m!==0&&(c=_s(m)))}else v=o&~h,v!==0?c=_s(v):m!==0&&(c=_s(m));if(c===0)return 0;if(n!==0&&n!==c&&(n&h)===0&&(h=c&-c,m=n&-n,h>=m||h===16&&(m&4194240)!==0))return n;if((c&4)!==0&&(c|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0o;o++)n.push(e);return n}function wi(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-et(n),e[n]=o}function Iy(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0=Mi),Xf=" ",Zf=!1;function eh(e,n){switch(e){case"keyup":return dx.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function th(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Na=!1;function hx(e,n){switch(e){case"compositionend":return th(n);case"keypress":return n.which!==32?null:(Zf=!0,Xf);case"textInput":return e=n.data,e===Xf&&Zf?null:e;default:return null}}function mx(e,n){if(Na)return e==="compositionend"||!Uc&&eh(e,n)?(e=Vf(),Wo=Ac=Kn=null,Na=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:o,offset:n-e};e=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=lh(o)}}function uh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?uh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function dh(){for(var e=window,n=nr();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=nr(e.document)}return n}function Bc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function jx(e){var n=dh(),o=e.focusedElem,c=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&uh(o.ownerDocument.documentElement,o)){if(c!==null&&Bc(o)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var h=o.textContent.length,m=Math.min(c.start,h);c=c.end===void 0?m:Math.min(c.end,h),!e.extend&&m>c&&(h=c,c=m,m=h),h=ch(o,m);var v=ch(o,c);h&&v&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(n=n.createRange(),n.setStart(h.node,h.offset),e.removeAllRanges(),m>c?(e.addRange(n),e.extend(v.node,v.offset)):(n.setEnd(v.node,v.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,ja=null,Qc=null,Oi=null,Vc=!1;function fh(e,n,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Vc||ja==null||ja!==nr(c)||(c=ja,"selectionStart"in c&&Bc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Oi&&Li(Oi,c)||(Oi=c,c=tl(Qc,"onSelect"),0Ra||(e.current=su[Ra],su[Ra]=null,Ra--)}function tt(e,n){Ra++,su[Ra]=e.current,e.current=n}var Xn={},Mt=Jn(Xn),Wt=Jn(!1),Fs=Xn;function Ma(e,n){var o=e.type.contextTypes;if(!o)return Xn;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var h={},m;for(m in o)h[m]=n[m];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),h}function Kt(e){return e=e.childContextTypes,e!=null}function al(){nt(Wt),nt(Mt)}function kh(e,n,o){if(Mt.current!==Xn)throw Error(s(168));tt(Mt,n),tt(Wt,o)}function Rh(e,n,o){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return o;c=c.getChildContext();for(var h in c)if(!(h in n))throw Error(s(108,Oe(e)||"Unknown",h));return J({},o,c)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,Fs=Mt.current,tt(Mt,e),tt(Wt,Wt.current),!0}function Mh(e,n,o){var c=e.stateNode;if(!c)throw Error(s(169));o?(e=Rh(e,n,Fs),c.__reactInternalMemoizedMergedChildContext=e,nt(Wt),nt(Mt),tt(Mt,e)):nt(Wt),tt(Wt,o)}var dn=null,ol=!1,au=!1;function Th(e){dn===null?dn=[e]:dn.push(e)}function Ax(e){ol=!0,Th(e)}function Zn(){if(!au&&dn!==null){au=!0;var e=0,n=Xe;try{var o=dn;for(Xe=1;e>=v,h-=v,fn=1<<32-et(n)+h|o<_e?(St=Le,Le=null):St=Le.sibling;var Ke=Y(F,Le,$[_e],ne);if(Ke===null){Le===null&&(Le=St);break}e&&Le&&Ke.alternate===null&&n(F,Le),L=m(Ke,L,_e),Pe===null?Ee=Ke:Pe.sibling=Ke,Pe=Ke,Le=St}if(_e===$.length)return o(F,Le),at&&zs(F,_e),Ee;if(Le===null){for(;_e<$.length;_e++)Le=re(F,$[_e],ne),Le!==null&&(L=m(Le,L,_e),Pe===null?Ee=Le:Pe.sibling=Le,Pe=Le);return at&&zs(F,_e),Ee}for(Le=c(F,Le);_e<$.length;_e++)St=me(Le,F,_e,$[_e],ne),St!==null&&(e&&St.alternate!==null&&Le.delete(St.key===null?_e:St.key),L=m(St,L,_e),Pe===null?Ee=St:Pe.sibling=St,Pe=St);return e&&Le.forEach(function(ls){return n(F,ls)}),at&&zs(F,_e),Ee}function je(F,L,$,ne){var Ee=le($);if(typeof Ee!="function")throw Error(s(150));if($=Ee.call($),$==null)throw Error(s(151));for(var Pe=Ee=null,Le=L,_e=L=0,St=null,Ke=$.next();Le!==null&&!Ke.done;_e++,Ke=$.next()){Le.index>_e?(St=Le,Le=null):St=Le.sibling;var ls=Y(F,Le,Ke.value,ne);if(ls===null){Le===null&&(Le=St);break}e&&Le&&ls.alternate===null&&n(F,Le),L=m(ls,L,_e),Pe===null?Ee=ls:Pe.sibling=ls,Pe=ls,Le=St}if(Ke.done)return o(F,Le),at&&zs(F,_e),Ee;if(Le===null){for(;!Ke.done;_e++,Ke=$.next())Ke=re(F,Ke.value,ne),Ke!==null&&(L=m(Ke,L,_e),Pe===null?Ee=Ke:Pe.sibling=Ke,Pe=Ke);return at&&zs(F,_e),Ee}for(Le=c(F,Le);!Ke.done;_e++,Ke=$.next())Ke=me(Le,F,_e,Ke.value,ne),Ke!==null&&(e&&Ke.alternate!==null&&Le.delete(Ke.key===null?_e:Ke.key),L=m(Ke,L,_e),Pe===null?Ee=Ke:Pe.sibling=Ke,Pe=Ke);return e&&Le.forEach(function(pv){return n(F,pv)}),at&&zs(F,_e),Ee}function mt(F,L,$,ne){if(typeof $=="object"&&$!==null&&$.type===P&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case B:e:{for(var Ee=$.key,Pe=L;Pe!==null;){if(Pe.key===Ee){if(Ee=$.type,Ee===P){if(Pe.tag===7){o(F,Pe.sibling),L=h(Pe,$.props.children),L.return=F,F=L;break e}}else if(Pe.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ie&&_h(Ee)===Pe.type){o(F,Pe.sibling),L=h(Pe,$.props),L.ref=$i(F,Pe,$),L.return=F,F=L;break e}o(F,Pe);break}else n(F,Pe);Pe=Pe.sibling}$.type===P?(L=Ks($.props.children,F.mode,ne,$.key),L.return=F,F=L):(ne=Al($.type,$.key,$.props,null,F.mode,ne),ne.ref=$i(F,L,$),ne.return=F,F=ne)}return v(F);case te:e:{for(Pe=$.key;L!==null;){if(L.key===Pe)if(L.tag===4&&L.stateNode.containerInfo===$.containerInfo&&L.stateNode.implementation===$.implementation){o(F,L.sibling),L=h(L,$.children||[]),L.return=F,F=L;break e}else{o(F,L);break}else n(F,L);L=L.sibling}L=rd($,F.mode,ne),L.return=F,F=L}return v(F);case ie:return Pe=$._init,mt(F,L,Pe($._payload),ne)}if(sn($))return we(F,L,$,ne);if(le($))return je(F,L,$,ne);dl(F,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,L!==null&&L.tag===6?(o(F,L.sibling),L=h(L,$),L.return=F,F=L):(o(F,L),L=td($,F.mode,ne),L.return=F,F=L),v(F)):o(F,L)}return mt}var Oa=Ih(!0),Fh=Ih(!1),fl=Jn(null),hl=null,Da=null,du=null;function fu(){du=Da=hl=null}function hu(e){var n=fl.current;nt(fl),e._currentValue=n}function mu(e,n,o){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===o)break;e=e.return}}function Aa(e,n){hl=e,du=Da=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Gt=!0),e.firstContext=null)}function yr(e){var n=e._currentValue;if(du!==e)if(e={context:e,memoizedValue:n,next:null},Da===null){if(hl===null)throw Error(s(308));Da=e,hl.dependencies={lanes:0,firstContext:e}}else Da=Da.next=e;return n}var Us=null;function pu(e){Us===null?Us=[e]:Us.push(e)}function $h(e,n,o,c){var h=n.interleaved;return h===null?(o.next=o,pu(n)):(o.next=h.next,h.next=o),n.interleaved=o,mn(e,c)}function mn(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var es=!1;function gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zh(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function ts(e,n,o){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(We&2)!==0){var h=c.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),c.pending=n,mn(e,o)}return h=c.interleaved,h===null?(n.next=n,pu(c)):(n.next=h.next,h.next=n),c.interleaved=n,mn(e,o)}function ml(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,o|=c,n.lanes=o,Tc(e,o)}}function Uh(e,n){var o=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var h=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var v={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};m===null?h=m=v:m=m.next=v,o=o.next}while(o!==null);m===null?h=m=n:m=m.next=n}else h=m=n;o={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:m,shared:c.shared,effects:c.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function pl(e,n,o,c){var h=e.updateQueue;es=!1;var m=h.firstBaseUpdate,v=h.lastBaseUpdate,C=h.shared.pending;if(C!==null){h.shared.pending=null;var M=C,q=M.next;M.next=null,v===null?m=q:v.next=q,v=M;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,C=Z.lastBaseUpdate,C!==v&&(C===null?Z.firstBaseUpdate=q:C.next=q,Z.lastBaseUpdate=M))}if(m!==null){var re=h.baseState;v=0,Z=q=M=null,C=m;do{var Y=C.lane,me=C.eventTime;if((c&Y)===Y){Z!==null&&(Z=Z.next={eventTime:me,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var we=e,je=C;switch(Y=n,me=o,je.tag){case 1:if(we=je.payload,typeof we=="function"){re=we.call(me,re,Y);break e}re=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=je.payload,Y=typeof we=="function"?we.call(me,re,Y):we,Y==null)break e;re=J({},re,Y);break e;case 2:es=!0}}C.callback!==null&&C.lane!==0&&(e.flags|=64,Y=h.effects,Y===null?h.effects=[C]:Y.push(C))}else me={eventTime:me,lane:Y,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Z===null?(q=Z=me,M=re):Z=Z.next=me,v|=Y;if(C=C.next,C===null){if(C=h.shared.pending,C===null)break;Y=C,C=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);if(Z===null&&(M=re),h.baseState=M,h.firstBaseUpdate=q,h.lastBaseUpdate=Z,n=h.shared.interleaved,n!==null){h=n;do v|=h.lane,h=h.next;while(h!==n)}else m===null&&(h.shared.lanes=0);Bs|=v,e.lanes=v,e.memoizedState=re}}function qh(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;no?o:4,e(!0);var c=wu.transition;wu.transition={};try{e(!1),n()}finally{Xe=o,wu.transition=c}}function om(){return xr().memoizedState}function $x(e,n,o){var c=as(e);if(o={lane:c,action:o,hasEagerState:!1,eagerState:null,next:null},lm(e))cm(n,o);else if(o=$h(e,n,o,c),o!==null){var h=$t();_r(o,e,c,h),um(o,n,c)}}function zx(e,n,o){var c=as(e),h={lane:c,action:o,hasEagerState:!1,eagerState:null,next:null};if(lm(e))cm(n,h);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var v=n.lastRenderedState,C=m(v,o);if(h.hasEagerState=!0,h.eagerState=C,Pr(C,v)){var M=n.interleaved;M===null?(h.next=h,pu(n)):(h.next=M.next,M.next=h),n.interleaved=h;return}}catch{}finally{}o=$h(e,n,h,c),o!==null&&(h=$t(),_r(o,e,c,h),um(o,n,c))}}function lm(e){var n=e.alternate;return e===ot||n!==null&&n===ot}function cm(e,n){Hi=xl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function um(e,n,o){if((o&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,o|=c,n.lanes=o,Tc(e,o)}}var wl={readContext:yr,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},Ux={readContext:yr,useCallback:function(e,n){return Wr().memoizedState=[e,n===void 0?null:n],e},useContext:yr,useEffect:Zh,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,vl(4194308,4,rm.bind(null,n,e),o)},useLayoutEffect:function(e,n){return vl(4194308,4,e,n)},useInsertionEffect:function(e,n){return vl(4,2,e,n)},useMemo:function(e,n){var o=Wr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var c=Wr();return n=o!==void 0?o(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=$x.bind(null,ot,e),[c.memoizedState,e]},useRef:function(e){var n=Wr();return e={current:e},n.memoizedState=e},useState:Jh,useDebugValue:Ru,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=Jh(!1),n=e[0];return e=Fx.bind(null,e[1]),Wr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var c=ot,h=Wr();if(at){if(o===void 0)throw Error(s(407));o=o()}else{if(o=n(),jt===null)throw Error(s(349));(Hs&30)!==0||Vh(c,n,o)}h.memoizedState=o;var m={value:o,getSnapshot:n};return h.queue=m,Zh(Kh.bind(null,c,m,e),[e]),c.flags|=2048,Vi(9,Wh.bind(null,c,m,o,n),void 0,null),o},useId:function(){var e=Wr(),n=jt.identifierPrefix;if(at){var o=hn,c=fn;o=(c&~(1<<32-et(c)-1)).toString(32)+o,n=":"+n+"R"+o,o=Bi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=v.createElement(o,{is:c.is}):(e=v.createElement(o),o==="select"&&(v=e,c.multiple?v.multiple=!0:c.size&&(v.size=c.size))):e=v.createElementNS(e,o),e[Qr]=n,e[Ii]=c,Tm(e,n,!1,!1),n.stateNode=e;e:{switch(v=xa(o,c),o){case"dialog":rt("cancel",e),rt("close",e),h=c;break;case"iframe":case"object":case"embed":rt("load",e),h=c;break;case"video":case"audio":for(h=0;hza&&(n.flags|=128,c=!0,Wi(m,!1),n.lanes=4194304)}else{if(!c)if(e=gl(v),e!==null){if(n.flags|=128,c=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),Wi(m,!0),m.tail===null&&m.tailMode==="hidden"&&!v.alternate&&!at)return Pt(n),null}else 2*Je()-m.renderingStartTime>za&&o!==1073741824&&(n.flags|=128,c=!0,Wi(m,!1),n.lanes=4194304);m.isBackwards?(v.sibling=n.child,n.child=v):(o=m.last,o!==null?o.sibling=v:n.child=v,m.last=v)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=Je(),n.sibling=null,o=it.current,tt(it,c?o&1|2:o&1),n):(Pt(n),null);case 22:case 23:return Xu(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(cr&1073741824)!==0&&(Pt(n),n.subtreeFlags&6&&(n.flags|=8192)):Pt(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function Gx(e,n){switch(ou(n),n.tag){case 1:return Kt(n.type)&&al(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _a(),nt(Wt),nt(Mt),bu(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return xu(n),null;case 13:if(nt(it),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));La()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return nt(it),null;case 4:return _a(),null;case 10:return hu(n.type._context),null;case 22:case 23:return Xu(),null;case 24:return null;default:return null}}var El=!1,Lt=!1,Yx=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Fa(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(c){ut(e,n,c)}else o.current=null}function zu(e,n,o){try{o()}catch(c){ut(e,n,c)}}var Om=!1;function Jx(e,n){if(Xc=Qo,e=dh(),Bc(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var h=c.anchorOffset,m=c.focusNode;c=c.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var v=0,C=-1,M=-1,q=0,Z=0,re=e,Y=null;t:for(;;){for(var me;re!==o||h!==0&&re.nodeType!==3||(C=v+h),re!==m||c!==0&&re.nodeType!==3||(M=v+c),re.nodeType===3&&(v+=re.nodeValue.length),(me=re.firstChild)!==null;)Y=re,re=me;for(;;){if(re===e)break t;if(Y===o&&++q===h&&(C=v),Y===m&&++Z===c&&(M=v),(me=re.nextSibling)!==null)break;re=Y,Y=re.parentNode}re=me}o=C===-1||M===-1?null:{start:C,end:M}}else o=null}o=o||{start:0,end:0}}else o=null;for(Zc={focusedElem:e,selectionRange:o},Qo=!1,xe=n;xe!==null;)if(n=xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,xe=e;else for(;xe!==null;){n=xe;try{var we=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var je=we.memoizedProps,mt=we.memoizedState,F=n.stateNode,L=F.getSnapshotBeforeUpdate(n.elementType===n.type?je:Or(n.type,je),mt);F.__reactInternalSnapshotBeforeUpdate=L}break;case 3:var $=n.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ne){ut(n,n.return,ne)}if(e=n.sibling,e!==null){e.return=n.return,xe=e;break}xe=n.return}return we=Om,Om=!1,we}function Ki(e,n,o){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&e)===e){var m=h.destroy;h.destroy=void 0,m!==void 0&&zu(n,o,m)}h=h.next}while(h!==c)}}function Cl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var c=o.create;o.destroy=c()}o=o.next}while(o!==n)}}function Uu(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function Dm(e){var n=e.alternate;n!==null&&(e.alternate=null,Dm(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Qr],delete n[Ii],delete n[nu],delete n[Ox],delete n[Dx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Am(e){return e.tag===5||e.tag===3||e.tag===4}function _m(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Am(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qu(e,n,o){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=nl));else if(c!==4&&(e=e.child,e!==null))for(qu(e,n,o),e=e.sibling;e!==null;)qu(e,n,o),e=e.sibling}function Hu(e,n,o){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(Hu(e,n,o),e=e.sibling;e!==null;)Hu(e,n,o),e=e.sibling}var kt=null,Dr=!1;function rs(e,n,o){for(o=o.child;o!==null;)Im(e,n,o),o=o.sibling}function Im(e,n,o){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(on,o)}catch{}switch(o.tag){case 5:Lt||Fa(o,n);case 6:var c=kt,h=Dr;kt=null,rs(e,n,o),kt=c,Dr=h,kt!==null&&(Dr?(e=kt,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):kt.removeChild(o.stateNode));break;case 18:kt!==null&&(Dr?(e=kt,o=o.stateNode,e.nodeType===8?ru(e.parentNode,o):e.nodeType===1&&ru(e,o),Ci(e)):ru(kt,o.stateNode));break;case 4:c=kt,h=Dr,kt=o.stateNode.containerInfo,Dr=!0,rs(e,n,o),kt=c,Dr=h;break;case 0:case 11:case 14:case 15:if(!Lt&&(c=o.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var m=h,v=m.destroy;m=m.tag,v!==void 0&&((m&2)!==0||(m&4)!==0)&&zu(o,n,v),h=h.next}while(h!==c)}rs(e,n,o);break;case 1:if(!Lt&&(Fa(o,n),c=o.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=o.memoizedProps,c.state=o.memoizedState,c.componentWillUnmount()}catch(C){ut(o,n,C)}rs(e,n,o);break;case 21:rs(e,n,o);break;case 22:o.mode&1?(Lt=(c=Lt)||o.memoizedState!==null,rs(e,n,o),Lt=c):rs(e,n,o);break;default:rs(e,n,o)}}function Fm(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Yx),n.forEach(function(c){var h=iv.bind(null,e,c);o.has(c)||(o.add(c),c.then(h,h))})}}function Ar(e,n){var o=n.deletions;if(o!==null)for(var c=0;ch&&(h=v),c&=~m}if(c=h,c=Je()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Zx(c/1960))-c,10e?16:e,ss===null)var c=!1;else{if(e=ss,ss=null,Pl=0,(We&6)!==0)throw Error(s(331));var h=We;for(We|=4,xe=e.current;xe!==null;){var m=xe,v=m.child;if((xe.flags&16)!==0){var C=m.deletions;if(C!==null){for(var M=0;MJe()-Vu?Vs(e,0):Qu|=o),Jt(e,n)}function Jm(e,n){n===0&&((e.mode&1)===0?n=1:(n=As,As<<=1,(As&130023424)===0&&(As=4194304)));var o=$t();e=mn(e,n),e!==null&&(wi(e,n,o),Jt(e,o))}function av(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Jm(e,o)}function iv(e,n){var o=0;switch(e.tag){case 13:var c=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(s(314))}c!==null&&c.delete(n),Jm(e,o)}var Xm;Xm=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Wt.current)Gt=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Gt=!1,Wx(e,n,o);Gt=(e.flags&131072)!==0}else Gt=!1,at&&(n.flags&1048576)!==0&&Ph(n,cl,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;Sl(e,n),e=n.pendingProps;var h=Ma(n,Mt.current);Aa(n,o),h=ju(null,n,c,e,h,o);var m=Su();return n.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Kt(c)?(m=!0,il(n)):m=!1,n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,gu(n),h.updater=Nl,n.stateNode=h,h._reactInternals=n,Tu(n,c,e,o),n=Du(null,n,c,!0,m,o)):(n.tag=0,at&&m&&iu(n),Ft(null,n,h,o),n=n.child),n;case 16:c=n.elementType;e:{switch(Sl(e,n),e=n.pendingProps,h=c._init,c=h(c._payload),n.type=c,h=n.tag=lv(c),e=Or(c,e),h){case 0:n=Ou(null,n,c,e,o);break e;case 1:n=Sm(null,n,c,e,o);break e;case 11:n=vm(null,n,c,e,o);break e;case 14:n=bm(null,n,c,Or(c.type,e),o);break e}throw Error(s(306,c,""))}return n;case 0:return c=n.type,h=n.pendingProps,h=n.elementType===c?h:Or(c,h),Ou(e,n,c,h,o);case 1:return c=n.type,h=n.pendingProps,h=n.elementType===c?h:Or(c,h),Sm(e,n,c,h,o);case 3:e:{if(Em(n),e===null)throw Error(s(387));c=n.pendingProps,m=n.memoizedState,h=m.element,zh(e,n),pl(n,c,null,o);var v=n.memoizedState;if(c=v.element,m.isDehydrated)if(m={element:c,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){h=Ia(Error(s(423)),n),n=Cm(e,n,c,o,h);break e}else if(c!==h){h=Ia(Error(s(424)),n),n=Cm(e,n,c,o,h);break e}else for(lr=Yn(n.stateNode.containerInfo.firstChild),or=n,at=!0,Lr=null,o=Fh(n,null,c,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(La(),c===h){n=gn(e,n,o);break e}Ft(e,n,c,o)}n=n.child}return n;case 5:return Hh(n),e===null&&cu(n),c=n.type,h=n.pendingProps,m=e!==null?e.memoizedProps:null,v=h.children,eu(c,h)?v=null:m!==null&&eu(c,m)&&(n.flags|=32),jm(e,n),Ft(e,n,v,o),n.child;case 6:return e===null&&cu(n),null;case 13:return km(e,n,o);case 4:return yu(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=Oa(n,null,c,o):Ft(e,n,c,o),n.child;case 11:return c=n.type,h=n.pendingProps,h=n.elementType===c?h:Or(c,h),vm(e,n,c,h,o);case 7:return Ft(e,n,n.pendingProps,o),n.child;case 8:return Ft(e,n,n.pendingProps.children,o),n.child;case 12:return Ft(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(c=n.type._context,h=n.pendingProps,m=n.memoizedProps,v=h.value,tt(fl,c._currentValue),c._currentValue=v,m!==null)if(Pr(m.value,v)){if(m.children===h.children&&!Wt.current){n=gn(e,n,o);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var C=m.dependencies;if(C!==null){v=m.child;for(var M=C.firstContext;M!==null;){if(M.context===c){if(m.tag===1){M=pn(-1,o&-o),M.tag=2;var q=m.updateQueue;if(q!==null){q=q.shared;var Z=q.pending;Z===null?M.next=M:(M.next=Z.next,Z.next=M),q.pending=M}}m.lanes|=o,M=m.alternate,M!==null&&(M.lanes|=o),mu(m.return,o,n),C.lanes|=o;break}M=M.next}}else if(m.tag===10)v=m.type===n.type?null:m.child;else if(m.tag===18){if(v=m.return,v===null)throw Error(s(341));v.lanes|=o,C=v.alternate,C!==null&&(C.lanes|=o),mu(v,o,n),v=m.sibling}else v=m.child;if(v!==null)v.return=m;else for(v=m;v!==null;){if(v===n){v=null;break}if(m=v.sibling,m!==null){m.return=v.return,v=m;break}v=v.return}m=v}Ft(e,n,h.children,o),n=n.child}return n;case 9:return h=n.type,c=n.pendingProps.children,Aa(n,o),h=yr(h),c=c(h),n.flags|=1,Ft(e,n,c,o),n.child;case 14:return c=n.type,h=Or(c,n.pendingProps),h=Or(c.type,h),bm(e,n,c,h,o);case 15:return wm(e,n,n.type,n.pendingProps,o);case 17:return c=n.type,h=n.pendingProps,h=n.elementType===c?h:Or(c,h),Sl(e,n),n.tag=1,Kt(c)?(e=!0,il(n)):e=!1,Aa(n,o),fm(n,c,h),Tu(n,c,h,o),Du(null,n,c,!0,e,o);case 19:return Mm(e,n,o);case 22:return Nm(e,n,o)}throw Error(s(156,n.tag))};function Zm(e,n){return ht(e,n)}function ov(e,n,o,c){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(e,n,o,c){return new ov(e,n,o,c)}function ed(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lv(e){if(typeof e=="function")return ed(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Re)return 11;if(e===se)return 14}return 2}function os(e,n){var o=e.alternate;return o===null?(o=br(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Al(e,n,o,c,h,m){var v=2;if(c=e,typeof e=="function")ed(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case P:return Ks(o.children,h,m,n);case ee:v=8,h|=8;break;case W:return e=br(12,o,n,h|2),e.elementType=W,e.lanes=m,e;case oe:return e=br(13,o,n,h),e.elementType=oe,e.lanes=m,e;case de:return e=br(19,o,n,h),e.elementType=de,e.lanes=m,e;case ve:return _l(o,h,m,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:v=10;break e;case Q:v=9;break e;case Re:v=11;break e;case se:v=14;break e;case ie:v=16,c=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=br(v,o,n,h),n.elementType=e,n.type=c,n.lanes=m,n}function Ks(e,n,o,c){return e=br(7,e,c,n),e.lanes=o,e}function _l(e,n,o,c){return e=br(22,e,c,n),e.elementType=ve,e.lanes=o,e.stateNode={isHidden:!1},e}function td(e,n,o){return e=br(6,e,null,n),e.lanes=o,e}function rd(e,n,o){return n=br(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function cv(e,n,o,c,h){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mc(0),this.expirationTimes=Mc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mc(0),this.identifierPrefix=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function nd(e,n,o,c,h,m,v,C,M){return e=new cv(e,n,o,C,M),n===1?(n=1,m===!0&&(n|=8)):n=0,m=br(3,null,null,n),e.current=m,m.stateNode=e,m.memoizedState={element:c,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},gu(m),e}function uv(e,n,o){var c=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),dd.exports=kv(),dd.exports}var mp;function Rv(){if(mp)return Bl;mp=1;var t=Vg();return Bl.createRoot=t.createRoot,Bl.hydrateRoot=t.hydrateRoot,Bl}var Mv=Rv();/** - * react-router v7.12.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var Wg=t=>{throw TypeError(t)},Tv=(t,r,s)=>r.has(t)||Wg("Cannot "+s),md=(t,r,s)=>(Tv(t,r,"read from private field"),s?s.call(t):r.get(t)),Pv=(t,r,s)=>r.has(t)?Wg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,s),pp="popstate";function Lv(t={}){function r(i,l){let{pathname:u,search:d,hash:f}=i.location;return ho("",{pathname:u,search:d,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(i,l){return typeof l=="string"?l:nn(l)}return Dv(r,s,null,t)}function ze(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function lt(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Ov(){return Math.random().toString(36).substring(2,10)}function gp(t,r){return{usr:t.state,key:t.key,idx:r}}function ho(t,r,s=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof r=="string"?Es(r):r,state:s,key:r&&r.key||i||Ov()}}function nn({pathname:t="/",search:r="",hash:s=""}){return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Es(t){let r={};if(t){let s=t.indexOf("#");s>=0&&(r.hash=t.substring(s),t=t.substring(0,s));let i=t.indexOf("?");i>=0&&(r.search=t.substring(i),t=t.substring(0,i)),t&&(r.pathname=t)}return r}function Dv(t,r,s,i={}){let{window:l=document.defaultView,v5Compat:u=!1}=i,d=l.history,f="POP",p=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function x(){f="POP";let E=y(),D=E==null?null:E-g;g=E,p&&p({action:f,location:S.location,delta:D})}function b(E,D){f="PUSH";let _=ho(S.location,E,D);g=y()+1;let A=gp(_,g),U=S.createHref(_);try{d.pushState(A,"",U)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(U)}u&&p&&p({action:f,location:S.location,delta:1})}function j(E,D){f="REPLACE";let _=ho(S.location,E,D);g=y();let A=gp(_,g),U=S.createHref(_);d.replaceState(A,"",U),u&&p&&p({action:f,location:S.location,delta:0})}function N(E){return Kg(E)}let S={get action(){return f},get location(){return t(l,d)},listen(E){if(p)throw new Error("A history only accepts one active listener");return l.addEventListener(pp,x),p=E,()=>{l.removeEventListener(pp,x),p=null}},createHref(E){return r(l,E)},createURL:N,encodeLocation(E){let D=N(E);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:b,replace:j,go(E){return d.go(E)}};return S}function Kg(t,r=!1){let s="http://localhost";typeof window<"u"&&(s=window.location.origin!=="null"?window.location.origin:window.location.href),ze(s,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:nn(t);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=s+i),new URL(i,s)}var oo,yp=class{constructor(t){if(Pv(this,oo,new Map),t)for(let[r,s]of t)this.set(r,s)}get(t){if(md(this,oo).has(t))return md(this,oo).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,r){md(this,oo).set(t,r)}};oo=new WeakMap;var Av=new Set(["lazy","caseSensitive","path","id","index","children"]);function _v(t){return Av.has(t)}var Iv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Fv(t){return Iv.has(t)}function $v(t){return t.index===!0}function mo(t,r,s=[],i={},l=!1){return t.map((u,d)=>{let f=[...s,String(d)],p=typeof u.id=="string"?u.id:f.join("-");if(ze(u.index!==!0||!u.children,"Cannot specify children on an index route"),ze(l||!i[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),$v(u)){let g={...u,id:p};return i[p]=xp(g,r(g)),g}else{let g={...u,id:p,children:void 0};return i[p]=xp(g,r(g)),u.children&&(g.children=mo(u.children,r,f,i,l)),g}})}function xp(t,r){return Object.assign(t,{...r,...typeof r.lazy=="object"&&r.lazy!=null?{lazy:{...t.lazy,...r.lazy}}:{}})}function us(t,r,s="/"){return lo(t,r,s,!1)}function lo(t,r,s,i){let l=typeof r=="string"?Es(r):r,u=Cr(l.pathname||"/",s);if(u==null)return null;let d=Gg(t);Uv(d);let f=null;for(let p=0;f==null&&p{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&p)return;ze(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let x=tn([i,y.relativePath]),b=s.concat(y);d.children&&d.children.length>0&&(ze(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Gg(d.children,r,b,x,p)),!(d.path==null&&!d.index)&&r.push({path:x,score:Kv(x,d.index),routesMeta:b})};return t.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))u(d,f);else for(let g of Yg(d.path))u(d,f,!0,g)}),r}function Yg(t){let r=t.split("/");if(r.length===0)return[];let[s,...i]=r,l=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return l?[u,""]:[u];let d=Yg(i.join("/")),f=[];return f.push(...d.map(p=>p===""?u:[u,p].join("/"))),l&&f.push(...d),f.map(p=>t.startsWith("/")&&p===""?"/":p)}function Uv(t){t.sort((r,s)=>r.score!==s.score?s.score-r.score:Gv(r.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var qv=/^:[\w-]+$/,Hv=3,Bv=2,Qv=1,Vv=10,Wv=-2,vp=t=>t==="*";function Kv(t,r){let s=t.split("/"),i=s.length;return s.some(vp)&&(i+=Wv),r&&(i+=Bv),s.filter(l=>!vp(l)).reduce((l,u)=>l+(qv.test(u)?Hv:u===""?Qv:Vv),i)}function Gv(t,r){return t.length===r.length&&t.slice(0,-1).every((i,l)=>i===r[l])?t[t.length-1]-r[r.length-1]:0}function Yv(t,r,s=!1){let{routesMeta:i}=t,l={},u="/",d=[];for(let f=0;f{if(y==="*"){let N=f[b]||"";d=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const j=f[b];return x&&!j?g[y]=void 0:g[y]=(j||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:t}}function Jv(t,r=!1,s=!0){lt(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,p)=>(i.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,r?void 0:"i"),i]}function Xv(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return lt(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),t}}function Cr(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,i=t.charAt(s);return i&&i!=="/"?null:t.slice(s)||"/"}function Zv({basename:t,pathname:r}){return r==="/"?t:tn([t,r])}var Jg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pc=t=>Jg.test(t);function eb(t,r="/"){let{pathname:s,search:i="",hash:l=""}=typeof t=="string"?Es(t):t,u;if(s)if(pc(s))u=s;else{if(s.includes("//")){let d=s;s=s.replace(/\/\/+/g,"/"),lt(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${s}`)}s.startsWith("/")?u=bp(s.substring(1),"/"):u=bp(s,r)}else u=r;return{pathname:u,search:rb(i),hash:nb(l)}}function bp(t,r){let s=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function pd(t,r,s,i){return`Cannot include a '${t}' character in a manually specified \`to.${r}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Xg(t){return t.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function gc(t){let r=Xg(t);return r.map((s,i)=>i===r.length-1?s.pathname:s.pathnameBase)}function yc(t,r,s,i=!1){let l;typeof t=="string"?l=Es(t):(l={...t},ze(!l.pathname||!l.pathname.includes("?"),pd("?","pathname","search",l)),ze(!l.pathname||!l.pathname.includes("#"),pd("#","pathname","hash",l)),ze(!l.search||!l.search.includes("#"),pd("#","search","hash",l)));let u=t===""||l.pathname==="",d=u?"/":l.pathname,f;if(d==null)f=s;else{let x=r.length-1;if(!i&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),x-=1;l.pathname=b.join("/")}f=x>=0?r[x]:"/"}let p=eb(l,f),g=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(g||y)&&(p.pathname+="/"),p}var tn=t=>t.join("/").replace(/\/\/+/g,"/"),tb=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),rb=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,nb=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,jo=class{constructor(t,r,s,i=!1){this.status=t,this.statusText=r||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function po(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function So(t){return t.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Zg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function e0(t,r){let s=t;if(typeof s!="string"||!Jg.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,l=!1;if(Zg)try{let u=new URL(window.location.href),d=s.startsWith("//")?new URL(u.protocol+s):new URL(s),f=Cr(d.pathname,r);d.origin===u.origin&&f!=null?s=f+d.search+d.hash:l=!0}catch{lt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:s}}var Ns=Symbol("Uninstrumented");function sb(t,r){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(l=>l({id:r.id,index:r.index,path:r.path,instrument(u){let d=Object.keys(s);for(let f of d)u[f]&&s[f].push(u[f])}}));let i={};if(typeof r.lazy=="function"&&s.lazy.length>0){let l=Ba(s.lazy,r.lazy,()=>{});l&&(i.lazy=l)}if(typeof r.lazy=="object"){let l=r.lazy;["middleware","loader","action"].forEach(u=>{let d=l[u],f=s[`lazy.${u}`];if(typeof d=="function"&&f.length>0){let p=Ba(f,d,()=>{});p&&(i.lazy=Object.assign(i.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(l=>{let u=r[l];if(typeof u=="function"&&s[l].length>0){let d=u[Ns]??u,f=Ba(s[l],d,(...p)=>wp(p[0]));f&&(l==="loader"&&d.hydrate===!0&&(f.hydrate=!0),f[Ns]=d,i[l]=f)}}),r.middleware&&r.middleware.length>0&&s.middleware.length>0&&(i.middleware=r.middleware.map(l=>{let u=l[Ns]??l,d=Ba(s.middleware,u,(...f)=>wp(f[0]));return d?(d[Ns]=u,d):l})),i}function ab(t,r){let s={navigate:[],fetch:[]};if(r.forEach(i=>i({instrument(l){let u=Object.keys(l);for(let d of u)l[d]&&s[d].push(l[d])}})),s.navigate.length>0){let i=t.navigate[Ns]??t.navigate,l=Ba(s.navigate,i,(...u)=>{let[d,f]=u;return{to:typeof d=="number"||typeof d=="string"?d:d?nn(d):".",...Np(t,f??{})}});l&&(l[Ns]=i,t.navigate=l)}if(s.fetch.length>0){let i=t.fetch[Ns]??t.fetch,l=Ba(s.fetch,i,(...u)=>{let[d,,f,p]=u;return{href:f??".",fetcherKey:d,...Np(t,p??{})}});l&&(l[Ns]=i,t.fetch=l)}return t}function Ba(t,r,s){return t.length===0?null:async(...i)=>{let l=await t0(t,s(...i),()=>r(...i),t.length-1);if(l.type==="error")throw l.value;return l.value}}async function t0(t,r,s,i){let l=t[i],u;if(l){let d,f=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=t0(t,r,s,i-1),u=await d,ze(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await l(f,r)}catch(p){console.error("An instrumentation function threw an error:",p)}d||await f(),await d}else try{u={type:"success",value:await s()}}catch(d){u={type:"error",value:d}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function wp(t){let{request:r,context:s,params:i,unstable_pattern:l}=t;return{request:ib(r),params:{...i},unstable_pattern:l,context:ob(s)}}function Np(t,r){return{currentUrl:nn(t.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function ib(t){return{method:t.method,url:t.url,headers:{get:(...r)=>t.headers.get(...r)}}}function ob(t){if(cb(t)){let r={...t};return Object.freeze(r),r}else return{get:r=>t.get(r)}}var lb=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cb(t){if(t===null||typeof t!="object")return!1;const r=Object.getPrototypeOf(t);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===lb}var r0=["POST","PUT","PATCH","DELETE"],ub=new Set(r0),db=["GET",...r0],fb=new Set(db),n0=new Set([301,302,303,307,308]),hb=new Set([307,308]),gd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},pb=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),s0="remix-router-transitions",a0=Symbol("ResetLoaderData");function gb(t){const r=t.window?t.window:typeof window<"u"?window:void 0,s=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";ze(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],l=t.mapRouteProperties||pb,u=l;if(t.unstable_instrumentations){let k=t.unstable_instrumentations;u=O=>({...l(O),...sb(k.map(z=>z.route).filter(Boolean),O)})}let d={},f=mo(t.routes,u,void 0,d),p,g=t.basename||"/";g.startsWith("/")||(g=`/${g}`);let y=t.dataStrategy||wb,x={...t.future},b=null,j=new Set,N=null,S=null,E=null,D=t.hydrationData!=null,_=us(f,t.history.location,g),A=!1,U=null,B;if(_==null&&!t.patchRoutesOnNavigation){let k=jr(404,{pathname:t.history.location.pathname}),{matches:O,route:z}=Ql(f);B=!0,_=O,U={[z.id]:k}}else if(_&&!t.hydrationData&&Ps(_,f,t.history.location.pathname).active&&(_=null),_)if(_.some(k=>k.route.lazy))B=!1;else if(!_.some(k=>uf(k.route)))B=!0;else{let k=t.hydrationData?t.hydrationData.loaderData:null,O=t.hydrationData?t.hydrationData.errors:null;if(O){let z=_.findIndex(X=>O[X.route.id]!==void 0);B=_.slice(0,z+1).every(X=>!Od(X.route,k,O))}else B=_.every(z=>!Od(z.route,k,O))}else{B=!1,_=[];let k=Ps(null,f,t.history.location.pathname);k.active&&k.matches&&(A=!0,_=k.matches)}let te,P={historyAction:t.history.action,location:t.history.location,matches:_,initialized:B,navigation:gd,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||U,fetchers:new Map,blockers:new Map},ee="POP",W=null,K=!1,Q,Re=!1,oe=new Map,de=null,se=!1,ie=!1,ve=new Set,V=new Map,le=0,J=-1,T=new Map,I=new Set,he=new Map,pe=new Map,G=new Set,ge=new Map,Oe,De=null;function Ze(){if(b=t.history.listen(({action:k,location:O,delta:z})=>{if(Oe){Oe(),Oe=void 0;return}lt(ge.size===0||z!=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 X=an({currentLocation:P.location,nextLocation:O,historyAction:k});if(X&&z!=null){let ae=new Promise(Se=>{Oe=Se});t.history.go(z*-1),zn(X,{state:"blocked",location:O,proceed(){zn(X,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),ae.then(()=>t.history.go(z))},reset(){let Se=new Map(P.blockers);Se.set(X,eo),ct({blockers:Se})}}),W==null||W.resolve(),W=null;return}return sr(k,O)}),s){$b(r,oe);let k=()=>zb(r,oe);r.addEventListener("pagehide",k),de=()=>r.removeEventListener("pagehide",k)}return P.initialized||sr("POP",P.location,{initialHydration:!0}),te}function Ct(){b&&b(),de&&de(),j.clear(),Q&&Q.abort(),P.fetchers.forEach((k,O)=>pi(O)),P.blockers.forEach((k,O)=>va(O))}function An(k){return j.add(k),()=>j.delete(k)}function ct(k,O={}){k.matches&&(k.matches=k.matches.map(ae=>{let Se=d[ae.route.id],Te=ae.route;return Te.element!==Se.element||Te.errorElement!==Se.errorElement||Te.hydrateFallbackElement!==Se.hydrateFallbackElement?{...ae,route:Se}:ae})),P={...P,...k};let z=[],X=[];P.fetchers.forEach((ae,Se)=>{ae.state==="idle"&&(G.has(Se)?z.push(Se):X.push(Se))}),G.forEach(ae=>{!P.fetchers.has(ae)&&!V.has(ae)&&z.push(ae)}),[...j].forEach(ae=>ae(P,{deletedFetchers:z,newErrors:k.errors??null,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),z.forEach(ae=>pi(ae)),X.forEach(ae=>P.fetchers.delete(ae))}function nr(k,O,{flushSync:z}={}){var Ie,ke;let X=P.actionData!=null&&P.navigation.formMethod!=null&&Ot(P.navigation.formMethod)&&P.navigation.state==="loading"&&((Ie=k.state)==null?void 0:Ie._isRedirect)!==!0,ae;O.actionData?Object.keys(O.actionData).length>0?ae=O.actionData:ae=null:X?ae=P.actionData:ae=null;let Se=O.loaderData?Lp(P.loaderData,O.loaderData,O.matches||[],O.errors):P.loaderData,Te=P.blockers;Te.size>0&&(Te=new Map(Te),Te.forEach((Fe,He)=>Te.set(He,eo)));let ye=se?!1:xi(k,O.matches||P.matches),be=K===!0||P.navigation.formMethod!=null&&Ot(P.navigation.formMethod)&&((ke=k.state)==null?void 0:ke._isRedirect)!==!0;p&&(f=p,p=void 0),se||ee==="POP"||(ee==="PUSH"?t.history.push(k,k.state):ee==="REPLACE"&&t.history.replace(k,k.state));let Ne;if(ee==="POP"){let Fe=oe.get(P.location.pathname);Fe&&Fe.has(k.pathname)?Ne={currentLocation:P.location,nextLocation:k}:oe.has(k.pathname)&&(Ne={currentLocation:k,nextLocation:P.location})}else if(Re){let Fe=oe.get(P.location.pathname);Fe?Fe.add(k.pathname):(Fe=new Set([k.pathname]),oe.set(P.location.pathname,Fe)),Ne={currentLocation:P.location,nextLocation:k}}ct({...O,actionData:ae,loaderData:Se,historyAction:ee,location:k,initialized:!0,navigation:gd,revalidation:"idle",restoreScrollPosition:ye,preventScrollReset:be,blockers:Te},{viewTransitionOpts:Ne,flushSync:z===!0}),ee="POP",K=!1,Re=!1,se=!1,ie=!1,W==null||W.resolve(),W=null,De==null||De.resolve(),De=null}async function _n(k,O){if(W==null||W.resolve(),W=null,typeof k=="number"){W||(W=_p());let He=W.promise;return t.history.go(k),He}let z=Ld(P.location,P.matches,g,k,O==null?void 0:O.fromRouteId,O==null?void 0:O.relative),{path:X,submission:ae,error:Se}=jp(!1,z,O),Te=P.location,ye=ho(P.location,X,O&&O.state);ye={...ye,...t.history.encodeLocation(ye)};let be=O&&O.replace!=null?O.replace:void 0,Ne="PUSH";be===!0?Ne="REPLACE":be===!1||ae!=null&&Ot(ae.formMethod)&&ae.formAction===P.location.pathname+P.location.search&&(Ne="REPLACE");let Ie=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,ke=(O&&O.flushSync)===!0,Fe=an({currentLocation:Te,nextLocation:ye,historyAction:Ne});if(Fe){zn(Fe,{state:"blocked",location:ye,proceed(){zn(Fe,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),_n(k,O)},reset(){let He=new Map(P.blockers);He.set(Fe,eo),ct({blockers:He})}});return}await sr(Ne,ye,{submission:ae,pendingError:Se,preventScrollReset:Ie,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:ke,callSiteDefaultShouldRevalidate:O&&O.unstable_defaultShouldRevalidate})}function pa(){De||(De=_p()),Ms(),ct({revalidation:"loading"});let k=De.promise;return P.navigation.state==="submitting"?k:P.navigation.state==="idle"?(sr(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),k):(sr(ee||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:Re===!0}),k)}async function sr(k,O,z){Q&&Q.abort(),Q=null,ee=k,se=(z&&z.startUninterruptedRevalidation)===!0,Uo(P.location,P.matches),K=(z&&z.preventScrollReset)===!0,Re=(z&&z.enableViewTransition)===!0;let X=p||f,ae=z&&z.overrideNavigation,Se=z!=null&&z.initialHydration&&P.matches&&P.matches.length>0&&!A?P.matches:us(X,O,g),Te=(z&&z.flushSync)===!0;if(Se&&P.initialized&&!ie&&Mb(P.location,O)&&!(z&&z.submission&&Ot(z.submission.formMethod))){nr(O,{matches:Se},{flushSync:Te});return}let ye=Ps(Se,X,O.pathname);if(ye.active&&ye.matches&&(Se=ye.matches),!Se){let{error:ht,notFoundMatches:wt,route:Ge}=Hr(O.pathname);nr(O,{matches:wt,loaderData:{},errors:{[Ge.id]:ht}},{flushSync:Te});return}Q=new AbortController;let be=Ha(t.history,O,Q.signal,z&&z.submission),Ne=t.getContext?await t.getContext():new yp,Ie;if(z&&z.pendingError)Ie=[ds(Se).route.id,{type:"error",error:z.pendingError}];else if(z&&z.submission&&Ot(z.submission.formMethod)){let ht=await Rs(be,O,z.submission,Se,Ne,ye.active,z&&z.initialHydration===!0,{replace:z.replace,flushSync:Te});if(ht.shortCircuited)return;if(ht.pendingActionResult){let[wt,Ge]=ht.pendingActionResult;if(ur(Ge)&&po(Ge.error)&&Ge.error.status===404){Q=null,nr(O,{matches:ht.matches,loaderData:{},errors:{[wt]:Ge.error}});return}}Se=ht.matches||Se,Ie=ht.pendingActionResult,ae=yd(O,z.submission),Te=!1,ye.active=!1,be=Ha(t.history,be.url,be.signal)}let{shortCircuited:ke,matches:Fe,loaderData:He,errors:pt}=await ga(be,O,Se,Ne,ye.active,ae,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,z&&z.initialHydration===!0,Te,Ie,z&&z.callSiteDefaultShouldRevalidate);ke||(Q=null,nr(O,{matches:Fe||Se,...Op(Ie),loaderData:He,errors:pt}))}async function Rs(k,O,z,X,ae,Se,Te,ye={}){Ms();let be=Ib(O,z);if(ct({navigation:be},{flushSync:ye.flushSync===!0}),Se){let ke=await Un(X,O.pathname,k.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:He,route:pt}=Ql(f);return{matches:He,pendingActionResult:[pt.id,{type:"error",error:ke.error}]}}let Fe=ds(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[Fe,{type:"error",error:ke.error}]}}else if(ke.matches)X=ke.matches;else{let{notFoundMatches:Fe,error:He,route:pt}=Hr(O.pathname);return{matches:Fe,pendingActionResult:[pt.id,{type:"error",error:He}]}}}let Ne,Ie=ec(X,O);if(!Ie.route.action&&!Ie.route.lazy)Ne={type:"error",error:jr(405,{method:k.method,pathname:O.pathname,routeId:Ie.route.id})};else{let ke=Qa(u,d,k,X,Ie,Te?[]:i,ae),Fe=await Fn(k,ke,ae,null);if(Ne=Fe[Ie.route.id],!Ne){for(let He of X)if(Fe[He.route.id]){Ne=Fe[He.route.id];break}}if(k.signal.aborted)return{shortCircuited:!0}}if(Gs(Ne)){let ke;return ye&&ye.replace!=null?ke=ye.replace:ke=Mp(Ne.response.headers.get("Location"),new URL(k.url),g,t.history)===P.location.pathname+P.location.search,await qr(k,Ne,!0,{submission:z,replace:ke}),{shortCircuited:!0}}if(ur(Ne)){let ke=ds(X,Ie.route.id);return(ye&&ye.replace)!==!0&&(ee="PUSH"),{matches:X,pendingActionResult:[ke.route.id,Ne,Ie.route.id]}}return{matches:X,pendingActionResult:[Ie.route.id,Ne]}}async function ga(k,O,z,X,ae,Se,Te,ye,be,Ne,Ie,ke,Fe){let He=Se||yd(O,Te),pt=Te||ye||Ap(He),ht=!se&&!Ne;if(ae){if(ht){let et=In(ke);ct({navigation:He,...et!==void 0?{actionData:et}:{}},{flushSync:Ie})}let Be=await Un(z,O.pathname,k.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){if(Be.partialMatches.length===0){let{matches:Hn,route:ln}=Ql(f);return{matches:Hn,loaderData:{},errors:{[ln.id]:Be.error}}}let et=ds(Be.partialMatches).route.id;return{matches:Be.partialMatches,loaderData:{},errors:{[et]:Be.error}}}else if(Be.matches)z=Be.matches;else{let{error:et,notFoundMatches:Hn,route:ln}=Hr(O.pathname);return{matches:Hn,loaderData:{},errors:{[ln.id]:et}}}}let wt=p||f,{dsMatches:Ge,revalidatingFetchers:Vt}=Sp(k,X,u,d,t.history,P,z,pt,O,Ne?[]:i,Ne===!0,ie,ve,G,he,I,wt,g,t.patchRoutesOnNavigation!=null,ke,Fe);if(J=++le,!t.dataStrategy&&!Ge.some(Be=>Be.shouldLoad)&&!Ge.some(Be=>Be.route.middleware&&Be.route.middleware.length>0)&&Vt.length===0){let Be=ya();return nr(O,{matches:z,loaderData:{},errors:ke&&ur(ke[1])?{[ke[0]]:ke[1].error}:null,...Op(ke),...Be?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Ie}),{shortCircuited:!0}}if(ht){let Be={};if(!ae){Be.navigation=He;let et=In(ke);et!==void 0&&(Be.actionData=et)}Vt.length>0&&(Be.fetchers=sn(Vt)),ct(Be,{flushSync:Ie})}Vt.forEach(Be=>{hr(Be.key),Be.controller&&V.set(Be.key,Be.controller)});let Je=()=>Vt.forEach(Be=>hr(Be.key));Q&&Q.signal.addEventListener("abort",Je);let{loaderResults:Os,fetcherResults:mr}=await mi(Ge,Vt,k,X);if(k.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",Je),Vt.forEach(Be=>V.delete(Be.key));let ar=Vl(Os);if(ar)return await qr(k,ar.result,!0,{replace:be}),{shortCircuited:!0};if(ar=Vl(mr),ar)return I.add(ar.key),await qr(k,ar.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:qn,errors:Ds}=Pp(P,z,Os,ke,Vt,mr);Ne&&P.errors&&(Ds={...P.errors,...Ds});let Br=ya(),on=xa(J),It=Br||on||Vt.length>0;return{matches:z,loaderData:qn,errors:Ds,...It?{fetchers:new Map(P.fetchers)}:{}}}function In(k){if(k&&!ur(k[1]))return{[k[0]]:k[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function sn(k){return k.forEach(O=>{let z=P.fetchers.get(O.key),X=to(void 0,z?z.data:void 0);P.fetchers.set(O.key,X)}),new Map(P.fetchers)}async function fe(k,O,z,X){hr(k);let ae=(X&&X.flushSync)===!0,Se=p||f,Te=Ld(P.location,P.matches,g,z,O,X==null?void 0:X.relative),ye=us(Se,Te,g),be=Ps(ye,Se,Te);if(be.active&&be.matches&&(ye=be.matches),!ye){fr(k,O,jr(404,{pathname:Te}),{flushSync:ae});return}let{path:Ne,submission:Ie,error:ke}=jp(!0,Te,X);if(ke){fr(k,O,ke,{flushSync:ae});return}let Fe=t.getContext?await t.getContext():new yp,He=(X&&X.preventScrollReset)===!0;if(Ie&&Ot(Ie.formMethod)){await qe(k,O,Ne,ye,Fe,be.active,ae,He,Ie,X&&X.unstable_defaultShouldRevalidate);return}he.set(k,{routeId:O,path:Ne}),await _t(k,O,Ne,ye,Fe,be.active,ae,He,Ie)}async function qe(k,O,z,X,ae,Se,Te,ye,be,Ne){Ms(),he.delete(k);let Ie=P.fetchers.get(k);Qt(k,Fb(be,Ie),{flushSync:Te});let ke=new AbortController,Fe=Ha(t.history,z,ke.signal,be);if(Se){let st=await Un(X,new URL(Fe.url).pathname,Fe.signal,k);if(st.type==="aborted")return;if(st.type==="error"){fr(k,O,st.error,{flushSync:Te});return}else if(st.matches)X=st.matches;else{fr(k,O,jr(404,{pathname:z}),{flushSync:Te});return}}let He=ec(X,z);if(!He.route.action&&!He.route.lazy){let st=jr(405,{method:be.formMethod,pathname:z,routeId:O});fr(k,O,st,{flushSync:Te});return}V.set(k,ke);let pt=le,ht=Qa(u,d,Fe,X,He,i,ae),wt=await Fn(Fe,ht,ae,k),Ge=wt[He.route.id];if(!Ge){for(let st of ht)if(wt[st.route.id]){Ge=wt[st.route.id];break}}if(Fe.signal.aborted){V.get(k)===ke&&V.delete(k);return}if(G.has(k)){if(Gs(Ge)||ur(Ge)){Qt(k,bn(void 0));return}}else{if(Gs(Ge))if(V.delete(k),J>pt){Qt(k,bn(void 0));return}else return I.add(k),Qt(k,to(be)),qr(Fe,Ge,!1,{fetcherSubmission:be,preventScrollReset:ye});if(ur(Ge)){fr(k,O,Ge.error);return}}let Vt=P.navigation.location||P.location,Je=Ha(t.history,Vt,ke.signal),Os=p||f,mr=P.navigation.state!=="idle"?us(Os,P.navigation.location,g):P.matches;ze(mr,"Didn't find any matches after fetcher action");let ar=++le;T.set(k,ar);let qn=to(be,Ge.data);P.fetchers.set(k,qn);let{dsMatches:Ds,revalidatingFetchers:Br}=Sp(Je,ae,u,d,t.history,P,mr,be,Vt,i,!1,ie,ve,G,he,I,Os,g,t.patchRoutesOnNavigation!=null,[He.route.id,Ge],Ne);Br.filter(st=>st.key!==k).forEach(st=>{let cn=st.key,As=P.fetchers.get(cn),_s=to(void 0,As?As.data:void 0);P.fetchers.set(cn,_s),hr(cn),st.controller&&V.set(cn,st.controller)}),ct({fetchers:new Map(P.fetchers)});let on=()=>Br.forEach(st=>hr(st.key));ke.signal.addEventListener("abort",on);let{loaderResults:It,fetcherResults:Be}=await mi(Ds,Br,Je,ae);if(ke.signal.aborted)return;if(ke.signal.removeEventListener("abort",on),T.delete(k),V.delete(k),Br.forEach(st=>V.delete(st.key)),P.fetchers.has(k)){let st=bn(Ge.data);P.fetchers.set(k,st)}let et=Vl(It);if(et)return qr(Je,et.result,!1,{preventScrollReset:ye});if(et=Vl(Be),et)return I.add(et.key),qr(Je,et.result,!1,{preventScrollReset:ye});let{loaderData:Hn,errors:ln}=Pp(P,mr,It,void 0,Br,Be);xa(ar),P.navigation.state==="loading"&&ar>J?(ze(ee,"Expected pending action"),Q&&Q.abort(),nr(P.navigation.location,{matches:mr,loaderData:Hn,errors:ln,fetchers:new Map(P.fetchers)})):(ct({errors:ln,loaderData:Lp(P.loaderData,Hn,mr,ln),fetchers:new Map(P.fetchers)}),ie=!1)}async function _t(k,O,z,X,ae,Se,Te,ye,be){let Ne=P.fetchers.get(k);Qt(k,to(be,Ne?Ne.data:void 0),{flushSync:Te});let Ie=new AbortController,ke=Ha(t.history,z,Ie.signal);if(Se){let Ge=await Un(X,new URL(ke.url).pathname,ke.signal,k);if(Ge.type==="aborted")return;if(Ge.type==="error"){fr(k,O,Ge.error,{flushSync:Te});return}else if(Ge.matches)X=Ge.matches;else{fr(k,O,jr(404,{pathname:z}),{flushSync:Te});return}}let Fe=ec(X,z);V.set(k,Ie);let He=le,pt=Qa(u,d,ke,X,Fe,i,ae),wt=(await Fn(ke,pt,ae,k))[Fe.route.id];if(V.get(k)===Ie&&V.delete(k),!ke.signal.aborted){if(G.has(k)){Qt(k,bn(void 0));return}if(Gs(wt))if(J>He){Qt(k,bn(void 0));return}else{I.add(k),await qr(ke,wt,!1,{preventScrollReset:ye});return}if(ur(wt)){fr(k,O,wt.error);return}Qt(k,bn(wt.data))}}async function qr(k,O,z,{submission:X,fetcherSubmission:ae,preventScrollReset:Se,replace:Te}={}){z||(W==null||W.resolve(),W=null),O.response.headers.has("X-Remix-Revalidate")&&(ie=!0);let ye=O.response.headers.get("Location");ze(ye,"Expected a Location header on the redirect Response"),ye=Mp(ye,new URL(k.url),g,t.history);let be=ho(P.location,ye,{_isRedirect:!0});if(s){let pt=!1;if(O.response.headers.has("X-Remix-Reload-Document"))pt=!0;else if(pc(ye)){const ht=Kg(ye,!0);pt=ht.origin!==r.location.origin||Cr(ht.pathname,g)==null}if(pt){Te?r.location.replace(ye):r.location.assign(ye);return}}Q=null;let Ne=Te===!0||O.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ie,formAction:ke,formEncType:Fe}=P.navigation;!X&&!ae&&Ie&&ke&&Fe&&(X=Ap(P.navigation));let He=X||ae;if(hb.has(O.response.status)&&He&&Ot(He.formMethod))await sr(Ne,be,{submission:{...He,formAction:ye},preventScrollReset:Se||K,enableViewTransition:z?Re:void 0});else{let pt=yd(be,X);await sr(Ne,be,{overrideNavigation:pt,fetcherSubmission:ae,preventScrollReset:Se||K,enableViewTransition:z?Re:void 0})}}async function Fn(k,O,z,X){var Te;let ae,Se={};try{ae=await jb(y,k,O,X,z,!1)}catch(ye){return O.filter(be=>be.shouldLoad).forEach(be=>{Se[be.route.id]={type:"error",error:ye}}),Se}if(k.signal.aborted)return Se;if(!Ot(k.method))for(let ye of O){if(((Te=ae[ye.route.id])==null?void 0:Te.type)==="error")break;!ae.hasOwnProperty(ye.route.id)&&!P.loaderData.hasOwnProperty(ye.route.id)&&(!P.errors||!P.errors.hasOwnProperty(ye.route.id))&&ye.shouldCallHandler()&&(ae[ye.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ye.route.id}`)})}for(let[ye,be]of Object.entries(ae))if(Ob(be)){let Ne=be.result;Se[ye]={type:"redirect",response:kb(Ne,k,ye,O,g)}}else Se[ye]=await Cb(be);return Se}async function mi(k,O,z,X){let ae=Fn(z,k,X,null),Se=Promise.all(O.map(async be=>{if(be.matches&&be.match&&be.request&&be.controller){let Ie=(await Fn(be.request,be.matches,X,be.key))[be.match.route.id];return{[be.key]:Ie}}else return Promise.resolve({[be.key]:{type:"error",error:jr(404,{pathname:be.path})}})})),Te=await ae,ye=(await Se).reduce((be,Ne)=>Object.assign(be,Ne),{});return{loaderResults:Te,fetcherResults:ye}}function Ms(){ie=!0,he.forEach((k,O)=>{V.has(O)&&ve.add(O),hr(O)})}function Qt(k,O,z={}){P.fetchers.set(k,O),ct({fetchers:new Map(P.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function fr(k,O,z,X={}){let ae=ds(P.matches,O);pi(k),ct({errors:{[ae.route.id]:z},fetchers:new Map(P.fetchers)},{flushSync:(X&&X.flushSync)===!0})}function $n(k){return pe.set(k,(pe.get(k)||0)+1),G.has(k)&&G.delete(k),P.fetchers.get(k)||mb}function Ts(k,O){hr(k,O==null?void 0:O.reason),Qt(k,bn(null))}function pi(k){let O=P.fetchers.get(k);V.has(k)&&!(O&&O.state==="loading"&&T.has(k))&&hr(k),he.delete(k),T.delete(k),I.delete(k),G.delete(k),ve.delete(k),P.fetchers.delete(k)}function Fo(k){let O=(pe.get(k)||0)-1;O<=0?(pe.delete(k),G.add(k)):pe.set(k,O),ct({fetchers:new Map(P.fetchers)})}function hr(k,O){let z=V.get(k);z&&(z.abort(O),V.delete(k))}function $o(k){for(let O of k){let z=$n(O),X=bn(z.data);P.fetchers.set(O,X)}}function ya(){let k=[],O=!1;for(let z of I){let X=P.fetchers.get(z);ze(X,`Expected fetcher: ${z}`),X.state==="loading"&&(I.delete(z),k.push(z),O=!0)}return $o(k),O}function xa(k){let O=[];for(let[z,X]of T)if(X0}function gi(k,O){let z=P.blockers.get(k)||eo;return ge.get(k)!==O&&ge.set(k,O),z}function va(k){P.blockers.delete(k),ge.delete(k)}function zn(k,O){let z=P.blockers.get(k)||eo;ze(z.state==="unblocked"&&O.state==="blocked"||z.state==="blocked"&&O.state==="blocked"||z.state==="blocked"&&O.state==="proceeding"||z.state==="blocked"&&O.state==="unblocked"||z.state==="proceeding"&&O.state==="unblocked",`Invalid blocker state transition: ${z.state} -> ${O.state}`);let X=new Map(P.blockers);X.set(k,O),ct({blockers:X})}function an({currentLocation:k,nextLocation:O,historyAction:z}){if(ge.size===0)return;ge.size>1&<(!1,"A router only supports one blocker at a time");let X=Array.from(ge.entries()),[ae,Se]=X[X.length-1],Te=P.blockers.get(ae);if(!(Te&&Te.state==="proceeding")&&Se({currentLocation:k,nextLocation:O,historyAction:z}))return ae}function Hr(k){let O=jr(404,{pathname:k}),z=p||f,{matches:X,route:ae}=Ql(z);return{notFoundMatches:X,route:ae,error:O}}function zo(k,O,z){if(N=k,E=O,S=z||null,!D&&P.navigation===gd){D=!0;let X=xi(P.location,P.matches);X!=null&&ct({restoreScrollPosition:X})}return()=>{N=null,E=null,S=null}}function yi(k,O){return S&&S(k,O.map(X=>zv(X,P.loaderData)))||k.key}function Uo(k,O){if(N&&E){let z=yi(k,O);N[z]=E()}}function xi(k,O){if(N){let z=yi(k,O),X=N[z];if(typeof X=="number")return X}return null}function Ps(k,O,z){if(t.patchRoutesOnNavigation)if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:lo(O,z,g,!0)}}else return{active:!0,matches:lo(O,z,g,!0)||[]};return{active:!1,matches:null}}async function Un(k,O,z,X){if(!t.patchRoutesOnNavigation)return{type:"success",matches:k};let ae=k;for(;;){let Se=p==null,Te=p||f,ye=d;try{await t.patchRoutesOnNavigation({signal:z,path:O,matches:ae,fetcherKey:X,patch:(Ie,ke)=>{z.aborted||Ep(Ie,ke,Te,ye,u,!1)}})}catch(Ie){return{type:"error",error:Ie,partialMatches:ae}}finally{Se&&!z.aborted&&(f=[...f])}if(z.aborted)return{type:"aborted"};let be=us(Te,O,g),Ne=null;if(be){if(Object.keys(be[0].params).length===0)return{type:"success",matches:be};if(Ne=lo(Te,O,g,!0),!(Ne&&ae.lengthz.route.id===O[X].route.id)}function Ls(k){d={},p=mo(k,u,void 0,d)}function bi(k,O,z=!1){let X=p==null;Ep(k,O,p||f,d,u,z),X&&(f=[...f],ct({}))}return te={get basename(){return g},get future(){return x},get state(){return P},get routes(){return f},get window(){return r},initialize:Ze,subscribe:An,enableScrollRestoration:zo,navigate:_n,fetch:fe,revalidate:pa,createHref:k=>t.history.createHref(k),encodeLocation:k=>t.history.encodeLocation(k),getFetcher:$n,resetFetcher:Ts,deleteFetcher:Fo,dispose:Ct,getBlocker:gi,deleteBlocker:va,patchRoutes:bi,_internalFetchControllers:V,_internalSetRoutes:Ls,_internalSetStateDoNotUseOrYouWillBreakYourApp(k){ct(k)}},t.unstable_instrumentations&&(te=ab(te,t.unstable_instrumentations.map(k=>k.router).filter(Boolean))),te}function yb(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Ld(t,r,s,i,l,u){let d,f;if(l){d=[];for(let g of r)if(d.push(g),g.route.id===l){f=g;break}}else d=r,f=r[r.length-1];let p=yc(i||".",gc(d),Cr(t.pathname,s)||t.pathname,u==="path");if(i==null&&(p.search=t.search,p.hash=t.hash),(i==null||i===""||i===".")&&f){let g=ff(p.search);if(f.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&g){let y=new URLSearchParams(p.search),x=y.getAll("index");y.delete("index"),x.filter(j=>j).forEach(j=>y.append("index",j));let b=y.toString();p.search=b?`?${b}`:""}}return s!=="/"&&(p.pathname=Zv({basename:s,pathname:p.pathname})),nn(p)}function jp(t,r,s){if(!s||!yb(s))return{path:r};if(s.formMethod&&!_b(s.formMethod))return{path:r,error:jr(405,{method:s.formMethod})};let i=()=>({path:r,error:jr(400,{type:"invalid-body"})}),u=(s.formMethod||"get").toUpperCase(),d=d0(r);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!Ot(u))return i();let x=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((b,[j,N])=>`${b}${j}=${N} -`,""):String(s.body);return{path:r,submission:{formMethod:u,formAction:d,formEncType:s.formEncType,formData:void 0,json:void 0,text:x}}}else if(s.formEncType==="application/json"){if(!Ot(u))return i();try{let x=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:r,submission:{formMethod:u,formAction:d,formEncType:s.formEncType,formData:void 0,json:x,text:void 0}}}catch{return i()}}}ze(typeof FormData=="function","FormData is not available in this environment");let f,p;if(s.formData)f=Ad(s.formData),p=s.formData;else if(s.body instanceof FormData)f=Ad(s.body),p=s.body;else if(s.body instanceof URLSearchParams)f=s.body,p=Tp(f);else if(s.body==null)f=new URLSearchParams,p=new FormData;else try{f=new URLSearchParams(s.body),p=Tp(f)}catch{return i()}let g={formMethod:u,formAction:d,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Ot(g.formMethod))return{path:r,submission:g};let y=Es(r);return t&&y.search&&ff(y.search)&&f.append("index",""),y.search=`?${f}`,{path:nn(y),submission:g}}function Sp(t,r,s,i,l,u,d,f,p,g,y,x,b,j,N,S,E,D,_,A,U){var se;let B=A?ur(A[1])?A[1].error:A[1].data:void 0,te=l.createURL(u.location),P=l.createURL(p),ee;if(y&&u.errors){let ie=Object.keys(u.errors)[0];ee=d.findIndex(ve=>ve.route.id===ie)}else if(A&&ur(A[1])){let ie=A[0];ee=d.findIndex(ve=>ve.route.id===ie)-1}let W=A?A[1].statusCode:void 0,K=W&&W>=400,Q={currentUrl:te,currentParams:((se=u.matches[0])==null?void 0:se.params)||{},nextUrl:P,nextParams:d[0].params,...f,actionResult:B,actionStatus:W},Re=So(d),oe=d.map((ie,ve)=>{let{route:V}=ie,le=null;if(ee!=null&&ve>ee?le=!1:V.lazy?le=!0:uf(V)?y?le=Od(V,u.loaderData,u.errors):xb(u.loaderData,u.matches[ve],ie)&&(le=!0):le=!1,le!==null)return Dd(s,i,t,Re,ie,g,r,le);let J=!1;typeof U=="boolean"?J=U:K?J=!1:(x||te.pathname+te.search===P.pathname+P.search||te.search!==P.search||vb(u.matches[ve],ie))&&(J=!0);let T={...Q,defaultShouldRevalidate:J},I=uo(ie,T);return Dd(s,i,t,Re,ie,g,r,I,T,U)}),de=[];return N.forEach((ie,ve)=>{if(y||!d.some(G=>G.route.id===ie.routeId)||j.has(ve))return;let V=u.fetchers.get(ve),le=V&&V.state!=="idle"&&V.data===void 0,J=us(E,ie.path,D);if(!J){if(_&&le)return;de.push({key:ve,routeId:ie.routeId,path:ie.path,matches:null,match:null,request:null,controller:null});return}if(S.has(ve))return;let T=ec(J,ie.path),I=new AbortController,he=Ha(l,ie.path,I.signal),pe=null;if(b.has(ve))b.delete(ve),pe=Qa(s,i,he,J,T,g,r);else if(le)x&&(pe=Qa(s,i,he,J,T,g,r));else{let G;typeof U=="boolean"?G=U:K?G=!1:G=x;let ge={...Q,defaultShouldRevalidate:G};uo(T,ge)&&(pe=Qa(s,i,he,J,T,g,r,ge))}pe&&de.push({key:ve,routeId:ie.routeId,path:ie.path,matches:pe,match:T,request:he,controller:I})}),{dsMatches:oe,revalidatingFetchers:de}}function uf(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function Od(t,r,s){if(t.lazy)return!0;if(!uf(t))return!1;let i=r!=null&&t.id in r,l=s!=null&&s[t.id]!==void 0;return!i&&l?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!i&&!l}function xb(t,r,s){let i=!r||s.route.id!==r.route.id,l=!t.hasOwnProperty(s.route.id);return i||l}function vb(t,r){let s=t.route.path;return t.pathname!==r.pathname||s!=null&&s.endsWith("*")&&t.params["*"]!==r.params["*"]}function uo(t,r){if(t.route.shouldRevalidate){let s=t.route.shouldRevalidate(r);if(typeof s=="boolean")return s}return r.defaultShouldRevalidate}function Ep(t,r,s,i,l,u){let d;if(t){let g=i[t];ze(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),d=g.children}else d=s;let f=[],p=[];if(r.forEach(g=>{let y=d.find(x=>i0(g,x));y?p.push({existingRoute:y,newRoute:g}):f.push(g)}),f.length>0){let g=mo(f,l,[t||"_","patch",String((d==null?void 0:d.length)||"0")],i);d.push(...g)}if(u&&p.length>0)for(let g=0;g{var l;return(l=r.children)==null?void 0:l.some(u=>i0(s,u))}):!1}var Cp=new WeakMap,o0=({key:t,route:r,manifest:s,mapRouteProperties:i})=>{let l=s[r.id];if(ze(l,"No route found in manifest"),!l.lazy||typeof l.lazy!="object")return;let u=l.lazy[t];if(!u)return;let d=Cp.get(l);d||(d={},Cp.set(l,d));let f=d[t];if(f)return f;let p=(async()=>{let g=_v(t),x=l[t]!==void 0&&t!=="hasErrorBoundary";if(g)lt(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),d[t]=Promise.resolve();else if(x)lt(!1,`Route "${l.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let b=await u();b!=null&&(Object.assign(l,{[t]:b}),Object.assign(l,i(l)))}typeof l.lazy=="object"&&(l.lazy[t]=void 0,Object.values(l.lazy).every(b=>b===void 0)&&(l.lazy=void 0))})();return d[t]=p,p},kp=new WeakMap;function bb(t,r,s,i,l){let u=s[t.id];if(ze(u,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let y=kp.get(u);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let x=(async()=>{ze(typeof t.lazy=="function","No lazy route function found");let b=await t.lazy(),j={};for(let N in b){let S=b[N];if(S===void 0)continue;let E=Fv(N),_=u[N]!==void 0&&N!=="hasErrorBoundary";E?lt(!E,"Route property "+N+" is not a supported property to be returned from a lazy route function. This property will be ignored."):_?lt(!_,`Route "${u.id}" has a static property "${N}" defined but its lazy function is also returning a value for this property. The lazy route property "${N}" will be ignored.`):j[N]=S}Object.assign(u,j),Object.assign(u,{...i(u),lazy:void 0})})();return kp.set(u,x),x.catch(()=>{}),{lazyRoutePromise:x,lazyHandlerPromise:x}}let d=Object.keys(t.lazy),f=[],p;for(let y of d){if(l&&l.includes(y))continue;let x=o0({key:y,route:t,manifest:s,mapRouteProperties:i});x&&(f.push(x),y===r&&(p=x))}let g=f.length>0?Promise.all(f).then(()=>{}):void 0;return g==null||g.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function Rp(t){let r=t.matches.filter(l=>l.shouldLoad),s={};return(await Promise.all(r.map(l=>l.resolve()))).forEach((l,u)=>{s[r[u].route.id]=l}),s}async function wb(t){return t.matches.some(r=>r.route.middleware)?l0(t,()=>Rp(t)):Rp(t)}function l0(t,r){return Nb(t,r,i=>{if(Ab(i))throw i;return i},Pb,s);function s(i,l,u){if(u)return Promise.resolve(Object.assign(u.value,{[l]:{type:"error",result:i}}));{let{matches:d}=t,f=Math.min(Math.max(d.findIndex(g=>g.route.id===l),0),Math.max(d.findIndex(g=>g.shouldCallHandler()),0)),p=ds(d,d[f].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:i}})}}}async function Nb(t,r,s,i,l){let{matches:u,request:d,params:f,context:p,unstable_pattern:g}=t,y=u.flatMap(b=>b.route.middleware?b.route.middleware.map(j=>[b.route.id,j]):[]);return await c0({request:d,params:f,context:p,unstable_pattern:g},y,r,s,i,l)}async function c0(t,r,s,i,l,u,d=0){let{request:f}=t;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let p=r[d];if(!p)return await s();let[g,y]=p,x,b=async()=>{if(x)throw new Error("You may only call `next()` once per middleware");try{return x={value:await c0(t,r,s,i,l,u,d+1)},x.value}catch(j){return x={value:await u(j,g,x)},x.value}};try{let j=await y(t,b),N=j!=null?i(j):void 0;return l(N)?N:x?N??x.value:(x={value:await b()},x.value)}catch(j){return await u(j,g,x)}}function u0(t,r,s,i,l){let u=o0({key:"middleware",route:i.route,manifest:r,mapRouteProperties:t}),d=bb(i.route,Ot(s.method)?"action":"loader",r,t,l);return{middleware:u,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function Dd(t,r,s,i,l,u,d,f,p=null,g){let y=!1,x=u0(t,r,s,l,u);return{...l,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:p,shouldCallHandler(b){return y=!0,p?typeof g=="boolean"?uo(l,{...p,defaultShouldRevalidate:g}):typeof b=="boolean"?uo(l,{...p,defaultShouldRevalidate:b}):uo(l,p):f},resolve(b){let{lazy:j,loader:N,middleware:S}=l.route,E=y||f||b&&!Ot(s.method)&&(j||N),D=S&&S.length>0&&!N&&!j;return E&&(Ot(s.method)||!D)?Sb({request:s,unstable_pattern:i,match:l,lazyHandlerPromise:x==null?void 0:x.handler,lazyRoutePromise:x==null?void 0:x.route,handlerOverride:b,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Qa(t,r,s,i,l,u,d,f=null){return i.map(p=>p.route.id!==l.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:u0(t,r,s,p,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Dd(t,r,s,So(i),p,u,d,!0,f))}async function jb(t,r,s,i,l,u){s.some(g=>{var y;return(y=g._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(s.map(g=>{var y;return(y=g._lazyPromises)==null?void 0:y.middleware}));let d={request:r,unstable_pattern:So(s),params:s[0].params,context:l,matches:s},p=await t({...d,fetcherKey:i,runClientMiddleware:g=>{let y=d;return l0(y,()=>g({...y,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(g=>{var y,x;return[(y=g._lazyPromises)==null?void 0:y.handler,(x=g._lazyPromises)==null?void 0:x.route]}))}catch{}return p}async function Sb({request:t,unstable_pattern:r,match:s,lazyHandlerPromise:i,lazyRoutePromise:l,handlerOverride:u,scopedContext:d}){let f,p,g=Ot(t.method),y=g?"action":"loader",x=b=>{let j,N=new Promise((D,_)=>j=_);p=()=>j(),t.signal.addEventListener("abort",p);let S=D=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):b({request:t,unstable_pattern:r,params:s.params,context:d},...D!==void 0?[D]:[]),E=(async()=>{try{return{type:"data",result:await(u?u(_=>S(_)):S())}}catch(D){return{type:"error",result:D}}})();return Promise.race([E,N])};try{let b=g?s.route.action:s.route.loader;if(i||l)if(b){let j,[N]=await Promise.all([x(b).catch(S=>{j=S}),i,l]);if(j!==void 0)throw j;f=N}else{await i;let j=g?s.route.action:s.route.loader;if(j)[f]=await Promise.all([x(j),l]);else if(y==="action"){let N=new URL(t.url),S=N.pathname+N.search;throw jr(405,{method:t.method,pathname:S,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(b)f=await x(b);else{let j=new URL(t.url),N=j.pathname+j.search;throw jr(404,{pathname:N})}}catch(b){return{type:"error",result:b}}finally{p&&t.signal.removeEventListener("abort",p)}return f}async function Eb(t){let r=t.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?t.body==null?null:t.json():t.text()}async function Cb(t){var i,l,u,d,f;let{result:r,type:s}=t;if(df(r)){let p;try{p=await Eb(r)}catch(g){return{type:"error",error:g}}return s==="error"?{type:"error",error:new jo(r.status,r.statusText,p),statusCode:r.status,headers:r.headers}:{type:"data",data:p,statusCode:r.status,headers:r.headers}}return s==="error"?Dp(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:(i=r.init)==null?void 0:i.status,headers:(l=r.init)!=null&&l.headers?new Headers(r.init.headers):void 0}:{type:"error",error:Tb(r),statusCode:po(r)?r.status:void 0,headers:(u=r.init)!=null&&u.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:po(r)?r.status:void 0}:Dp(r)?{type:"data",data:r.data,statusCode:(d=r.init)==null?void 0:d.status,headers:(f=r.init)!=null&&f.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function kb(t,r,s,i,l){let u=t.headers.get("Location");if(ze(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!pc(u)){let d=i.slice(0,i.findIndex(f=>f.route.id===s)+1);u=Ld(new URL(r.url),d,l,u),t.headers.set("Location",u)}return t}function Mp(t,r,s,i){let l=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(pc(t)){let u=t,d=u.startsWith("//")?new URL(r.protocol+u):new URL(u);if(l.includes(d.protocol))throw new Error("Invalid redirect location");let f=Cr(d.pathname,s)!=null;if(d.origin===r.origin&&f)return d.pathname+d.search+d.hash}try{let u=i.createURL(t);if(l.includes(u.protocol))throw new Error("Invalid redirect location")}catch{}return t}function Ha(t,r,s,i){let l=t.createURL(d0(r)).toString(),u={signal:s};if(i&&Ot(i.formMethod)){let{formMethod:d,formEncType:f}=i;u.method=d.toUpperCase(),f==="application/json"?(u.headers=new Headers({"Content-Type":f}),u.body=JSON.stringify(i.json)):f==="text/plain"?u.body=i.text:f==="application/x-www-form-urlencoded"&&i.formData?u.body=Ad(i.formData):u.body=i.formData}return new Request(l,u)}function Ad(t){let r=new URLSearchParams;for(let[s,i]of t.entries())r.append(s,typeof i=="string"?i:i.name);return r}function Tp(t){let r=new FormData;for(let[s,i]of t.entries())r.append(s,i);return r}function Rb(t,r,s,i=!1,l=!1){let u={},d=null,f,p=!1,g={},y=s&&ur(s[1])?s[1].error:void 0;return t.forEach(x=>{if(!(x.route.id in r))return;let b=x.route.id,j=r[b];if(ze(!Gs(j),"Cannot handle redirect results in processLoaderData"),ur(j)){let N=j.error;if(y!==void 0&&(N=y,y=void 0),d=d||{},l)d[b]=N;else{let S=ds(t,b);d[S.route.id]==null&&(d[S.route.id]=N)}i||(u[b]=a0),p||(p=!0,f=po(j.error)?j.error.status:500),j.headers&&(g[b]=j.headers)}else u[b]=j.data,j.statusCode&&j.statusCode!==200&&!p&&(f=j.statusCode),j.headers&&(g[b]=j.headers)}),y!==void 0&&s&&(d={[s[0]]:y},s[2]&&(u[s[2]]=void 0)),{loaderData:u,errors:d,statusCode:f||200,loaderHeaders:g}}function Pp(t,r,s,i,l,u){let{loaderData:d,errors:f}=Rb(r,s,i);return l.filter(p=>!p.matches||p.matches.some(g=>g.shouldLoad)).forEach(p=>{let{key:g,match:y,controller:x}=p;if(x&&x.signal.aborted)return;let b=u[g];if(ze(b,"Did not find corresponding fetcher result"),ur(b)){let j=ds(t.matches,y==null?void 0:y.route.id);f&&f[j.route.id]||(f={...f,[j.route.id]:b.error}),t.fetchers.delete(g)}else if(Gs(b))ze(!1,"Unhandled fetcher revalidation redirect");else{let j=bn(b.data);t.fetchers.set(g,j)}}),{loaderData:d,errors:f}}function Lp(t,r,s,i){let l=Object.entries(r).filter(([,u])=>u!==a0).reduce((u,[d,f])=>(u[d]=f,u),{});for(let u of s){let d=u.route.id;if(!r.hasOwnProperty(d)&&t.hasOwnProperty(d)&&u.route.loader&&(l[d]=t[d]),i&&i.hasOwnProperty(d))break}return l}function Op(t){return t?ur(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ds(t,r){return(r?t.slice(0,t.findIndex(i=>i.route.id===r)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Ql(t){let r=t.length===1?t[0]:t.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function jr(t,{pathname:r,routeId:s,method:i,type:l,message:u}={}){let d="Unknown Server Error",f="Unknown @remix-run/router error";return t===400?(d="Bad Request",i&&r&&s?f=`You made a ${i} request to "${r}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:l==="invalid-body"&&(f="Unable to encode submission body")):t===403?(d="Forbidden",f=`Route "${s}" does not match URL "${r}"`):t===404?(d="Not Found",f=`No route matches URL "${r}"`):t===405&&(d="Method Not Allowed",i&&r&&s?f=`You made a ${i.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(f=`Invalid request method "${i.toUpperCase()}"`)),new jo(t||500,d,new Error(f),!0)}function Vl(t){let r=Object.entries(t);for(let s=r.length-1;s>=0;s--){let[i,l]=r[s];if(Gs(l))return{key:i,result:l}}}function d0(t){let r=typeof t=="string"?Es(t):t;return nn({...r,hash:""})}function Mb(t,r){return t.pathname!==r.pathname||t.search!==r.search?!1:t.hash===""?r.hash!=="":t.hash===r.hash?!0:r.hash!==""}function Tb(t){var r,s;return new jo(((r=t.init)==null?void 0:r.status)??500,((s=t.init)==null?void 0:s.statusText)??"Internal Server Error",t.data)}function Pb(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([r,s])=>typeof r=="string"&&Lb(s))}function Lb(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function Ob(t){return df(t.result)&&n0.has(t.result.status)}function ur(t){return t.type==="error"}function Gs(t){return(t&&t.type)==="redirect"}function Dp(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function df(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Db(t){return n0.has(t)}function Ab(t){return df(t)&&Db(t.status)&&t.headers.has("Location")}function _b(t){return fb.has(t.toUpperCase())}function Ot(t){return ub.has(t.toUpperCase())}function ff(t){return new URLSearchParams(t).getAll("index").some(r=>r==="")}function ec(t,r){let s=typeof r=="string"?Es(r).search:r.search;if(t[t.length-1].route.index&&ff(s||""))return t[t.length-1];let i=Xg(t);return i[i.length-1]}function Ap(t){let{formMethod:r,formAction:s,formEncType:i,text:l,formData:u,json:d}=t;if(!(!r||!s||!i)){if(l!=null)return{formMethod:r,formAction:s,formEncType:i,formData:void 0,json:void 0,text:l};if(u!=null)return{formMethod:r,formAction:s,formEncType:i,formData:u,json:void 0,text:void 0};if(d!==void 0)return{formMethod:r,formAction:s,formEncType:i,formData:void 0,json:d,text:void 0}}}function yd(t,r){return r?{state:"loading",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ib(t,r){return{state:"submitting",location:t,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function to(t,r){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function Fb(t,r){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:r?r.data:void 0}}function bn(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $b(t,r){try{let s=t.sessionStorage.getItem(s0);if(s){let i=JSON.parse(s);for(let[l,u]of Object.entries(i||{}))u&&Array.isArray(u)&&r.set(l,new Set(u||[]))}}catch{}}function zb(t,r){if(r.size>0){let s={};for(let[i,l]of r)s[i]=[...l];try{t.sessionStorage.setItem(s0,JSON.stringify(s))}catch(i){lt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function _p(){let t,r,s=new Promise((i,l)=>{t=async u=>{i(u);try{await s}catch{}},r=async u=>{l(u);try{await s}catch{}}});return{promise:s,resolve:t,reject:r}}var fa=w.createContext(null);fa.displayName="DataRouter";var Eo=w.createContext(null);Eo.displayName="DataRouterState";var f0=w.createContext(!1);function Ub(){return w.useContext(f0)}var hf=w.createContext({isTransitioning:!1});hf.displayName="ViewTransition";var h0=w.createContext(new Map);h0.displayName="Fetchers";var qb=w.createContext(null);qb.displayName="Await";var dr=w.createContext(null);dr.displayName="Navigation";var xc=w.createContext(null);xc.displayName="Location";var $r=w.createContext({outlet:null,matches:[],isDataRoute:!1});$r.displayName="Route";var mf=w.createContext(null);mf.displayName="RouteError";var m0="REACT_ROUTER_ERROR",Hb="REDIRECT",Bb="ROUTE_ERROR_RESPONSE";function Qb(t){if(t.startsWith(`${m0}:${Hb}:{`))try{let r=JSON.parse(t.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Vb(t){if(t.startsWith(`${m0}:${Bb}:{`))try{let r=JSON.parse(t.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new jo(r.status,r.statusText,r.data)}catch{}}function Wb(t,{relative:r}={}){ze(li(),"useHref() may be used only in the context of a component.");let{basename:s,navigator:i}=w.useContext(dr),{hash:l,pathname:u,search:d}=ko(t,{relative:r}),f=u;return s!=="/"&&(f=u==="/"?s:tn([s,u])),i.createHref({pathname:f,search:d,hash:l})}function li(){return w.useContext(xc)!=null}function On(){return ze(li(),"useLocation() may be used only in the context of a component."),w.useContext(xc).location}var p0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function g0(t){w.useContext(dr).static||w.useLayoutEffect(t)}function Co(){let{isDataRoute:t}=w.useContext($r);return t?lw():Kb()}function Kb(){ze(li(),"useNavigate() may be used only in the context of a component.");let t=w.useContext(fa),{basename:r,navigator:s}=w.useContext(dr),{matches:i}=w.useContext($r),{pathname:l}=On(),u=JSON.stringify(gc(i)),d=w.useRef(!1);return g0(()=>{d.current=!0}),w.useCallback((p,g={})=>{if(lt(d.current,p0),!d.current)return;if(typeof p=="number"){s.go(p);return}let y=yc(p,JSON.parse(u),l,g.relative==="path");t==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:tn([r,y.pathname])),(g.replace?s.replace:s.push)(y,g.state,g)},[r,s,u,l,t])}var Gb=w.createContext(null);function Yb(t){let r=w.useContext($r).outlet;return w.useMemo(()=>r&&w.createElement(Gb.Provider,{value:t},r),[r,t])}function ko(t,{relative:r}={}){let{matches:s}=w.useContext($r),{pathname:i}=On(),l=JSON.stringify(gc(s));return w.useMemo(()=>yc(t,JSON.parse(l),i,r==="path"),[t,l,i,r])}function Jb(t,r,s,i,l){ze(li(),"useRoutes() may be used only in the context of a component.");let{navigator:u}=w.useContext(dr),{matches:d}=w.useContext($r),f=d[d.length-1],p=f?f.params:{},g=f?f.pathname:"/",y=f?f.pathnameBase:"/",x=f&&f.route;{let _=x&&x.path||"";x0(g,!x||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${g}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let b=On(),j;j=b;let N=j.pathname||"/",S=N;if(y!=="/"){let _=y.replace(/^\//,"").split("/");S="/"+N.replace(/^\//,"").split("/").slice(_.length).join("/")}let E=us(t,{pathname:S});return lt(x||E!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),lt(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),rw(E&&E.map(_=>Object.assign({},_,{params:Object.assign({},p,_.params),pathname:tn([y,u.encodeLocation?u.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?y:tn([y,u.encodeLocation?u.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),d,s,i,l)}function Xb(){let t=ow(),r=po(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},u={padding:"2px 4px",backgroundColor:i},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=w.createElement(w.Fragment,null,w.createElement("p",null,"πŸ’Ώ Hey developer πŸ‘‹"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:u},"ErrorBoundary")," or"," ",w.createElement("code",{style:u},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},r),s?w.createElement("pre",{style:l},s):null,d)}var Zb=w.createElement(Xb,null),y0=class extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){this.props.onError?this.props.onError(t,r):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const s=Vb(t.digest);s&&(t=s)}let r=t!==void 0?w.createElement($r.Provider,{value:this.props.routeContext},w.createElement(mf.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?w.createElement(ew,{error:t},r):r}};y0.contextType=f0;var xd=new WeakMap;function ew({children:t,error:r}){let{basename:s}=w.useContext(dr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let i=Qb(r.digest);if(i){let l=xd.get(r);if(l)throw l;let u=e0(i.location,s);if(Zg&&!xd.get(r))if(u.isExternal||i.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:i.replace}));throw xd.set(r,d),d}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function tw({routeContext:t,match:r,children:s}){let i=w.useContext(fa);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement($r.Provider,{value:t},s)}function rw(t,r=[],s=null,i=null,l=null){if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(r.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let u=t,d=s==null?void 0:s.errors;if(d!=null){let y=u.findIndex(x=>x.route.id&&(d==null?void 0:d[x.route.id])!==void 0);ze(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,y+1))}let f=!1,p=-1;if(s)for(let y=0;y=0?u=u.slice(0,p+1):u=[u[0]];break}}}let g=s&&i?(y,x)=>{var b,j;i(y,{location:s.location,params:((j=(b=s.matches)==null?void 0:b[0])==null?void 0:j.params)??{},unstable_pattern:So(s.matches),errorInfo:x})}:void 0;return u.reduceRight((y,x,b)=>{let j,N=!1,S=null,E=null;s&&(j=d&&x.route.id?d[x.route.id]:void 0,S=x.route.errorElement||Zb,f&&(p<0&&b===0?(x0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,E=null):p===b&&(N=!0,E=x.route.hydrateFallbackElement||null)));let D=r.concat(u.slice(0,b+1)),_=()=>{let A;return j?A=S:N?A=E:x.route.Component?A=w.createElement(x.route.Component,null):x.route.element?A=x.route.element:A=y,w.createElement(tw,{match:x,routeContext:{outlet:y,matches:D,isDataRoute:s!=null},children:A})};return s&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?w.createElement(y0,{location:s.location,revalidation:s.revalidation,component:S,error:j,children:_(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:g}):_()},null)}function pf(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nw(t){let r=w.useContext(fa);return ze(r,pf(t)),r}function sw(t){let r=w.useContext(Eo);return ze(r,pf(t)),r}function aw(t){let r=w.useContext($r);return ze(r,pf(t)),r}function gf(t){let r=aw(t),s=r.matches[r.matches.length-1];return ze(s.route.id,`${t} can only be used on routes that contain a unique "id"`),s.route.id}function iw(){return gf("useRouteId")}function ow(){var i;let t=w.useContext(mf),r=sw("useRouteError"),s=gf("useRouteError");return t!==void 0?t:(i=r.errors)==null?void 0:i[s]}function lw(){let{router:t}=nw("useNavigate"),r=gf("useNavigate"),s=w.useRef(!1);return g0(()=>{s.current=!0}),w.useCallback(async(l,u={})=>{lt(s.current,p0),s.current&&(typeof l=="number"?await t.navigate(l):await t.navigate(l,{fromRouteId:r,...u}))},[t,r])}var Ip={};function x0(t,r,s){!r&&!Ip[t]&&(Ip[t]=!0,lt(!1,s))}var Fp={};function $p(t,r){!t&&!Fp[r]&&(Fp[r]=!0,console.warn(r))}var cw="useOptimistic",zp=Sv[cw],uw=()=>{};function dw(t){return zp?zp(t):[t,uw]}function fw(t){let r={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&<(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:w.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&<(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:w.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&<(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:w.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),r}var hw=["HydrateFallback","hydrateFallbackElement"],mw=class{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",t(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",r(s))}})}};function pw({router:t,flushSync:r,onError:s,unstable_useTransitions:i}){i=Ub()||i;let[u,d]=w.useState(t.state),[f,p]=dw(u),[g,y]=w.useState(),[x,b]=w.useState({isTransitioning:!1}),[j,N]=w.useState(),[S,E]=w.useState(),[D,_]=w.useState(),A=w.useRef(new Map),U=w.useCallback((ee,{deletedFetchers:W,newErrors:K,flushSync:Q,viewTransitionOpts:Re})=>{K&&s&&Object.values(K).forEach(de=>{var se;return s(de,{location:ee.location,params:((se=ee.matches[0])==null?void 0:se.params)??{},unstable_pattern:So(ee.matches)})}),ee.fetchers.forEach((de,se)=>{de.data!==void 0&&A.current.set(se,de.data)}),W.forEach(de=>A.current.delete(de)),$p(Q===!1||r!=null,'You provided the `flushSync` option to a router update, but you are not using the `` 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 oe=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if($p(Re==null||oe,"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."),!Re||!oe){r&&Q?r(()=>d(ee)):i===!1?d(ee):w.startTransition(()=>{i===!0&&p(de=>Up(de,ee)),d(ee)});return}if(r&&Q){r(()=>{S&&(j==null||j.resolve(),S.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})});let de=t.window.document.startViewTransition(()=>{r(()=>d(ee))});de.finished.finally(()=>{r(()=>{N(void 0),E(void 0),y(void 0),b({isTransitioning:!1})})}),r(()=>E(de));return}S?(j==null||j.resolve(),S.skipTransition(),_({state:ee,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation})):(y(ee),b({isTransitioning:!0,flushSync:!1,currentLocation:Re.currentLocation,nextLocation:Re.nextLocation}))},[t.window,r,S,j,i,p,s]);w.useLayoutEffect(()=>t.subscribe(U),[t,U]),w.useEffect(()=>{x.isTransitioning&&!x.flushSync&&N(new mw)},[x]),w.useEffect(()=>{if(j&&g&&t.window){let ee=g,W=j.promise,K=t.window.document.startViewTransition(async()=>{i===!1?d(ee):w.startTransition(()=>{i===!0&&p(Q=>Up(Q,ee)),d(ee)}),await W});K.finished.finally(()=>{N(void 0),E(void 0),y(void 0),b({isTransitioning:!1})}),E(K)}},[g,j,t.window,i,p]),w.useEffect(()=>{j&&g&&f.location.key===g.location.key&&j.resolve()},[j,S,f.location,g]),w.useEffect(()=>{!x.isTransitioning&&D&&(y(D.state),b({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),_(void 0))},[x.isTransitioning,D]);let B=w.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:ee=>t.navigate(ee),push:(ee,W,K)=>t.navigate(ee,{state:W,preventScrollReset:K==null?void 0:K.preventScrollReset}),replace:(ee,W,K)=>t.navigate(ee,{replace:!0,state:W,preventScrollReset:K==null?void 0:K.preventScrollReset})}),[t]),te=t.basename||"/",P=w.useMemo(()=>({router:t,navigator:B,static:!1,basename:te,onError:s}),[t,B,te,s]);return w.createElement(w.Fragment,null,w.createElement(fa.Provider,{value:P},w.createElement(Eo.Provider,{value:f},w.createElement(h0.Provider,{value:A.current},w.createElement(hf.Provider,{value:x},w.createElement(bw,{basename:te,location:f.location,navigationType:f.historyAction,navigator:B,unstable_useTransitions:i},w.createElement(gw,{routes:t.routes,future:t.future,state:f,onError:s})))))),null)}function Up(t,r){return{...t,navigation:r.navigation.state!=="idle"?r.navigation:t.navigation,revalidation:r.revalidation!=="idle"?r.revalidation:t.revalidation,actionData:r.navigation.state!=="submitting"?r.actionData:t.actionData,fetchers:r.fetchers}}var gw=w.memo(yw);function yw({routes:t,future:r,state:s,onError:i}){return Jb(t,void 0,s,i,r)}function xw({to:t,replace:r,state:s,relative:i}){ze(li()," may be used only in the context of a component.");let{static:l}=w.useContext(dr);lt(!l," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=w.useContext($r),{pathname:d}=On(),f=Co(),p=yc(t,gc(u),d,i==="path"),g=JSON.stringify(p);return w.useEffect(()=>{f(JSON.parse(g),{replace:r,state:s,relative:i})},[f,g,i,r,s]),null}function vw(t){return Yb(t.context)}function bw({basename:t="/",children:r=null,location:s,navigationType:i="POP",navigator:l,static:u=!1,unstable_useTransitions:d}){ze(!li(),"You cannot render a inside another . You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:f,navigator:l,static:u,unstable_useTransitions:d,future:{}}),[f,l,u,d]);typeof s=="string"&&(s=Es(s));let{pathname:g="/",search:y="",hash:x="",state:b=null,key:j="default"}=s,N=w.useMemo(()=>{let S=Cr(g,f);return S==null?null:{location:{pathname:S,search:y,hash:x,state:b,key:j},navigationType:i}},[f,g,y,x,b,j,i]);return lt(N!=null,` is not able to match the URL "${g}${y}${x}" because it does not start with the basename, so the won't render anything.`),N==null?null:w.createElement(dr.Provider,{value:p},w.createElement(xc.Provider,{children:r,value:N}))}var tc="get",rc="application/x-www-form-urlencoded";function vc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function ww(t){return vc(t)&&t.tagName.toLowerCase()==="button"}function Nw(t){return vc(t)&&t.tagName.toLowerCase()==="form"}function jw(t){return vc(t)&&t.tagName.toLowerCase()==="input"}function Sw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Ew(t,r){return t.button===0&&(!r||r==="_self")&&!Sw(t)}function _d(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((r,s)=>{let i=t[s];return r.concat(Array.isArray(i)?i.map(l=>[s,l]):[[s,i]])},[]))}function Cw(t,r){let s=_d(t);return r&&r.forEach((i,l)=>{s.has(l)||r.getAll(l).forEach(u=>{s.append(l,u)})}),s}var Wl=null;function kw(){if(Wl===null)try{new FormData(document.createElement("form"),0),Wl=!1}catch{Wl=!0}return Wl}var Rw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vd(t){return t!=null&&!Rw.has(t)?(lt(!1,`"${t}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${rc}"`),null):t}function Mw(t,r){let s,i,l,u,d;if(Nw(t)){let f=t.getAttribute("action");i=f?Cr(f,r):null,s=t.getAttribute("method")||tc,l=vd(t.getAttribute("enctype"))||rc,u=new FormData(t)}else if(ww(t)||jw(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a