import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{t}from"./react-Augu_vA3.js";function n(e,t={}){let n=e;for(let e in t)n=n.replace(`:${e}`,t[e]);return n}function r(e,t={}){let n=`${window.location.origin}${e}`;for(let e in t)n=n.replace(`:${e}`,t[e]);return console.log(n),n}var i=e(t());function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function g(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:c=!1}=r,u=i.history,d=o.Pop,h=null,g=_();g??(g=0,u.replaceState(a({},u.state,{idx:g}),``));function _(){return(u.state||{idx:null}).idx}function v(){d=o.Pop;let e=_(),t=e==null?null:e-g;g=e,h&&h({action:d,location:S.location,delta:t})}function y(e,t){d=o.Push;let r=p(S.location,e,t);n&&n(r,e),g=_()+1;let a=f(r,g),s=S.createHref(r);try{u.pushState(a,``,s)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(s)}c&&h&&h({action:d,location:S.location,delta:1})}function b(e,t){d=o.Replace;let r=p(S.location,e,t);n&&n(r,e),g=_();let i=f(r,g),a=S.createHref(r);u.replaceState(i,``,a),c&&h&&h({action:d,location:S.location,delta:0})}function x(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:m(e);return n=n.replace(/ $/,`%20`),l(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let S={get action(){return d},get location(){return e(i,u)},listen(e){if(h)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,v),h=e,()=>{i.removeEventListener(s,v),h=null}},createHref(e){return t(i,e)},createURL:x,encodeLocation(e){let t=x(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:y,replace:b,go(e){return u.go(e)}};return S}var _;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(_||={});function v(e,t,n){return n===void 0&&(n=`/`),y(e,t,n,!1)}function y(e,t,n,r){let i=E((typeof t==`string`?h(t):t).pathname||`/`,n);if(i==null)return null;let a=b(e);S(a);let o=null;for(let e=0;o==null&&e{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(l(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=j([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(l(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),b(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:ae(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of x(e.path))i(e,t,n)}),t}function x(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=x(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function S(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var C=/^:[\w-]+$/,ee=3,te=2,ne=1,re=10,ie=-2,w=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(w)&&(r+=ie),t&&(r+=te),n.filter(e=>!w(e)).reduce((e,t)=>e+(C.test(t)?ee:t===``?ne:re),r)}function oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function se(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;ee==null?``:typeof e==`string`?e:String(e);return r+n.split(/\/+/).map((e,n,r)=>{if(n===r.length-1&&e===`*`)return i(t[`*`]);let a=e.match(/^:([\w-]+)(\??)$/);if(a){let[,e,n]=a,r=t[e];return l(n===`?`||r!=null,`Missing ":`+e+`" param`),i(r)}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function T(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=le(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function le(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),u(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ue(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return u(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function E(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 D(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?h(e):e;return{pathname:n?n.startsWith(`/`)?n:de(n,t):t,search:me(r),hash:he(i)}}function de(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(`/`):`/`}function O(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 and the router will parse it for you.`}function fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function k(e,t){let n=fe(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function A(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=h(e):(i=a({},e),l(!i.pathname||!i.pathname.includes(`?`),O(`?`,`pathname`,`search`,i)),l(!i.pathname||!i.pathname.includes(`#`),O(`#`,`pathname`,`hash`,i)),l(!i.search||!i.search.includes(`#`),O(`#`,`search`,`hash`,i)));let o=e===``||i.pathname===``,s=o?`/`:i.pathname,c;if(s==null)c=n;else{let e=t.length-1;if(!r&&s.startsWith(`..`)){let t=s.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}c=e>=0?t[e]:`/`}let u=D(i,c),d=s&&s!==`/`&&s.endsWith(`/`),f=(o||s===`.`)&&n.endsWith(`/`);return!u.pathname.endsWith(`/`)&&(d||f)&&(u.pathname+=`/`),u}var j=e=>e.join(`/`).replace(/\/\/+/g,`/`),pe=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),me=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,he=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function ge(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var M=[`post`,`put`,`patch`,`delete`];new Set(M);var _e=[`get`,...M];new Set(_e);function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.current=!0}),i.useCallback(function(n,i){if(i===void 0&&(i={}),!c.current)return;if(typeof n==`number`){r.go(n);return}let a=A(n,JSON.parse(s),o,i.relative===`path`);e==null&&t!==`/`&&(a.pathname=a.pathname===`/`?t:j([t,a.pathname])),(i.replace?r.replace:r.push)(a,i.state,i)},[t,r,s,o,e])}var G=i.createContext(null);function ye(){return i.useContext(G)}function be(e){let t=i.useContext(R).outlet;return t&&i.createElement(G.Provider,{value:e},t)}function xe(){let{matches:e}=i.useContext(R),t=e[e.length-1];return t?t.params:{}}function K(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=i.useContext(I),{matches:a}=i.useContext(R),{pathname:o}=V(),s=JSON.stringify(k(a,r.v7_relativeSplatPath));return i.useMemo(()=>A(e,JSON.parse(s),o,n===`path`),[e,s,o,n])}function Se(e,t){return Ce(e,t)}function Ce(e,t,n,r){!B()&&l(!1);let{navigator:a,static:s}=i.useContext(I),{matches:c}=i.useContext(R),u=c[c.length-1],d=u?u.params:{};u&&u.pathname;let f=u?u.pathnameBase:`/`;u&&u.route;let p=V(),m;if(t){let e=typeof t==`string`?h(t):t;!(f===`/`||e.pathname?.startsWith(f))&&l(!1),m=e}else m=p;let g=m.pathname||`/`,_=g;if(f!==`/`){let e=f.replace(/^\//,``).split(`/`);_=`/`+g.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let y=!s&&n&&n.matches&&n.matches.length>0?n.matches:v(e,{pathname:_}),b=Oe(y&&y.map(e=>Object.assign({},e,{params:Object.assign({},d,e.params),pathname:j([f,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?f:j([f,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),c,n,r);return t&&b?i.createElement(L.Provider,{value:{location:N({pathname:`/`,search:``,hash:``,state:null,key:`default`},m),navigationType:o.Pop}},b):b}function we(){let e=Me(),t=ge(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return i.createElement(i.Fragment,null,i.createElement(`h2`,null,`Unexpected Application Error!`),i.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?i.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Te=i.createElement(we,null),Ee=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:i.createElement(R.Provider,{value:this.props.routeContext},i.createElement(z.Provider,{value:this.state.error,children:this.props.component}))}};function De(e){let{routeContext:t,match:n,children:r}=e,a=i.useContext(P);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(R.Provider,{value:t},r)}function Oe(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let e=o.findIndex(e=>e.route.id&&s?.[e.route.id]!==void 0);!(e>=0)&&l(!1),o=o.slice(0,Math.min(o.length,e+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e=0?o.slice(0,u+1):[o[0]];break}}}return o.reduceRight((e,r,a)=>{let l,d=!1,f=null,p=null;n&&(l=s&&r.route.id?s[r.route.id]:void 0,f=r.route.errorElement||Te,c&&(u<0&&a===0?(Pe(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):u===a&&(d=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,a+1)),h=()=>{let t;return t=l?f:d?p:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(De,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||a===0)?i.createElement(Ee,{location:n.location,revalidation:n.revalidation,component:f,error:l,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var q=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(q||{}),J=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(J||{});function ke(e){let t=i.useContext(P);return!t&&l(!1),t}function Ae(e){let t=i.useContext(F);return!t&&l(!1),t}function je(e){let t=i.useContext(R);return!t&&l(!1),t}function Y(e){let t=je(e),n=t.matches[t.matches.length-1];return!n.route.id&&l(!1),n.route.id}function Me(){let e=i.useContext(z),t=Ae(J.UseRouteError),n=Y(J.UseRouteError);return e===void 0?t.errors?.[n]:e}function Ne(){let{router:e}=ke(q.UseNavigateStable),t=Y(J.UseNavigateStable),n=i.useRef(!1);return H(()=>{n.current=!0}),i.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,N({fromRouteId:t},i)))},[e,t])}var X={};function Pe(e,t,n){!t&&!X[e]&&(X[e]=!0)}var Z=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function Fe(e,t){e?.v7_startTransition===void 0&&Z(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||!t.v7_relativeSplatPath)&&Z(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&Z(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&Z(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&Z(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&Z(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function Ie(e){let{to:t,replace:n,state:r,relative:a}=e;!B()&&l(!1);let{future:o,static:s}=i.useContext(I),{matches:c}=i.useContext(R),{pathname:u}=V(),d=U(),f=A(t,k(c,o.v7_relativeSplatPath),u,a===`path`),p=JSON.stringify(f);return i.useEffect(()=>d(JSON.parse(p),{replace:n,state:r,relative:a}),[d,p,a,n,r]),null}function Le(e){return be(e.context)}function Q(e){l(!1)}function Re(e){let{basename:t=`/`,children:n=null,location:r,navigationType:a=o.Pop,navigator:s,static:c=!1,future:u}=e;B()&&l(!1);let d=t.replace(/^\/*/,`/`),f=i.useMemo(()=>({basename:d,navigator:s,static:c,future:N({v7_relativeSplatPath:!1},u)}),[d,u,s,c]);typeof r==`string`&&(r=h(r));let{pathname:p=`/`,search:m=``,hash:g=``,state:_=null,key:v=`default`}=r,y=i.useMemo(()=>{let e=E(p,d);return e==null?null:{location:{pathname:e,search:m,hash:g,state:_,key:v},navigationType:a}},[d,p,m,g,_,v,a]);return y==null?null:i.createElement(I.Provider,{value:f},i.createElement(L.Provider,{children:n,value:y}))}function ze(e){let{children:t,location:n}=e;return Se($(t),n)}var Be=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Be||{});new Promise(()=>{}),i.Component;function $(e,t){t===void 0&&(t=[]);let n=[];return i.Children.forEach(e,(e,r)=>{if(!i.isValidElement(e))return;let a=[...t,r];if(e.type===i.Fragment){n.push.apply(n,$(e.props.children,a));return}e.type!==Q&&l(!1),!(!e.props.index||!e.props.children)&&l(!1);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=$(e.props.children,a)),n.push(o)}),n}export{E as _,Re as a,ve as c,ye as d,xe as f,ce as g,m as h,Q as i,V as l,c as m,I as n,ze as o,K as p,Le as r,Fe as s,Ie as t,U as u,n as v,r as y};