@famgia/omnify-gui 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ function Qr(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(n,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ft={exports:{}},j={};/**
2
+ * @license React
3
+ * react.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Er;function Xn(){if(Er)return j;Er=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),w=Symbol.iterator;function g(f){return f===null||typeof f!="object"?null:(f=w&&f[w]||f["@@iterator"],typeof f=="function"?f:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,x={};function P(f,E,U){this.props=f,this.context=E,this.refs=x,this.updater=U||b}P.prototype.isReactComponent={},P.prototype.setState=function(f,E){if(typeof f!="object"&&typeof f!="function"&&f!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,f,E,"setState")},P.prototype.forceUpdate=function(f){this.updater.enqueueForceUpdate(this,f,"forceUpdate")};function S(){}S.prototype=P.prototype;function $(f,E,U){this.props=f,this.context=E,this.refs=x,this.updater=U||b}var Q=$.prototype=new S;Q.constructor=$,L(Q,P.prototype),Q.isPureReactComponent=!0;var G=Array.isArray;function Z(){}var p={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function I(f,E,U){var O=U.ref;return{$$typeof:e,type:f,key:E,ref:O!==void 0?O:null,props:U}}function J(f,E){return I(f.type,E,f.props)}function X(f){return typeof f=="object"&&f!==null&&f.$$typeof===e}function le(f){var E={"=":"=0",":":"=2"};return"$"+f.replace(/[=:]/g,function(U){return E[U]})}var we=/\/+/g;function ne(f,E){return typeof f=="object"&&f!==null&&f.key!=null?le(""+f.key):E.toString(36)}function ve(f){switch(f.status){case"fulfilled":return f.value;case"rejected":throw f.reason;default:switch(typeof f.status=="string"?f.then(Z,Z):(f.status="pending",f.then(function(E){f.status==="pending"&&(f.status="fulfilled",f.value=E)},function(E){f.status==="pending"&&(f.status="rejected",f.reason=E)})),f.status){case"fulfilled":return f.value;case"rejected":throw f.reason}}throw f}function Y(f,E,U,O,F){var B=typeof f;(B==="undefined"||B==="boolean")&&(f=null);var q=!1;if(f===null)q=!0;else switch(B){case"bigint":case"string":case"number":q=!0;break;case"object":switch(f.$$typeof){case e:case t:q=!0;break;case h:return q=f._init,Y(q(f._payload),E,U,O,F)}}if(q)return F=F(f),q=O===""?"."+ne(f,0):O,G(F)?(U="",q!=null&&(U=q.replace(we,"$&/")+"/"),Y(F,E,U,"",function(Ot){return Ot})):F!=null&&(X(F)&&(F=J(F,U+(F.key==null||f&&f.key===F.key?"":(""+F.key).replace(we,"$&/")+"/")+q)),E.push(F)),1;q=0;var se=O===""?".":O+":";if(G(f))for(var de=0;de<f.length;de++)O=f[de],B=se+ne(O,de),q+=Y(O,E,U,B,F);else if(de=g(f),typeof de=="function")for(f=de.call(f),de=0;!(O=f.next()).done;)O=O.value,B=se+ne(O,de++),q+=Y(O,E,U,B,F);else if(B==="object"){if(typeof f.then=="function")return Y(ve(f),E,U,O,F);throw E=String(f),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return q}function re(f,E,U){if(f==null)return f;var O=[],F=0;return Y(f,O,"","",function(B){return E.call(U,B,F++)}),O}function ee(f){if(f._status===-1){var E=f._result;E=E(),E.then(function(U){(f._status===0||f._status===-1)&&(f._status=1,f._result=U)},function(U){(f._status===0||f._status===-1)&&(f._status=2,f._result=U)}),f._status===-1&&(f._status=0,f._result=E)}if(f._status===1)return f._result.default;throw f._result}var ue=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},ie={map:re,forEach:function(f,E,U){re(f,function(){E.apply(this,arguments)},U)},count:function(f){var E=0;return re(f,function(){E++}),E},toArray:function(f){return re(f,function(E){return E})||[]},only:function(f){if(!X(f))throw Error("React.Children.only expected to receive a single React element child.");return f}};return j.Activity=m,j.Children=ie,j.Component=P,j.Fragment=r,j.Profiler=a,j.PureComponent=$,j.StrictMode=n,j.Suspense=u,j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p,j.__COMPILER_RUNTIME={__proto__:null,c:function(f){return p.H.useMemoCache(f)}},j.cache=function(f){return function(){return f.apply(null,arguments)}},j.cacheSignal=function(){return null},j.cloneElement=function(f,E,U){if(f==null)throw Error("The argument must be a React element, but you passed "+f+".");var O=L({},f.props),F=f.key;if(E!=null)for(B in E.key!==void 0&&(F=""+E.key),E)!k.call(E,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&E.ref===void 0||(O[B]=E[B]);var B=arguments.length-2;if(B===1)O.children=U;else if(1<B){for(var q=Array(B),se=0;se<B;se++)q[se]=arguments[se+2];O.children=q}return I(f.type,F,O)},j.createContext=function(f){return f={$$typeof:i,_currentValue:f,_currentValue2:f,_threadCount:0,Provider:null,Consumer:null},f.Provider=f,f.Consumer={$$typeof:o,_context:f},f},j.createElement=function(f,E,U){var O,F={},B=null;if(E!=null)for(O in E.key!==void 0&&(B=""+E.key),E)k.call(E,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(F[O]=E[O]);var q=arguments.length-2;if(q===1)F.children=U;else if(1<q){for(var se=Array(q),de=0;de<q;de++)se[de]=arguments[de+2];F.children=se}if(f&&f.defaultProps)for(O in q=f.defaultProps,q)F[O]===void 0&&(F[O]=q[O]);return I(f,B,F)},j.createRef=function(){return{current:null}},j.forwardRef=function(f){return{$$typeof:s,render:f}},j.isValidElement=X,j.lazy=function(f){return{$$typeof:h,_payload:{_status:-1,_result:f},_init:ee}},j.memo=function(f,E){return{$$typeof:l,type:f,compare:E===void 0?null:E}},j.startTransition=function(f){var E=p.T,U={};p.T=U;try{var O=f(),F=p.S;F!==null&&F(U,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(Z,ue)}catch(B){ue(B)}finally{E!==null&&U.types!==null&&(E.types=U.types),p.T=E}},j.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()},j.use=function(f){return p.H.use(f)},j.useActionState=function(f,E,U){return p.H.useActionState(f,E,U)},j.useCallback=function(f,E){return p.H.useCallback(f,E)},j.useContext=function(f){return p.H.useContext(f)},j.useDebugValue=function(){},j.useDeferredValue=function(f,E){return p.H.useDeferredValue(f,E)},j.useEffect=function(f,E){return p.H.useEffect(f,E)},j.useEffectEvent=function(f){return p.H.useEffectEvent(f)},j.useId=function(){return p.H.useId()},j.useImperativeHandle=function(f,E,U){return p.H.useImperativeHandle(f,E,U)},j.useInsertionEffect=function(f,E){return p.H.useInsertionEffect(f,E)},j.useLayoutEffect=function(f,E){return p.H.useLayoutEffect(f,E)},j.useMemo=function(f,E){return p.H.useMemo(f,E)},j.useOptimistic=function(f,E){return p.H.useOptimistic(f,E)},j.useReducer=function(f,E,U){return p.H.useReducer(f,E,U)},j.useRef=function(f){return p.H.useRef(f)},j.useState=function(f){return p.H.useState(f)},j.useSyncExternalStore=function(f,E,U){return p.H.useSyncExternalStore(f,E,U)},j.useTransition=function(){return p.H.useTransition()},j.version="19.2.3",j}var Rr;function en(){return Rr||(Rr=1,Ft.exports=Xn()),Ft.exports}var y=en();const Qn=Zr(y),Zn=Qr({__proto__:null,default:Qn},[y]);var kt={exports:{}},pe={};/**
10
+ * @license React
11
+ * react-dom.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var br;function ea(){if(br)return pe;br=1;var e=en();function t(u){var l="https://react.dev/errors/"+u;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(u,l,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:u,containerInfo:l,implementation:h}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(u,l){if(u==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,pe.createPortal=function(u,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(u,l,null,h)},pe.flushSync=function(u){var l=i.T,h=n.p;try{if(i.T=null,n.p=2,u)return u()}finally{i.T=l,n.p=h,n.d.f()}},pe.preconnect=function(u,l){typeof u=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(u,l))},pe.prefetchDNS=function(u){typeof u=="string"&&n.d.D(u)},pe.preinit=function(u,l){if(typeof u=="string"&&l&&typeof l.as=="string"){var h=l.as,m=s(h,l.crossOrigin),w=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;h==="style"?n.d.S(u,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:m,integrity:w,fetchPriority:g}):h==="script"&&n.d.X(u,{crossOrigin:m,integrity:w,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},pe.preinitModule=function(u,l){if(typeof u=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var h=s(l.as,l.crossOrigin);n.d.M(u,{crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(u)},pe.preload=function(u,l){if(typeof u=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var h=l.as,m=s(h,l.crossOrigin);n.d.L(u,h,{crossOrigin:m,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},pe.preloadModule=function(u,l){if(typeof u=="string")if(l){var h=s(l.as,l.crossOrigin);n.d.m(u,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(u)},pe.requestFormReset=function(u){n.d.r(u)},pe.unstable_batchedUpdates=function(u,l){return u(l)},pe.useFormState=function(u,l,h){return i.H.useFormState(u,l,h)},pe.useFormStatus=function(){return i.H.useHostTransitionStatus()},pe.version="19.2.3",pe}var Cr;function ta(){if(Cr)return kt.exports;Cr=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),kt.exports=ea(),kt.exports}var qt=ta();const ra=Zr(qt),Li=Qr({__proto__:null,default:ra},[qt]);/**
18
+ * react-router v7.11.0
19
+ *
20
+ * Copyright (c) Remix Software Inc.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE.md file in the root directory of this source tree.
24
+ *
25
+ * @license MIT
26
+ */var tn=e=>{throw TypeError(e)},na=(e,t,r)=>t.has(e)||tn("Cannot "+r),jt=(e,t,r)=>(na(e,t,"read from private field"),r?r.call(e):t.get(e)),aa=(e,t,r)=>t.has(e)?tn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Sr="popstate";function oa(e={}){function t(n,a){let{pathname:o,search:i,hash:s}=n.location;return lt("",{pathname:o,search:i,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:_e(a)}return la(t,r,null,e)}function W(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ae(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ia(){return Math.random().toString(36).substring(2,10)}function Pr(e,t){return{usr:e.state,key:e.key,idx:t}}function lt(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ke(t):t,state:r,key:t&&t.key||n||ia()}}function _e({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ke(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function la(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,s="POP",u=null,l=h();l==null&&(l=0,i.replaceState({...i.state,idx:l},""));function h(){return(i.state||{idx:null}).idx}function m(){s="POP";let x=h(),P=x==null?null:x-l;l=x,u&&u({action:s,location:L.location,delta:P})}function w(x,P){s="PUSH";let S=lt(L.location,x,P);l=h()+1;let $=Pr(S,l),Q=L.createHref(S);try{i.pushState($,"",Q)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;a.location.assign(Q)}o&&u&&u({action:s,location:L.location,delta:1})}function g(x,P){s="REPLACE";let S=lt(L.location,x,P);l=h();let $=Pr(S,l),Q=L.createHref(S);i.replaceState($,"",Q),o&&u&&u({action:s,location:L.location,delta:0})}function b(x){return rn(x)}let L={get action(){return s},get location(){return e(a,i)},listen(x){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(Sr,m),u=x,()=>{a.removeEventListener(Sr,m),u=null}},createHref(x){return t(a,x)},createURL:b,encodeLocation(x){let P=b(x);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:w,replace:g,go(x){return i.go(x)}};return L}function rn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),W(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:_e(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var at,xr=class{constructor(e){if(aa(this,at,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(jt(this,at).has(e))return jt(this,at).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){jt(this,at).set(e,t)}};at=new WeakMap;var ua=new Set(["lazy","caseSensitive","path","id","index","children"]);function sa(e){return ua.has(e)}var ca=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function fa(e){return ca.has(e)}function da(e){return e.index===!0}function ut(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let s=[...r,String(i)],u=typeof o.id=="string"?o.id:s.join("-");if(W(o.index!==!0||!o.children,"Cannot specify children on an index route"),W(a||!n[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),da(o)){let l={...o,id:u};return n[u]=Lr(l,t(l)),l}else{let l={...o,id:u,children:void 0};return n[u]=Lr(l,t(l)),o.children&&(l.children=ut(o.children,t,s,n,a)),l}})}function Lr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ne(e,t,r="/"){return ot(e,t,r,!1)}function ot(e,t,r,n){let a=typeof t=="string"?ke(t):t,o=Ee(a.pathname||"/",r);if(o==null)return null;let i=nn(e);ma(i);let s=null;for(let u=0;s==null&&u<i.length;++u){let l=Pa(o);s=Ca(i[u],l,n)}return s}function ha(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function nn(e,t=[],r=[],n="",a=!1){let o=(i,s,u=a,l)=>{let h={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&u)return;W(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let m=Le([n,h.relativePath]),w=r.concat(h);i.children&&i.children.length>0&&(W(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),nn(i.children,t,w,m,u)),!(i.path==null&&!i.index)&&t.push({path:m,score:Ra(m,i.index),routesMeta:w})};return e.forEach((i,s)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))o(i,s);else for(let l of an(i.path))o(i,s,!0,l)}),t}function an(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=an(n.join("/")),s=[];return s.push(...i.map(u=>u===""?o:[o,u].join("/"))),a&&s.push(...i),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function ma(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ba(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var pa=/^:[\w-]+$/,ya=3,va=2,ga=1,wa=10,Ea=-2,_r=e=>e==="*";function Ra(e,t){let r=e.split("/"),n=r.length;return r.some(_r)&&(n+=Ea),t&&(n+=va),r.filter(a=>!_r(a)).reduce((a,o)=>a+(pa.test(o)?ya:o===""?ga:wa),n)}function ba(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Ca(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let s=0;s<n.length;++s){let u=n[s],l=s===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",m=xt({path:u.relativePath,caseSensitive:u.caseSensitive,end:l},h),w=u.route;if(!m&&l&&r&&!n[n.length-1].route.index&&(m=xt({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!m)return null;Object.assign(a,m.params),i.push({params:a,pathname:Le([o,m.pathname]),pathnameBase:_a(Le([o,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(o=Le([o,m.pathnameBase]))}return i}function xt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Sa(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((l,{paramName:h,isOptional:m},w)=>{if(h==="*"){let b=s[w]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const g=s[w];return m&&!g?l[h]=void 0:l[h]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:i,pattern:e}}function Sa(e,t=!1,r=!0){ae(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,u)=>(n.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Pa(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ae(!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 Ee(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function xa({basename:e,pathname:t}){return t==="/"?e:Le([e,t])}var on=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lt=e=>on.test(e);function La(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ke(e):e,o;if(r)if(Lt(r))o=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),ae(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${r}`)}r.startsWith("/")?o=Tr(r.substring(1),"/"):o=Tr(r,t)}else o=t;return{pathname:o,search:Ta(n),hash:Ma(a)}}function Tr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function It(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ln(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _t(e){let t=ln(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function Tt(e,t,r,n=!1){let a;typeof e=="string"?a=ke(e):(a={...e},W(!a.pathname||!a.pathname.includes("?"),It("?","pathname","search",a)),W(!a.pathname||!a.pathname.includes("#"),It("#","pathname","hash",a)),W(!a.search||!a.search.includes("#"),It("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,s;if(i==null)s=r;else{let m=t.length-1;if(!n&&i.startsWith("..")){let w=i.split("/");for(;w[0]==="..";)w.shift(),m-=1;a.pathname=w.join("/")}s=m>=0?t[m]:"/"}let u=La(a,s),l=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(l||h)&&(u.pathname+="/"),u}var Le=e=>e.join("/").replace(/\/\/+/g,"/"),_a=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ma=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ct=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function st(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ft(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var un=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sn(e,t){let r=e;if(typeof r!="string"||!on.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(un)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),s=Ee(i.pathname,t);i.origin===o.origin&&s!=null?r=s+i.search+i.hash:a=!0}catch{ae(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var Fe=Symbol("Uninstrumented");function Da(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let i=Object.keys(r);for(let s of i)o[s]&&r[s].push(o[s])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],s=r[`lazy.${o}`];if(typeof i=="function"&&s.length>0){let u=qe(s,i,()=>{});u&&(n.lazy=Object.assign(n.lazy||{},{[o]:u}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[Fe]??o,s=qe(r[a],i,(...u)=>Mr(u[0]));s&&(s[Fe]=i,n[a]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[Fe]??a,i=qe(r.middleware,o,(...s)=>Mr(s[0]));return i?(i[Fe]=o,i):a})),n}function Oa(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[Fe]??e.navigate,a=qe(r.navigate,n,(...o)=>{let[i,s]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?_e(i):".",...Dr(e,s??{})}});a&&(a[Fe]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[Fe]??e.fetch,a=qe(r.fetch,n,(...o)=>{let[i,,s,u]=o;return{href:s??".",fetcherKey:i,...Dr(e,u??{})}});a&&(a[Fe]=n,e.fetch=a)}return e}function qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await cn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function cn(e,t,r,n){let a=e[n],o;if(a){let i,s=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=cn(e,t,r,n-1),o=await i,W(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(s,t)}catch(u){console.error("An instrumentation function threw an error:",u)}i||await s(),await i}else try{o={type:"success",value:await r()}}catch(i){o={type:"error",value:i}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Mr(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:Aa(t),params:{...n},unstable_pattern:a,context:Ua(r)}}function Dr(e,t){return{currentUrl:_e(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Aa(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ua(e){if($a(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Na=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $a(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Na}var fn=["POST","PUT","PATCH","DELETE"],Fa=new Set(fn),ka=["GET",...fn],ja=new Set(ka),dn=new Set([301,302,303,307,308]),Ia=new Set([307,308]),zt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},za={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ge={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ha=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),hn="remix-router-transitions",mn=Symbol("ResetLoaderData");function Ba(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";W(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Ha,o=a;if(e.unstable_instrumentations){let c=e.unstable_instrumentations;o=d=>({...a(d),...Da(c.map(v=>v.route).filter(Boolean),d)})}let i={},s=ut(e.routes,o,void 0,i),u,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let h=e.dataStrategy||Ga,m={...e.future},w=null,g=new Set,b=null,L=null,x=null,P=e.hydrationData!=null,S=Ne(s,e.history.location,l),$=!1,Q=null,G;if(S==null&&!e.patchRoutesOnNavigation){let c=Se(404,{pathname:e.history.location.pathname}),{matches:d,route:v}=Et(s);G=!0,S=d,Q={[v.id]:c}}else if(S&&!e.hydrationData&&pt(S,s,e.history.location.pathname).active&&(S=null),S)if(S.some(c=>c.route.lazy))G=!1;else if(!S.some(c=>Xt(c.route)))G=!0;else{let c=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null;if(d){let v=S.findIndex(R=>d[R.route.id]!==void 0);G=S.slice(0,v+1).every(R=>!Vt(R.route,c,d))}else G=S.every(v=>!Vt(v.route,c,d))}else{G=!1,S=[];let c=pt(null,s,e.history.location.pathname);c.active&&c.matches&&($=!0,S=c.matches)}let Z,p={historyAction:e.history.action,location:e.history.location,matches:S,initialized:G,navigation:zt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||Q,fetchers:new Map,blockers:new Map},k="POP",I=null,J=!1,X,le=!1,we=new Map,ne=null,ve=!1,Y=!1,re=new Set,ee=new Map,ue=0,ie=-1,f=new Map,E=new Set,U=new Map,O=new Map,F=new Set,B=new Map,q,se=null;function de(){if(w=e.history.listen(({action:c,location:d,delta:v})=>{if(q){q(),q=void 0;return}ae(B.size===0||v!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let R=pr({currentLocation:p.location,nextLocation:d,historyAction:c});if(R&&v!=null){let C=new Promise(M=>{q=M});e.history.go(v*-1),mt(R,{state:"blocked",location:d,proceed(){mt(R,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),C.then(()=>e.history.go(v))},reset(){let M=new Map(p.blockers);M.set(R,Ge),he({blockers:M})}}),I==null||I.resolve(),I=null;return}return je(c,d)}),r){ho(t,we);let c=()=>mo(t,we);t.addEventListener("pagehide",c),ne=()=>t.removeEventListener("pagehide",c)}return p.initialized||je("POP",p.location,{initialHydration:!0}),Z}function Ot(){w&&w(),ne&&ne(),g.clear(),X&&X.abort(),p.fetchers.forEach((c,d)=>Ut(d)),p.blockers.forEach((c,d)=>mr(d))}function Nn(c){return g.add(c),()=>g.delete(c)}function he(c,d={}){c.matches&&(c.matches=c.matches.map(C=>{let M=i[C.route.id],N=C.route;return N.element!==M.element||N.errorElement!==M.errorElement||N.hydrateFallbackElement!==M.hydrateFallbackElement?{...C,route:M}:C})),p={...p,...c};let v=[],R=[];p.fetchers.forEach((C,M)=>{C.state==="idle"&&(F.has(M)?v.push(M):R.push(M))}),F.forEach(C=>{!p.fetchers.has(C)&&!ee.has(C)&&v.push(C)}),[...g].forEach(C=>C(p,{deletedFetchers:v,newErrors:c.errors??null,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),v.forEach(C=>Ut(C)),R.forEach(C=>p.fetchers.delete(C))}function Ve(c,d,{flushSync:v}={}){var z,D;let R=p.actionData!=null&&p.navigation.formMethod!=null&&ye(p.navigation.formMethod)&&p.navigation.state==="loading"&&((z=c.state)==null?void 0:z._isRedirect)!==!0,C;d.actionData?Object.keys(d.actionData).length>0?C=d.actionData:C=null:R?C=p.actionData:C=null;let M=d.loaderData?zr(p.loaderData,d.loaderData,d.matches||[],d.errors):p.loaderData,N=p.blockers;N.size>0&&(N=new Map(N),N.forEach((H,V)=>N.set(V,Ge)));let _=ve?!1:vr(c,d.matches||p.matches),T=J===!0||p.navigation.formMethod!=null&&ye(p.navigation.formMethod)&&((D=c.state)==null?void 0:D._isRedirect)!==!0;u&&(s=u,u=void 0),ve||k==="POP"||(k==="PUSH"?e.history.push(c,c.state):k==="REPLACE"&&e.history.replace(c,c.state));let A;if(k==="POP"){let H=we.get(p.location.pathname);H&&H.has(c.pathname)?A={currentLocation:p.location,nextLocation:c}:we.has(c.pathname)&&(A={currentLocation:c,nextLocation:p.location})}else if(le){let H=we.get(p.location.pathname);H?H.add(c.pathname):(H=new Set([c.pathname]),we.set(p.location.pathname,H)),A={currentLocation:p.location,nextLocation:c}}he({...d,actionData:C,loaderData:M,historyAction:k,location:c,initialized:!0,navigation:zt,revalidation:"idle",restoreScrollPosition:_,preventScrollReset:T,blockers:N},{viewTransitionOpts:A,flushSync:v===!0}),k="POP",J=!1,le=!1,ve=!1,Y=!1,I==null||I.resolve(),I=null,se==null||se.resolve(),se=null}async function lr(c,d){if(I==null||I.resolve(),I=null,typeof c=="number"){I||(I=Yr());let V=I.promise;return e.history.go(c),V}let v=Yt(p.location,p.matches,l,c,d==null?void 0:d.fromRouteId,d==null?void 0:d.relative),{path:R,submission:C,error:M}=Or(!1,v,d),N=p.location,_=lt(p.location,R,d&&d.state);_={..._,...e.history.encodeLocation(_)};let T=d&&d.replace!=null?d.replace:void 0,A="PUSH";T===!0?A="REPLACE":T===!1||C!=null&&ye(C.formMethod)&&C.formAction===p.location.pathname+p.location.search&&(A="REPLACE");let z=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,D=(d&&d.flushSync)===!0,H=pr({currentLocation:N,nextLocation:_,historyAction:A});if(H){mt(H,{state:"blocked",location:_,proceed(){mt(H,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),lr(c,d)},reset(){let V=new Map(p.blockers);V.set(H,Ge),he({blockers:V})}});return}await je(A,_,{submission:C,pendingError:M,preventScrollReset:z,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:D,callSiteDefaultShouldRevalidate:d&&d.unstable_defaultShouldRevalidate})}function $n(){se||(se=Yr()),At(),he({revalidation:"loading"});let c=se.promise;return p.navigation.state==="submitting"?c:p.navigation.state==="idle"?(je(p.historyAction,p.location,{startUninterruptedRevalidation:!0}),c):(je(k||p.historyAction,p.navigation.location,{overrideNavigation:p.navigation,enableViewTransition:le===!0}),c)}async function je(c,d,v){X&&X.abort(),X=null,k=c,ve=(v&&v.startUninterruptedRevalidation)===!0,Kn(p.location,p.matches),J=(v&&v.preventScrollReset)===!0,le=(v&&v.enableViewTransition)===!0;let R=u||s,C=v&&v.overrideNavigation,M=v!=null&&v.initialHydration&&p.matches&&p.matches.length>0&&!$?p.matches:Ne(R,d,l),N=(v&&v.flushSync)===!0;if(M&&p.initialized&&!Y&&ro(p.location,d)&&!(v&&v.submission&&ye(v.submission.formMethod))){Ve(d,{matches:M},{flushSync:N});return}let _=pt(M,R,d.pathname);if(_.active&&_.matches&&(M=_.matches),!M){let{error:ce,notFoundMatches:ge,route:te}=Nt(d.pathname);Ve(d,{matches:ge,loaderData:{},errors:{[te.id]:ce}},{flushSync:N});return}X=new AbortController;let T=Je(e.history,d,X.signal,v&&v.submission),A=e.getContext?await e.getContext():new xr,z;if(v&&v.pendingError)z=[$e(M).route.id,{type:"error",error:v.pendingError}];else if(v&&v.submission&&ye(v.submission.formMethod)){let ce=await Fn(T,d,v.submission,M,A,_.active,v&&v.initialHydration===!0,{replace:v.replace,flushSync:N});if(ce.shortCircuited)return;if(ce.pendingActionResult){let[ge,te]=ce.pendingActionResult;if(Re(te)&&st(te.error)&&te.error.status===404){X=null,Ve(d,{matches:ce.matches,loaderData:{},errors:{[ge]:te.error}});return}}M=ce.matches||M,z=ce.pendingActionResult,C=Ht(d,v.submission),N=!1,_.active=!1,T=Je(e.history,T.url,T.signal)}let{shortCircuited:D,matches:H,loaderData:V,errors:fe}=await kn(T,d,M,A,_.active,C,v&&v.submission,v&&v.fetcherSubmission,v&&v.replace,v&&v.initialHydration===!0,N,z,v&&v.callSiteDefaultShouldRevalidate);D||(X=null,Ve(d,{matches:H||M,...Hr(z),loaderData:V,errors:fe}))}async function Fn(c,d,v,R,C,M,N,_={}){At();let T=co(d,v);if(he({navigation:T},{flushSync:_.flushSync===!0}),M){let D=await yt(R,d.pathname,c.signal);if(D.type==="aborted")return{shortCircuited:!0};if(D.type==="error"){if(D.partialMatches.length===0){let{matches:V,route:fe}=Et(s);return{matches:V,pendingActionResult:[fe.id,{type:"error",error:D.error}]}}let H=$e(D.partialMatches).route.id;return{matches:D.partialMatches,pendingActionResult:[H,{type:"error",error:D.error}]}}else if(D.matches)R=D.matches;else{let{notFoundMatches:H,error:V,route:fe}=Nt(d.pathname);return{matches:H,pendingActionResult:[fe.id,{type:"error",error:V}]}}}let A,z=Ct(R,d);if(!z.route.action&&!z.route.lazy)A={type:"error",error:Se(405,{method:c.method,pathname:d.pathname,routeId:z.route.id})};else{let D=Xe(o,i,c,R,z,N?[]:n,C),H=await Ze(c,D,C,null);if(A=H[z.route.id],!A){for(let V of R)if(H[V.route.id]){A=H[V.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(We(A)){let D;return _&&_.replace!=null?D=_.replace:D=kr(A.response.headers.get("Location"),new URL(c.url),l)===p.location.pathname+p.location.search,await Ie(c,A,!0,{submission:v,replace:D}),{shortCircuited:!0}}if(Re(A)){let D=$e(R,z.route.id);return(_&&_.replace)!==!0&&(k="PUSH"),{matches:R,pendingActionResult:[D.route.id,A,z.route.id]}}return{matches:R,pendingActionResult:[z.route.id,A]}}async function kn(c,d,v,R,C,M,N,_,T,A,z,D,H){let V=M||Ht(d,N),fe=N||_||Wr(V),ce=!ve&&!A;if(C){if(ce){let me=ur(D);he({navigation:V,...me!==void 0?{actionData:me}:{}},{flushSync:z})}let K=await yt(v,d.pathname,c.signal);if(K.type==="aborted")return{shortCircuited:!0};if(K.type==="error"){if(K.partialMatches.length===0){let{matches:Ke,route:Be}=Et(s);return{matches:Ke,loaderData:{},errors:{[Be.id]:K.error}}}let me=$e(K.partialMatches).route.id;return{matches:K.partialMatches,loaderData:{},errors:{[me]:K.error}}}else if(K.matches)v=K.matches;else{let{error:me,notFoundMatches:Ke,route:Be}=Nt(d.pathname);return{matches:Ke,loaderData:{},errors:{[Be.id]:me}}}}let ge=u||s,{dsMatches:te,revalidatingFetchers:Ce}=Ar(c,R,o,i,e.history,p,v,fe,d,A?[]:n,A===!0,Y,re,F,U,E,ge,l,e.patchRoutesOnNavigation!=null,D,H);if(ie=++ue,!e.dataStrategy&&!te.some(K=>K.shouldLoad)&&!te.some(K=>K.route.middleware&&K.route.middleware.length>0)&&Ce.length===0){let K=dr();return Ve(d,{matches:v,loaderData:{},errors:D&&Re(D[1])?{[D[0]]:D[1].error}:null,...Hr(D),...K?{fetchers:new Map(p.fetchers)}:{}},{flushSync:z}),{shortCircuited:!0}}if(ce){let K={};if(!C){K.navigation=V;let me=ur(D);me!==void 0&&(K.actionData=me)}Ce.length>0&&(K.fetchers=jn(Ce)),he(K,{flushSync:z})}Ce.forEach(K=>{De(K.key),K.controller&&ee.set(K.key,K.controller)});let ze=()=>Ce.forEach(K=>De(K.key));X&&X.signal.addEventListener("abort",ze);let{loaderResults:et,fetcherResults:Ue}=await sr(te,Ce,c,R);if(c.signal.aborted)return{shortCircuited:!0};X&&X.signal.removeEventListener("abort",ze),Ce.forEach(K=>ee.delete(K.key));let xe=Rt(et);if(xe)return await Ie(c,xe.result,!0,{replace:T}),{shortCircuited:!0};if(xe=Rt(Ue),xe)return E.add(xe.key),await Ie(c,xe.result,!0,{replace:T}),{shortCircuited:!0};let{loaderData:$t,errors:tt}=Ir(p,v,et,D,Ce,Ue);A&&p.errors&&(tt={...p.errors,...tt});let He=dr(),vt=hr(ie),gt=He||vt||Ce.length>0;return{matches:v,loaderData:$t,errors:tt,...gt?{fetchers:new Map(p.fetchers)}:{}}}function ur(c){if(c&&!Re(c[1]))return{[c[0]]:c[1].data};if(p.actionData)return Object.keys(p.actionData).length===0?null:p.actionData}function jn(c){return c.forEach(d=>{let v=p.fetchers.get(d.key),R=rt(void 0,v?v.data:void 0);p.fetchers.set(d.key,R)}),new Map(p.fetchers)}async function In(c,d,v,R){De(c);let C=(R&&R.flushSync)===!0,M=u||s,N=Yt(p.location,p.matches,l,v,d,R==null?void 0:R.relative),_=Ne(M,N,l),T=pt(_,M,N);if(T.active&&T.matches&&(_=T.matches),!_){Me(c,d,Se(404,{pathname:N}),{flushSync:C});return}let{path:A,submission:z,error:D}=Or(!0,N,R);if(D){Me(c,d,D,{flushSync:C});return}let H=e.getContext?await e.getContext():new xr,V=(R&&R.preventScrollReset)===!0;if(z&&ye(z.formMethod)){await zn(c,d,A,_,H,T.active,C,V,z,R&&R.unstable_defaultShouldRevalidate);return}U.set(c,{routeId:d,path:A}),await Hn(c,d,A,_,H,T.active,C,V,z)}async function zn(c,d,v,R,C,M,N,_,T,A){At(),U.delete(c);let z=p.fetchers.get(c);Te(c,fo(T,z),{flushSync:N});let D=new AbortController,H=Je(e.history,v,D.signal,T);if(M){let oe=await yt(R,new URL(H.url).pathname,H.signal,c);if(oe.type==="aborted")return;if(oe.type==="error"){Me(c,d,oe.error,{flushSync:N});return}else if(oe.matches)R=oe.matches;else{Me(c,d,Se(404,{pathname:v}),{flushSync:N});return}}let V=Ct(R,v);if(!V.route.action&&!V.route.lazy){let oe=Se(405,{method:T.formMethod,pathname:v,routeId:d});Me(c,d,oe,{flushSync:N});return}ee.set(c,D);let fe=ue,ce=Xe(o,i,H,R,V,n,C),ge=await Ze(H,ce,C,c),te=ge[V.route.id];if(!te){for(let oe of ce)if(ge[oe.route.id]){te=ge[oe.route.id];break}}if(H.signal.aborted){ee.get(c)===D&&ee.delete(c);return}if(F.has(c)){if(We(te)||Re(te)){Te(c,Oe(void 0));return}}else{if(We(te))if(ee.delete(c),ie>fe){Te(c,Oe(void 0));return}else return E.add(c),Te(c,rt(T)),Ie(H,te,!1,{fetcherSubmission:T,preventScrollReset:_});if(Re(te)){Me(c,d,te.error);return}}let Ce=p.navigation.location||p.location,ze=Je(e.history,Ce,D.signal),et=u||s,Ue=p.navigation.state!=="idle"?Ne(et,p.navigation.location,l):p.matches;W(Ue,"Didn't find any matches after fetcher action");let xe=++ue;f.set(c,xe);let $t=rt(T,te.data);p.fetchers.set(c,$t);let{dsMatches:tt,revalidatingFetchers:He}=Ar(ze,C,o,i,e.history,p,Ue,T,Ce,n,!1,Y,re,F,U,E,et,l,e.patchRoutesOnNavigation!=null,[V.route.id,te],A);He.filter(oe=>oe.key!==c).forEach(oe=>{let wt=oe.key,wr=p.fetchers.get(wt),qn=rt(void 0,wr?wr.data:void 0);p.fetchers.set(wt,qn),De(wt),oe.controller&&ee.set(wt,oe.controller)}),he({fetchers:new Map(p.fetchers)});let vt=()=>He.forEach(oe=>De(oe.key));D.signal.addEventListener("abort",vt);let{loaderResults:gt,fetcherResults:K}=await sr(tt,He,ze,C);if(D.signal.aborted)return;if(D.signal.removeEventListener("abort",vt),f.delete(c),ee.delete(c),He.forEach(oe=>ee.delete(oe.key)),p.fetchers.has(c)){let oe=Oe(te.data);p.fetchers.set(c,oe)}let me=Rt(gt);if(me)return Ie(ze,me.result,!1,{preventScrollReset:_});if(me=Rt(K),me)return E.add(me.key),Ie(ze,me.result,!1,{preventScrollReset:_});let{loaderData:Ke,errors:Be}=Ir(p,Ue,gt,void 0,He,K);hr(xe),p.navigation.state==="loading"&&xe>ie?(W(k,"Expected pending action"),X&&X.abort(),Ve(p.navigation.location,{matches:Ue,loaderData:Ke,errors:Be,fetchers:new Map(p.fetchers)})):(he({errors:Be,loaderData:zr(p.loaderData,Ke,Ue,Be),fetchers:new Map(p.fetchers)}),Y=!1)}async function Hn(c,d,v,R,C,M,N,_,T){let A=p.fetchers.get(c);Te(c,rt(T,A?A.data:void 0),{flushSync:N});let z=new AbortController,D=Je(e.history,v,z.signal);if(M){let te=await yt(R,new URL(D.url).pathname,D.signal,c);if(te.type==="aborted")return;if(te.type==="error"){Me(c,d,te.error,{flushSync:N});return}else if(te.matches)R=te.matches;else{Me(c,d,Se(404,{pathname:v}),{flushSync:N});return}}let H=Ct(R,v);ee.set(c,z);let V=ue,fe=Xe(o,i,D,R,H,n,C),ge=(await Ze(D,fe,C,c))[H.route.id];if(ee.get(c)===z&&ee.delete(c),!D.signal.aborted){if(F.has(c)){Te(c,Oe(void 0));return}if(We(ge))if(ie>V){Te(c,Oe(void 0));return}else{E.add(c),await Ie(D,ge,!1,{preventScrollReset:_});return}if(Re(ge)){Me(c,d,ge.error);return}Te(c,Oe(ge.data))}}async function Ie(c,d,v,{submission:R,fetcherSubmission:C,preventScrollReset:M,replace:N}={}){v||(I==null||I.resolve(),I=null),d.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let _=d.response.headers.get("Location");W(_,"Expected a Location header on the redirect Response"),_=kr(_,new URL(c.url),l);let T=lt(p.location,_,{_isRedirect:!0});if(r){let fe=!1;if(d.response.headers.has("X-Remix-Reload-Document"))fe=!0;else if(Lt(_)){const ce=rn(_,!0);fe=ce.origin!==t.location.origin||Ee(ce.pathname,l)==null}if(fe){N?t.location.replace(_):t.location.assign(_);return}}X=null;let A=N===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:z,formAction:D,formEncType:H}=p.navigation;!R&&!C&&z&&D&&H&&(R=Wr(p.navigation));let V=R||C;if(Ia.has(d.response.status)&&V&&ye(V.formMethod))await je(A,T,{submission:{...V,formAction:_},preventScrollReset:M||J,enableViewTransition:v?le:void 0});else{let fe=Ht(T,R);await je(A,T,{overrideNavigation:fe,fetcherSubmission:C,preventScrollReset:M||J,enableViewTransition:v?le:void 0})}}async function Ze(c,d,v,R){var N;let C,M={};try{C=await qa(h,c,d,R,v,!1)}catch(_){return d.filter(T=>T.shouldLoad).forEach(T=>{M[T.route.id]={type:"error",error:_}}),M}if(c.signal.aborted)return M;if(!ye(c.method))for(let _ of d){if(((N=C[_.route.id])==null?void 0:N.type)==="error")break;!C.hasOwnProperty(_.route.id)&&!p.loaderData.hasOwnProperty(_.route.id)&&(!p.errors||!p.errors.hasOwnProperty(_.route.id))&&_.shouldCallHandler()&&(C[_.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${_.route.id}`)})}for(let[_,T]of Object.entries(C))if(io(T)){let A=T.result;M[_]={type:"redirect",response:eo(A,c,_,d,l)}}else M[_]=await Za(T);return M}async function sr(c,d,v,R){let C=Ze(v,c,R,null),M=Promise.all(d.map(async T=>{if(T.matches&&T.match&&T.request&&T.controller){let z=(await Ze(T.request,T.matches,R,T.key))[T.match.route.id];return{[T.key]:z}}else return Promise.resolve({[T.key]:{type:"error",error:Se(404,{pathname:T.path})}})})),N=await C,_=(await M).reduce((T,A)=>Object.assign(T,A),{});return{loaderResults:N,fetcherResults:_}}function At(){Y=!0,U.forEach((c,d)=>{ee.has(d)&&re.add(d),De(d)})}function Te(c,d,v={}){p.fetchers.set(c,d),he({fetchers:new Map(p.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function Me(c,d,v,R={}){let C=$e(p.matches,d);Ut(c),he({errors:{[C.route.id]:v},fetchers:new Map(p.fetchers)},{flushSync:(R&&R.flushSync)===!0})}function cr(c){return O.set(c,(O.get(c)||0)+1),F.has(c)&&F.delete(c),p.fetchers.get(c)||za}function Bn(c,d){De(c,d==null?void 0:d.reason),Te(c,Oe(null))}function Ut(c){let d=p.fetchers.get(c);ee.has(c)&&!(d&&d.state==="loading"&&f.has(c))&&De(c),U.delete(c),f.delete(c),E.delete(c),F.delete(c),re.delete(c),p.fetchers.delete(c)}function Wn(c){let d=(O.get(c)||0)-1;d<=0?(O.delete(c),F.add(c)):O.set(c,d),he({fetchers:new Map(p.fetchers)})}function De(c,d){let v=ee.get(c);v&&(v.abort(d),ee.delete(c))}function fr(c){for(let d of c){let v=cr(d),R=Oe(v.data);p.fetchers.set(d,R)}}function dr(){let c=[],d=!1;for(let v of E){let R=p.fetchers.get(v);W(R,`Expected fetcher: ${v}`),R.state==="loading"&&(E.delete(v),c.push(v),d=!0)}return fr(c),d}function hr(c){let d=[];for(let[v,R]of f)if(R<c){let C=p.fetchers.get(v);W(C,`Expected fetcher: ${v}`),C.state==="loading"&&(De(v),f.delete(v),d.push(v))}return fr(d),d.length>0}function Yn(c,d){let v=p.blockers.get(c)||Ge;return B.get(c)!==d&&B.set(c,d),v}function mr(c){p.blockers.delete(c),B.delete(c)}function mt(c,d){let v=p.blockers.get(c)||Ge;W(v.state==="unblocked"&&d.state==="blocked"||v.state==="blocked"&&d.state==="blocked"||v.state==="blocked"&&d.state==="proceeding"||v.state==="blocked"&&d.state==="unblocked"||v.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${v.state} -> ${d.state}`);let R=new Map(p.blockers);R.set(c,d),he({blockers:R})}function pr({currentLocation:c,nextLocation:d,historyAction:v}){if(B.size===0)return;B.size>1&&ae(!1,"A router only supports one blocker at a time");let R=Array.from(B.entries()),[C,M]=R[R.length-1],N=p.blockers.get(C);if(!(N&&N.state==="proceeding")&&M({currentLocation:c,nextLocation:d,historyAction:v}))return C}function Nt(c){let d=Se(404,{pathname:c}),v=u||s,{matches:R,route:C}=Et(v);return{notFoundMatches:R,route:C,error:d}}function Vn(c,d,v){if(b=c,x=d,L=v||null,!P&&p.navigation===zt){P=!0;let R=vr(p.location,p.matches);R!=null&&he({restoreScrollPosition:R})}return()=>{b=null,x=null,L=null}}function yr(c,d){return L&&L(c,d.map(R=>ha(R,p.loaderData)))||c.key}function Kn(c,d){if(b&&x){let v=yr(c,d);b[v]=x()}}function vr(c,d){if(b){let v=yr(c,d),R=b[v];if(typeof R=="number")return R}return null}function pt(c,d,v){if(e.patchRoutesOnNavigation)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:ot(d,v,l,!0)}}else return{active:!0,matches:ot(d,v,l,!0)||[]};return{active:!1,matches:null}}async function yt(c,d,v,R){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let C=c;for(;;){let M=u==null,N=u||s,_=i;try{await e.patchRoutesOnNavigation({signal:v,path:d,matches:C,fetcherKey:R,patch:(z,D)=>{v.aborted||Ur(z,D,N,_,o,!1)}})}catch(z){return{type:"error",error:z,partialMatches:C}}finally{M&&!v.aborted&&(s=[...s])}if(v.aborted)return{type:"aborted"};let T=Ne(N,d,l),A=null;if(T){if(Object.keys(T[0].params).length===0)return{type:"success",matches:T};if(A=ot(N,d,l,!0),!(A&&C.length<A.length&&gr(C,A.slice(0,C.length))))return{type:"success",matches:T}}if(A||(A=ot(N,d,l,!0)),!A||gr(C,A))return{type:"success",matches:null};C=A}}function gr(c,d){return c.length===d.length&&c.every((v,R)=>v.route.id===d[R].route.id)}function Gn(c){i={},u=ut(c,o,void 0,i)}function Jn(c,d,v=!1){let R=u==null;Ur(c,d,u||s,i,o,v),R&&(s=[...s],he({}))}return Z={get basename(){return l},get future(){return m},get state(){return p},get routes(){return s},get window(){return t},initialize:de,subscribe:Nn,enableScrollRestoration:Vn,navigate:lr,fetch:In,revalidate:$n,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:cr,resetFetcher:Bn,deleteFetcher:Wn,dispose:Ot,getBlocker:Yn,deleteBlocker:mr,patchRoutes:Jn,_internalFetchControllers:ee,_internalSetRoutes:Gn,_internalSetStateDoNotUseOrYouWillBreakYourApp(c){he(c)}},e.unstable_instrumentations&&(Z=Oa(Z,e.unstable_instrumentations.map(c=>c.router).filter(Boolean))),Z}function Wa(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Yt(e,t,r,n,a,o){let i,s;if(a){i=[];for(let l of t)if(i.push(l),l.route.id===a){s=l;break}}else i=t,s=t[t.length-1];let u=Tt(n||".",_t(i),Ee(e.pathname,r)||e.pathname,o==="path");if(n==null&&(u.search=e.search,u.hash=e.hash),(n==null||n===""||n===".")&&s){let l=Zt(u.search);if(s.route.index&&!l)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&l){let h=new URLSearchParams(u.search),m=h.getAll("index");h.delete("index"),m.filter(g=>g).forEach(g=>h.append("index",g));let w=h.toString();u.search=w?`?${w}`:""}}return r!=="/"&&(u.pathname=xa({basename:r,pathname:u.pathname})),_e(u)}function Or(e,t,r){if(!r||!Wa(r))return{path:t};if(r.formMethod&&!so(r.formMethod))return{path:t,error:Se(405,{method:r.formMethod})};let n=()=>({path:t,error:Se(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=En(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ye(o))return n();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((w,[g,b])=>`${w}${g}=${b}
27
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!ye(o))return n();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return n()}}}W(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=Gt(r.formData),u=r.formData;else if(r.body instanceof FormData)s=Gt(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=jr(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=jr(s)}catch{return n()}let l={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ye(l.formMethod))return{path:t,submission:l};let h=ke(t);return e&&h.search&&Zt(h.search)&&s.append("index",""),h.search=`?${s}`,{path:_e(h),submission:l}}function Ar(e,t,r,n,a,o,i,s,u,l,h,m,w,g,b,L,x,P,S,$,Q){var ve;let G=$?Re($[1])?$[1].error:$[1].data:void 0,Z=a.createURL(o.location),p=a.createURL(u),k;if(h&&o.errors){let Y=Object.keys(o.errors)[0];k=i.findIndex(re=>re.route.id===Y)}else if($&&Re($[1])){let Y=$[0];k=i.findIndex(re=>re.route.id===Y)-1}let I=$?$[1].statusCode:void 0,J=I&&I>=400,X={currentUrl:Z,currentParams:((ve=o.matches[0])==null?void 0:ve.params)||{},nextUrl:p,nextParams:i[0].params,...s,actionResult:G,actionStatus:I},le=ft(i),we=i.map((Y,re)=>{let{route:ee}=Y,ue=null;if(k!=null&&re>k?ue=!1:ee.lazy?ue=!0:Xt(ee)?h?ue=Vt(ee,o.loaderData,o.errors):Ya(o.loaderData,o.matches[re],Y)&&(ue=!0):ue=!1,ue!==null)return Kt(r,n,e,le,Y,l,t,ue);let ie=!1;typeof Q=="boolean"?ie=Q:J?ie=!1:(m||Z.pathname+Z.search===p.pathname+p.search||Z.search!==p.search||Va(o.matches[re],Y))&&(ie=!0);let f={...X,defaultShouldRevalidate:ie},E=it(Y,f);return Kt(r,n,e,le,Y,l,t,E,f,Q)}),ne=[];return b.forEach((Y,re)=>{if(h||!i.some(F=>F.route.id===Y.routeId)||g.has(re))return;let ee=o.fetchers.get(re),ue=ee&&ee.state!=="idle"&&ee.data===void 0,ie=Ne(x,Y.path,P);if(!ie){if(S&&ue)return;ne.push({key:re,routeId:Y.routeId,path:Y.path,matches:null,match:null,request:null,controller:null});return}if(L.has(re))return;let f=Ct(ie,Y.path),E=new AbortController,U=Je(a,Y.path,E.signal),O=null;if(w.has(re))w.delete(re),O=Xe(r,n,U,ie,f,l,t);else if(ue)m&&(O=Xe(r,n,U,ie,f,l,t));else{let F;typeof Q=="boolean"?F=Q:J?F=!1:F=m;let B={...X,defaultShouldRevalidate:F};it(f,B)&&(O=Xe(r,n,U,ie,f,l,t,B))}O&&ne.push({key:re,routeId:Y.routeId,path:Y.path,matches:O,match:f,request:U,controller:E})}),{dsMatches:we,revalidatingFetchers:ne}}function Xt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Vt(e,t,r){if(e.lazy)return!0;if(!Xt(e))return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Ya(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function Va(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function it(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Ur(e,t,r,n,a,o){let i;if(e){let l=n[e];W(l,`No route found to patch children into: routeId = ${e}`),l.children||(l.children=[]),i=l.children}else i=r;let s=[],u=[];if(t.forEach(l=>{let h=i.find(m=>pn(l,m));h?u.push({existingRoute:h,newRoute:l}):s.push(l)}),s.length>0){let l=ut(s,a,[e||"_","patch",String((i==null?void 0:i.length)||"0")],n);i.push(...l)}if(o&&u.length>0)for(let l=0;l<u.length;l++){let{existingRoute:h,newRoute:m}=u[l],w=h,[g]=ut([m],a,[],{},!0);Object.assign(w,{element:g.element?g.element:w.element,errorElement:g.errorElement?g.errorElement:w.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:w.hydrateFallbackElement})}}function pn(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>pn(r,o))}):!1}var Nr=new WeakMap,yn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(W(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=Nr.get(a);i||(i={},Nr.set(a,i));let s=i[e];if(s)return s;let u=(async()=>{let l=sa(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(l)ae(!l,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(m)ae(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let w=await o();w!=null&&(Object.assign(a,{[e]:w}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(w=>w===void 0)&&(a.lazy=void 0))})();return i[e]=u,u},$r=new WeakMap;function Ka(e,t,r,n,a){let o=r[e.id];if(W(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=$r.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let m=(async()=>{W(typeof e.lazy=="function","No lazy route function found");let w=await e.lazy(),g={};for(let b in w){let L=w[b];if(L===void 0)continue;let x=fa(b),S=o[b]!==void 0&&b!=="hasErrorBoundary";x?ae(!x,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?ae(!S,`Route "${o.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):g[b]=L}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return $r.set(o,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let i=Object.keys(e.lazy),s=[],u;for(let h of i){if(a&&a.includes(h))continue;let m=yn({key:h,route:e,manifest:r,mapRouteProperties:n});m&&(s.push(m),h===t&&(u=m))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l==null||l.catch(()=>{}),u==null||u.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:u}}async function Fr(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function Ga(e){return e.matches.some(t=>t.route.middleware)?vn(e,()=>Fr(e)):Fr(e)}function vn(e,t){return Ja(e,t,n=>{if(uo(n))throw n;return n},ao,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,s=Math.min(Math.max(i.findIndex(l=>l.route.id===a),0),Math.max(i.findIndex(l=>l.shouldCallHandler()),0)),u=$e(i,i[s].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:n}})}}}async function Ja(e,t,r,n,a){let{matches:o,request:i,params:s,context:u,unstable_pattern:l}=e,h=o.flatMap(w=>w.route.middleware?w.route.middleware.map(g=>[w.route.id,g]):[]);return await gn({request:i,params:s,context:u,unstable_pattern:l},h,t,r,n,a)}async function gn(e,t,r,n,a,o,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[l,h]=u,m,w=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await gn(e,t,r,n,a,o,i+1)},m.value}catch(g){return m={value:await o(g,l,m)},m.value}};try{let g=await h(e,w),b=g!=null?n(g):void 0;return a(b)?b:m?b??m.value:(m={value:await w()},m.value)}catch(g){return await o(g,l,m)}}function wn(e,t,r,n,a){let o=yn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=Ka(n.route,ye(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Kt(e,t,r,n,a,o,i,s,u=null,l){let h=!1,m=wn(e,t,r,a,o);return{...a,_lazyPromises:m,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler(w){return h=!0,u?typeof l=="boolean"?it(a,{...u,defaultShouldRevalidate:l}):typeof w=="boolean"?it(a,{...u,defaultShouldRevalidate:w}):it(a,u):s},resolve(w){let{lazy:g,loader:b,middleware:L}=a.route,x=h||s||w&&!ye(r.method)&&(g||b),P=L&&L.length>0&&!b&&!g;return x&&(ye(r.method)||!P)?Xa({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:w,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Xe(e,t,r,n,a,o,i,s=null){return n.map(u=>u.route.id!==a.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:wn(e,t,r,u,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Kt(e,t,r,ft(n),u,o,i,!0,s))}async function qa(e,t,r,n,a,o){r.some(l=>{var h;return(h=l._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(r.map(l=>{var h;return(h=l._lazyPromises)==null?void 0:h.middleware}));let i={request:t,unstable_pattern:ft(r),params:r[0].params,context:a,matches:r},u=await e({...i,fetcherKey:n,runClientMiddleware:l=>{let h=i;return vn(h,()=>l({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(l=>{var h,m;return[(h=l._lazyPromises)==null?void 0:h.handler,(m=l._lazyPromises)==null?void 0:m.route]}))}catch{}return u}async function Xa({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let s,u,l=ye(e.method),h=l?"action":"loader",m=w=>{let g,b=new Promise((P,S)=>g=S);u=()=>g(),e.signal.addEventListener("abort",u);let L=P=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):w({request:e,unstable_pattern:t,params:r.params,context:i},...P!==void 0?[P]:[]),x=(async()=>{try{return{type:"data",result:await(o?o(S=>L(S)):L())}}catch(P){return{type:"error",result:P}}})();return Promise.race([x,b])};try{let w=l?r.route.action:r.route.loader;if(n||a)if(w){let g,[b]=await Promise.all([m(w).catch(L=>{g=L}),n,a]);if(g!==void 0)throw g;s=b}else{await n;let g=l?r.route.action:r.route.loader;if(g)[s]=await Promise.all([m(g),a]);else if(h==="action"){let b=new URL(e.url),L=b.pathname+b.search;throw Se(405,{method:e.method,pathname:L,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)s=await m(w);else{let g=new URL(e.url),b=g.pathname+g.search;throw Se(404,{pathname:b})}}catch(w){return{type:"error",result:w}}finally{u&&e.signal.removeEventListener("abort",u)}return s}async function Qa(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Za(e){var n,a,o,i,s;let{result:t,type:r}=e;if(Qt(t)){let u;try{u=await Qa(t)}catch(l){return{type:"error",error:l}}return r==="error"?{type:"error",error:new ct(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:"data",data:u,statusCode:t.status,headers:t.headers}}return r==="error"?Br(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(n=t.init)==null?void 0:n.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:no(t),statusCode:st(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:st(t)?t.status:void 0}:Br(t)?{type:"data",data:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function eo(e,t,r,n,a){let o=e.headers.get("Location");if(W(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Lt(o)){let i=n.slice(0,n.findIndex(s=>s.route.id===r)+1);o=Yt(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function kr(e,t,r){if(Lt(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=Ee(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Je(e,t,r,n){let a=e.createURL(En(t)).toString(),o={signal:r};if(n&&ye(n.formMethod)){let{formMethod:i,formEncType:s}=n;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(n.json)):s==="text/plain"?o.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?o.body=Gt(n.formData):o.body=n.formData}return new Request(a,o)}function Gt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function jr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function to(e,t,r,n=!1,a=!1){let o={},i=null,s,u=!1,l={},h=r&&Re(r[1])?r[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let w=m.route.id,g=t[w];if(W(!We(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let b=g.error;if(h!==void 0&&(b=h,h=void 0),i=i||{},a)i[w]=b;else{let L=$e(e,w);i[L.route.id]==null&&(i[L.route.id]=b)}n||(o[w]=mn),u||(u=!0,s=st(g.error)?g.error.status:500),g.headers&&(l[w]=g.headers)}else o[w]=g.data,g.statusCode&&g.statusCode!==200&&!u&&(s=g.statusCode),g.headers&&(l[w]=g.headers)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:l}}function Ir(e,t,r,n,a,o){let{loaderData:i,errors:s}=to(t,r,n);return a.filter(u=>!u.matches||u.matches.some(l=>l.shouldLoad)).forEach(u=>{let{key:l,match:h,controller:m}=u;if(m&&m.signal.aborted)return;let w=o[l];if(W(w,"Did not find corresponding fetcher result"),Re(w)){let g=$e(e.matches,h==null?void 0:h.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:w.error}),e.fetchers.delete(l)}else if(We(w))W(!1,"Unhandled fetcher revalidation redirect");else{let g=Oe(w.data);e.fetchers.set(l,g)}}),{loaderData:i,errors:s}}function zr(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==mn).reduce((o,[i,s])=>(o[i]=s,o),{});for(let o of r){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function Hr(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function $e(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Et(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Se(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new ct(e||500,i,new Error(s),!0)}function Rt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(We(a))return{key:n,result:a}}}function En(e){let t=typeof e=="string"?ke(e):e;return _e({...t,hash:""})}function ro(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function no(e){var t,r;return new ct(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function ao(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&oo(r))}function oo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function io(e){return Qt(e.result)&&dn.has(e.result.status)}function Re(e){return e.type==="error"}function We(e){return(e&&e.type)==="redirect"}function Br(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Qt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function lo(e){return dn.has(e)}function uo(e){return Qt(e)&&lo(e.status)&&e.headers.has("Location")}function so(e){return ja.has(e.toUpperCase())}function ye(e){return Fa.has(e.toUpperCase())}function Zt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ct(e,t){let r=typeof t=="string"?ke(t).search:t.search;if(e[e.length-1].route.index&&Zt(r||""))return e[e.length-1];let n=ln(e);return n[n.length-1]}function Wr(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Ht(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function co(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function rt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function fo(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Oe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ho(e,t){try{let r=e.sessionStorage.getItem(hn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function mo(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(hn,JSON.stringify(r))}catch(n){ae(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function Yr(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ye=y.createContext(null);Ye.displayName="DataRouter";var dt=y.createContext(null);dt.displayName="DataRouterState";var Rn=y.createContext(!1);function po(){return y.useContext(Rn)}var er=y.createContext({isTransitioning:!1});er.displayName="ViewTransition";var bn=y.createContext(new Map);bn.displayName="Fetchers";var yo=y.createContext(null);yo.displayName="Await";var be=y.createContext(null);be.displayName="Navigation";var Mt=y.createContext(null);Mt.displayName="Location";var Pe=y.createContext({outlet:null,matches:[],isDataRoute:!1});Pe.displayName="Route";var tr=y.createContext(null);tr.displayName="RouteError";var Cn="REACT_ROUTER_ERROR",vo="REDIRECT",go="ROUTE_ERROR_RESPONSE";function wo(e){if(e.startsWith(`${Cn}:${vo}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Eo(e){if(e.startsWith(`${Cn}:${go}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ct(t.status,t.statusText,t.data)}catch{}}function Ro(e,{relative:t}={}){W(Qe(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=y.useContext(be),{hash:a,pathname:o,search:i}=ht(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:Le([r,o])),n.createHref({pathname:s,search:i,hash:a})}function Qe(){return y.useContext(Mt)!=null}function Ae(){return W(Qe(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Mt).location}var Sn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Pn(e){y.useContext(be).static||y.useLayoutEffect(e)}function rr(){let{isDataRoute:e}=y.useContext(Pe);return e?No():bo()}function bo(){W(Qe(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Ye),{basename:t,navigator:r}=y.useContext(be),{matches:n}=y.useContext(Pe),{pathname:a}=Ae(),o=JSON.stringify(_t(n)),i=y.useRef(!1);return Pn(()=>{i.current=!0}),y.useCallback((u,l={})=>{if(ae(i.current,Sn),!i.current)return;if(typeof u=="number"){r.go(u);return}let h=Tt(u,JSON.parse(o),a,l.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Le([t,h.pathname])),(l.replace?r.replace:r.push)(h,l.state,l)},[t,r,o,a,e])}var Co=y.createContext(null);function So(e){let t=y.useContext(Pe).outlet;return y.useMemo(()=>t&&y.createElement(Co.Provider,{value:e},t),[t,e])}function _i(){let{matches:e}=y.useContext(Pe),t=e[e.length-1];return t?t.params:{}}function ht(e,{relative:t}={}){let{matches:r}=y.useContext(Pe),{pathname:n}=Ae(),a=JSON.stringify(_t(r));return y.useMemo(()=>Tt(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function Po(e,t,r,n,a){W(Qe(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=y.useContext(be),{matches:i}=y.useContext(Pe),s=i[i.length-1],u=s?s.params:{},l=s?s.pathname:"/",h=s?s.pathnameBase:"/",m=s&&s.route;{let S=m&&m.path||"";Tn(l,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${S}">) 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.
28
+
29
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let w=Ae(),g;g=w;let b=g.pathname||"/",L=b;if(h!=="/"){let S=h.replace(/^\//,"").split("/");L="/"+b.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=Ne(e,{pathname:L});return ae(m||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),ae(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`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.`),Mo(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},u,S.params),pathname:Le([h,o.encodeLocation?o.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:Le([h,o.encodeLocation?o.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r,n,a)}function xo(){let e=Ao(),t=st(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:a},r):null,i)}var Lo=y.createElement(xo,null),xn=class extends y.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?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Eo(e.digest);r&&(e=r)}let t=e!==void 0?y.createElement(Pe.Provider,{value:this.props.routeContext},y.createElement(tr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(_o,{error:e},t):t}};xn.contextType=Rn;var Bt=new WeakMap;function _o({children:e,error:t}){let{basename:r}=y.useContext(be);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=wo(t.digest);if(n){let a=Bt.get(t);if(a)throw a;let o=sn(n.location,r);if(un&&!Bt.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw Bt.set(t,i),i}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function To({routeContext:e,match:t,children:r}){let n=y.useContext(Ye);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Pe.Provider,{value:e},r)}function Mo(e,t=[],r=null,n=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r==null?void 0:r.errors;if(i!=null){let h=o.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);W(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let s=!1,u=-1;if(r)for(let h=0;h<o.length;h++){let m=o[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=h),m.route.id){let{loaderData:w,errors:g}=r,b=m.route.loader&&!w.hasOwnProperty(m.route.id)&&(!g||g[m.route.id]===void 0);if(m.route.lazy||b){s=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}let l=r&&n?(h,m)=>{var w,g;n(h,{location:r.location,params:((g=(w=r.matches)==null?void 0:w[0])==null?void 0:g.params)??{},unstable_pattern:ft(r.matches),errorInfo:m})}:void 0;return o.reduceRight((h,m,w)=>{let g,b=!1,L=null,x=null;r&&(g=i&&m.route.id?i[m.route.id]:void 0,L=m.route.errorElement||Lo,s&&(u<0&&w===0?(Tn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,x=null):u===w&&(b=!0,x=m.route.hydrateFallbackElement||null)));let P=t.concat(o.slice(0,w+1)),S=()=>{let $;return g?$=L:b?$=x:m.route.Component?$=y.createElement(m.route.Component,null):m.route.element?$=m.route.element:$=h,y.createElement(To,{match:m,routeContext:{outlet:h,matches:P,isDataRoute:r!=null},children:$})};return r&&(m.route.ErrorBoundary||m.route.errorElement||w===0)?y.createElement(xn,{location:r.location,revalidation:r.revalidation,component:L,error:g,children:S(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:l}):S()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ln(e){let t=y.useContext(Ye);return W(t,nr(e)),t}function _n(e){let t=y.useContext(dt);return W(t,nr(e)),t}function Do(e){let t=y.useContext(Pe);return W(t,nr(e)),t}function ar(e){let t=Do(e),r=t.matches[t.matches.length-1];return W(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Oo(){return ar("useRouteId")}function Ao(){var n;let e=y.useContext(tr),t=_n("useRouteError"),r=ar("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}var Uo=0;function Ti(e){let{router:t,basename:r}=Ln("useBlocker"),n=_n("useBlocker"),[a,o]=y.useState(""),i=y.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:u,nextLocation:l,historyAction:h}=s;return e({currentLocation:{...u,pathname:Ee(u.pathname,r)||u.pathname},nextLocation:{...l,pathname:Ee(l.pathname,r)||l.pathname},historyAction:h})},[r,e]);return y.useEffect(()=>{let s=String(++Uo);return o(s),()=>t.deleteBlocker(s)},[t]),y.useEffect(()=>{a!==""&&t.getBlocker(a,i)},[t,a,i]),a&&n.blockers.has(a)?n.blockers.get(a):Ge}function No(){let{router:e}=Ln("useNavigate"),t=ar("useNavigate"),r=y.useRef(!1);return Pn(()=>{r.current=!0}),y.useCallback(async(a,o={})=>{ae(r.current,Sn),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var Vr={};function Tn(e,t,r){!t&&!Vr[e]&&(Vr[e]=!0,ae(!1,r))}var Kr={};function Gr(e,t){!e&&!Kr[t]&&(Kr[t]=!0,console.warn(t))}var $o="useOptimistic",Jr=Zn[$o],Fo=()=>{};function ko(e){return Jr?Jr(e):[e,Fo]}function jo(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ae(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ae(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ae(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Io=["HydrateFallback","hydrateFallbackElement"],zo=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function Ho({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=po()||n;let[o,i]=y.useState(e.state),[s,u]=ko(o),[l,h]=y.useState(),[m,w]=y.useState({isTransitioning:!1}),[g,b]=y.useState(),[L,x]=y.useState(),[P,S]=y.useState(),$=y.useRef(new Map),Q=y.useCallback((k,{deletedFetchers:I,newErrors:J,flushSync:X,viewTransitionOpts:le})=>{J&&r&&Object.values(J).forEach(ne=>{var ve;return r(ne,{location:k.location,params:((ve=k.matches[0])==null?void 0:ve.params)??{},unstable_pattern:ft(k.matches)})}),k.fetchers.forEach((ne,ve)=>{ne.data!==void 0&&$.current.set(ve,ne.data)}),I.forEach(ne=>$.current.delete(ne)),Gr(X===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let we=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Gr(le==null||we,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!le||!we){t&&X?t(()=>i(k)):n===!1?i(k):y.startTransition(()=>{n===!0&&u(ne=>qr(ne,k)),i(k)});return}if(t&&X){t(()=>{L&&(g==null||g.resolve(),L.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:le.currentLocation,nextLocation:le.nextLocation})});let ne=e.window.document.startViewTransition(()=>{t(()=>i(k))});ne.finished.finally(()=>{t(()=>{b(void 0),x(void 0),h(void 0),w({isTransitioning:!1})})}),t(()=>x(ne));return}L?(g==null||g.resolve(),L.skipTransition(),S({state:k,currentLocation:le.currentLocation,nextLocation:le.nextLocation})):(h(k),w({isTransitioning:!0,flushSync:!1,currentLocation:le.currentLocation,nextLocation:le.nextLocation}))},[e.window,t,L,g,n,u,r]);y.useLayoutEffect(()=>e.subscribe(Q),[e,Q]),y.useEffect(()=>{m.isTransitioning&&!m.flushSync&&b(new zo)},[m]),y.useEffect(()=>{if(g&&l&&e.window){let k=l,I=g.promise,J=e.window.document.startViewTransition(async()=>{n===!1?i(k):y.startTransition(()=>{n===!0&&u(X=>qr(X,k)),i(k)}),await I});J.finished.finally(()=>{b(void 0),x(void 0),h(void 0),w({isTransitioning:!1})}),x(J)}},[l,g,e.window,n,u]),y.useEffect(()=>{g&&l&&s.location.key===l.location.key&&g.resolve()},[g,L,s.location,l]),y.useEffect(()=>{!m.isTransitioning&&P&&(h(P.state),w({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),S(void 0))},[m.isTransitioning,P]);let G=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:k=>e.navigate(k),push:(k,I,J)=>e.navigate(k,{state:I,preventScrollReset:J==null?void 0:J.preventScrollReset}),replace:(k,I,J)=>e.navigate(k,{replace:!0,state:I,preventScrollReset:J==null?void 0:J.preventScrollReset})}),[e]),Z=e.basename||"/",p=y.useMemo(()=>({router:e,navigator:G,static:!1,basename:Z,onError:r}),[e,G,Z,r]);return y.createElement(y.Fragment,null,y.createElement(Ye.Provider,{value:p},y.createElement(dt.Provider,{value:s},y.createElement(bn.Provider,{value:$.current},y.createElement(er.Provider,{value:m},y.createElement(Yo,{basename:Z,location:s.location,navigationType:s.historyAction,navigator:G,unstable_useTransitions:n},y.createElement(Bo,{routes:e.routes,future:e.future,state:s,onError:r})))))),null)}function qr(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var Bo=y.memo(Wo);function Wo({routes:e,future:t,state:r,onError:n}){return Po(e,void 0,r,n,t)}function Mi({to:e,replace:t,state:r,relative:n}){W(Qe(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=y.useContext(be);ae(!a,"<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:o}=y.useContext(Pe),{pathname:i}=Ae(),s=rr(),u=Tt(e,_t(o),i,n==="path"),l=JSON.stringify(u);return y.useEffect(()=>{s(JSON.parse(l),{replace:t,state:r,relative:n})},[s,l,n,t,r]),null}function Di(e){return So(e.context)}function Yo({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){W(!Qe(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:s,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[s,a,o,i]);typeof r=="string"&&(r=ke(r));let{pathname:l="/",search:h="",hash:m="",state:w=null,key:g="default"}=r,b=y.useMemo(()=>{let L=Ee(l,s);return L==null?null:{location:{pathname:L,search:h,hash:m,state:w,key:g},navigationType:n}},[s,l,h,m,w,g,n]);return ae(b!=null,`<Router basename="${s}"> is not able to match the URL "${l}${h}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:y.createElement(be.Provider,{value:u},y.createElement(Mt.Provider,{children:t,value:b}))}var St="get",Pt="application/x-www-form-urlencoded";function Dt(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Vo(e){return Dt(e)&&e.tagName.toLowerCase()==="button"}function Ko(e){return Dt(e)&&e.tagName.toLowerCase()==="form"}function Go(e){return Dt(e)&&e.tagName.toLowerCase()==="input"}function Jo(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qo(e,t){return e.button===0&&(!t||t==="_self")&&!Jo(e)}function Jt(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function Xo(e,t){let r=Jt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}var bt=null;function Qo(){if(bt===null)try{new FormData(document.createElement("form"),0),bt=!1}catch{bt=!0}return bt}var Zo=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wt(e){return e!=null&&!Zo.has(e)?(ae(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function ei(e,t){let r,n,a,o,i;if(Ko(e)){let s=e.getAttribute("action");n=s?Ee(s,t):null,r=e.getAttribute("method")||St,a=Wt(e.getAttribute("enctype"))||Pt,o=new FormData(e)}else if(Vo(e)||Go(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||s.getAttribute("action");if(n=u?Ee(u,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||St,a=Wt(e.getAttribute("formenctype"))||Wt(s.getAttribute("enctype"))||Pt,o=new FormData(s,e),!Qo()){let{name:l,type:h,value:m}=e;if(h==="image"){let w=l?`${l}.`:"";o.append(`${w}x`,"0"),o.append(`${w}y`,"0")}else l&&o.append(l,m)}}else{if(Dt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=St,n=null,a=Pt,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function or(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ti(e,t,r){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname=`_root.${r}`:t&&Ee(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function ri(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ni(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function ai(e,t,r){let n=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let i=await ri(o,r);return i.links?i.links():[]}return[]}));return ui(n.flat(1).filter(ni).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Xr(e,t,r,n,a,o){let i=(u,l)=>r[l]?u.route.id!==r[l].route.id:!0,s=(u,l)=>{var h;return r[l].pathname!==u.pathname||((h=r[l].route.path)==null?void 0:h.endsWith("*"))&&r[l].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,l)=>i(u,l)||s(u,l)):o==="data"?t.filter((u,l)=>{var m;let h=n.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(i(u,l)||s(u,l))return!0;if(u.route.shouldRevalidate){let w=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=r[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function oi(e,t,{includeHydrateFallback:r}={}){return ii(e.map(n=>{let a=t.routes[n.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function ii(e){return[...new Set(e)]}function li(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function ui(e,t){let r=new Set;return new Set(t),e.reduce((n,a)=>{let o=JSON.stringify(li(a));return r.has(o)||(r.add(o),n.push({key:o,link:a})),n},[])}function Mn(){let e=y.useContext(Ye);return or(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function si(){let e=y.useContext(dt);return or(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ir=y.createContext(void 0);ir.displayName="FrameworkContext";function Dn(){let e=y.useContext(ir);return or(e,"You must render this element inside a <HydratedRouter> element"),e}function ci(e,t){let r=y.useContext(ir),[n,a]=y.useState(!1),[o,i]=y.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:l,onMouseLeave:h,onTouchStart:m}=t,w=y.useRef(null);y.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let L=P=>{P.forEach(S=>{i(S.isIntersecting)})},x=new IntersectionObserver(L,{threshold:.5});return w.current&&x.observe(w.current),()=>{x.disconnect()}}},[e]),y.useEffect(()=>{if(n){let L=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(L)}}},[n]);let g=()=>{a(!0)},b=()=>{a(!1),i(!1)};return r?e!=="intent"?[o,w,{}]:[o,w,{onFocus:nt(s,g),onBlur:nt(u,b),onMouseEnter:nt(l,g),onMouseLeave:nt(h,b),onTouchStart:nt(m,g)}]:[!1,w,{}]}function nt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function fi({page:e,...t}){let{router:r}=Mn(),n=y.useMemo(()=>Ne(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?y.createElement(hi,{page:e,matches:n,...t}):null}function di(e){let{manifest:t,routeModules:r}=Dn(),[n,a]=y.useState([]);return y.useEffect(()=>{let o=!1;return ai(e,t,r).then(i=>{o||a(i)}),()=>{o=!0}},[e,t,r]),n}function hi({page:e,matches:t,...r}){let n=Ae(),{manifest:a,routeModules:o}=Dn(),{basename:i}=Mn(),{loaderData:s,matches:u}=si(),l=y.useMemo(()=>Xr(e,t,u,a,n,"data"),[e,t,u,a,n]),h=y.useMemo(()=>Xr(e,t,u,a,n,"assets"),[e,t,u,a,n]),m=y.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,L=!1;if(t.forEach(P=>{var $;let S=a.routes[P.route.id];!S||!S.hasLoader||(!l.some(Q=>Q.route.id===P.route.id)&&P.route.id in s&&(($=o[P.route.id])!=null&&$.shouldRevalidate)||S.hasClientLoader?L=!0:b.add(P.route.id))}),b.size===0)return[];let x=ti(e,i,"data");return L&&b.size>0&&x.searchParams.set("_routes",t.filter(P=>b.has(P.route.id)).map(P=>P.route.id).join(",")),[x.pathname+x.search]},[i,s,n,a,l,t,e,o]),w=y.useMemo(()=>oi(h,a),[h,a]),g=di(h);return y.createElement(y.Fragment,null,m.map(b=>y.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),w.map(b=>y.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),g.map(({key:b,link:L})=>y.createElement("link",{key:b,nonce:r.nonce,...L})))}function mi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var pi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pi&&(window.__reactRouterVersion="7.11.0")}catch{}function Oi(e,t){return Ba({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:oa({window:t==null?void 0:t.window}),hydrationData:yi(),routes:e,mapRouteProperties:jo,hydrationRouteProperties:Io,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function yi(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:vi(e.errors)}),e}function vi(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new ct(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack="",r[n]=o}}else r[n]=a;return r}var On=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,An=y.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:s,target:u,to:l,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:w,...g},b){let{basename:L,unstable_useTransitions:x}=y.useContext(be),P=typeof l=="string"&&On.test(l),S=sn(l,L);l=S.to;let $=Ro(l,{relative:a}),[Q,G,Z]=ci(n,g),p=Ri(l,{replace:i,state:s,target:u,preventScrollReset:h,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:w,unstable_useTransitions:x});function k(J){t&&t(J),J.defaultPrevented||p(J)}let I=y.createElement("a",{...g,...Z,href:S.absoluteURL||$,onClick:S.isExternal||o?t:k,ref:mi(b,G),target:u,"data-discover":!P&&r==="render"?"true":void 0});return Q&&!P?y.createElement(y.Fragment,null,I,y.createElement(fi,{page:$})):I});An.displayName="Link";var gi=y.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:s,children:u,...l},h){let m=ht(i,{relative:l.relative}),w=Ae(),g=y.useContext(dt),{navigator:b,basename:L}=y.useContext(be),x=g!=null&&xi(m)&&s===!0,P=b.encodeLocation?b.encodeLocation(m).pathname:m.pathname,S=w.pathname,$=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(S=S.toLowerCase(),$=$?$.toLowerCase():null,P=P.toLowerCase()),$&&L&&($=Ee($,L)||$);const Q=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let G=S===P||!a&&S.startsWith(P)&&S.charAt(Q)==="/",Z=$!=null&&($===P||!a&&$.startsWith(P)&&$.charAt(P.length)==="/"),p={isActive:G,isPending:Z,isTransitioning:x},k=G?t:void 0,I;typeof n=="function"?I=n(p):I=[n,G?"active":null,Z?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let J=typeof o=="function"?o(p):o;return y.createElement(An,{...l,"aria-current":k,className:I,ref:h,style:J,to:i,viewTransition:s},typeof u=="function"?u(p):u)});gi.displayName="NavLink";var wi=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=St,action:s,onSubmit:u,relative:l,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:w,...g},b)=>{let{unstable_useTransitions:L}=y.useContext(be),x=Si(),P=Pi(s,{relative:l}),S=i.toLowerCase()==="get"?"get":"post",$=typeof s=="string"&&On.test(s),Q=G=>{if(u&&u(G),G.defaultPrevented)return;G.preventDefault();let Z=G.nativeEvent.submitter,p=(Z==null?void 0:Z.getAttribute("formmethod"))||i,k=()=>x(Z||G.currentTarget,{fetcherKey:t,method:p,navigate:r,replace:a,state:o,relative:l,preventScrollReset:h,viewTransition:m,unstable_defaultShouldRevalidate:w});L&&r!==!1?y.startTransition(()=>k()):k()};return y.createElement("form",{ref:b,method:S,action:P,onSubmit:n?u:Q,...g,"data-discover":!$&&e==="render"?"true":void 0})});wi.displayName="Form";function Ei(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Un(e){let t=y.useContext(Ye);return W(t,Ei(e)),t}function Ri(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:s,unstable_useTransitions:u}={}){let l=rr(),h=Ae(),m=ht(e,{relative:o});return y.useCallback(w=>{if(qo(w,t)){w.preventDefault();let g=r!==void 0?r:_e(h)===_e(m),b=()=>l(e,{replace:g,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_defaultShouldRevalidate:s});u?y.startTransition(()=>b()):b()}},[h,l,m,r,n,t,e,a,o,i,s,u])}function Ai(e){ae(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 t=y.useRef(Jt(e)),r=y.useRef(!1),n=Ae(),a=y.useMemo(()=>Xo(n.search,r.current?null:t.current),[n.search]),o=rr(),i=y.useCallback((s,u)=>{const l=Jt(typeof s=="function"?s(new URLSearchParams(a)):s);r.current=!0,o("?"+l,u)},[o,a]);return[a,i]}var bi=0,Ci=()=>`__${String(++bi)}__`;function Si(){let{router:e}=Un("useSubmit"),{basename:t}=y.useContext(be),r=Oo(),n=e.fetch,a=e.navigate;return y.useCallback(async(o,i={})=>{let{action:s,method:u,encType:l,formData:h,body:m}=ei(o,t);if(i.navigate===!1){let w=i.fetcherKey||Ci();await n(w,r,i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:m,formMethod:i.method||u,formEncType:i.encType||l,flushSync:i.flushSync})}else await a(i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:h,body:m,formMethod:i.method||u,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Pi(e,{relative:t}={}){let{basename:r}=y.useContext(be),n=y.useContext(Pe);W(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...ht(e||".",{relative:t})},i=Ae();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),u=s.getAll("index");if(u.some(h=>h==="")){s.delete("index"),u.filter(m=>m).forEach(m=>s.append("index",m));let h=s.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Le([r,o.pathname])),_e(o)}function xi(e,{relative:t}={}){let r=y.useContext(er);W(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Un("useViewTransitionState"),a=ht(e,{relative:t});if(!r.isTransitioning)return!1;let o=Ee(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Ee(r.nextLocation.pathname,n)||r.nextLocation.pathname;return xt(a.pathname,i)!=null||xt(a.pathname,o)!=null}function Ui(e){return y.createElement(Ho,{flushSync:qt.flushSync,...e})}export{Mi as N,Di as O,Qn as R,ra as a,Zn as b,qt as c,Li as d,en as e,ta as f,Zr as g,Ae as h,_i as i,Ai as j,Ti as k,Oi as l,Ui as m,y as r,rr as u};
30
+ //# sourceMappingURL=vendor-react-GrtO722N.js.map