import{r as e}from"./vendor-X31hiD63.js";
/**
 * react-router v7.9.1
 *
 * 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 t="popstate";function n(e={}){return function(e,n,a,u={}){let{window:s=document.defaultView,v5Compat:c=!1}=u,h=s.history,d="POP",p=null,m=f();null==m&&(m=0,h.replaceState({...h.state,idx:m},""));function f(){return(h.state||{idx:null}).idx}function v(){d="POP";let e=f(),t=null==e?null:e-m;m=e,p&&p({action:d,location:b.location,delta:t})}function y(e,t){d="PUSH";let n=i(b.location,e,t);m=f()+1;let r=o(n,m),a=b.createHref(n);try{h.pushState(r,"",a)}catch(l){if(l instanceof DOMException&&"DataCloneError"===l.name)throw l;s.location.assign(a)}c&&p&&p({action:d,location:b.location,delta:1})}function g(e,t){d="REPLACE";let n=i(b.location,e,t);m=f();let r=o(n,m),a=b.createHref(n);h.replaceState(r,"",a),c&&p&&p({action:d,location:b.location,delta:0})}function w(e){return function(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href);r(n,"No window.location.(origin|href) available to create URL");let a="string"==typeof e?e:l(e);a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a);return new URL(a,n)}(e)}let b={get action(){return d},get location(){return e(s,h)},listen(e){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(t,v),p=e,()=>{s.removeEventListener(t,v),p=null}},createHref:e=>n(s,e),createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:y,replace:g,go:e=>h.go(e)};return b}(function(e,t){let{pathname:n,search:r,hash:a}=e.location;return i("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:l(t)},0,e)}function r(e,t){if(!1===e||null==e)throw new Error(t)}function a(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function o(e,t){return{usr:e.state,key:e.key,idx:t}}function i(e,t,n=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?u(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function l({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function u(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function s(e,t,n="/"){return function(e,t,n,r){let a="string"==typeof t?u(t):t,o=R(a.pathname||"/",n);if(null==o)return null;let i=c(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(i);let l=null;for(let u=0;null==l&&u<i.length;++u){let e=E(o);l=b(i[u],e,r)}return l}(e,t,n,!1)}function c(e,t=[],n=[],a="",o=!1){let i=(e,i,l=o,u)=>{let s={relativePath:void 0===u?e.path||"":u,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(a)&&l)return;r(s.relativePath.startsWith(a),`Absolute route path "${s.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(a.length)}let h=L([a,s.relativePath]),d=n.concat(s);e.children&&e.children.length>0&&(r(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),c(e.children,t,d,h,l)),(null!=e.path||e.index)&&t.push({path:h,score:w(h,e.index),routesMeta:d})};return e.forEach((e,t)=>{var n;if(""!==e.path&&(null==(n=e.path)?void 0:n.includes("?")))for(let r of h(e.path))i(e,t,!0,r);else i(e,t)}),t}function h(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let i=h(r.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}var d=/^:[\w-]+$/,p=3,m=2,f=1,v=10,y=-2,g=e=>"*"===e;function w(e,t){let n=e.split("/"),r=n.length;return n.some(g)&&(r+=y),t&&(r+=m),n.filter(e=>!g(e)).reduce((e,t)=>e+(d.test(t)?p:""===t?f:v),r)}function b(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let l=0;l<r.length;++l){let e=r[l],u=l===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c=x({path:e.relativePath,caseSensitive:e.caseSensitive,end:u},s),h=e.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=x({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},s)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:L([o,c.pathname]),pathnameBase:k(L([o,c.pathnameBase])),route:h}),"/"!==c.pathnameBase&&(o=L([o,c.pathnameBase]))}return i}function x(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){a("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],l=i.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=u[r]||"";l=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const a=u[r];return e[t]=n&&!a?void 0:(a||"").replace(/%2F/g,"/"),e},{}),pathname:i,pathnameBase:l,pattern:e}}function E(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return a(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function R(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function C(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function S(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $(e,t,n,a=!1){let o;"string"==typeof e?o=u(e):(o={...e},r(!o.pathname||!o.pathname.includes("?"),C("?","pathname","search",o)),r(!o.pathname||!o.pathname.includes("#"),C("#","pathname","hash",o)),r(!o.search||!o.search.includes("#"),C("#","search","hash",o)));let i,l=""===e||""===o.pathname,s=l?"/":o.pathname;if(null==s)i=n;else{let e=t.length-1;if(!a&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let c=function(e,t="/"){let{pathname:n,search:r="",hash:a=""}="string"==typeof e?u(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:P(r),hash:T(a)}}(o,i),h=s&&"/"!==s&&s.endsWith("/"),d=(l||"."===s)&&n.endsWith("/");return c.pathname.endsWith("/")||!h&&!d||(c.pathname+="/"),c}var L=e=>e.join("/").replace(/\/\/+/g,"/"),k=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",T=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var N=["POST","PUT","PATCH","DELETE"];new Set(N);var F=["GET",...N];new Set(F);var M=e.createContext(null);M.displayName="DataRouter";var A=e.createContext(null);A.displayName="DataRouterState",e.createContext(!1);var O=e.createContext({isTransitioning:!1});O.displayName="ViewTransition",e.createContext(new Map).displayName="Fetchers",e.createContext(null).displayName="Await";var D=e.createContext(null);D.displayName="Navigation";var W=e.createContext(null);W.displayName="Location";var B=e.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName="Route";var U=e.createContext(null);function j(){return null!=e.useContext(W)}function _(){return r(j(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(W).location}U.displayName="RouteError";var H="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function I(t){e.useContext(D).static||e.useLayoutEffect(t)}function z(){let{isDataRoute:t}=e.useContext(B);return t?function(){let{router:t}=function(t){let n=e.useContext(M);return r(n,Q(t)),n}("useNavigate"),n=Z("useNavigate"),o=e.useRef(!1);return I(()=>{o.current=!0}),e.useCallback(async(e,r={})=>{a(o.current,H),o.current&&("number"==typeof e?t.navigate(e):await t.navigate(e,{fromRouteId:n,...r}))},[t,n])}():function(){r(j(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(M),{basename:n,navigator:o}=e.useContext(D),{matches:i}=e.useContext(B),{pathname:l}=_(),u=JSON.stringify(S(i)),s=e.useRef(!1);return I(()=>{s.current=!0}),e.useCallback((e,r={})=>{if(a(s.current,H),!s.current)return;if("number"==typeof e)return void o.go(e);let i=$(e,JSON.parse(u),l,"path"===r.relative);null==t&&"/"!==n&&(i.pathname="/"===i.pathname?n:L([n,i.pathname])),(r.replace?o.replace:o.push)(i,r.state,r)},[n,o,u,l,t])}()}var J=e.createContext(null);function Y(t,{relative:n}={}){let{matches:r}=e.useContext(B),{pathname:a}=_(),o=JSON.stringify(S(r));return e.useMemo(()=>$(t,JSON.parse(o),a,"path"===n),[t,o,a,n])}function K(t,n,o,i,l){var c;r(j(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:h}=e.useContext(D),{matches:d}=e.useContext(B),p=d[d.length-1],m=p?p.params:{},f=p?p.pathname:"/",v=p?p.pathnameBase:"/",y=p&&p.route;{let e=y&&y.path||"";te(f,!y||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let g,w=_();if(n){let e="string"==typeof n?u(n):n;r("/"===v||(null==(c=e.pathname)?void 0:c.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${e.pathname}" was given in the \`location\` prop.`),g=e}else g=w;let b=g.pathname||"/",x=b;if("/"!==v){let e=v.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let E=s(t,{pathname:x});a(y||null!=E,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),a(null==E||void 0!==E[E.length-1].route.element||void 0!==E[E.length-1].route.Component||void 0!==E[E.length-1].route.lazy,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=function(t,n=[],a=null,o=null){if(null==t){if(!a)return null;if(a.errors)t=a.matches;else{if(0!==n.length||a.initialized||!(a.matches.length>0))return null;t=a.matches}}let i=t,l=null==a?void 0:a.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));r(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,s=-1;if(a)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:n}=a,r=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||r){u=!0,i=s>=0?i.slice(0,s+1):[i[0]];break}}}return i.reduceRight((t,r,c)=>{let h,d=!1,p=null,m=null;a&&(h=l&&r.route.id?l[r.route.id]:void 0,p=r.route.errorElement||q,u&&(s<0&&0===c?(te("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===c&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(i.slice(0,c+1)),v=()=>{let n;return n=h?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(X,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===c)?e.createElement(G,{location:a.location,revalidation:a.revalidation,component:p,error:h,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0},unstable_onError:o}):v()},null)}(E&&E.map(e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:L([v,h.encodeLocation?h.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?v:L([v,h.encodeLocation?h.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),d,o,i,l);return n&&R?e.createElement(W.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},R):R}function V(){let t=function(){var t;let n=e.useContext(U),a=function(t){let n=e.useContext(A);return r(n,Q(t)),n}("useRouteError"),o=Z("useRouteError");if(void 0!==n)return n;return null==(t=a.errors)?void 0:t[o]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=e.createElement(e.Fragment,null,e.createElement("p",null,"💿 Hey developer 👋"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:l},"ErrorBoundary")," or"," ",e.createElement("code",{style:l},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),a?e.createElement("pre",{style:i},a):null,u)}var q=e.createElement(V,null),G=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return void 0!==this.state.error?e.createElement(B.Provider,{value:this.props.routeContext},e.createElement(U.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function X({routeContext:t,match:n,children:r}){let a=e.useContext(M);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(B.Provider,{value:t},r)}function Q(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Z(t){let n=function(t){let n=e.useContext(B);return r(n,Q(t)),n}(t),a=n.matches[n.matches.length-1];return r(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}var ee={};function te(e,t,n){t||ee[e]||(ee[e]=!0,a(!1,n))}function ne({to:t,replace:n,state:o,relative:i}){r(j(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=e.useContext(D);a(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=e.useContext(B),{pathname:s}=_(),c=z(),h=$(t,S(u),s,"path"===i),d=JSON.stringify(h);return e.useEffect(()=>{c(JSON.parse(d),{replace:n,state:o,relative:i})},[c,d,i,n,o]),null}function re(t){return function(t){let n=e.useContext(B).outlet;return n?e.createElement(J.Provider,{value:t},n):n}(t.context)}function ae(e){r(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function oe({basename:t="/",children:n=null,location:o,navigationType:i="POP",navigator:l,static:s=!1}){r(!j(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),h=e.useMemo(()=>({basename:c,navigator:l,static:s,future:{}}),[c,l,s]);"string"==typeof o&&(o=u(o));let{pathname:d="/",search:p="",hash:m="",state:f=null,key:v="default"}=o,y=e.useMemo(()=>{let e=R(d,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:f,key:v},navigationType:i}},[c,d,p,m,f,v,i]);return a(null!=y,`<Router basename="${c}"> is not able to match the URL "${d}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:e.createElement(D.Provider,{value:h},e.createElement(W.Provider,{children:n,value:y}))}function ie({children:e,location:t}){return K(le(e),t)}function le(t,n=[]){let a=[];return e.Children.forEach(t,(t,o)=>{if(!e.isValidElement(t))return;let i=[...n,o];if(t.type===e.Fragment)return void a.push.apply(a,le(t.props.children,i));r(t.type===ae,`[${"string"==typeof t.type?t.type:t.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),r(!t.props.index||!t.props.children,"An index route cannot have child routes.");let l={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(l.children=le(t.props.children,i)),a.push(l)}),a}e.memo(function({routes:e,future:t,state:n,unstable_onError:r}){return K(e,void 0,n,r,t)});var ue="get",se="application/x-www-form-urlencoded";function ce(e){return null!=e&&"string"==typeof e.tagName}var he=null;var de=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pe(e){return null==e||de.has(e)?e:(a(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${se}"`),null)}function me(e,t){let n,r,a,o,i;if(ce(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?R(i,t):null,n=e.getAttribute("method")||ue,a=pe(e.getAttribute("enctype"))||se,o=new FormData(e)}else if(function(e){return ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ce(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(r=l?R(l,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||ue,a=pe(e.getAttribute("formenctype"))||pe(i.getAttribute("enctype"))||se,o=new FormData(i,e),!function(){if(null===he)try{new FormData(document.createElement("form"),0),he=!1}catch(e){he=!0}return he}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,r)}}else{if(ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ue,r=null,a=se,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}function fe(e,t){if(!1===e||null==e)throw new Error(t)}function ve(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function ye(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e},[])}((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ve).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}function ge(e,t,n,r,a,o){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,l=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null==(r=n[t].route.path)?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{var u;let s=r.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:(null==(u=n[0])?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function we(e,t,{includeHydrateFallback:n}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1),[...new Set(r)];var r}function be(){let t=e.useContext(M);return fe(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xe=e.createContext(void 0);function Ee(){let t=e.useContext(xe);return fe(t,"You must render this element inside a <HydratedRouter> element"),t}function Re(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ce({page:t,...n}){let{router:r}=be(),a=e.useMemo(()=>s(r.routes,t,r.basename),[r.routes,t,r.basename]);return a?e.createElement(Se,{page:t,matches:a,...n}):null}function Se({page:t,matches:n,...r}){let a=_(),{manifest:o,routeModules:i}=Ee(),{basename:l}=be(),{loaderData:u,matches:s}=function(){let t=e.useContext(A);return fe(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}(),c=e.useMemo(()=>ge(t,n,s,o,a,"data"),[t,n,s,o,a]),h=e.useMemo(()=>ge(t,n,s,o,a,"assets"),[t,n,s,o,a]),d=e.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let e=new Set,r=!1;if(n.forEach(t=>{var n;let a=o.routes[t.route.id];a&&a.hasLoader&&(!c.some(e=>e.route.id===t.route.id)&&t.route.id in u&&(null==(n=i[t.route.id])?void 0:n.shouldRevalidate)||a.hasClientLoader?r=!0:e.add(t.route.id))}),0===e.size)return[];let s=function(e,t,n){let r="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===r.pathname?r.pathname=`_root.${n}`:t&&"/"===R(r.pathname,t)?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}(t,l,"data");return r&&e.size>0&&s.searchParams.set("_routes",n.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[s.pathname+s.search]},[l,u,a,o,c,n,t,i]),p=e.useMemo(()=>we(h,o),[h,o]),m=function(t){let{manifest:n,routeModules:r}=Ee(),[a,o]=e.useState([]);return e.useEffect(()=>{let e=!1;return ye(t,n,r).then(t=>{e||o(t)}),()=>{e=!0}},[t,n,r]),a}(h);return e.createElement(e.Fragment,null,d.map(t=>e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...r})),p.map(t=>e.createElement("link",{key:t,rel:"modulepreload",href:t,...r})),m.map(({key:t,link:n})=>e.createElement("link",{key:t,nonce:r.nonce,...n})))}function $e(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}xe.displayName="FrameworkContext";var Le="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Le&&(window.__reactRouterVersion="7.9.1")}catch(Oe){}function ke({basename:t,children:r,window:a}){let o=e.useRef();null==o.current&&(o.current=n({window:a,v5Compat:!0}));let i=o.current,[l,u]=e.useState({action:i.action,location:i.location}),s=e.useCallback(t=>{e.startTransition(()=>u(t))},[u]);return e.useLayoutEffect(()=>i.listen(s),[i,s]),e.createElement(oe,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i})}var Pe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Te=e.forwardRef(function({onClick:t,discover:n="render",prefetch:o="none",relative:i,reloadDocument:u,replace:s,state:c,target:h,to:d,preventScrollReset:p,viewTransition:m,...f},v){let y,{basename:g}=e.useContext(D),w="string"==typeof d&&Pe.test(d),b=!1;if("string"==typeof d&&w&&(y=d,Le))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),n=R(t.pathname,g);t.origin===e.origin&&null!=n?d=n+t.search+t.hash:b=!0}catch(Oe){a(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let x=function(t,{relative:n}={}){r(j(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=e.useContext(D),{hash:i,pathname:l,search:u}=Y(t,{relative:n}),s=l;return"/"!==a&&(s="/"===l?a:L([a,l])),o.createHref({pathname:s,search:u,hash:i})}(d,{relative:i}),[E,C,S]=function(t,n){let r=e.useContext(xe),[a,o]=e.useState(!1),[i,l]=e.useState(!1),{onFocus:u,onBlur:s,onMouseEnter:c,onMouseLeave:h,onTouchStart:d}=n,p=e.useRef(null);e.useEffect(()=>{if("render"===t&&l(!0),"viewport"===t){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(a){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[a]);let m=()=>{o(!0)},f=()=>{o(!1),l(!1)};return r?"intent"!==t?[i,p,{}]:[i,p,{onFocus:Re(u,m),onBlur:Re(s,f),onMouseEnter:Re(c,m),onMouseLeave:Re(h,f),onTouchStart:Re(d,m)}]:[!1,p,{}]}(o,f),$=function(t,{target:n,replace:r,state:a,preventScrollReset:o,relative:i,viewTransition:u}={}){let s=z(),c=_(),h=Y(t,{relative:i});return e.useCallback(e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,n)){e.preventDefault();let n=void 0!==r?r:l(c)===l(h);s(t,{replace:n,state:a,preventScrollReset:o,relative:i,viewTransition:u})}},[c,s,h,r,a,n,t,o,i,u])}(d,{replace:s,state:c,target:h,preventScrollReset:p,relative:i,viewTransition:m});let k=e.createElement("a",{...f,...S,href:y||x,onClick:b||u?t:function(e){t&&t(e),e.defaultPrevented||$(e)},ref:$e(v,C),target:h,"data-discover":w||"render"!==n?void 0:"true"});return E&&!w?e.createElement(e.Fragment,null,k,e.createElement(Ce,{page:x})):k});Te.displayName="Link";var Ne=e.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:i,to:l,viewTransition:u,children:s,...c},h){let d=Y(l,{relative:c.relative}),p=_(),m=e.useContext(A),{navigator:f,basename:v}=e.useContext(D),y=null!=m&&function(t,{relative:n}={}){let a=e.useContext(O);r(null!=a,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Fe("useViewTransitionState"),i=Y(t,{relative:n});if(!a.isTransitioning)return!1;let l=R(a.currentLocation.pathname,o)||a.currentLocation.pathname,u=R(a.nextLocation.pathname,o)||a.nextLocation.pathname;return null!=x(i.pathname,u)||null!=x(i.pathname,l)}(d)&&!0===u,g=f.encodeLocation?f.encodeLocation(d).pathname:d.pathname,w=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(w=w.toLowerCase(),b=b?b.toLowerCase():null,g=g.toLowerCase()),b&&v&&(b=R(b,v)||b);const E="/"!==g&&g.endsWith("/")?g.length-1:g.length;let C,S=w===g||!o&&w.startsWith(g)&&"/"===w.charAt(E),$=null!=b&&(b===g||!o&&b.startsWith(g)&&"/"===b.charAt(g.length)),L={isActive:S,isPending:$,isTransitioning:y},k=S?t:void 0;C="function"==typeof a?a(L):[a,S?"active":null,$?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof i?i(L):i;return e.createElement(Te,{...c,"aria-current":k,className:C,ref:h,style:P,to:l,viewTransition:u},"function"==typeof s?s(L):s)});function Fe(t){let n=e.useContext(M);return r(n,function(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}(t)),n}Ne.displayName="NavLink",e.forwardRef(({discover:t="render",fetcherKey:n,navigate:a,reloadDocument:o,replace:i,state:u,method:s=ue,action:c,onSubmit:h,relative:d,preventScrollReset:p,viewTransition:m,...f},v)=>{let y=function(){let{router:t}=Fe("useSubmit"),{basename:n}=e.useContext(D),r=Z("useRouteId");return e.useCallback(async(e,a={})=>{let{action:o,method:i,encType:l,formData:u,body:s}=me(e,n);if(!1===a.navigate){let e=a.fetcherKey||Ae();await t.fetch(e,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:s,formMethod:a.method||i,formEncType:a.encType||l,flushSync:a.flushSync})}else await t.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:s,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[t,n,r])}(),g=function(t,{relative:n}={}){let{basename:a}=e.useContext(D),o=e.useContext(B);r(o,"useFormAction must be used inside a RouteContext");let[i]=o.matches.slice(-1),u={...Y(t||".",{relative:n})},s=_();if(null==t){u.search=s.search;let e=new URLSearchParams(u.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();u.search=n?`?${n}`:""}}t&&"."!==t||!i.route.index||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index");"/"!==a&&(u.pathname="/"===u.pathname?a:L([a,u.pathname]));return l(u)}(c,{relative:d}),w="get"===s.toLowerCase()?"get":"post",b="string"==typeof c&&Pe.test(c);return e.createElement("form",{ref:v,method:w,action:g,onSubmit:o?h:e=>{if(h&&h(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||s;y(t||e.currentTarget,{fetcherKey:n,method:r,navigate:a,replace:i,state:u,relative:d,preventScrollReset:p,viewTransition:m})},...f,"data-discover":b||"render"!==t?void 0:"true"})}).displayName="Form";var Me=0,Ae=()=>`__${String(++Me)}__`;export{ke as B,Te as L,Ne as N,re as O,ie as R,z as a,ne as b,ae as c,_ as u};
