@dhzh/foundry 0.0.1 → 0.0.3-beta.1

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.
@@ -1,2 +0,0 @@
1
- /*! LICENSE: lib-router.8e2d3d5a96.js.LICENSE.txt */
2
- "use strict";(self.rspackChunk_dhzh_foundry_web=self.rspackChunk_dhzh_foundry_web||[]).push([[535],{990(e,t,n){var r=n(172),a=n(761),o=n(95),i=n(936),l=n(405);function u(e){return(0,i.P1)(e.context)}function s(e){(0,r.V1)(!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 c({basename:e="/",children:t=null,location:n,navigationType:u="POP",navigator:s,static:h=!1,useTransitions:d}){(0,r.V1)(!(0,i.Ri)(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=e.replace(/^\/*/,"/"),m=l.useMemo(()=>({basename:p,navigator:s,static:h,useTransitions:d,future:{}}),[p,s,h,d]);"string"==typeof n&&(n=(0,r.Rr)(n));let{pathname:f="/",search:g="",hash:y="",state:v=null,key:w="default",mask:b}=n,x=l.useMemo(()=>{let e=(0,a.pb)(f,p);return null==e?null:{location:{pathname:e,search:g,hash:y,state:v,key:w,mask:b},navigationType:u}},[p,f,g,y,v,w,u,b]);return((0,r.$e)(null!=x,`<Router basename="${p}"> is not able to match the URL "${f}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),null==x)?null:l.createElement(o._3.Provider,{value:m},l.createElement(o.di.Provider,{children:t,value:x}))}function h({children:e,location:t}){return(0,i.Ye)(function e(t,n=[]){let a=[];return l.Children.forEach(t,(t,o)=>{if(!l.isValidElement(t))return;let i=[...n,o];if(t.type===l.Fragment)return void a.push.apply(a,e(t.props.children,i));(0,r.V1)(t.type===s,`[${"string"==typeof t.type?t.type:t.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let u=t.props;(0,r.V1)(!u.index||!u.children,"An index route cannot have child routes.");let c={id:u.id||i.join("-"),caseSensitive:u.caseSensitive,element:u.element,Component:u.Component,index:u.index,path:u.path,middleware:u.middleware,loader:u.loader,action:u.action,hydrateFallbackElement:u.hydrateFallbackElement,HydrateFallback:u.HydrateFallback,errorElement:u.errorElement,ErrorBoundary:u.ErrorBoundary,shouldRevalidate:u.shouldRevalidate,handle:u.handle,lazy:u.lazy};u.children&&(c.children=e(u.children,i)),a.push(c)}),a}(e),t)}l.memo(function({routes:e,manifest:t,future:n,state:r,isStatic:a,onError:o}){return(0,i.uG)(e,void 0,{manifest:t,state:r,isStatic:a,onError:o,future:n})}),l.Component,n.d(t,{BV:()=>h,Ix:()=>c,qh:()=>s,sv:()=>u})},95(e,t,n){var r=n(405);let a=r.createContext(null);a.displayName="DataRouter";let o=r.createContext(null);o.displayName="DataRouterState";let i=r.createContext(!1);function l(){return r.useContext(i)}let u=r.createContext({isTransitioning:!1});u.displayName="ViewTransition",r.createContext(new Map).displayName="Fetchers";let s=r.createContext(null);s.displayName="Await";let c=r.createContext(null);c.displayName="Navigation";let h=r.createContext(null);h.displayName="Location";let d=r.createContext({outlet:null,matches:[],isDataRoute:!1});d.displayName="Route";let p=r.createContext(null);p.displayName="RouteError",n.d(t,{OA:()=>l},{Bu:i,KZ:u,Pl:d,_3:c,ay:o,di:h,hf:a,m4:s,xN:p})},527(e,t,n){n.d(t,{I9:()=>k,N_:()=>L});var r=n(9),a=n(172),o=n(761),i=n(95),l=n(936),u=n(990);let s="application/x-www-form-urlencoded";function c(e){return"u">typeof HTMLElement&&e instanceof HTMLElement}let h=null,d=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function p(e){return null==e||d.has(e)?e:((0,a.$e)(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${s}"`),null)}function m(e,t){if(!1===e||null==e)throw Error(t)}async function f(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function g(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function y(e,t,n){var r;let a,o;return r=(await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await f(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(g).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),r.reduce((e,t)=>{!1;let n=JSON.stringify(function(e){let t={};for(let n of Object.keys(e).sort())t[n]=e[n];return t}(t));return a.has(n)||(a.add(n),e.push({key:n,link:t})),e},[])}function v(e,t,n,r,a,o){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,l=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let u=r.routes[t.route.id];if(!u||!u.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}var w=n(405);function b(e,t){let n="string"==typeof e?new URL(e,"u"<typeof window?"server://singlefetch/":window.location.origin):e;return n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}Symbol("SingleFetchRedirect");let x=w.createContext(void 0);function R(){let e=w.useContext(x);return m(e,"You must render this element inside a <HydratedRouter> element"),e}function E(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function C({page:e,...t}){let n,r=(0,i.OA)(),{nonce:a}=R(),{router:l}=(m(n=w.useContext(i.hf),"You must render this element inside a <DataRouterContext.Provider> element"),n),u=w.useMemo(()=>(0,o.ue)(l.routes,e,l.basename),[l.routes,e,l.basename]);return u?(null==t.nonce&&a&&(t={...t,nonce:a}),r)?w.createElement(S,{page:e,matches:u,...t}):w.createElement($,{page:e,matches:u,...t}):null}function S({page:e,matches:t,...n}){let r=(0,l.zy)(),a=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=b(e,"rsc"),a=!1,o=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set("_routes",o.join(",")),[n.pathname+n.search]},[e,r,t]);return w.createElement(w.Fragment,null,a.map(e=>w.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})))}function $({page:e,matches:t,...n}){let r,a=(0,l.zy)(),{manifest:o,routeModules:u}=R(),{loaderData:s,matches:c}=(m(r=w.useContext(i.ay),"You must render this element inside a <DataRouterStateContext.Provider> element"),r),h=w.useMemo(()=>v(e,t,c,o,a,"data"),[e,t,c,o,a]),d=w.useMemo(()=>v(e,t,c,o,a,"assets"),[e,t,c,o,a]),p=w.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!h.some(t=>t.route.id===e.route.id)&&e.route.id in s&&u[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),0===n.size)return[];let i=b(e,"data");return r&&n.size>0&&i.searchParams.set("_routes",t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(",")),[i.pathname+i.search]},[s,a,o,h,t,e,u]),f=w.useMemo(()=>(function(e,t,{includeHydrateFallback:n}={}){return[...new Set(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))]})(d,o),[d,o]),g=function(e){let{manifest:t,routeModules:n}=R(),[r,a]=w.useState([]);return w.useEffect(()=>{let r=!1;return y(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),r}(d);return w.createElement(w.Fragment,null,p.map(e=>w.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})),f.map(e=>w.createElement("link",{key:e,rel:"modulepreload",href:e,...n})),g.map(({key:e,link:t})=>w.createElement("link",{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}x.displayName="FrameworkContext";let P="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{P&&(window.__reactRouterVersion="8.1.0")}catch(e){}function k({basename:e,children:t,useTransitions:n,window:r}){let o=w.useRef(null);null==o.current&&(o.current=(0,a.TM)({window:r,v5Compat:!0}));let i=o.current,[l,s]=w.useState({action:i.action,location:i.location}),c=w.useCallback(e=>{!1===n?s(e):w.startTransition(()=>s(e))},[n]);return w.useLayoutEffect(()=>i.listen(c),[i,c]),w.createElement(u.Ix,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}let L=w.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:u,reloadDocument:s,replace:c,mask:h,state:d,target:p,to:m,preventScrollReset:f,viewTransition:g,defaultShouldRevalidate:y,...v},b){let{basename:R,navigator:S,useTransitions:$}=w.useContext(i._3),P="string"==typeof m&&r.E6.test(m),k=(0,o.X9)(m,R);m=k.to;let L=(0,l.$P)(m,{relative:u}),A=(0,l.zy)(),N=null;if(h){let e=(0,o.Gh)(h,[],A.mask?A.mask.pathname:"/",!0);"/"!==R&&(e.pathname="/"===e.pathname?R:(0,o.HS)([R,e.pathname])),N=S.createHref(e)}let[O,T,_]=function(e,t){let n=w.useContext(x),[r,a]=w.useState(!1),[o,i]=w.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:s,onMouseLeave:c,onTouchStart:h}=t,d=w.useRef(null);w.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return d.current&&e.observe(d.current),()=>{e.disconnect()}}},[e]),w.useEffect(()=>{if(r){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{a(!0)},m=()=>{a(!1),i(!1)};return n?"intent"!==e?[o,d,{}]:[o,d,{onFocus:E(l,p),onBlur:E(u,m),onMouseEnter:E(s,p),onMouseLeave:E(c,m),onTouchStart:E(h,p)}]:[!1,d,{}]}(n,v),M=function(e,{target:t,replace:n,mask:r,state:o,preventScrollReset:i,relative:u,viewTransition:s,defaultShouldRevalidate:c,useTransitions:h}={}){let d=(0,l.Zp)(),p=(0,l.zy)(),m=(0,l.x$)(e,{relative:u});return w.useCallback(l=>{if(0===l.button&&(!t||"_self"===t)&&!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)){l.preventDefault();let t=void 0!==n?n:(0,a.AO)(p)===(0,a.AO)(m),f=()=>d(e,{replace:t,mask:r,state:o,preventScrollReset:i,relative:u,viewTransition:s,defaultShouldRevalidate:c});h?w.startTransition(()=>f()):f()}},[p,d,m,n,r,o,t,e,i,u,s,c,h])}(m,{replace:c,mask:h,state:d,target:p,preventScrollReset:f,relative:u,viewTransition:g,defaultShouldRevalidate:y,useTransitions:$}),F=!(k.isExternal||s),V=w.createElement("a",{...v,..._,href:(F?N:void 0)||k.absoluteURL||L,onClick:F?function(t){e&&e(t),t.defaultPrevented||M(t)}:e,ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(b,T),target:p,"data-discover":P||"render"!==t?void 0:"true"});return O&&!P?w.createElement(w.Fragment,null,V,w.createElement(C,{page:L})):V});L.displayName="Link",w.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:u,to:s,viewTransition:c,children:h,...d},p){let m,f=(0,l.x$)(s,{relative:d.relative}),g=(0,l.zy)(),y=w.useContext(i.ay),{navigator:v,basename:b}=w.useContext(i._3),x=null!=y&&function(e,{relative:t}={}){let n=w.useContext(i.KZ);(0,a.V1)(null!=n,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=A("useViewTransitionState"),u=(0,l.x$)(e,{relative:t});if(!n.isTransitioning)return!1;let s=(0,o.pb)(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=(0,o.pb)(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=(0,o.B6)(u.pathname,c)||null!=(0,o.B6)(u.pathname,s)}(f)&&!0===c,R=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,E=g.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;t||(E=E.toLowerCase(),C=C?C.toLowerCase():null,R=R.toLowerCase()),C&&b&&(C=(0,o.pb)(C,b)||C);let S="/"!==R&&R.endsWith("/")?R.length-1:R.length,$=E===R||!r&&E.startsWith(R)&&"/"===E.charAt(S),P=null!=C&&(C===R||!r&&C.startsWith(R)&&"/"===C.charAt(R.length)),k={isActive:$,isPending:P,isTransitioning:x},N=$?e:void 0;m="function"==typeof n?n(k):[n,$?"active":null,P?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let O="function"==typeof u?u(k):u;return w.createElement(L,{...d,"aria-current":N,className:m,ref:p,style:O,to:s,viewTransition:c},"function"==typeof h?h(k):h)}).displayName="NavLink",w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:u,replace:d,state:m,method:f="get",action:g,onSubmit:y,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:R,...E},C)=>{let{useTransitions:S}=w.useContext(i._3),$=function(){let{router:e}=A("useSubmit"),{basename:t}=w.useContext(i._3),n=(0,l.Gw)(),r=e.fetch,a=e.navigate;return w.useCallback(async(e,i={})=>{let{action:l,method:u,encType:d,formData:m,body:f}=function(e,t){let n,r,a,i,l;if(c(e)&&"form"===e.tagName.toLowerCase()){let l=e.getAttribute("action");r=l?(0,o.pb)(l,t):null,n=e.getAttribute("method")||"get",a=p(e.getAttribute("enctype"))||s,i=new FormData(e)}else if(c(e)&&"button"===e.tagName.toLowerCase()||c(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let l=e.form;if(null==l)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?(0,o.pb)(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||"get",a=p(e.getAttribute("formenctype"))||p(l.getAttribute("enctype"))||s,i=new FormData(l,e),!function(){if(null===h)try{new FormData(document.createElement("form"),0),h=!1}catch(e){h=!0}return h}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else if(c(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else n="get",r=null,a=s,l=e;return i&&"text/plain"===a&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:l}}(e,t);!1===i.navigate?await r(i.fetcherKey||`__${String(++N)}__`,n,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||u,formEncType:i.encType||d,flushSync:i.flushSync}):await a(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,body:f,formMethod:i.method||u,formEncType:i.encType||d,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,a,t,n])}(),P=function(e,{relative:t}={}){let{basename:n}=w.useContext(i._3),r=w.useContext(i.Pl);(0,a.V1)(r,"useFormAction must be used inside a RouteContext");let[u]=r.matches.slice(-1),s={...(0,l.x$)(e||".",{relative:t})},c=(0,l.zy)();if(null==e){s.search=c.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();s.search=n?`?${n}`:""}}return(!e||"."===e)&&u.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(s.pathname="/"===s.pathname?n:(0,o.HS)([n,s.pathname])),(0,a.AO)(s)}(g,{relative:v}),k="get"===f.toLowerCase()?"get":"post",L="string"==typeof g&&r.E6.test(g);return w.createElement("form",{ref:C,method:k,action:P,onSubmit:u?y:e=>{if(y&&y(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,a=r?.getAttribute("formmethod")||f,o=()=>$(r||e.currentTarget,{fetcherKey:t,method:a,navigate:n,replace:d,state:m,relative:v,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:R});S&&!1!==n?w.startTransition(()=>o()):o()},...E,"data-discover":L||"render"!==e?void 0:"true"})}).displayName="Form";function A(e){var t;let n=w.useContext(i.hf);return(0,a.V1)(n,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),n}let N=0},936(e,t,n){n.d(t,{$P:()=>s,Ri:()=>c,zy:()=>h,FE:()=>L,Zp:()=>p,cq:()=>k,P1:()=>f,x$:()=>g,Gw:()=>P,Ye:()=>y,uG:()=>v});var r=n(172),a=n(761);Symbol("ResetLoaderData");let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];var i=n(95);let l="REACT_ROUTER_ERROR";var u=n(405);function s(e,{relative:t}={}){(0,r.V1)(c(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=u.useContext(i._3),{hash:l,pathname:h,search:d}=g(e,{relative:t}),p=h;return"/"!==n&&(p="/"===h?n:(0,a.HS)([n,h])),o.createHref({pathname:p,search:d,hash:l})}function c(){return null!=u.useContext(i.di)}function h(){return(0,r.V1)(c(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(i.di).location}let d="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function p(){let{isDataRoute:e}=u.useContext(i.Pl);return e?function(){let e,{router:t}=(e=u.useContext(i.hf),(0,r.V1)(e,C("useNavigate")),e),n=$("useNavigate"),a=u.useRef(!1);return u.useLayoutEffect(()=>{a.current=!0}),u.useCallback(async(e,o={})=>{(0,r.$e)(a.current,d),a.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:n,...o}))},[t,n])}():function(){(0,r.V1)(c(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(i.hf),{basename:t,navigator:n}=u.useContext(i._3),{matches:o}=u.useContext(i.Pl),{pathname:l}=h(),s=JSON.stringify((0,a.PD)(o)),p=u.useRef(!1);return u.useLayoutEffect(()=>{p.current=!0}),u.useCallback((o,i={})=>{if((0,r.$e)(p.current,d),!p.current)return;if("number"==typeof o)return void n.go(o);let u=(0,a.Gh)(o,JSON.parse(s),l,"path"===i.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:(0,a.HS)([t,u.pathname])),(i.replace?n.replace:n.push)(u,i.state,i)},[t,n,s,l,e])}()}let m=u.createContext(null);function f(e){let t=u.useContext(i.Pl).outlet;return u.useMemo(()=>t&&u.createElement(m.Provider,{value:e},t),[t,e])}function g(e,{relative:t}={}){let{matches:n}=u.useContext(i.Pl),{pathname:r}=h(),o=JSON.stringify((0,a.PD)(n));return u.useMemo(()=>(0,a.Gh)(e,JSON.parse(o),r,"path"===t),[e,o,r,t])}function y(e,t){return v(e,t)}function v(e,t,n){let o;(0,r.V1)(c(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=u.useContext(i._3),{matches:s}=u.useContext(i.Pl),d=s[s.length-1],p=d?d.params:{};d&&d.pathname;let m=d?d.pathnameBase:"/";d&&d.route;let f=h();if(t){let e="string"==typeof t?(0,r.Rr)(t):t;(0,r.V1)("/"===m||e.pathname?.startsWith(m),`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 "${m}" but pathname "${e.pathname}" was given in the \`location\` prop.`),o=e}else o=f;let g=o.pathname||"/",y=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):(0,a.ue)(e,{pathname:y}),x=function(e,t=[],n){let o=n?.state;if(null==e){if(!o)return null;if(o.errors)e=o.matches;else{if(0!==t.length||o.initialized||!(o.matches.length>0))return null;e=o.matches}}let i=e,l=o?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);(0,r.V1)(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(n&&o){s=o.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=o,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){n.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let h=n?.onError,d=o&&h?(e,t)=>{h(e,{location:o.location,params:o.matches?.[0]?.params??{},pattern:(0,a.gU)(o.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,a)=>{var h,p;let m,f=!1,g=null,y=null;o&&(m=l&&n.route.id?l[n.route.id]:void 0,g=n.route.errorElement||w,s&&(c<0&&0===a?(h="route-fallback",p="No `HydrateFallback` element provided to render during initial hydration",A[h]||(A[h]=!0,(0,r.$e)(!1,p)),f=!0,y=null):c===a&&(f=!0,y=n.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,a+1)),x=()=>{let t;return t=m?g:f?y:n.route.Component?u.createElement(n.route.Component,null):n.route.element?n.route.element:e,u.createElement(E,{match:n,routeContext:{outlet:e,matches:v,isDataRoute:null!=o},children:t})};return o&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?u.createElement(b,{location:o.location,revalidation:o.revalidation,component:g,error:m,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):x()},null)}(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},p,e.params),pathname:(0,a.HS)([m,l.encodeLocation?l.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:(0,a.HS)([m,l.encodeLocation?l.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,n);return t&&x?u.createElement(i.di.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...o},navigationType:"POP"}},x):x}let w=u.createElement(function(){let e,t,n,r=(e=u.useContext(i.xN),t=S("useRouteError"),n=$("useRouteError"),void 0!==e?e:t.errors?.[n]),o=(0,a.pX)(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null;return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},o),l?u.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},l):null,null)},null);var b=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=i.Bu;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?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&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${l}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new a.cj(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?u.createElement(i.Pl.Provider,{value:this.props.routeContext},u.createElement(i.xN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?u.createElement(R,{error:e},t):t}};let x=new WeakMap;function R({children:e,error:t}){let{basename:n}=u.useContext(i._3);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${l}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=x.get(t);if(r)throw r;let i=(0,a.X9)(e.location,n),l=i.absoluteURL||i.to;if(function(e){try{return o.includes(new URL(e).protocol)}catch{return!1}}(l))throw Error("Invalid redirect location");if(a.Bd&&!x.get(t))if(i.isExternal||e.reloadDocument)window.location.href=l;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw x.set(t,n),n}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function E({routeContext:e,match:t,children:n}){let r=u.useContext(i.hf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(i.Pl.Provider,{value:e},n)}function C(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S(e){let t=u.useContext(i.ay);return(0,r.V1)(t,C(e)),t}function $(e){let t,n=(t=u.useContext(i.Pl),(0,r.V1)(t,C(e)),t),a=n.matches[n.matches.length-1];return(0,r.V1)(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function P(){return $("useRouteId")}function k(){let e=S("useNavigation");return u.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function L(){let{matches:e,loaderData:t}=S("useMatches");return u.useMemo(()=>e.map(e=>(0,a.wy)(e,t)),[e,t])}let A={}},172(e,t,n){var r=n(9);let a="popstate";function o(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function i(e={}){return function(e,t,n,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,p=u.history,m="POP",f=null,g=y();function y(){return(p.state||{idx:null}).idx}function v(){m="POP";let e=y(),t=null==e?null:e-g;g=e,f&&f({action:m,location:b.location,delta:t})}function w(e){return function(e,t,n=!1){let a="http://localhost";e&&(a="null"!==e.location.origin?e.location.origin:e.location.href),l(a,"No window.location.(origin|href) available to create URL");let o="string"==typeof t?t:h(t);return o=o.replace(/ $/,"%20"),!n&&r.iA.test(o)&&(o=a+o),new URL(o,a)}(u,e)}null==g&&(g=0,p.replaceState({...p.state,idx:g},""));let b={get action(){return m},get location(){return e(u,p)},listen(e){if(f)throw Error("A history only accepts one active listener");return u.addEventListener(a,v),f=e,()=>{u.removeEventListener(a,v),f=null}},createHref:e=>t(u,e),createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){m="PUSH";let r=o(e)?e:c(b.location,e,t);n&&n(r,e);let a=s(r,g=y()+1),i=b.createHref(r.mask||r);try{p.pushState(a,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;u.location.assign(i)}d&&f&&f({action:m,location:b.location,delta:1})},replace:function(e,t){m="REPLACE";let r=o(e)?e:c(b.location,e,t);n&&n(r,e);let a=s(r,g=y()),i=b.createHref(r.mask||r);p.replaceState(a,"",i),d&&f&&f({action:m,location:b.location,delta:0})},go:e=>p.go(e)};return b}(function(e,t){let{pathname:n="/",search:r="",hash:a=""}=d(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),c("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:h(t))},function(e,t){u("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function l(e,t){if(!1===e||null==e)throw Error(t)}function u(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function s(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function c(e,t,n=null,r,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?d(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10),mask:a}}function h({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function d(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}n.d(t,{$e:()=>u,AO:()=>h,Rr:()=>d,TM:()=>i,V1:()=>l})},9(e,t,n){function r(e,t){return t+e.replace(/\\/g,"/")}n.d(t,{lS:()=>r},{E6:/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,iA:/^[\\/]{2}/})},761(e,t,n){var r=n(9),a=n(172);function o(e,t,n="/"){return function(e,t,n,r){let o,i=d(("string"==typeof t?(0,a.Rr)(t):t).pathname||"/",n);if(null==i)return null;let p=(void 0)??((o=function e(t,n=[],r=[],o="",i=!1){let s=(t,s,c=i,d)=>{var p,m;let f,g,y={relativePath:void 0===d?t.path||"":d,caseSensitive:!0===t.caseSensitive,childrenIndex:s,route:t};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&c)return;(0,a.V1)(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let w=v([o,y.relativePath]),b=r.concat(y);t.children&&t.children.length>0&&((0,a.V1)(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),e(t.children,n,b,w,c)),(null!=t.path||t.index)&&n.push({path:w,score:(p=w,m=t.index,g=(f=p.split("/")).length,f.some(u)&&(g+=-2),m&&(g+=2),f.filter(e=>!u(e)).reduce((e,t)=>e+(l.test(t)?3:""===t?1:10),g)),routesMeta:b.map((e,t)=>{let[n,r]=h(e.relativePath,e.caseSensitive,t===b.length-1);return{...e,matcher:n,compiledParams:r}})})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of function e(t){let n=t.split("/");if(0===n.length)return[];let[r,...a]=n,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),u=[];return u.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&u.push(...l),u.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))s(e,t,!0,n);else s(e,t)}),n}(e)).sort((e,t)=>{var n,r;return e.score!==t.score?t.score-e.score:(n=e.routesMeta.map(e=>e.childrenIndex),r=t.routesMeta.map(e=>e.childrenIndex),n.length===r.length&&n.slice(0,-1).every((e,t)=>e===r[t])?n[n.length-1]-r[r.length-1]:0)}),o),m=null,f=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return(0,a.$e)(!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}}(i);for(let e=0;null==m&&e<p.length;++e)m=function(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",i=[];for(let e=0;e<r.length;++e){let l=r[e],u=e===r.length-1,h="/"===o?t:t.slice(o.length)||"/",d={path:l.relativePath,caseSensitive:l.caseSensitive,end:u},p=l.matcher&&l.compiledParams?c(d,h,l.matcher,l.compiledParams):s(d,h),m=l.route;if(!p&&u&&n&&!r[r.length-1].route.index&&(p=s({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},h)),!p)return null;Object.assign(a,p.params),i.push({params:a,pathname:v([o,p.pathname]),pathnameBase:b(v([o,p.pathnameBase])),route:m}),"/"!==p.pathnameBase&&(o=v([o,p.pathnameBase]))}return i}(p[e],f,r);return m}(e,t,n,!1)}function i(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,loaderData:t[n.id],handle:n.handle}}n(405);let l=/^:[\w-]+$/,u=e=>"*"===e;function s(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=h(e.path,e.caseSensitive,e.end);return c(e,t,n,r)}function c(e,t,n,r){let a=t.match(n);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[r];return n&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function h(e,t=!1,n=!0){(0,a.$e)("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,a,o)=>{if(r.push({paramName:t,isOptional:null!=n}),n){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function d(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function p(e,t){let n=w(t).split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function m(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function f(e){let t=e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function g(e,t,n,r=!1){let o,i;"string"==typeof e?o=(0,a.Rr)(e):(o={...e},(0,a.V1)(!o.pathname||!o.pathname.includes("?"),m("?","pathname","search",o)),(0,a.V1)(!o.pathname||!o.pathname.includes("#"),m("#","pathname","hash",o)),(0,a.V1)(!o.search||!o.search.includes("#"),m("#","search","hash",o)));let l=""===e||""===o.pathname,u=l?"/":o.pathname;if(null==u)i=n;else{let e=t.length-1;if(!r&&u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let s=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?(0,a.Rr)(e):e;return{pathname:n?(n=y(n)).startsWith("/")?p(n.substring(1),"/"):p(n,t):t,search:x(r),hash:R(o)}}(o,i),c=u&&"/"!==u&&u.endsWith("/"),h=(l||"."===u)&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||h)&&(s.pathname+="/"),s}let y=e=>e.replace(/[\\/]{2,}/g,"/"),v=e=>y(e.join("/")),w=e=>e.replace(/\/+$/,""),b=e=>w(e).replace(/^\/*/,"/"),x=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",R=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var E=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function C(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function S(e){return v(e.map(e=>e.route.path).filter(Boolean))||"/"}let $="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function P(e,t){let n=e;if("string"!=typeof n||!r.E6.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,i=!1;if($)try{let e=new URL(window.location.href),a=new URL(r.iA.test(n)?(0,r.lS)(n,e.protocol):n),o=d(a.pathname,t);a.origin===e.origin&&null!=o?n=o+a.search+a.hash:i=!0}catch(e){(0,a.$e)(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:i,to:n}}n.d(t,{B6:()=>s,Gh:()=>g,PD:()=>f,X9:()=>P,cj:()=>E,gU:()=>S,pX:()=>C,pb:()=>d,ue:()=>o,wy:()=>i},{Bd:$,HS:v})}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * react-router v8.1.0
3
- *
4
- * Copyright (c) Remix Software Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */