diff --git a/themes/demo-store-headless/dist/assets/index-DGnXaPK9.js b/themes/demo-store-headless/dist/assets/index-DGnXaPK9.js index c89c48a5..67f93c2f 100644 --- a/themes/demo-store-headless/dist/assets/index-DGnXaPK9.js +++ b/themes/demo-store-headless/dist/assets/index-DGnXaPK9.js @@ -48,4 +48,4 @@ Error generating stack: `+o.message+` * @license MIT */var zc="popstate";function Mc(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function Ep(i={}){function s(f,d){let h=d.state?.masked,{pathname:g,search:y,hash:x}=h||f.location;return va("",{pathname:g,search:y,hash:x},d.state&&d.state.usr||null,d.state&&d.state.key||"default",h?{pathname:f.location.pathname,search:f.location.search,hash:f.location.hash}:void 0)}function a(f,d){return typeof d=="string"?d:$r(d)}return Np(s,a,null,i)}function _e(i,s){if(i===!1||i===null||typeof i>"u")throw new Error(s)}function St(i,s){if(!i){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Cp(){return Math.random().toString(36).substring(2,10)}function Fc(i,s){return{usr:i.state,key:i.key,idx:s,masked:i.mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function va(i,s,a=null,f,d){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof s=="string"?Yn(s):s,state:a,key:s&&s.key||f||Cp(),mask:d}}function $r({pathname:i="/",search:s="",hash:a=""}){return s&&s!=="?"&&(i+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(i+=a.charAt(0)==="#"?a:"#"+a),i}function Yn(i){let s={};if(i){let a=i.indexOf("#");a>=0&&(s.hash=i.substring(a),i=i.substring(0,a));let f=i.indexOf("?");f>=0&&(s.search=i.substring(f),i=i.substring(0,f)),i&&(s.pathname=i)}return s}function Np(i,s,a,f={}){let{window:d=document.defaultView,v5Compat:h=!1}=f,g=d.history,y="POP",x=null,C=j();C==null&&(C=0,g.replaceState({...g.state,idx:C},""));function j(){return(g.state||{idx:null}).idx}function _(){y="POP";let P=j(),B=P==null?null:P-C;C=P,x&&x({action:y,location:M.location,delta:B})}function L(P,B){y="PUSH";let J=Mc(P)?P:va(M.location,P,B);C=j()+1;let q=Fc(J,C),re=M.createHref(J.mask||J);try{g.pushState(q,"",re)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;d.location.assign(re)}h&&x&&x({action:y,location:M.location,delta:1})}function z(P,B){y="REPLACE";let J=Mc(P)?P:va(M.location,P,B);C=j();let q=Fc(J,C),re=M.createHref(J.mask||J);g.replaceState(q,"",re),h&&x&&x({action:y,location:M.location,delta:0})}function F(P){return jp(P)}let M={get action(){return y},get location(){return i(d,g)},listen(P){if(x)throw new Error("A history only accepts one active listener");return d.addEventListener(zc,_),x=P,()=>{d.removeEventListener(zc,_),x=null}},createHref(P){return s(d,P)},createURL:F,encodeLocation(P){let B=F(P);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:L,replace:z,go(P){return g.go(P)}};return M}function jp(i,s=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),_e(a,"No window.location.(origin|href) available to create URL");let f=typeof i=="string"?i:$r(i);return f=f.replace(/ $/,"%20"),!s&&f.startsWith("//")&&(f=a+f),new URL(f,a)}function Wc(i,s,a="/"){return Pp(i,s,a,!1)}function Pp(i,s,a,f,d){let h=typeof s=="string"?Yn(s):s,g=Ut(h.pathname||"/",a);if(g==null)return null;let y=Rp(i),x=null,C=Bp(g);for(let j=0;x==null&&j{let j={relativePath:C===void 0?g.path||"":C,caseSensitive:g.caseSensitive===!0,childrenIndex:y,route:g};if(j.relativePath.startsWith("/")){if(!j.relativePath.startsWith(f)&&x)return;_e(j.relativePath.startsWith(f),`Absolute route path "${j.relativePath}" nested under path "${f}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),j.relativePath=j.relativePath.slice(f.length)}let _=xt([f,j.relativePath]),L=a.concat(j);g.children&&g.children.length>0&&(_e(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),Qc(g.children,s,L,_,x)),!(g.path==null&&!g.index)&&s.push({path:_,score:Fp(_,g.index),routesMeta:L})};return i.forEach((g,y)=>{if(g.path===""||!g.path?.includes("?"))h(g,y);else for(let x of Kc(g.path))h(g,y,!0,x)}),s}function Kc(i){let s=i.split("/");if(s.length===0)return[];let[a,...f]=s,d=a.endsWith("?"),h=a.replace(/\?$/,"");if(f.length===0)return d?[h,""]:[h];let g=Kc(f.join("/")),y=[];return y.push(...g.map(x=>x===""?h:[h,x].join("/"))),d&&y.push(...g),y.map(x=>i.startsWith("/")&&x===""?"/":x)}function Lp(i){i.sort((s,a)=>s.score!==a.score?a.score-s.score:Ap(s.routesMeta.map(f=>f.childrenIndex),a.routesMeta.map(f=>f.childrenIndex)))}var Tp=/^:[\w-]+$/,Op=3,Dp=2,Ip=1,zp=10,Mp=-2,Ac=i=>i==="*";function Fp(i,s){let a=i.split("/"),f=a.length;return a.some(Ac)&&(f+=Mp),s&&(f+=Dp),a.filter(d=>!Ac(d)).reduce((d,h)=>d+(Tp.test(h)?Op:h===""?Ip:zp),f)}function Ap(i,s){return i.length===s.length&&i.slice(0,-1).every((f,d)=>f===s[d])?i[i.length-1]-s[s.length-1]:0}function $p(i,s,a=!1){let{routesMeta:f}=i,d={},h="/",g=[];for(let y=0;y{if(j==="*"){let F=y[L]||"";g=h.slice(0,h.length-F.length).replace(/(.)\/+$/,"$1")}const z=y[L];return _&&!z?C[j]=void 0:C[j]=(z||"").replace(/%2F/g,"/"),C},{}),pathname:h,pathnameBase:g,pattern:i}}function Up(i,s=!1,a=!0){St(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let f=[],d="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,y,x,C,j)=>{if(f.push({paramName:y,isOptional:x!=null}),x){let _=j.charAt(C+g.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(f.push({paramName:"*"}),d+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?d+="\\/*$":i!==""&&i!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,s?void 0:"i"),f]}function Bp(i){try{return i.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return St(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),i}}function Ut(i,s){if(s==="/")return i;if(!i.toLowerCase().startsWith(s.toLowerCase()))return null;let a=s.endsWith("/")?s.length-1:s.length,f=i.charAt(a);return f&&f!=="/"?null:i.slice(a)||"/"}var Hp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Vp(i,s="/"){let{pathname:a,search:f="",hash:d=""}=typeof i=="string"?Yn(i):i,h;return a?(a=Gc(a),a.startsWith("/")?h=$c(a.substring(1),"/"):h=$c(a,s)):h=s,{pathname:h,search:Kp(f),hash:Yp(d)}}function $c(i,s){let a=so(s).split("/");return i.split("/").forEach(d=>{d===".."?a.length>1&&a.pop():d!=="."&&a.push(d)}),a.length>1?a.join("/"):"/"}function da(i,s,a,f){return`Cannot include a '${i}' character in a manually specified \`to.${s}\` field [${JSON.stringify(f)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Wp(i){return i.filter((s,a)=>a===0||s.route.path&&s.route.path.length>0)}function Yc(i){let s=Wp(i);return s.map((a,f)=>f===s.length-1?a.pathname:a.pathnameBase)}function xa(i,s,a,f=!1){let d;typeof i=="string"?d=Yn(i):(d={...i},_e(!d.pathname||!d.pathname.includes("?"),da("?","pathname","search",d)),_e(!d.pathname||!d.pathname.includes("#"),da("#","pathname","hash",d)),_e(!d.search||!d.search.includes("#"),da("#","search","hash",d)));let h=i===""||d.pathname==="",g=h?"/":d.pathname,y;if(g==null)y=a;else{let _=s.length-1;if(!f&&g.startsWith("..")){let L=g.split("/");for(;L[0]==="..";)L.shift(),_-=1;d.pathname=L.join("/")}y=_>=0?s[_]:"/"}let x=Vp(d,y),C=g&&g!=="/"&&g.endsWith("/"),j=(h||g===".")&&a.endsWith("/");return!x.pathname.endsWith("/")&&(C||j)&&(x.pathname+="/"),x}var Gc=i=>i.replace(/\/\/+/g,"/"),xt=i=>Gc(i.join("/")),so=i=>i.replace(/\/+$/,""),Qp=i=>so(i).replace(/^\/*/,"/"),Kp=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,Yp=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,Gp=class{constructor(i,s,a,f=!1){this.status=i,this.statusText=s||"",this.internal=f,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function qp(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Xp(i){let s=i.map(a=>a.route.path).filter(Boolean);return xt(s)||"/"}var qc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xc(i,s){let a=i;if(typeof a!="string"||!Hp.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let f=a,d=!1;if(qc)try{let h=new URL(window.location.href),g=a.startsWith("//")?new URL(h.protocol+a):new URL(a),y=Ut(g.pathname,s);g.origin===h.origin&&y!=null?a=y+g.search+g.hash:d=!0}catch{St(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:f,isExternal:d,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jc=["POST","PUT","PATCH","DELETE"];new Set(Jc);var Jp=["GET",...Jc];new Set(Jp);var Gn=w.createContext(null);Gn.displayName="DataRouter";var uo=w.createContext(null);uo.displayName="DataRouterState";var Zc=w.createContext(!1);function Zp(){return w.useContext(Zc)}var bc=w.createContext({isTransitioning:!1});bc.displayName="ViewTransition";var bp=w.createContext(new Map);bp.displayName="Fetchers";var eh=w.createContext(null);eh.displayName="Await";var ft=w.createContext(null);ft.displayName="Navigation";var Ur=w.createContext(null);Ur.displayName="Location";var jt=w.createContext({outlet:null,matches:[],isDataRoute:!1});jt.displayName="Route";var Sa=w.createContext(null);Sa.displayName="RouteError";var ed="REACT_ROUTER_ERROR",th="REDIRECT",nh="ROUTE_ERROR_RESPONSE";function rh(i){if(i.startsWith(`${ed}:${th}:{`))try{let s=JSON.parse(i.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function lh(i){if(i.startsWith(`${ed}:${nh}:{`))try{let s=JSON.parse(i.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new Gp(s.status,s.statusText,s.data)}catch{}}function oh(i,{relative:s}={}){_e(Br(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:f}=w.useContext(ft),{hash:d,pathname:h,search:g}=Hr(i,{relative:s}),y=h;return a!=="/"&&(y=h==="/"?a:xt([a,h])),f.createHref({pathname:y,search:g,hash:d})}function Br(){return w.useContext(Ur)!=null}function Pt(){return _e(Br(),"useLocation() may be used only in the context of a component."),w.useContext(Ur).location}var td="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nd(i){w.useContext(ft).static||w.useLayoutEffect(i)}function qn(){let{isDataRoute:i}=w.useContext(jt);return i?yh():ih()}function ih(){_e(Br(),"useNavigate() may be used only in the context of a component.");let i=w.useContext(Gn),{basename:s,navigator:a}=w.useContext(ft),{matches:f}=w.useContext(jt),{pathname:d}=Pt(),h=JSON.stringify(Yc(f)),g=w.useRef(!1);return nd(()=>{g.current=!0}),w.useCallback((x,C={})=>{if(St(g.current,td),!g.current)return;if(typeof x=="number"){a.go(x);return}let j=xa(x,JSON.parse(h),d,C.relative==="path");i==null&&s!=="/"&&(j.pathname=j.pathname==="/"?s:xt([s,j.pathname])),(C.replace?a.replace:a.push)(j,C.state,C)},[s,a,h,d,i])}w.createContext(null);function rd(){let{matches:i}=w.useContext(jt);return i[i.length-1]?.params??{}}function Hr(i,{relative:s}={}){let{matches:a}=w.useContext(jt),{pathname:f}=Pt(),d=JSON.stringify(Yc(a));return w.useMemo(()=>xa(i,JSON.parse(d),f,s==="path"),[i,d,f,s])}function ah(i,s){return ld(i,s)}function ld(i,s,a){_e(Br(),"useRoutes() may be used only in the context of a component.");let{navigator:f}=w.useContext(ft),{matches:d}=w.useContext(jt),h=d[d.length-1],g=h?h.params:{},y=h?h.pathname:"/",x=h?h.pathnameBase:"/",C=h&&h.route;{let P=C&&C.path||"";id(y,!C||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${y}" (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 j=Pt(),_;if(s){let P=typeof s=="string"?Yn(s):s;_e(x==="/"||P.pathname?.startsWith(x),`When overriding the location using \`\` 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 "${x}" but pathname "${P.pathname}" was given in the \`location\` prop.`),_=P}else _=j;let L=_.pathname||"/",z=L;if(x!=="/"){let P=x.replace(/^\//,"").split("/");z="/"+L.replace(/^\//,"").split("/").slice(P.length).join("/")}let F=a&&a.state.matches.length?a.state.matches.map(P=>Object.assign(P,{route:a.manifest[P.route.id]||P.route})):Wc(i,{pathname:z});St(C||F!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),St(F==null||F[F.length-1].route.element!==void 0||F[F.length-1].route.Component!==void 0||F[F.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.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.`);let M=fh(F&&F.map(P=>Object.assign({},P,{params:Object.assign({},g,P.params),pathname:xt([x,f.encodeLocation?f.encodeLocation(P.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?x:xt([x,f.encodeLocation?f.encodeLocation(P.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathnameBase])})),d,a);return s&&M?w.createElement(Ur.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,..._},navigationType:"POP"}},M):M}function sh(){let i=gh(),s=qp(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,f="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:f},h={padding:"2px 4px",backgroundColor:f},g=null;return console.error("Error handled by React Router default ErrorBoundary:",i),g=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:h},"ErrorBoundary")," or"," ",w.createElement("code",{style:h},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},s),a?w.createElement("pre",{style:d},a):null,g)}var uh=w.createElement(sh,null),od=class extends w.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,s){return s.location!==i.location||s.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:s.error,location:s.location,revalidation:i.revalidation||s.revalidation}}componentDidCatch(i,s){this.props.onError?this.props.onError(i,s):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const a=lh(i.digest);a&&(i=a)}let s=i!==void 0?w.createElement(jt.Provider,{value:this.props.routeContext},w.createElement(Sa.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?w.createElement(ch,{error:i},s):s}};od.contextType=Zc;var fa=new WeakMap;function ch({children:i,error:s}){let{basename:a}=w.useContext(ft);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let f=rh(s.digest);if(f){let d=fa.get(s);if(d)throw d;let h=Xc(f.location,a);if(qc&&!fa.get(s))if(h.isExternal||f.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:f.replace}));throw fa.set(s,g),g}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return i}function dh({routeContext:i,match:s,children:a}){let f=w.useContext(Gn);return f&&f.static&&f.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(f.staticContext._deepestRenderedBoundaryId=s.route.id),w.createElement(jt.Provider,{value:i},a)}function fh(i,s=[],a){let f=a?.state;if(i==null){if(!f)return null;if(f.errors)i=f.matches;else if(s.length===0&&!f.initialized&&f.matches.length>0)i=f.matches;else return null}let d=i,h=f?.errors;if(h!=null){let j=d.findIndex(_=>_.route.id&&h?.[_.route.id]!==void 0);_e(j>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),d=d.slice(0,Math.min(d.length,j+1))}let g=!1,y=-1;if(a&&f){g=f.renderFallback;for(let j=0;j=0?d=d.slice(0,y+1):d=[d[0]];break}}}}let x=a?.onError,C=f&&x?(j,_)=>{x(j,{location:f.location,params:f.matches?.[0]?.params??{},pattern:Xp(f.matches),errorInfo:_})}:void 0;return d.reduceRight((j,_,L)=>{let z,F=!1,M=null,P=null;f&&(z=h&&_.route.id?h[_.route.id]:void 0,M=_.route.errorElement||uh,g&&(y<0&&L===0?(id("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),F=!0,P=null):y===L&&(F=!0,P=_.route.hydrateFallbackElement||null)));let B=s.concat(d.slice(0,L+1)),J=()=>{let q;return z?q=M:F?q=P:_.route.Component?q=w.createElement(_.route.Component,null):_.route.element?q=_.route.element:q=j,w.createElement(dh,{match:_,routeContext:{outlet:j,matches:B,isDataRoute:f!=null},children:q})};return f&&(_.route.ErrorBoundary||_.route.errorElement||L===0)?w.createElement(od,{location:f.location,revalidation:f.revalidation,component:M,error:z,children:J(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:C}):J()},null)}function ka(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ph(i){let s=w.useContext(Gn);return _e(s,ka(i)),s}function hh(i){let s=w.useContext(uo);return _e(s,ka(i)),s}function mh(i){let s=w.useContext(jt);return _e(s,ka(i)),s}function _a(i){let s=mh(i),a=s.matches[s.matches.length-1];return _e(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function vh(){return _a("useRouteId")}function gh(){let i=w.useContext(Sa),s=hh("useRouteError"),a=_a("useRouteError");return i!==void 0?i:s.errors?.[a]}function yh(){let{router:i}=ph("useNavigate"),s=_a("useNavigate"),a=w.useRef(!1);return nd(()=>{a.current=!0}),w.useCallback(async(d,h={})=>{St(a.current,td),a.current&&(typeof d=="number"?await i.navigate(d):await i.navigate(d,{fromRouteId:s,...h}))},[i,s])}var Uc={};function id(i,s,a){!s&&!Uc[i]&&(Uc[i]=!0,St(!1,a))}w.memo(wh);function wh({routes:i,manifest:s,future:a,state:f,isStatic:d,onError:h}){return ld(i,void 0,{manifest:s,state:f,isStatic:d,onError:h})}function xn(i){_e(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function xh({basename:i="/",children:s=null,location:a,navigationType:f="POP",navigator:d,static:h=!1,useTransitions:g}){_e(!Br(),"You cannot render a inside another . You should never have more than one in your app.");let y=i.replace(/^\/*/,"/"),x=w.useMemo(()=>({basename:y,navigator:d,static:h,useTransitions:g,future:{}}),[y,d,h,g]);typeof a=="string"&&(a=Yn(a));let{pathname:C="/",search:j="",hash:_="",state:L=null,key:z="default",mask:F}=a,M=w.useMemo(()=>{let P=Ut(C,y);return P==null?null:{location:{pathname:P,search:j,hash:_,state:L,key:z,mask:F},navigationType:f}},[y,C,j,_,L,z,f,F]);return St(M!=null,` is not able to match the URL "${C}${j}${_}" because it does not start with the basename, so the won't render anything.`),M==null?null:w.createElement(ft.Provider,{value:x},w.createElement(Ur.Provider,{children:s,value:M}))}function Sh({children:i,location:s}){return ah(ga(i),s)}function ga(i,s=[]){let a=[];return w.Children.forEach(i,(f,d)=>{if(!w.isValidElement(f))return;let h=[...s,d];if(f.type===w.Fragment){a.push.apply(a,ga(f.props.children,h));return}_e(f.type===xn,`[${typeof f.type=="string"?f.type:f.type.name}] is not a component. All component children of must be a or `),_e(!f.props.index||!f.props.children,"An index route cannot have child routes.");let g={id:f.props.id||h.join("-"),caseSensitive:f.props.caseSensitive,element:f.props.element,Component:f.props.Component,index:f.props.index,path:f.props.path,middleware:f.props.middleware,loader:f.props.loader,action:f.props.action,hydrateFallbackElement:f.props.hydrateFallbackElement,HydrateFallback:f.props.HydrateFallback,errorElement:f.props.errorElement,ErrorBoundary:f.props.ErrorBoundary,hasErrorBoundary:f.props.hasErrorBoundary===!0||f.props.ErrorBoundary!=null||f.props.errorElement!=null,shouldRevalidate:f.props.shouldRevalidate,handle:f.props.handle,lazy:f.props.lazy};f.props.children&&(g.children=ga(f.props.children,h)),a.push(g)}),a}var oo="get",io="application/x-www-form-urlencoded";function co(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function kh(i){return co(i)&&i.tagName.toLowerCase()==="button"}function _h(i){return co(i)&&i.tagName.toLowerCase()==="form"}function Eh(i){return co(i)&&i.tagName.toLowerCase()==="input"}function Ch(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Nh(i,s){return i.button===0&&(!s||s==="_self")&&!Ch(i)}function ya(i=""){return new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((s,a)=>{let f=i[a];return s.concat(Array.isArray(f)?f.map(d=>[a,d]):[[a,f]])},[]))}function jh(i,s){let a=ya(i);return s&&s.forEach((f,d)=>{a.has(d)||s.getAll(d).forEach(h=>{a.append(d,h)})}),a}var to=null;function Ph(){if(to===null)try{new FormData(document.createElement("form"),0),to=!1}catch{to=!0}return to}var Rh=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pa(i){return i!=null&&!Rh.has(i)?(St(!1,`"${i}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${io}"`),null):i}function Lh(i,s){let a,f,d,h,g;if(_h(i)){let y=i.getAttribute("action");f=y?Ut(y,s):null,a=i.getAttribute("method")||oo,d=pa(i.getAttribute("enctype"))||io,h=new FormData(i)}else if(kh(i)||Eh(i)&&(i.type==="submit"||i.type==="image")){let y=i.form;if(y==null)throw new Error('Cannot submit a