mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
5 lines
42 KiB
JavaScript
5 lines
42 KiB
JavaScript
function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se={exports:{}},R={};var Ce;function tt(){if(Ce)return R;Ce=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),s=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),o=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.iterator;function E(a){return a===null||typeof a!="object"?null:(a=v&&a[v]||a["@@iterator"],typeof a=="function"?a:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,g={};function y(a,p,C){this.props=a,this.context=p,this.refs=g,this.updater=C||_}y.prototype.isReactComponent={},y.prototype.setState=function(a,p){if(typeof a!="object"&&typeof a!="function"&&a!=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,a,p,"setState")},y.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function m(){}m.prototype=y.prototype;function b(a,p,C){this.props=a,this.context=p,this.refs=g,this.updater=C||_}var $=b.prototype=new m;$.constructor=b,x($,y.prototype),$.isPureReactComponent=!0;var N=Array.isArray;function j(){}var S={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function A(a,p,C){var w=C.ref;return{$$typeof:e,type:a,key:p,ref:w!==void 0?w:null,props:C}}function W(a,p){return A(a.type,p,a.props)}function q(a){return typeof a=="object"&&a!==null&&a.$$typeof===e}function Je(a){var p={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(C){return p[C]})}var Re=/\/+/g;function le(a,p){return typeof a=="object"&&a!==null&&a.key!=null?Je(""+a.key):p.toString(36)}function Xe(a){switch(a.status){case"fulfilled":return a.value;case"rejected":throw a.reason;default:switch(typeof a.status=="string"?a.then(j,j):(a.status="pending",a.then(function(p){a.status==="pending"&&(a.status="fulfilled",a.value=p)},function(p){a.status==="pending"&&(a.status="rejected",a.reason=p)})),a.status){case"fulfilled":return a.value;case"rejected":throw a.reason}}throw a}function K(a,p,C,w,P){var T=typeof a;(T==="undefined"||T==="boolean")&&(a=null);var L=!1;if(a===null)L=!0;else switch(T){case"bigint":case"string":case"number":L=!0;break;case"object":switch(a.$$typeof){case e:case t:L=!0;break;case c:return L=a._init,K(L(a._payload),p,C,w,P)}}if(L)return P=P(a),L=w===""?"."+le(a,0):w,N(P)?(C="",L!=null&&(C=L.replace(Re,"$&/")+"/"),K(P,p,C,"",function(et){return et})):P!=null&&(q(P)&&(P=W(P,C+(P.key==null||a&&a.key===P.key?"":(""+P.key).replace(Re,"$&/")+"/")+L)),p.push(P)),1;L=0;var I=w===""?".":w+":";if(N(a))for(var D=0;D<a.length;D++)w=a[D],T=I+le(w,D),L+=K(w,p,C,T,P);else if(D=E(a),typeof D=="function")for(a=D.call(a),D=0;!(w=a.next()).done;)w=w.value,T=I+le(w,D++),L+=K(w,p,C,T,P);else if(T==="object"){if(typeof a.then=="function")return K(Xe(a),p,C,w,P);throw p=String(a),Error("Objects are not valid as a React child (found: "+(p==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":p)+"). If you meant to render a collection of children, use an array instead.")}return L}function te(a,p,C){if(a==null)return a;var w=[],P=0;return K(a,w,"","",function(T){return p.call(C,T,P++)}),w}function Qe(a){if(a._status===-1){var p=a._result;p=p(),p.then(function(C){(a._status===0||a._status===-1)&&(a._status=1,a._result=C)},function(C){(a._status===0||a._status===-1)&&(a._status=2,a._result=C)}),a._status===-1&&(a._status=0,a._result=p)}if(a._status===1)return a._result.default;throw a._result}var we=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ze={map:te,forEach:function(a,p,C){te(a,function(){p.apply(this,arguments)},C)},count:function(a){var p=0;return te(a,function(){p++}),p},toArray:function(a){return te(a,function(p){return p})||[]},only:function(a){if(!q(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};return R.Activity=h,R.Children=Ze,R.Component=y,R.Fragment=r,R.Profiler=i,R.PureComponent=b,R.StrictMode=n,R.Suspense=l,R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,R.__COMPILER_RUNTIME={__proto__:null,c:function(a){return S.H.useMemoCache(a)}},R.cache=function(a){return function(){return a.apply(null,arguments)}},R.cacheSignal=function(){return null},R.cloneElement=function(a,p,C){if(a==null)throw Error("The argument must be a React element, but you passed "+a+".");var w=x({},a.props),P=a.key;if(p!=null)for(T in p.key!==void 0&&(P=""+p.key),p)!Y.call(p,T)||T==="key"||T==="__self"||T==="__source"||T==="ref"&&p.ref===void 0||(w[T]=p[T]);var T=arguments.length-2;if(T===1)w.children=C;else if(1<T){for(var L=Array(T),I=0;I<T;I++)L[I]=arguments[I+2];w.children=L}return A(a.type,P,w)},R.createContext=function(a){return a={$$typeof:s,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null},a.Provider=a,a.Consumer={$$typeof:u,_context:a},a},R.createElement=function(a,p,C){var w,P={},T=null;if(p!=null)for(w in p.key!==void 0&&(T=""+p.key),p)Y.call(p,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(P[w]=p[w]);var L=arguments.length-2;if(L===1)P.children=C;else if(1<L){for(var I=Array(L),D=0;D<L;D++)I[D]=arguments[D+2];P.children=I}if(a&&a.defaultProps)for(w in L=a.defaultProps,L)P[w]===void 0&&(P[w]=L[w]);return A(a,T,P)},R.createRef=function(){return{current:null}},R.forwardRef=function(a){return{$$typeof:d,render:a}},R.isValidElement=q,R.lazy=function(a){return{$$typeof:c,_payload:{_status:-1,_result:a},_init:Qe}},R.memo=function(a,p){return{$$typeof:o,type:a,compare:p===void 0?null:p}},R.startTransition=function(a){var p=S.T,C={};S.T=C;try{var w=a(),P=S.S;P!==null&&P(C,w),typeof w=="object"&&w!==null&&typeof w.then=="function"&&w.then(j,we)}catch(T){we(T)}finally{p!==null&&C.types!==null&&(p.types=C.types),S.T=p}},R.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},R.use=function(a){return S.H.use(a)},R.useActionState=function(a,p,C){return S.H.useActionState(a,p,C)},R.useCallback=function(a,p){return S.H.useCallback(a,p)},R.useContext=function(a){return S.H.useContext(a)},R.useDebugValue=function(){},R.useDeferredValue=function(a,p){return S.H.useDeferredValue(a,p)},R.useEffect=function(a,p){return S.H.useEffect(a,p)},R.useEffectEvent=function(a){return S.H.useEffectEvent(a)},R.useId=function(){return S.H.useId()},R.useImperativeHandle=function(a,p,C){return S.H.useImperativeHandle(a,p,C)},R.useInsertionEffect=function(a,p){return S.H.useInsertionEffect(a,p)},R.useLayoutEffect=function(a,p){return S.H.useLayoutEffect(a,p)},R.useMemo=function(a,p){return S.H.useMemo(a,p)},R.useOptimistic=function(a,p){return S.H.useOptimistic(a,p)},R.useReducer=function(a,p,C){return S.H.useReducer(a,p,C)},R.useRef=function(a){return S.H.useRef(a)},R.useState=function(a){return S.H.useState(a)},R.useSyncExternalStore=function(a,p,C){return S.H.useSyncExternalStore(a,p,C)},R.useTransition=function(){return S.H.useTransition()},R.version="19.2.0",R}var _e;function $e(){return _e||(_e=1,se.exports=tt()),se.exports}var f=$e();const br=ke(f);var ce={exports:{}},k={};var xe;function rt(){if(xe)return k;xe=1;var e=$e();function t(l){var o="https://react.dev/errors/"+l;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+l+"; visit "+o+" 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},i=Symbol.for("react.portal");function u(l,o,c){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:o,implementation:c}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(l,o){if(l==="font")return"";if(typeof o=="string")return o==="use-credentials"?o:""}return k.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,k.createPortal=function(l,o){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)throw Error(t(299));return u(l,o,null,c)},k.flushSync=function(l){var o=s.T,c=n.p;try{if(s.T=null,n.p=2,l)return l()}finally{s.T=o,n.p=c,n.d.f()}},k.preconnect=function(l,o){typeof l=="string"&&(o?(o=o.crossOrigin,o=typeof o=="string"?o==="use-credentials"?o:"":void 0):o=null,n.d.C(l,o))},k.prefetchDNS=function(l){typeof l=="string"&&n.d.D(l)},k.preinit=function(l,o){if(typeof l=="string"&&o&&typeof o.as=="string"){var c=o.as,h=d(c,o.crossOrigin),v=typeof o.integrity=="string"?o.integrity:void 0,E=typeof o.fetchPriority=="string"?o.fetchPriority:void 0;c==="style"?n.d.S(l,typeof o.precedence=="string"?o.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:E}):c==="script"&&n.d.X(l,{crossOrigin:h,integrity:v,fetchPriority:E,nonce:typeof o.nonce=="string"?o.nonce:void 0})}},k.preinitModule=function(l,o){if(typeof l=="string")if(typeof o=="object"&&o!==null){if(o.as==null||o.as==="script"){var c=d(o.as,o.crossOrigin);n.d.M(l,{crossOrigin:c,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0})}}else o==null&&n.d.M(l)},k.preload=function(l,o){if(typeof l=="string"&&typeof o=="object"&&o!==null&&typeof o.as=="string"){var c=o.as,h=d(c,o.crossOrigin);n.d.L(l,c,{crossOrigin:h,integrity:typeof o.integrity=="string"?o.integrity:void 0,nonce:typeof o.nonce=="string"?o.nonce:void 0,type:typeof o.type=="string"?o.type:void 0,fetchPriority:typeof o.fetchPriority=="string"?o.fetchPriority:void 0,referrerPolicy:typeof o.referrerPolicy=="string"?o.referrerPolicy:void 0,imageSrcSet:typeof o.imageSrcSet=="string"?o.imageSrcSet:void 0,imageSizes:typeof o.imageSizes=="string"?o.imageSizes:void 0,media:typeof o.media=="string"?o.media:void 0})}},k.preloadModule=function(l,o){if(typeof l=="string")if(o){var c=d(o.as,o.crossOrigin);n.d.m(l,{as:typeof o.as=="string"&&o.as!=="script"?o.as:void 0,crossOrigin:c,integrity:typeof o.integrity=="string"?o.integrity:void 0})}else n.d.m(l)},k.requestFormReset=function(l){n.d.r(l)},k.unstable_batchedUpdates=function(l,o){return l(o)},k.useFormState=function(l,o,c){return s.H.useFormState(l,o,c)},k.useFormStatus=function(){return s.H.useHostTransitionStatus()},k.version="19.2.0",k}var Se;function nt(){if(Se)return ce.exports;Se=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(),ce.exports=rt(),ce.exports}var Pe="popstate";function ot(e={}){function t(n,i){let{pathname:u,search:s,hash:d}=n.location;return pe("",{pathname:u,search:s,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:X(i)}return it(t,r,null,e)}function O(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function M(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function at(){return Math.random().toString(36).substring(2,10)}function be(e,t){return{usr:e.state,key:e.key,idx:t}}function pe(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||n||at()}}function X({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 V(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 it(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:u=!1}=n,s=i.history,d="POP",l=null,o=c();o==null&&(o=0,s.replaceState({...s.state,idx:o},""));function c(){return(s.state||{idx:null}).idx}function h(){d="POP";let g=c(),y=g==null?null:g-o;o=g,l&&l({action:d,location:x.location,delta:y})}function v(g,y){d="PUSH";let m=pe(x.location,g,y);o=c()+1;let b=be(m,o),$=x.createHref(m);try{s.pushState(b,"",$)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign($)}u&&l&&l({action:d,location:x.location,delta:1})}function E(g,y){d="REPLACE";let m=pe(x.location,g,y);o=c();let b=be(m,o),$=x.createHref(m);s.replaceState(b,"",$),u&&l&&l({action:d,location:x.location,delta:0})}function _(g){return ut(g)}let x={get action(){return d},get location(){return e(i,s)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Pe,h),l=g,()=>{i.removeEventListener(Pe,h),l=null}},createHref(g){return t(i,g)},createURL:_,encodeLocation(g){let y=_(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:v,replace:E,go(g){return s.go(g)}};return x}function ut(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),O(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:X(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function Ae(e,t,r="/"){return lt(e,t,r,!1)}function lt(e,t,r,n){let i=typeof t=="string"?V(t):t,u=U(i.pathname||"/",r);if(u==null)return null;let s=Ne(e);st(s);let d=null;for(let l=0;d==null&&l<s.length;++l){let o=Rt(u);d=vt(s[l],o,n)}return d}function Ne(e,t=[],r=[],n="",i=!1){let u=(s,d,l=i,o)=>{let c={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:d,route:s};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(n)&&l)return;O(c.relativePath.startsWith(n),`Absolute route path "${c.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(n.length)}let h=F([n,c.relativePath]),v=r.concat(c);s.children&&s.children.length>0&&(O(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Ne(s.children,t,v,h,l)),!(s.path==null&&!s.index)&&t.push({path:h,score:yt(h,s.index),routesMeta:v})};return e.forEach((s,d)=>{if(s.path===""||!s.path?.includes("?"))u(s,d);else for(let l of De(s.path))u(s,d,!0,l)}),t}function De(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),u=r.replace(/\?$/,"");if(n.length===0)return i?[u,""]:[u];let s=De(n.join("/")),d=[];return d.push(...s.map(l=>l===""?u:[u,l].join("/"))),i&&d.push(...s),d.map(l=>e.startsWith("/")&&l===""?"/":l)}function st(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:gt(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var ct=/^:[\w-]+$/,ft=3,dt=2,pt=1,ht=10,mt=-2,Te=e=>e==="*";function yt(e,t){let r=e.split("/"),n=r.length;return r.some(Te)&&(n+=mt),t&&(n+=dt),r.filter(i=>!Te(i)).reduce((i,u)=>i+(ct.test(u)?ft:u===""?pt:ht),n)}function gt(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function vt(e,t,r=!1){let{routesMeta:n}=e,i={},u="/",s=[];for(let d=0;d<n.length;++d){let l=n[d],o=d===n.length-1,c=u==="/"?t:t.slice(u.length)||"/",h=ae({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},c),v=l.route;if(!h&&o&&r&&!n[n.length-1].route.index&&(h=ae({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!h)return null;Object.assign(i,h.params),s.push({params:i,pathname:F([u,h.pathname]),pathnameBase:xt(F([u,h.pathnameBase])),route:v}),h.pathnameBase!=="/"&&(u=F([u,h.pathnameBase]))}return s}function ae(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Et(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let u=i[0],s=u.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:n.reduce((o,{paramName:c,isOptional:h},v)=>{if(c==="*"){let _=d[v]||"";s=u.slice(0,u.length-_.length).replace(/(.)\/+$/,"$1")}const E=d[v];return h&&!E?o[c]=void 0:o[c]=(E||"").replace(/%2F/g,"/"),o},{}),pathname:u,pathnameBase:s,pattern:e}}function Et(e,t=!1,r=!0){M(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,d,l)=>(n.push({paramName:d,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function Rt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return M(!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 U(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 wt(e,t="/"){let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?V(e):e;return{pathname:r?r.startsWith("/")?r:Ct(r,t):t,search:St(n),hash:Pt(i)}}function Ct(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function fe(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 _t(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ie(e){let t=_t(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function Me(e,t,r,n=!1){let i;typeof e=="string"?i=V(e):(i={...e},O(!i.pathname||!i.pathname.includes("?"),fe("?","pathname","search",i)),O(!i.pathname||!i.pathname.includes("#"),fe("#","pathname","hash",i)),O(!i.search||!i.search.includes("#"),fe("#","search","hash",i)));let u=e===""||i.pathname==="",s=u?"/":i.pathname,d;if(s==null)d=r;else{let h=t.length-1;if(!n&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),h-=1;i.pathname=v.join("/")}d=h>=0?t[h]:"/"}let l=wt(i,d),o=s&&s!=="/"&&s.endsWith("/"),c=(u||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(o||c)&&(l.pathname+="/"),l}var F=e=>e.join("/").replace(/\/\/+/g,"/"),xt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),St=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function bt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var He=["POST","PUT","PATCH","DELETE"];new Set(He);var Tt=["GET",...He];new Set(Tt);var G=f.createContext(null);G.displayName="DataRouter";var ie=f.createContext(null);ie.displayName="DataRouterState";f.createContext(!1);var Fe=f.createContext({isTransitioning:!1});Fe.displayName="ViewTransition";var Lt=f.createContext(new Map);Lt.displayName="Fetchers";var Ot=f.createContext(null);Ot.displayName="Await";var H=f.createContext(null);H.displayName="Navigation";var Q=f.createContext(null);Q.displayName="Location";var B=f.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName="Route";var me=f.createContext(null);me.displayName="RouteError";function kt(e,{relative:t}={}){O(Z(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=f.useContext(H),{hash:i,pathname:u,search:s}=ee(e,{relative:t}),d=u;return r!=="/"&&(d=u==="/"?r:F([r,u])),n.createHref({pathname:d,search:s,hash:i})}function Z(){return f.useContext(Q)!=null}function z(){return O(Z(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Q).location}var Ue="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Be(e){f.useContext(H).static||f.useLayoutEffect(e)}function $t(){let{isDataRoute:e}=f.useContext(B);return e?zt():At()}function At(){O(Z(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(G),{basename:t,navigator:r}=f.useContext(H),{matches:n}=f.useContext(B),{pathname:i}=z(),u=JSON.stringify(Ie(n)),s=f.useRef(!1);return Be(()=>{s.current=!0}),f.useCallback((l,o={})=>{if(M(s.current,Ue),!s.current)return;if(typeof l=="number"){r.go(l);return}let c=Me(l,JSON.parse(u),i,o.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:F([t,c.pathname])),(o.replace?r.replace:r.push)(c,o.state,o)},[t,r,u,i,e])}f.createContext(null);function ee(e,{relative:t}={}){let{matches:r}=f.useContext(B),{pathname:n}=z(),i=JSON.stringify(Ie(r));return f.useMemo(()=>Me(e,JSON.parse(i),n,t==="path"),[e,i,n,t])}function Nt(e,t){return je(e,t)}function je(e,t,r,n,i){O(Z(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=f.useContext(H),{matches:s}=f.useContext(B),d=s[s.length-1],l=d?d.params:{},o=d?d.pathname:"/",c=d?d.pathnameBase:"/",h=d&&d.route;{let m=h&&h.path||"";We(o,!h||m.endsWith("*")||m.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${o}" (under <Route path="${m}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
|
|
Please change the parent <Route path="${m}"> to <Route path="${m==="/"?"*":`${m}/*`}">.`)}let v=z(),E;if(t){let m=typeof t=="string"?V(t):t;O(c==="/"||m.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${m.pathname}" was given in the \`location\` prop.`),E=m}else E=v;let _=E.pathname||"/",x=_;if(c!=="/"){let m=c.replace(/^\//,"").split("/");x="/"+_.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=Ae(e,{pathname:x});M(h||g!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),M(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.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.`);let y=Ft(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},l,m.params),pathname:F([c,u.encodeLocation?u.encodeLocation(m.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?c:F([c,u.encodeLocation?u.encodeLocation(m.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:m.pathnameBase])})),s,r,n,i);return t&&y?f.createElement(Q.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...E},navigationType:"POP"}},y):y}function Dt(){let e=Yt(),t=bt(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)",i={padding:"0.5rem",backgroundColor:n},u={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:u},"ErrorBoundary")," or"," ",f.createElement("code",{style:u},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:i},r):null,s)}var It=f.createElement(Dt,null),Mt=class extends f.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.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?f.createElement(B.Provider,{value:this.props.routeContext},f.createElement(me.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ht({routeContext:e,match:t,children:r}){let n=f.useContext(G);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(B.Provider,{value:e},r)}function Ft(e,t=[],r=null,n=null,i=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 u=e,s=r?.errors;if(s!=null){let o=u.findIndex(c=>c.route.id&&s?.[c.route.id]!==void 0);O(o>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),u=u.slice(0,Math.min(u.length,o+1))}let d=!1,l=-1;if(r)for(let o=0;o<u.length;o++){let c=u[o];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=o),c.route.id){let{loaderData:h,errors:v}=r,E=c.route.loader&&!h.hasOwnProperty(c.route.id)&&(!v||v[c.route.id]===void 0);if(c.route.lazy||E){d=!0,l>=0?u=u.slice(0,l+1):u=[u[0]];break}}}return u.reduceRight((o,c,h)=>{let v,E=!1,_=null,x=null;r&&(v=s&&c.route.id?s[c.route.id]:void 0,_=c.route.errorElement||It,d&&(l<0&&h===0?(We("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,x=null):l===h&&(E=!0,x=c.route.hydrateFallbackElement||null)));let g=t.concat(u.slice(0,h+1)),y=()=>{let m;return v?m=_:E?m=x:c.route.Component?m=f.createElement(c.route.Component,null):c.route.element?m=c.route.element:m=o,f.createElement(Ht,{match:c,routeContext:{outlet:o,matches:g,isDataRoute:r!=null},children:m})};return r&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?f.createElement(Mt,{location:r.location,revalidation:r.revalidation,component:_,error:v,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0},unstable_onError:n}):y()},null)}function ye(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ut(e){let t=f.useContext(G);return O(t,ye(e)),t}function Bt(e){let t=f.useContext(ie);return O(t,ye(e)),t}function jt(e){let t=f.useContext(B);return O(t,ye(e)),t}function ge(e){let t=jt(e),r=t.matches[t.matches.length-1];return O(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Wt(){return ge("useRouteId")}function Yt(){let e=f.useContext(me),t=Bt("useRouteError"),r=ge("useRouteError");return e!==void 0?e:t.errors?.[r]}function zt(){let{router:e}=Ut("useNavigate"),t=ge("useNavigate"),r=f.useRef(!1);return Be(()=>{r.current=!0}),f.useCallback(async(i,u={})=>{M(r.current,Ue),r.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...u}))},[e,t])}var Le={};function We(e,t,r){!t&&!Le[e]&&(Le[e]=!0,M(!1,r))}f.memo(qt);function qt({routes:e,future:t,state:r,unstable_onError:n}){return je(e,void 0,r,n,t)}function Kt(e){O(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Vt({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:u=!1}){O(!Z(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:s,navigator:i,static:u,future:{}}),[s,i,u]);typeof r=="string"&&(r=V(r));let{pathname:l="/",search:o="",hash:c="",state:h=null,key:v="default"}=r,E=f.useMemo(()=>{let _=U(l,s);return _==null?null:{location:{pathname:_,search:o,hash:c,state:h,key:v},navigationType:n}},[s,l,o,c,h,v,n]);return M(E!=null,`<Router basename="${s}"> is not able to match the URL "${l}${o}${c}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:f.createElement(H.Provider,{value:d},f.createElement(Q.Provider,{children:t,value:E}))}function Tr({children:e,location:t}){return Nt(he(e),t)}function he(e,t=[]){let r=[];return f.Children.forEach(e,(n,i)=>{if(!f.isValidElement(n))return;let u=[...t,i];if(n.type===f.Fragment){r.push.apply(r,he(n.props.children,u));return}O(n.type===Kt,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),O(!n.props.index||!n.props.children,"An index route cannot have child routes.");let s={id:n.props.id||u.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=he(n.props.children,u)),r.push(s)}),r}var ne="get",oe="application/x-www-form-urlencoded";function ue(e){return e!=null&&typeof e.tagName=="string"}function Gt(e){return ue(e)&&e.tagName.toLowerCase()==="button"}function Jt(e){return ue(e)&&e.tagName.toLowerCase()==="form"}function Xt(e){return ue(e)&&e.tagName.toLowerCase()==="input"}function Qt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zt(e,t){return e.button===0&&(!t||t==="_self")&&!Qt(e)}var re=null;function er(){if(re===null)try{new FormData(document.createElement("form"),0),re=!1}catch{re=!0}return re}var tr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function de(e){return e!=null&&!tr.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oe}"`),null):e}function rr(e,t){let r,n,i,u,s;if(Jt(e)){let d=e.getAttribute("action");n=d?U(d,t):null,r=e.getAttribute("method")||ne,i=de(e.getAttribute("enctype"))||oe,u=new FormData(e)}else if(Gt(e)||Xt(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||d.getAttribute("action");if(n=l?U(l,t):null,r=e.getAttribute("formmethod")||d.getAttribute("method")||ne,i=de(e.getAttribute("formenctype"))||de(d.getAttribute("enctype"))||oe,u=new FormData(d,e),!er()){let{name:o,type:c,value:h}=e;if(c==="image"){let v=o?`${o}.`:"";u.append(`${v}x`,"0"),u.append(`${v}y`,"0")}else o&&u.append(o,h)}}else{if(ue(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ne,n=null,i=oe,s=e}return u&&i==="text/plain"&&(s=u,u=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:u,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nr(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&&U(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:n.pathname=`${n.pathname.replace(/\/$/,"")}.${r}`,n}async function or(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 ar(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 ir(e,t,r){let n=await Promise.all(e.map(async i=>{let u=t.routes[i.route.id];if(u){let s=await or(u,r);return s.links?s.links():[]}return[]}));return cr(n.flat(1).filter(ar).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Oe(e,t,r,n,i,u){let s=(l,o)=>r[o]?l.route.id!==r[o].route.id:!0,d=(l,o)=>r[o].pathname!==l.pathname||r[o].route.path?.endsWith("*")&&r[o].params["*"]!==l.params["*"];return u==="assets"?t.filter((l,o)=>s(l,o)||d(l,o)):u==="data"?t.filter((l,o)=>{let c=n.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(s(l,o)||d(l,o))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function ur(e,t,{includeHydrateFallback:r}={}){return lr(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let u=[i.module];return i.clientActionModule&&(u=u.concat(i.clientActionModule)),i.clientLoaderModule&&(u=u.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(u=u.concat(i.hydrateFallbackModule)),i.imports&&(u=u.concat(i.imports)),u}).flat(1))}function lr(e){return[...new Set(e)]}function sr(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function cr(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let u=JSON.stringify(sr(i));return r.has(u)||(r.add(u),n.push({key:u,link:i})),n},[])}function Ye(){let e=f.useContext(G);return ve(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function fr(){let e=f.useContext(ie);return ve(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ee=f.createContext(void 0);Ee.displayName="FrameworkContext";function ze(){let e=f.useContext(Ee);return ve(e,"You must render this element inside a <HydratedRouter> element"),e}function dr(e,t){let r=f.useContext(Ee),[n,i]=f.useState(!1),[u,s]=f.useState(!1),{onFocus:d,onBlur:l,onMouseEnter:o,onMouseLeave:c,onTouchStart:h}=t,v=f.useRef(null);f.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let x=y=>{y.forEach(m=>{s(m.isIntersecting)})},g=new IntersectionObserver(x,{threshold:.5});return v.current&&g.observe(v.current),()=>{g.disconnect()}}},[e]),f.useEffect(()=>{if(n){let x=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(x)}}},[n]);let E=()=>{i(!0)},_=()=>{i(!1),s(!1)};return r?e!=="intent"?[u,v,{}]:[u,v,{onFocus:J(d,E),onBlur:J(l,_),onMouseEnter:J(o,E),onMouseLeave:J(c,_),onTouchStart:J(h,E)}]:[!1,v,{}]}function J(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function pr({page:e,...t}){let{router:r}=Ye(),n=f.useMemo(()=>Ae(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?f.createElement(mr,{page:e,matches:n,...t}):null}function hr(e){let{manifest:t,routeModules:r}=ze(),[n,i]=f.useState([]);return f.useEffect(()=>{let u=!1;return ir(e,t,r).then(s=>{u||i(s)}),()=>{u=!0}},[e,t,r]),n}function mr({page:e,matches:t,...r}){let n=z(),{manifest:i,routeModules:u}=ze(),{basename:s}=Ye(),{loaderData:d,matches:l}=fr(),o=f.useMemo(()=>Oe(e,t,l,i,n,"data"),[e,t,l,i,n]),c=f.useMemo(()=>Oe(e,t,l,i,n,"assets"),[e,t,l,i,n]),h=f.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let _=new Set,x=!1;if(t.forEach(y=>{let m=i.routes[y.route.id];!m||!m.hasLoader||(!o.some(b=>b.route.id===y.route.id)&&y.route.id in d&&u[y.route.id]?.shouldRevalidate||m.hasClientLoader?x=!0:_.add(y.route.id))}),_.size===0)return[];let g=nr(e,s,"data");return x&&_.size>0&&g.searchParams.set("_routes",t.filter(y=>_.has(y.route.id)).map(y=>y.route.id).join(",")),[g.pathname+g.search]},[s,d,n,i,o,t,e,u]),v=f.useMemo(()=>ur(c,i),[c,i]),E=hr(c);return f.createElement(f.Fragment,null,h.map(_=>f.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...r})),v.map(_=>f.createElement("link",{key:_,rel:"modulepreload",href:_,...r})),E.map(({key:_,link:x})=>f.createElement("link",{key:_,nonce:r.nonce,...x})))}function yr(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qe&&(window.__reactRouterVersion="7.9.5")}catch{}function Lr({basename:e,children:t,window:r}){let n=f.useRef();n.current==null&&(n.current=ot({window:r,v5Compat:!0}));let i=n.current,[u,s]=f.useState({action:i.action,location:i.location}),d=f.useCallback(l=>{f.startTransition(()=>s(l))},[s]);return f.useLayoutEffect(()=>i.listen(d),[i,d]),f.createElement(Vt,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:i})}var Ke=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ve=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:u,replace:s,state:d,target:l,to:o,preventScrollReset:c,viewTransition:h,...v},E){let{basename:_}=f.useContext(H),x=typeof o=="string"&&Ke.test(o),g,y=!1;if(typeof o=="string"&&x&&(g=o,qe))try{let A=new URL(window.location.href),W=o.startsWith("//")?new URL(A.protocol+o):new URL(o),q=U(W.pathname,_);W.origin===A.origin&&q!=null?o=q+W.search+W.hash:y=!0}catch{M(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let m=kt(o,{relative:i}),[b,$,N]=dr(n,v),j=Rr(o,{replace:s,state:d,target:l,preventScrollReset:c,relative:i,viewTransition:h});function S(A){t&&t(A),A.defaultPrevented||j(A)}let Y=f.createElement("a",{...v,...N,href:g||m,onClick:y||u?t:S,ref:yr(E,$),target:l,"data-discover":!x&&r==="render"?"true":void 0});return b&&!x?f.createElement(f.Fragment,null,Y,f.createElement(pr,{page:m})):Y});Ve.displayName="Link";var gr=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:u,to:s,viewTransition:d,children:l,...o},c){let h=ee(s,{relative:o.relative}),v=z(),E=f.useContext(ie),{navigator:_,basename:x}=f.useContext(H),g=E!=null&&Sr(h)&&d===!0,y=_.encodeLocation?_.encodeLocation(h).pathname:h.pathname,m=v.pathname,b=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(m=m.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&x&&(b=U(b,x)||b);const $=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let N=m===y||!i&&m.startsWith(y)&&m.charAt($)==="/",j=b!=null&&(b===y||!i&&b.startsWith(y)&&b.charAt(y.length)==="/"),S={isActive:N,isPending:j,isTransitioning:g},Y=N?t:void 0,A;typeof n=="function"?A=n(S):A=[n,N?"active":null,j?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let W=typeof u=="function"?u(S):u;return f.createElement(Ve,{...o,"aria-current":Y,className:A,ref:c,style:W,to:s,viewTransition:d},typeof l=="function"?l(S):l)});gr.displayName="NavLink";var vr=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:u,method:s=ne,action:d,onSubmit:l,relative:o,preventScrollReset:c,viewTransition:h,...v},E)=>{let _=_r(),x=xr(d,{relative:o}),g=s.toLowerCase()==="get"?"get":"post",y=typeof d=="string"&&Ke.test(d),m=b=>{if(l&&l(b),b.defaultPrevented)return;b.preventDefault();let $=b.nativeEvent.submitter,N=$?.getAttribute("formmethod")||s;_($||b.currentTarget,{fetcherKey:t,method:N,navigate:r,replace:i,state:u,relative:o,preventScrollReset:c,viewTransition:h})};return f.createElement("form",{ref:E,method:g,action:x,onSubmit:n?l:m,...v,"data-discover":!y&&e==="render"?"true":void 0})});vr.displayName="Form";function Er(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ge(e){let t=f.useContext(G);return O(t,Er(e)),t}function Rr(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:u,viewTransition:s}={}){let d=$t(),l=z(),o=ee(e,{relative:u});return f.useCallback(c=>{if(Zt(c,t)){c.preventDefault();let h=r!==void 0?r:X(l)===X(o);d(e,{replace:h,state:n,preventScrollReset:i,relative:u,viewTransition:s})}},[l,d,o,r,n,t,e,i,u,s])}var wr=0,Cr=()=>`__${String(++wr)}__`;function _r(){let{router:e}=Ge("useSubmit"),{basename:t}=f.useContext(H),r=Wt();return f.useCallback(async(n,i={})=>{let{action:u,method:s,encType:d,formData:l,body:o}=rr(n,t);if(i.navigate===!1){let c=i.fetcherKey||Cr();await e.fetch(c,r,i.action||u,{preventScrollReset:i.preventScrollReset,formData:l,body:o,formMethod:i.method||s,formEncType:i.encType||d,flushSync:i.flushSync})}else await e.navigate(i.action||u,{preventScrollReset:i.preventScrollReset,formData:l,body:o,formMethod:i.method||s,formEncType:i.encType||d,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,r])}function xr(e,{relative:t}={}){let{basename:r}=f.useContext(H),n=f.useContext(B);O(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...ee(e||".",{relative:t})},s=z();if(e==null){u.search=s.search;let d=new URLSearchParams(u.search),l=d.getAll("index");if(l.some(c=>c==="")){d.delete("index"),l.filter(h=>h).forEach(h=>d.append("index",h));let c=d.toString();u.search=c?`?${c}`:""}}return(!e||e===".")&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:F([r,u.pathname])),X(u)}function Sr(e,{relative:t}={}){let r=f.useContext(Fe);O(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ge("useViewTransitionState"),i=ee(e,{relative:t});if(!r.isTransitioning)return!1;let u=U(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=U(r.nextLocation.pathname,n)||r.nextLocation.pathname;return ae(i.pathname,s)!=null||ae(i.pathname,u)!=null}var Pr=nt();const Or=ke(Pr);export{Lr as B,br as R,nt as a,f as b,Or as c,z as d,Tr as e,Kt as f,$e as r,$t as u};
|
|
//# sourceMappingURL=react-BZmgNp9X.js.map
|