import{r as u,a as se}from"./react-core-lkHtAB4F.js";/** * @remix-run/router v1.23.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 */function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Q(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ce(){return Math.random().toString(36).substr(2,8)}function z(e,t){return{usr:e.state,key:e.key,idx:t}}function $(e,t,n,r){return n===void 0&&(n=null),B({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?L(t):t,{state:n,key:t&&t.key||r||ce()})}function T(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function L(e){let t={};if(e){let n=e.indexOf("#");n>=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 fe(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:l=!1}=r,i=a.history,o=R.Pop,s=null,c=h();c==null&&(c=0,i.replaceState(B({},i.state,{idx:c}),""));function h(){return(i.state||{idx:null}).idx}function f(){o=R.Pop;let d=h(),p=d==null?null:d-c;c=d,s&&s({action:o,location:v.location,delta:p})}function m(d,p){o=R.Push;let E=$(v.location,d,p);c=h()+1;let C=z(E,c),w=v.createHref(E);try{i.pushState(C,"",w)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;a.location.assign(w)}l&&s&&s({action:o,location:v.location,delta:1})}function x(d,p){o=R.Replace;let E=$(v.location,d,p);c=h();let C=z(E,c),w=v.createHref(E);i.replaceState(C,"",w),l&&s&&s({action:o,location:v.location,delta:0})}function y(d){let p=a.location.origin!=="null"?a.location.origin:a.location.href,E=typeof d=="string"?d:T(d);return E=E.replace(/ $/,"%20"),g(p,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,p)}let v={get action(){return o},get location(){return e(a,i)},listen(d){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(J,f),s=d,()=>{a.removeEventListener(J,f),s=null}},createHref(d){return t(a,d)},createURL:y,encodeLocation(d){let p=y(d);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:m,replace:x,go(d){return i.go(d)}};return v}var A;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(A||(A={}));function he(e,t,n){return n===void 0&&(n="/"),de(e,t,n)}function de(e,t,n,r){let a=typeof t=="string"?L(t):t,l=F(a.pathname||"/",n);if(l==null)return null;let i=Y(e);pe(i);let o=null;for(let s=0;o==null&&s{let s={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};s.relativePath.startsWith("/")&&(g(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let c=b([r,s.relativePath]),h=n.concat(s);l.children&&l.children.length>0&&(g(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Y(l.children,t,h,c)),!(l.path==null&&!l.index)&&t.push({path:c,score:Ee(c,l.index),routesMeta:h})};return e.forEach((l,i)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))a(l,i);else for(let s of Z(l.path))a(l,i,s)}),t}function Z(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return a?[l,""]:[l];let i=Z(r.join("/")),o=[];return o.push(...i.map(s=>s===""?l:[l,s].join("/"))),a&&o.push(...i),o.map(s=>e.startsWith("/")&&s===""?"/":s)}function pe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Pe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const me=/^:[\w-]+$/,ve=3,ge=2,ye=1,xe=10,Ce=-2,K=e=>e==="*";function Ee(e,t){let n=e.split("/"),r=n.length;return n.some(K)&&(r+=Ce),t&&(r+=ge),n.filter(a=>!K(a)).reduce((a,l)=>a+(me.test(l)?ve:l===""?ye:xe),r)}function Pe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function we(e,t,n){let{routesMeta:r}=e,a={},l="/",i=[];for(let o=0;o{let{paramName:m,isOptional:x}=h;if(m==="*"){let v=o[f]||"";i=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const y=o[f];return x&&!y?c[m]=void 0:c[m]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:l,pathnameBase:i,pattern:e}}function be(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Q(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,s)=>(r.push({paramName:o,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Se(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Q(!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 F(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 Oe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?L(e):e;return{pathname:n?n.startsWith("/")?n:Le(n,t):t,search:Ie(r),hash:Ne(a)}}function Le(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function k(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 Ue(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function M(e,t){let n=Ue(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function V(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=L(e):(a=B({},e),g(!a.pathname||!a.pathname.includes("?"),k("?","pathname","search",a)),g(!a.pathname||!a.pathname.includes("#"),k("#","pathname","hash",a)),g(!a.search||!a.search.includes("#"),k("#","search","hash",a)));let l=e===""||a.pathname==="",i=l?"/":a.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}o=f>=0?t[f]:"/"}let s=Oe(a,o),c=i&&i!=="/"&&i.endsWith("/"),h=(l||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||h)&&(s.pathname+="/"),s}const b=e=>e.join("/").replace(/\/\/+/g,"/"),Be=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ie=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ne=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Te(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ee=["post","put","patch","delete"];new Set(ee);const je=["get",...ee];new Set(je);/** * React Router v6.30.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 */function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),u.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let f=V(c,JSON.parse(i),l,h.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:b([t,f.pathname])),(h.replace?r.replace:r.push)(f,h.state,h)},[t,r,i,l,e])}const We=u.createContext(null);function Fe(e){let t=u.useContext(P).outlet;return t&&u.createElement(We.Provider,{value:e},t)}function ht(){let{matches:e}=u.useContext(P),t=e[e.length-1];return t?t.params:{}}function ae(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=u.useContext(S),{matches:a}=u.useContext(P),{pathname:l}=N(),i=JSON.stringify(M(a,r.v7_relativeSplatPath));return u.useMemo(()=>V(e,JSON.parse(i),l,n==="path"),[e,i,l,n])}function Me(e,t){return Ve(e,t)}function Ve(e,t,n,r){U()||g(!1);let{navigator:a,static:l}=u.useContext(S),{matches:i}=u.useContext(P),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let h=N(),f;if(t){var m;let p=typeof t=="string"?L(t):t;c==="/"||(m=p.pathname)!=null&&m.startsWith(c)||g(!1),f=p}else f=h;let x=f.pathname||"/",y=x;if(c!=="/"){let p=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(p.length).join("/")}let v=he(e,{pathname:y}),d=Ke(v&&v.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:b([c,a.encodeLocation?a.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?c:b([c,a.encodeLocation?a.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),i,n,r);return t&&d?u.createElement(j.Provider,{value:{location:I({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:R.Pop}},d):d}function De(){let e=He(),t=Te(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:a},n):null,null)}const Je=u.createElement(De,null);class ze extends u.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?u.createElement(P.Provider,{value:this.props.routeContext},u.createElement(te.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ae(e){let{routeContext:t,match:n,children:r}=e,a=u.useContext(D);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(P.Provider,{value:t},r)}function Ke(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=(a=n)==null?void 0:a.errors;if(o!=null){let h=i.findIndex(f=>f.route.id&&o?.[f.route.id]!==void 0);h>=0||g(!1),i=i.slice(0,Math.min(i.length,h+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((h,f,m)=>{let x,y=!1,v=null,d=null;n&&(x=o&&f.route.id?o[f.route.id]:void 0,v=f.route.errorElement||Je,s&&(c<0&&m===0?(Ye("route-fallback"),y=!0,d=null):c===m&&(y=!0,d=f.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,m+1)),E=()=>{let C;return x?C=v:y?C=d:f.route.Component?C=u.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=h,u.createElement(Ae,{match:f,routeContext:{outlet:h,matches:p,isDataRoute:n!=null},children:C})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?u.createElement(ze,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:E(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):E()},null)}var le=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(le||{}),ie=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}(ie||{});function qe(e){let t=u.useContext(D);return t||g(!1),t}function Ge(e){let t=u.useContext(ke);return t||g(!1),t}function Xe(e){let t=u.useContext(P);return t||g(!1),t}function oe(e){let t=Xe(),n=t.matches[t.matches.length-1];return n.route.id||g(!1),n.route.id}function He(){var e;let t=u.useContext(te),n=Ge(),r=oe();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Qe(){let{router:e}=qe(le.UseNavigateStable),t=oe(ie.UseNavigateStable),n=u.useRef(!1);return ne(()=>{n.current=!0}),u.useCallback(function(a,l){l===void 0&&(l={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,I({fromRouteId:t},l)))},[e,t])}const q={};function Ye(e,t,n){q[e]||(q[e]=!0)}function Ze(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function dt(e){let{to:t,replace:n,state:r,relative:a}=e;U()||g(!1);let{future:l,static:i}=u.useContext(S),{matches:o}=u.useContext(P),{pathname:s}=N(),c=re(),h=V(t,M(o,l.v7_relativeSplatPath),s,a==="path"),f=JSON.stringify(h);return u.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:a}),[c,f,a,n,r]),null}function pt(e){return Fe(e.context)}function et(e){g(!1)}function tt(e){let{basename:t="/",children:n=null,location:r,navigationType:a=R.Pop,navigator:l,static:i=!1,future:o}=e;U()&&g(!1);let s=t.replace(/^\/*/,"/"),c=u.useMemo(()=>({basename:s,navigator:l,static:i,future:I({v7_relativeSplatPath:!1},o)}),[s,o,l,i]);typeof r=="string"&&(r=L(r));let{pathname:h="/",search:f="",hash:m="",state:x=null,key:y="default"}=r,v=u.useMemo(()=>{let d=F(h,s);return d==null?null:{location:{pathname:d,search:f,hash:m,state:x,key:y},navigationType:a}},[s,h,f,m,x,y,a]);return v==null?null:u.createElement(S.Provider,{value:c},u.createElement(j.Provider,{children:n,value:v}))}function mt(e){let{children:t,location:n}=e;return Me(_(t),n)}new Promise(()=>{});function _(e,t){t===void 0&&(t=[]);let n=[];return u.Children.forEach(e,(r,a)=>{if(!u.isValidElement(r))return;let l=[...t,a];if(r.type===u.Fragment){n.push.apply(n,_(r.props.children,l));return}r.type!==et&&g(!1),!r.props.index||!r.props.children||g(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=_(r.props.children,l)),n.push(i)}),n}/** * React Router DOM v6.30.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 */function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function rt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function at(e,t){return e.button===0&&(!t||t==="_self")&&!rt(e)}const lt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],it="6";try{window.__reactRouterVersion=it}catch{}const ot="startTransition",G=se[ot];function vt(e){let{basename:t,children:n,future:r,window:a}=e,l=u.useRef();l.current==null&&(l.current=ue({window:a,v5Compat:!0}));let i=l.current,[o,s]=u.useState({action:i.action,location:i.location}),{v7_startTransition:c}=r||{},h=u.useCallback(f=>{c&&G?G(()=>s(f)):s(f)},[s,c]);return u.useLayoutEffect(()=>i.listen(h),[i,h]),u.useEffect(()=>Ze(r),[r]),u.createElement(tt,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i,future:r})}const st=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gt=u.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:l,replace:i,state:o,target:s,to:c,preventScrollReset:h,viewTransition:f}=t,m=nt(t,lt),{basename:x}=u.useContext(S),y,v=!1;if(typeof c=="string"&&ut.test(c)&&(y=c,st))try{let C=new URL(window.location.href),w=c.startsWith("//")?new URL(C.protocol+c):new URL(c),O=F(w.pathname,x);w.origin===C.origin&&O!=null?c=O+w.search+w.hash:v=!0}catch{}let d=$e(c,{relative:a}),p=ct(c,{replace:i,state:o,target:s,preventScrollReset:h,relative:a,viewTransition:f});function E(C){r&&r(C),C.defaultPrevented||p(C)}return u.createElement("a",W({},m,{href:y||d,onClick:v||l?r:E,ref:n,target:s}))});var X;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(X||(X={}));var H;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(H||(H={}));function ct(e,t){let{target:n,replace:r,state:a,preventScrollReset:l,relative:i,viewTransition:o}=t===void 0?{}:t,s=re(),c=N(),h=ae(e,{relative:i});return u.useCallback(f=>{if(at(f,n)){f.preventDefault();let m=r!==void 0?r:T(c)===T(h);s(e,{replace:m,state:a,preventScrollReset:l,relative:i,viewTransition:o})}},[c,s,h,r,a,n,e,l,i,o])}export{vt as B,gt as L,dt as N,pt as O,mt as R,re as a,ht as b,et as c,N as u};