1import{s as A,b as _,r as l,F as ie,c as j,i as L,I as ue,N as F,p as ce,d as fe,e as P,f as me,g as z,h as de,k as Q,D as he,l as Z,m as M,n as V,A as K,V as pe,o as G,q as ee,t as we}from"./components-IZO0J7r-.js";import{u as ye,m as Se,P as Re,F as be,e as X}from"./errorBoundaries-3TpwCv_s.js";const D="application/x-www-form-urlencoded";function H(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ge(e){return H(e)&&e.tagName.toLowerCase()==="button"}function Ce(e){return H(e)&&e.tagName.toLowerCase()==="form"}function ve(e){return H(e)&&e.tagName.toLowerCase()==="input"}function xe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ee(e,s){return e.button===0&&(!s||s==="_self")&&!xe(e)}function B(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((s,t)=>{let r=e[t];return s.concat(Array.isArray(r)?r.map(i=>[t,i]):[[t,r]])},[]))}function Le(e,s){let t=B(e);return s&&s.forEach((r,i)=>{t.has(i)||s.getAll(i).forEach(a=>{t.append(i,a)})}),t}let I=null;function Fe(){if(I===null)try{new FormData(document.createElement("form"),0),I=!1}catch{I=!0}return I}const Pe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function U(e){return e!=null&&!Pe.has(e)?(_(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${D}"`),null):e}function Te(e,s){let t,r,i,a,n;if(Ce(e)){let o=e.getAttribute("action");r=o?A(o,s):null,t=e.getAttribute("method")||"get",i=U(e.getAttribute("enctype"))||D,a=new FormData(e)}else if(ge(e)||ve(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||o.getAttribute("action");if(r=c?A(c,s):null,t=e.getAttribute("formmethod")||o.getAttribute("method")||"get",i=U(e.getAttribute("formenctype"))||U(o.getAttribute("enctype"))||D,a=new FormData(o,e),!Fe()){let{name:u,type:f,value:m}=e;if(f==="image"){let S=u?`${u}.`:"";a.append(`${S}x`,"0"),a.append(`${S}y`,"0")}else u&&a.append(u,m)}}else{if(H(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t="get",r=null,i=D,n=e}return a&&i==="text/plain"&&(n=a,a=void 0),{action:r,method:t.toLowerCase(),encType:i,formData:a,body:n}}const Ae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ae&&(window.__reactRouterVersion="8.3.0")}catch{}const te=l.forwardRef(function({onClick:s,discover:t="render",prefetch:r="none",relative:i,reloadDocument:a,replace:n,mask:o,state:c,target:u,to:f,preventScrollReset:m,viewTransition:S,defaultShouldRevalidate:y,...R},b){let{basename:g,navigator:p,useTransitions:C}=l.useContext(F),d=typeof f=="string"&&K.test(f),w=ce(f,g);f=w.to;let h=fe(f,{relative:i}),v=P(),x=null;if(o){let E=me(o,[],v.mask?v.mask.pathname:"/",!0);g!=="/"&&(E.pathname=E.pathname==="/"?g:z([g,E.pathname])),x=p.createHref(E)}let[T,k,O]=ye(r,R),se=Ne(f,{replace:n,mask:o,state:c,target:u,preventScrollReset:m,relative:i,viewTransition:S,defaultShouldRevalidate:y,useTransitions:C});function le(E){s&&s(E),E.defaultPrevented||se(E)}let Y=!(w.isExternal||a),q=l.createElement("a",{...R,...O,href:(Y?x:void 0)||w.absoluteURL||h,onClick:Y?le:s,ref:Se(b,k),target:u,"data-discover":!d&&t==="render"?"true":void 0});return T&&!d?l.createElement(l.Fragment,null,q,l.createElement(Re,{page:h})):q});te.displayName="Link";const ke=l.forwardRef(function({"aria-current":s="page",caseSensitive:t=!1,className:r="",end:i=!1,style:a,to:n,viewTransition:o,children:c,...u},f){let m=M(n,{relative:u.relative}),S=P(),y=l.useContext(Z),{navigator:R,basename:b}=l.useContext(F),g=y!=null&&Oe(m)&&o===!0,p=R.encodeLocation?R.encodeLocation(m).pathname:m.pathname,C=S.pathname,d=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;t||(C=C.toLowerCase(),d=d?d.toLowerCase():null,p=p.toLowerCase()),d&&b&&(d=A(d,b)||d);const w=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let h=C===p||!i&&C.startsWith(p)&&C.charAt(w)==="/",v=d!=null&&(d===p||!i&&d.startsWith(p)&&d.charAt(w)==="/"),x={isActive:h,isPending:v,isTransitioning:g},T=h?s:void 0,k;typeof r=="function"?k=r(x):k=[r,h?"active":null,v?"pending":null,g?"transitioning":null].filter(
1Boolean).join(" ");let O=typeof a=="function"?a(x):a;return l.createElement(te,{...u,"aria-current":T,className:k,ref:f,style:O,to:n,viewTransition:o},typeof c=="function"?c(x):c)});ke.displayName="NavLink";const re=l.forwardRef(({discover:e="render",fetcherKey:s,navigate:t,reloadDocument:r,replace:i,state:a,method:n="get",action:o,onSubmit:c,relative:u,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:S,...y},R)=>{let{useTransitions:b}=l.useContext(F),g=oe(),p=Me(o,{relative:u}),C=n.toLowerCase()==="get"?"get":"post",d=typeof o=="string"&&K.test(o),w=h=>{if(c&&c(h),h.defaultPrevented)return;h.preventDefault();let v=h.nativeEvent.submitter,x=v?.getAttribute("formmethod")||n,T=()=>g(v||h.currentTarget,{fetcherKey:s,method:x,navigate:t,replace:i,state:a,relative:u,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:S});b&&t!==!1?l.startTransition(()=>T()):T()};return l.createElement("form",{ref:R,method:C,action:p,onSubmit:r?c:w,...y,"data-discover":!d&&e==="render"?"true":void 0})});re.displayName="Form";function Ie({getKey:e,storageKey:s,...t}){let r=l.useContext(be),{basename:i}=l.useContext(F),a=P(),n=ee();He({getKey:e,storageKey:s});let o=l.useMemo(()=>{if(!r||!e)return null;let u=J(a,n,i,e);return u!==a.key?u:null},[]);if(!r||r.isSpaMode)return null;let c=((u,f)=>{if(!window.history.state||!window.history.state.key){let m=Math.random().toString(32).slice(2);window.history.replaceState({key:m},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[f||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(m){console.error(m),sessionStorage.removeItem(u)}}).toString();return t.nonce==null&&r?.nonce&&(t.nonce=r.nonce),l.createElement("script",{...t,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${X(JSON.stringify(s||W))}, ${X(JSON.stringify(o))})`}})}Ie.displayName="ScrollRestoration";function ae(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $(e){let s=l.useContext(he);return L(s,ae(e)),s}function ne(e){let s=l.useContext(Z);return L(s,ae(e)),s}function Ne(e,{target:s,replace:t,mask:r,state:i,preventScrollReset:a,relative:n,viewTransition:o,defaultShouldRevalidate:c,useTransitions:u}={}){let f=Q(),m=P(),S=M(e,{relative:n});return l.useCallback(y=>{if(Ee(y,s)){y.preventDefault();let R=t!==void 0?t:V(m)===V(S),b=()=>f(e,{replace:R,mask:r,state:i,preventScrollReset:a,relative:n,viewTransition:o,defaultShouldRevalidate:c});u?l.startTransition(()=>b()):b()}},[m,f,S,t,r,i,s,e,a,n,o,c,u])}function Be(e){_(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let s=l.useRef(B(e)),t=l.useRef(!1),r=P(),i=l.useMemo(()=>Le(r.search,t.current?null:s.current),[r.search]),a=Q();return[i,l.useCallback((n,o)=>{const c=B(typeof n=="function"?n(new URLSearchParams(i)):n);t.current=!0,a("?"+c,o)},[a,i])]}let De=0,_e=()=>`__${String(++De)}__`;function oe(){let{router:e}=$("useSubmit"),{basename:s}=l.useContext(F),t=de(),r=e.fetch,i=e.navigate;return l.useCallback(async(a,n={})=>{let{action:o,method:c,encType:u,formData:f,body:m}=Te(a,s);n.navigate===!1?await r(n.fetcherKey||_e(),t,n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:f,body:m,formMethod:n.method||c,formEncType:n.encType||u,flushSync:n.flushSync}):await i(n.action||o,{defaultShouldRevalidate:n.defaultShouldRevalidate,preventScrollReset:n.preventScrollReset,formData:f,body:m,formMethod:n.method||c,formEncType:n.encType||u,replace:n.replace,state:n.state,fromRouteId:t,flushSync:n.flushSync,viewTransition:n.viewTransition})},[r,i,s,t])}function Me(e,{relative:s}={}){let{basename:t}=l.useContext(F),r=l.useContext(j);L(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...M(e||".",{relative:s})},n=P();if(e==null){a.search=n.search;let o=new URLSearchParams(a.search),c=o.getAll("index");if(c.some(u=>u==="")){o.delete("index"),c.filter(f=>f).forEach(f=>o.append("index",f));let u=o.toString();a.search=u?`?${u}
1`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:z([t,a.pathname])),V(a)}function We({key:e}={}){let{router:s}=$("useFetcher"),t=ne("useFetcher"),r=l.useContext(ie),i=l.useContext(j),a=i.matches[i.matches.length-1]?.route.id;L(r,"useFetcher must be used inside a FetchersContext"),L(i,"useFetcher must be used inside a RouteContext"),L(a!=null,'useFetcher can only be used on routes that contain a unique "id"');let n=l.useId(),[o,c]=l.useState(e||n);e&&e!==o&&c(e);let{deleteFetcher:u,getFetcher:f,resetFetcher:m,fetch:S}=s;l.useEffect(()=>(f(o),()=>u(o)),[u,f,o]);let y=l.useCallback(async(w,h)=>{L(a,"No routeId available for fetcher.load()"),await S(o,a,w,h)},[o,a,S]),R=oe(),b=l.useCallback(async(w,h)=>{await R(w,{...h,navigate:!1,fetcherKey:o})},[o,R]),g=l.useCallback(w=>m(o,w),[m,o]),p=l.useMemo(()=>{let w=l.forwardRef((h,v)=>l.createElement(re,{...h,navigate:!1,fetcherKey:o,ref:v}));return w.displayName="fetcher.Form",w},[o]),C=t.fetchers.get(o)||ue,d=r.get(o);return l.useMemo(()=>({Form:p,submit:b,load:y,reset:g,...C,data:d}),[p,b,y,g,C,d])}const W="react-router-scroll-positions";let N={};function J(e,s,t,r){let i=null;return r&&(t!=="/"?i=r({...e,pathname:A(e.pathname,t)||e.pathname},s):i=r(e,s)),i==null&&(i=e.key),i}function He({getKey:e,storageKey:s}={}){let{router:t}=$("useScrollRestoration"),{restoreScrollPosition:r,preventScrollReset:i}=ne("useScrollRestoration"),{basename:a}=l.useContext(F),n=P(),o=ee(),c=we();l.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),$e(l.useCallback(()=>{if(c.state==="idle"){let u=J(n,o,a,e);N[u]=window.scrollY}try{sessionStorage.setItem(s||W,JSON.stringify(N))}catch(u){_(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[c.state,e,a,n,o,s])),typeof document<"u"&&(l.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(s||W);u&&(N=JSON.parse(u))}catch{}},[s]),l.useLayoutEffect(()=>{let u=t?.enableScrollRestoration(N,()=>window.scrollY,e?(f,m)=>J(f,m,a,e):void 0);return()=>u&&u()},[t,a,e]),l.useLayoutEffect(()=>{if(r!==!1){if(typeof r=="number"){window.scrollTo(0,r);return}try{if(n.hash){let u=document.getElementById(decodeURIComponent(n.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{_(!1,`"${n.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[n,r,i]))}function $e(e,s){let{capture:t}={};l.useEffect(()=>{let r=t!=null?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,t])}function Oe(e,{relative:s}={}){let t=l.useContext(pe);L(t!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=$("useViewTransitionState"),i=M(e,{relative:s});if(!t.isTransitioning)return!1;let a=A(t.currentLocation.pathname,r)||t.currentLocation.pathname,n=A(t.nextLocation.pathname,r)||t.nextLocation.pathname;return G(i.pathname,n)!=null||G(i.pathname,a)!=null}export{re as F,te as L,Ie as S,oe as a,Be as b,We as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.