useblocks 1.1.27 → 1.1.30
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.
- package/iframe/js/amp.A5wCvj7V.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.B4dVzZIU.js +1 -1
- package/package.json +1 -1
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +1 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +536 -665
- package/runtime/antd/index.js +1 -1
- package/runtime/dayjs/index.js +1 -1
- package/runtime/react-router-dom/index.js +1 -1
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{8708a613.js → 1424c612.js} +3 -3
- package/static/core/17aff8bb.js +1 -0
- package/static/core/1cbec0bb.js +1 -0
- package/static/core/24ee85aa.js +1 -0
- package/static/core/3cec0f58.js +1 -0
- package/static/core/3d6d9ecd2.js +1 -0
- package/static/core/{d37f7419.js → 43190ba4.js} +1 -1
- package/static/core/512e3b5f2.js +1 -0
- package/static/core/5386c2ec.js +1 -0
- package/static/core/586a39dc.js +1 -0
- package/static/core/60d78d6b.js +1 -0
- package/static/core/65add2fe.js +33 -0
- package/static/core/69518486.js +3 -0
- package/static/core/6cfc43e6.js +1 -0
- package/static/core/{e6c16532.js → 70acf01b.js} +2 -2
- package/static/core/78f0ec55.js +1 -0
- package/static/core/80494391.js +1 -0
- package/static/core/824a1eac.js +1 -0
- package/static/core/{4dc76046.js → 84430610.js} +4 -4
- package/static/core/88da7a16.js +1 -0
- package/static/core/928d808b.js +506 -0
- package/static/core/95f8d3c8.js +1 -0
- package/static/core/9f597c4d.js +20 -0
- package/static/core/a906a1a3.js +1 -0
- package/static/core/ac168281.js +1 -0
- package/static/core/{902b3490.js → b77ec308.js} +1 -1
- package/static/core/{779a8eb5.js → beb4d9d1.js} +2 -2
- package/static/core/{5f1992c62.js → c628207d.js} +1 -1
- package/static/core/c734a3d8.js +1 -0
- package/static/core/d0e5aa97.js +4 -0
- package/static/core/d2257218.js +1 -0
- package/static/core/d85b4555.js +1 -0
- package/static/core/e0d58fdc.js +1 -0
- package/static/core/e5e840f6.js +78 -0
- package/static/core/e930f267.js +1 -0
- package/static/core/eb1e40b4.js +895 -0
- package/static/core/ec425df9.js +1 -0
- package/static/core/f2141b55.js +1 -0
- package/static/core/f6dff18b.js +1 -0
- package/static/esm/{ea7efce0.js → 7b7508f6.js} +1 -1
- package/static/esm/{3159c14c.js → cdc4c5a4.js} +1 -1
- package/static/runtime/DownloadOutlined-C-5Yi5xA.js +76 -0
- package/static/runtime/dayjs.min-7qDGpCH7.js +1 -0
- package/static/runtime/defineProperty-DxTQfsxO.js +1 -0
- package/static/runtime/dist-C0p5hVla.js +2 -0
- package/static/runtime/es-DhckSY88.js +315 -0
- package/static/runtime/es-jkBfKdP4.js +2 -0
- package/static/runtime/es-rvjSIqny.js +1 -0
- package/two_step_headless_plugin.html +1 -1
- package/ui-kit/index.js +2041 -1934
- package/{useblocks-core.8b14ebb5.js → useblocks-core.6be93158.js} +1 -1
- package/useblocks-esm.js +4 -4
- package/useblocks.d.ts +9 -3
- package/useblocks.js +12 -12
- package/iframe/js/amp.DAh9j5NQ.js +0 -1
- package/static/core/122fc0d7.js +0 -1
- package/static/core/1b4eacdb.js +0 -1
- package/static/core/245b2799.js +0 -1
- package/static/core/27639caf.js +0 -1
- package/static/core/35387f7a.js +0 -20
- package/static/core/38cc8504.js +0 -1
- package/static/core/395cdb1b.js +0 -596
- package/static/core/3d832cfc.js +0 -1
- package/static/core/4aafbb37.js +0 -1
- package/static/core/52646cb0.js +0 -3
- package/static/core/52c7da98.js +0 -1
- package/static/core/53978dd3.js +0 -1
- package/static/core/5a853fbb.js +0 -1
- package/static/core/5c3bc4e4.js +0 -1
- package/static/core/613230e7.js +0 -1
- package/static/core/64501810.js +0 -1
- package/static/core/6d624cfc2.js +0 -1
- package/static/core/8400037a.js +0 -1
- package/static/core/8a1c4338.js +0 -1
- package/static/core/95f33488.js +0 -1
- package/static/core/a13fc482.js +0 -33
- package/static/core/a7643b25.js +0 -1
- package/static/core/aaaead9c.js +0 -1
- package/static/core/ae258789.js +0 -1
- package/static/core/aea690c8.js +0 -833
- package/static/core/b2e32919.js +0 -1
- package/static/core/b4510ae5.js +0 -1
- package/static/core/ca052be9.js +0 -1
- package/static/core/cba792ea.js +0 -1
- package/static/core/eff08366.js +0 -471
- package/static/core/f03c7816.js +0 -1
- package/static/core/f38723d0.js +0 -1
- package/static/core/f4ec16b4.js +0 -78
- package/static/core/fb3e5ba7.js +0 -1
- package/static/runtime/DownloadOutlined-Czug__JA.js +0 -1
- package/static/runtime/dayjs.min-BktkwxcQ.js +0 -1
- package/static/runtime/dist-B1ZrbBVP.js +0 -2
- package/static/runtime/es-Dt0MDtMm.js +0 -5
- package/static/runtime/es-LbCQ86AJ.js +0 -444
- package/static/runtime/es-n8SS20ln.js +0 -55
- /package/iframe/{iframe-eblock.8b14ebb5.html → iframe-eblock.6be93158.html} +0 -0
- /package/iframe/{iframe.8b14ebb5.html → iframe.6be93158.html} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{t as n}from"./react-BWGRLa9R.js";import{t as r}from"./react-dom-BlsJ1peI.js";var i=t(n()),a=t(r());function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(null,arguments)}var s;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(s||(s={}));var c=`popstate`;function l(e){e===void 0&&(e={});let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>d(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=l(n??i.length-1),o=s.Pop,c=null;function l(e){return Math.min(Math.max(e,0),i.length-1)}function u(){return i[a]}function d(e,t,n){t===void 0&&(t=null);let r=g(i?u().pathname:`/`,e,t,n);return p(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: `+JSON.stringify(e)),r}function f(e){return typeof e==`string`?e:_(e)}return{get index(){return a},get action(){return o},get location(){return u()},createHref:f,createURL(e){return new URL(f(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?v(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=s.Push;let n=d(e,t);a+=1,i.splice(a,i.length,n),r&&c&&c({action:o,location:n,delta:1})},replace(e,t){o=s.Replace;let n=d(e,t);i[a]=n,r&&c&&c({action:o,location:n,delta:0})},go(e){o=s.Pop;let t=l(a+e),n=i[t];a=t,c&&c({action:o,location:n,delta:e})},listen(e){return c=e,()=>{c=null}}}}function u(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return g(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:_(t)}return y(t,n,null,e)}function d(e){e===void 0&&(e={});function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=v(e.location.hash.substr(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),g(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:_(t))}function r(e,t){p(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(`+JSON.stringify(t)+`)`)}return y(t,n,r,e)}function f(e,t){if(e===!1||e==null)throw Error(t)}function p(e,t){if(!e)try{throw Error(t)}catch{}}function m(){return Math.random().toString(36).substr(2,8)}function h(e,t){return{usr:e.state,key:e.key,idx:t}}function g(e,t,n,r){return n===void 0&&(n=null),o({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?v(t):t,{state:n,key:t&&t.key||r||m()})}function _(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function v(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,l=i.history,u=s.Pop,d=null,p=m();p??(p=0,l.replaceState(o({},l.state,{idx:p}),``));function m(){return(l.state||{idx:null}).idx}function v(){u=s.Pop;let e=m(),t=e==null?null:e-p;p=e,d&&d({action:u,location:S.location,delta:t})}function y(e,t){u=s.Push;let r=g(S.location,e,t);n&&n(r,e),p=m()+1;let o=h(r,p),c=S.createHref(r);try{l.pushState(o,``,c)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(c)}a&&d&&d({action:u,location:S.location,delta:1})}function b(e,t){u=s.Replace;let r=g(S.location,e,t);n&&n(r,e),p=m();let i=h(r,p),o=S.createHref(r);l.replaceState(i,``,o),a&&d&&d({action:u,location:S.location,delta:0})}function x(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:_(e);return n=n.replace(/ $/,`%20`),f(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let S={get action(){return u},get location(){return e(i,l)},listen(e){if(d)throw Error(`A history only accepts one active listener`);return i.addEventListener(c,v),d=e,()=>{i.removeEventListener(c,v),d=null}},createHref(e){return t(i,e)},createURL:x,encodeLocation(e){let t=x(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:y,replace:b,go(e){return l.go(e)}};return S}var b;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(b||(b={}));var x=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function S(e){return e.index===!0}function C(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],s=typeof e.id==`string`?e.id:a.join(`-`);if(f(e.index!==!0||!e.children,`Cannot specify children on an index route`),f(!r[s],`Found a route id collision on id "`+s+`". Route id's must be globally unique within Data Router usages`),S(e)){let n=o({},e,t(e),{id:s});return r[s]=n,n}else{let n=o({},e,t(e),{id:s,children:void 0});return r[s]=n,e.children&&(n.children=C(e.children,t,a,r)),n}})}function w(e,t,n){return n===void 0&&(n=`/`),T(e,t,n,!1)}function T(e,t,n,r){let i=F((typeof t==`string`?v(t):t).pathname||`/`,n);if(i==null)return null;let a=ee(e);te(a);let o=null,s=ce(i);for(let e=0;o==null&&e<a.length;++e)o=ae(a[e],s,r);return o}function E(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function ee(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(f(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=B([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(f(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),ee(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:N(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of D(e.path))i(e,t,n)}),t}function D(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=D(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function te(e){e.sort((e,t)=>e.score===t.score?ie(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ne=/^:[\w-]+$/,O=3,k=2,A=1,j=10,re=-2,M=e=>e===`*`;function N(e,t){let n=e.split(`/`),r=n.length;return n.some(M)&&(r+=re),t&&(r+=k),n.filter(e=>!M(e)).reduce((e,t)=>e+(ne.test(t)?O:t===``?A:j),r)}function ie(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ae(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=P({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=P({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:B([a,u.pathname]),pathnameBase:me(B([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=B([a,u.pathnameBase]))}return o}function oe(e,t){t===void 0&&(t={});let n=e;n.endsWith(`*`)&&n!==`*`&&!n.endsWith(`/*`)&&(p(!1,`Route path "`+n+`" will be treated as if it were `+(`"`+n.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+n.replace(/\*$/,`/*`)+`".`)),n=n.replace(/\*$/,`/*`));let r=n.startsWith(`/`)?`/`:``,i=e=>e==null?``:typeof e==`string`?e:String(e);return r+n.split(/\/+/).map((e,n,r)=>{if(n===r.length-1&&e===`*`)return i(t[`*`]);let a=e.match(/^:([\w-]+)(\??)$/);if(a){let[,e,n]=a,r=t[e];return f(n===`?`||r!=null,`Missing ":`+e+`" param`),i(r)}return e.replace(/\?$/g,``)}).filter(e=>!!e).join(`/`)}function P(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),p(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return p(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function F(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)||`/`}var I=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,le=e=>I.test(e);function ue(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?v(e):e,a;if(n)if(le(n))a=n;else{if(n.includes(`//`)){let e=n;n=z(n),p(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?de(n.substring(1),`/`):de(n,t)}else a=t;return{pathname:a,search:he(r),hash:ge(i)}}function de(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function L(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 fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function pe(e,t){let n=fe(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function R(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=v(e):(i=o({},e),f(!i.pathname||!i.pathname.includes(`?`),L(`?`,`pathname`,`search`,i)),f(!i.pathname||!i.pathname.includes(`#`),L(`#`,`pathname`,`hash`,i)),f(!i.search||!i.search.includes(`#`),L(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,s=a?`/`:i.pathname,c;if(s==null)c=n;else{let e=t.length-1;if(!r&&s.startsWith(`..`)){let t=s.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}c=e>=0?t[e]:`/`}let l=ue(i,c),u=s&&s!==`/`&&s.endsWith(`/`),d=(a||s===`.`)&&n.endsWith(`/`);return!l.pathname.endsWith(`/`)&&(u||d)&&(l.pathname+=`/`),l}var z=e=>e.replace(/\/\/+/g,`/`),B=e=>z(e.join(`/`)),me=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),he=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=function(e,t){t===void 0&&(t={});let n=typeof t==`number`?{status:t}:t,r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json; charset=utf-8`),new Response(JSON.stringify(e),o({},n,{headers:r}))},V=class extends Error{},ve=class{constructor(e,t){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],f(e&&typeof e==`object`&&!Array.isArray(e),`defer() only accepts plain objects`);let n;this.abortPromise=new Promise((e,t)=>n=t),this.controller=new AbortController;let r=()=>n(new V(`Deferred data aborted`));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener(`abort`,r),this.controller.signal.addEventListener(`abort`,r),this.data=Object.entries(e).reduce((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:this.trackPromise(n,r)})},{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let n=Promise.race([t,this.abortPromise]).then(t=>this.onSettle(n,e,void 0,t),t=>this.onSettle(n,e,t));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(e,t,n,r){if(this.controller.signal.aborted&&n instanceof V)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),n===void 0&&r===void 0){let n=Error(`Deferred data for key "`+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>n}),this.emit(!1,t),Promise.reject(n)}return r===void 0?(Object.defineProperty(e,"_error",{get:()=>n}),this.emit(!1,t),Promise.reject(n)):(Object.defineProperty(e,"_data",{get:()=>r}),this.emit(!1,t),r)}emit(e,t){this.subscribers.forEach(n=>n(e,t))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((e,t)=>this.pendingKeysSet.delete(t)),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let n=()=>this.cancel();e.addEventListener(`abort`,n),t=await new Promise(t=>{this.subscribe(r=>{e.removeEventListener(`abort`,n),(r||this.done)&&t(r)})})}return t}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return f(this.data!==null&&this.done,`Can only unwrap data on initialized and settled deferreds`),Object.entries(this.data).reduce((e,t)=>{let[n,r]=t;return Object.assign(e,{[n]:be(r)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}};function ye(e){return e instanceof Promise&&e._tracked===!0}function be(e){if(!ye(e))return e;if(e._error)throw e._error;return e._data}var xe=function(e,t){return t===void 0&&(t={}),new ve(e,typeof t==`number`?{status:t}:t)},Se=function(e,t){t===void 0&&(t=302);let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,o({},n,{headers:r}))},Ce=(e,t)=>{let n=Se(e,t);return n.headers.set(`X-Remix-Reload-Document`,`true`),n},we=(e,t)=>{let n=Se(e,t);return n.headers.set(`X-Remix-Replace`,`true`),n},Te=class{constructor(e,t,n,r){r===void 0&&(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 Ee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var De=[`post`,`put`,`patch`,`delete`],Oe=new Set(De),ke=[`get`,...De],Ae=new Set(ke),je=new Set([301,302,303,307,308]),Me=new Set([307,308]),Ne={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pe={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Fe={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Ie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Le=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Re=`remix-router-transitions`;function ze(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0,r=!n;f(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=Le;let a={},c=C(e.routes,i,void 0,a),l,u=e.basename||`/`,d=e.dataStrategy||Xe,m=e.patchRoutesOnNavigation,h=o({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),_=null,v=new Set,y=null,x=null,S=null,ee=e.hydrationData!=null,D=w(c,e.history.location,u),te=!1,ne=null;if(D==null&&!m){let t=W(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=ut(c);D=n,ne={[r.id]:t}}D&&!e.hydrationData&&q(D,c,e.history.location.pathname).active&&(D=null);let O;if(!D){if(O=!1,D=[],h.v7_partialHydration){let t=q(null,c,e.history.location.pathname);t.active&&t.matches&&(te=!0,D=t.matches)}}else if(D.some(e=>e.route.lazy))O=!1;else if(!D.some(e=>e.route.loader))O=!0;else if(h.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=D.findIndex(e=>n[e.route.id]!==void 0);O=D.slice(0,e+1).every(e=>!We(e.route,t,n))}else O=D.every(e=>!We(e.route,t,n))}else O=e.hydrationData!=null;let k,A={historyAction:e.history.action,location:e.history.location,matches:D,initialized:O,navigation:Ne,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||ne,fetchers:new Map,blockers:new Map},j=s.Pop,re=!1,M,N=!1,ie=new Map,ae=null,oe=!1,P=!1,se=[],ce=new Set,I=new Map,le=0,ue=-1,de=new Map,L=new Set,fe=new Map,pe=new Map,R=new Set,z=new Map,B=new Map,me;function he(){if(_=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(me){me(),me=void 0;return}p(B.size===0||i!=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 a=_t({currentLocation:A.location,nextLocation:r,historyAction:n});if(a&&i!=null){let t=new Promise(e=>{me=e});e.history.go(i*-1),ft(a,{state:`blocked`,location:r,proceed(){ft(a,{state:`proceeding`,proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(A.blockers);e.set(a,Fe),V({blockers:e})}});return}return xe(n,r)}),n){Mt(t,ie);let e=()=>Nt(t,ie);t.addEventListener(`pagehide`,e),ae=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||xe(s.Pop,A.location,{initialHydration:!0}),k}function ge(){_&&_(),ae&&ae(),v.clear(),M&&M.abort(),A.fetchers.forEach((e,t)=>Ke(t)),A.blockers.forEach((e,t)=>at(t))}function _e(e){return v.add(e),()=>v.delete(e)}function V(e,t){t===void 0&&(t={}),A=o({},A,e);let n=[],r=[];h.v7_fetcherPersist&&A.fetchers.forEach((e,t)=>{e.state===`idle`&&(R.has(t)?r.push(t):n.push(t))}),R.forEach(e=>{!A.fetchers.has(e)&&!I.has(e)&&r.push(e)}),[...v].forEach(e=>e(A,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),h.v7_fetcherPersist?(n.forEach(e=>A.fetchers.delete(e)),r.forEach(e=>Ke(e))):r.forEach(e=>R.delete(e))}function ve(t,n,r){let{flushSync:i}=r===void 0?{}:r,a=A.actionData!=null&&A.navigation.formMethod!=null&&K(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,u;u=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?A.actionData:null;let d=n.loaderData?st(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,f=A.blockers;f.size>0&&(f=new Map(f),f.forEach((e,t)=>f.set(t,Fe)));let p=re===!0||A.navigation.formMethod!=null&&K(A.navigation.formMethod)&&t.state?._isRedirect!==!0;l&&(c=l,l=void 0),oe||j===s.Pop||(j===s.Push?e.history.push(t,t.state):j===s.Replace&&e.history.replace(t,t.state));let m;if(j===s.Pop){let e=ie.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:ie.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(N){let e=ie.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ie.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}V(o({},n,{actionData:u,loaderData:d,historyAction:j,location:t,initialized:!0,navigation:Ne,revalidation:`idle`,restoreScrollPosition:Ft(t,n.matches||A.matches),preventScrollReset:p,blockers:f}),{viewTransitionOpts:m,flushSync:i===!0}),j=s.Pop,re=!1,N=!1,oe=!1,P=!1,se=[]}async function ye(t,n){if(typeof t==`number`){e.history.go(t);return}let r=Ve(A.location,A.matches,u,h.v7_prependBasename,t,h.v7_relativeSplatPath,n?.fromRouteId,n?.relative),{path:i,submission:a,error:c}=He(h.v7_normalizeFormMethod,!1,r,n),l=A.location,d=g(A.location,i,n&&n.state);d=o({},d,e.history.encodeLocation(d));let f=n&&n.replace!=null?n.replace:void 0,p=s.Push;f===!0?p=s.Replace:f===!1||a!=null&&K(a.formMethod)&&a.formAction===A.location.pathname+A.location.search&&(p=s.Replace);let m=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,_=(n&&n.flushSync)===!0,v=_t({currentLocation:l,nextLocation:d,historyAction:p});if(v){ft(v,{state:`blocked`,location:d,proceed(){ft(v,{state:`proceeding`,proceed:void 0,reset:void 0,location:d}),ye(t,n)},reset(){let e=new Map(A.blockers);e.set(v,Fe),V({blockers:e})}});return}return await xe(p,d,{submission:a,pendingError:c,preventScrollReset:m,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:_})}function be(){if(ze(),V({revalidation:`loading`}),A.navigation.state!==`submitting`){if(A.navigation.state===`idle`){xe(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}xe(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:N===!0})}}async function xe(t,n,r){M&&M.abort(),M=null,j=t,oe=(r&&r.startUninterruptedRevalidation)===!0,Pt(A.location,A.matches),re=(r&&r.preventScrollReset)===!0,N=(r&&r.enableViewTransition)===!0;let i=l||c,a=r&&r.overrideNavigation,s=r!=null&&r.initialHydration&&A.matches&&A.matches.length>0&&!te?A.matches:w(i,n,u),d=(r&&r.flushSync)===!0;if(s&&A.initialized&&!P&&pt(A.location,n)&&!(r&&r.submission&&K(r.submission.formMethod))){ve(n,{matches:s},{flushSync:d});return}let f=q(s,i,n.pathname);if(f.active&&f.matches&&(s=f.matches),!s){let{error:e,notFoundMatches:t,route:r}=vt(n.pathname);ve(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:d});return}M=new AbortController;let p=nt(e.history,n,M.signal,r&&r.submission),m;if(r&&r.pendingError)m=[lt(s).route.id,{type:b.error,error:r.pendingError}];else if(r&&r.submission&&K(r.submission.formMethod)){let t=await Se(p,n,r.submission,s,f.active,{replace:r.replace,flushSync:d});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(G(r)&&Ee(r.error)&&r.error.status===404){M=null,ve(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}s=t.matches||s,m=t.pendingActionResult,a=Dt(n,r.submission),d=!1,f.active=!1,p=nt(e.history,p.url,p.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await Ce(p,n,s,f.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,d,m);h||(M=null,ve(n,o({matches:g||s},ct(m),{loaderData:_,errors:v})))}async function Se(t,n,r,i,a,o){if(o===void 0&&(o={}),ze(),V({navigation:Ot(n,r)},{flushSync:o.flushSync===!0}),a){let e=await It(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=lt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:b.error,error:e.error}]}}else if(e.matches)i=e.matches;else{let{notFoundMatches:e,error:t,route:r}=vt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:b.error,error:t}]}}}let c,l=Tt(i,n);if(!l.route.action&&!l.route.lazy)c={type:b.error,error:W(405,{method:t.method,pathname:n.pathname,routeId:l.route.id})};else if(c=(await je(`action`,A,t,[l],i,null))[l.route.id],t.signal.aborted)return{shortCircuited:!0};if(gt(c)){let n;return n=o&&o.replace!=null?o.replace:tt(c.response.headers.get(`Location`),new URL(t.url),u,e.history)===A.location.pathname+A.location.search,await Ae(t,c,!0,{submission:r,replace:n}),{shortCircuited:!0}}if(ht(c))throw W(400,{type:`defer-action`});if(G(c)){let e=lt(i,l.route.id);return(o&&o.replace)!==!0&&(j=s.Push),{matches:i,pendingActionResult:[e.route.id,c]}}return{matches:i,pendingActionResult:[l.route.id,c]}}async function Ce(t,n,r,i,a,s,d,f,p,m,g){let _=a||Dt(n,s),v=s||d||Et(_),y=!oe&&(!h.v7_partialHydration||!p);if(i){if(y){let e=we(g);V(o({navigation:_},e===void 0?{}:{actionData:e}),{flushSync:m})}let e=await It(r,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){let t=lt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)r=e.matches;else{let{error:e,notFoundMatches:t,route:r}=vt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let b=l||c,[x,S]=Ue(e.history,A,r,v,n,h.v7_partialHydration&&p===!0,h.v7_skipActionErrorRevalidation,P,se,ce,R,fe,L,b,u,g);if(yt(e=>!(r&&r.some(t=>t.route.id===e))||x&&x.some(t=>t.route.id===e)),ue=++le,x.length===0&&S.length===0){let e=Qe();return ve(n,o({matches:r,loaderData:{},errors:g&&G(g[1])?{[g[0]]:g[1].error}:null},ct(g),e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:m}),{shortCircuited:!0}}if(y){let e={};if(!i){e.navigation=_;let t=we(g);t!==void 0&&(e.actionData=t)}S.length>0&&(e.fetchers=Te(S)),V(e,{flushSync:m})}S.forEach(e=>{U(e.key),e.controller&&I.set(e.key,e.controller)});let C=()=>S.forEach(e=>U(e.key));M&&M.signal.addEventListener(`abort`,C);let{loaderResults:w,fetcherResults:T}=await Re(A,r,x,S,t);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener(`abort`,C),S.forEach(e=>I.delete(e.key));let E=dt(w);if(E)return await Ae(t,E.result,!0,{replace:f}),{shortCircuited:!0};if(E=dt(T),E)return L.add(E.key),await Ae(t,E.result,!0,{replace:f}),{shortCircuited:!0};let{loaderData:ee,errors:D}=ot(A,r,w,g,S,T,z);z.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&z.delete(t)})}),h.v7_partialHydration&&p&&A.errors&&(D=o({},A.errors,D));let te=Qe(),ne=rt(ue),O=te||ne||S.length>0;return o({matches:r,loaderData:ee,errors:D},O?{fetchers:new Map(A.fetchers)}:{})}function we(e){if(e&&!G(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Te(e){return e.forEach(e=>{let t=A.fetchers.get(e.key),n=kt(void 0,t?t.data:void 0);A.fetchers.set(e.key,n)}),new Map(A.fetchers)}function De(e,t,n,i){if(r)throw Error(`router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.`);U(e);let a=(i&&i.flushSync)===!0,o=l||c,s=Ve(A.location,A.matches,u,h.v7_prependBasename,n,h.v7_relativeSplatPath,t,i?.relative),d=w(o,s,u),f=q(d,o,s);if(f.active&&f.matches&&(d=f.matches),!d){H(e,t,W(404,{pathname:s}),{flushSync:a});return}let{path:p,submission:m,error:g}=He(h.v7_normalizeFormMethod,!0,s,i);if(g){H(e,t,g,{flushSync:a});return}let _=Tt(d,p),v=(i&&i.preventScrollReset)===!0;if(m&&K(m.formMethod)){Oe(e,t,p,_,d,f.active,a,v,m);return}fe.set(e,{routeId:t,path:p}),ke(e,t,p,_,d,f.active,a,v,m)}async function Oe(t,n,r,i,a,o,s,d,p){ze(),fe.delete(t);function m(e){return!e.route.action&&!e.route.lazy?(H(t,n,W(405,{method:p.formMethod,pathname:r,routeId:n}),{flushSync:s}),!0):!1}if(!o&&m(i))return;Be(t,At(p,A.fetchers.get(t)),{flushSync:s});let g=new AbortController,_=nt(e.history,r,g.signal,p);if(o){let e=await It(a,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){H(t,n,e.error,{flushSync:s});return}else if(!e.matches){H(t,n,W(404,{pathname:r}),{flushSync:s});return}else if(a=e.matches,i=Tt(a,r),m(i))return}I.set(t,g);let v=le,y=(await je(`action`,A,_,[i],a,t))[i.route.id];if(_.signal.aborted){I.get(t)===g&&I.delete(t);return}if(h.v7_fetcherPersist&&R.has(t)){if(gt(y)||G(y)){Be(t,jt(void 0));return}}else{if(gt(y))if(I.delete(t),ue>v){Be(t,jt(void 0));return}else return L.add(t),Be(t,kt(p)),Ae(_,y,!1,{fetcherSubmission:p,preventScrollReset:d});if(G(y)){H(t,n,y.error);return}}if(ht(y))throw W(400,{type:`defer-action`});let b=A.navigation.location||A.location,x=nt(e.history,b,g.signal),S=l||c,C=A.navigation.state===`idle`?A.matches:w(S,A.navigation.location,u);f(C,`Didn't find any matches after fetcher action`);let T=++le;de.set(t,T);let E=kt(p,y.data);A.fetchers.set(t,E);let[ee,D]=Ue(e.history,A,C,p,b,!1,h.v7_skipActionErrorRevalidation,P,se,ce,R,fe,L,S,u,[i.route.id,y]);D.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.fetchers.get(t),r=kt(void 0,n?n.data:void 0);A.fetchers.set(t,r),U(t),e.controller&&I.set(t,e.controller)}),V({fetchers:new Map(A.fetchers)});let te=()=>D.forEach(e=>U(e.key));g.signal.addEventListener(`abort`,te);let{loaderResults:ne,fetcherResults:O}=await Re(A,C,ee,D,x);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,te),de.delete(t),I.delete(t),D.forEach(e=>I.delete(e.key));let k=dt(ne);if(k)return Ae(x,k.result,!1,{preventScrollReset:d});if(k=dt(O),k)return L.add(k.key),Ae(x,k.result,!1,{preventScrollReset:d});let{loaderData:re,errors:N}=ot(A,C,ne,void 0,D,O,z);if(A.fetchers.has(t)){let e=jt(y.data);A.fetchers.set(t,e)}rt(T),A.navigation.state===`loading`&&T>ue?(f(j,`Expected pending action`),M&&M.abort(),ve(A.navigation.location,{matches:C,loaderData:re,errors:N,fetchers:new Map(A.fetchers)})):(V({errors:N,loaderData:st(A.loaderData,re,C,N),fetchers:new Map(A.fetchers)}),P=!1)}async function ke(t,n,r,i,a,o,s,c,l){let u=A.fetchers.get(t);Be(t,kt(l,u?u.data:void 0),{flushSync:s});let d=new AbortController,p=nt(e.history,r,d.signal);if(o){let e=await It(a,new URL(p.url).pathname,p.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){H(t,n,e.error,{flushSync:s});return}else if(e.matches)a=e.matches,i=Tt(a,r);else{H(t,n,W(404,{pathname:r}),{flushSync:s});return}}I.set(t,d);let m=le,h=(await je(`loader`,A,p,[i],a,t))[i.route.id];if(ht(h)&&(h=await Ct(h,p.signal,!0)||h),I.get(t)===d&&I.delete(t),!p.signal.aborted){if(R.has(t)){Be(t,jt(void 0));return}if(gt(h))if(ue>m){Be(t,jt(void 0));return}else{L.add(t),await Ae(p,h,!1,{preventScrollReset:c});return}if(G(h)){H(t,n,h.error);return}f(!ht(h),`Unhandled fetcher deferred data`),Be(t,jt(h.data))}}async function Ae(r,i,a,c){let{submission:l,fetcherSubmission:d,preventScrollReset:p,replace:m}=c===void 0?{}:c;i.response.headers.has(`X-Remix-Revalidate`)&&(P=!0);let h=i.response.headers.get(`Location`);f(h,`Expected a Location header on the redirect Response`),h=tt(h,new URL(r.url),u,e.history);let _=g(A.location,h,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))n=!0;else if(Ie.test(h)){let r=e.history.createURL(h);n=r.origin!==t.location.origin||F(r.pathname,u)==null}if(n){m?t.location.replace(h):t.location.assign(h);return}}M=null;let v=m===!0||i.response.headers.has(`X-Remix-Replace`)?s.Replace:s.Push,{formMethod:y,formAction:b,formEncType:x}=A.navigation;!l&&!d&&y&&b&&x&&(l=Et(A.navigation));let S=l||d;Me.has(i.response.status)&&S&&K(S.formMethod)?await xe(v,_,{submission:o({},S,{formAction:h}),preventScrollReset:p||re,enableViewTransition:a?N:void 0}):await xe(v,_,{overrideNavigation:Dt(_,l),fetcherSubmission:d,preventScrollReset:p||re,enableViewTransition:a?N:void 0})}async function je(e,t,n,r,o,s){let c,l={};try{c=await Ze(d,e,t,n,r,o,s,a,i)}catch(e){return r.forEach(t=>{l[t.route.id]={type:b.error,error:e}}),l}for(let[e,t]of Object.entries(c))if(mt(t)){let r=t.result;l[e]={type:b.redirect,response:et(r,n,e,o,u,h.v7_relativeSplatPath)}}else l[e]=await $e(t);return l}async function Re(t,n,r,i,a){let o=t.matches,s=je(`loader`,t,a,r,n,null),c=Promise.all(i.map(async n=>{if(n.matches&&n.match&&n.controller){let r=(await je(`loader`,t,nt(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}else return Promise.resolve({[n.key]:{type:b.error,error:W(404,{pathname:n.path})}})})),l=await s,u=(await c).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([xt(n,l,a.signal,o,t.loaderData),St(n,u,i)]),{loaderResults:l,fetcherResults:u}}function ze(){P=!0,se.push(...yt()),fe.forEach((e,t)=>{I.has(t)&&ce.add(t),U(t)})}function Be(e,t,n){n===void 0&&(n={}),A.fetchers.set(e,t),V({fetchers:new Map(A.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function H(e,t,n,r){r===void 0&&(r={});let i=lt(A.matches,t);Ke(e),V({errors:{[i.route.id]:n},fetchers:new Map(A.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Ge(e){return pe.set(e,(pe.get(e)||0)+1),R.has(e)&&R.delete(e),A.fetchers.get(e)||Pe}function Ke(e){let t=A.fetchers.get(e);I.has(e)&&!(t&&t.state===`loading`&&de.has(e))&&U(e),fe.delete(e),de.delete(e),L.delete(e),h.v7_fetcherPersist&&R.delete(e),ce.delete(e),A.fetchers.delete(e)}function qe(e){let t=(pe.get(e)||0)-1;t<=0?(pe.delete(e),R.add(e),h.v7_fetcherPersist||Ke(e)):pe.set(e,t),V({fetchers:new Map(A.fetchers)})}function U(e){let t=I.get(e);t&&(t.abort(),I.delete(e))}function Ye(e){for(let t of e){let e=jt(Ge(t).data);A.fetchers.set(t,e)}}function Qe(){let e=[],t=!1;for(let n of L){let r=A.fetchers.get(n);f(r,`Expected fetcher: `+n),r.state===`loading`&&(L.delete(n),e.push(n),t=!0)}return Ye(e),t}function rt(e){let t=[];for(let[n,r]of de)if(r<e){let e=A.fetchers.get(n);f(e,`Expected fetcher: `+n),e.state===`loading`&&(U(n),de.delete(n),t.push(n))}return Ye(t),t.length>0}function it(e,t){let n=A.blockers.get(e)||Fe;return B.get(e)!==t&&B.set(e,t),n}function at(e){A.blockers.delete(e),B.delete(e)}function ft(e,t){let n=A.blockers.get(e)||Fe;f(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: `+n.state+` -> `+t.state);let r=new Map(A.blockers);r.set(e,t),V({blockers:r})}function _t(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(B.size===0)return;B.size>1&&p(!1,`A router only supports one blocker at a time`);let i=Array.from(B.entries()),[a,o]=i[i.length-1],s=A.blockers.get(a);if(!(s&&s.state===`proceeding`)&&o({currentLocation:t,nextLocation:n,historyAction:r}))return a}function vt(e){let t=W(404,{pathname:e}),{matches:n,route:r}=ut(l||c);return yt(),{notFoundMatches:n,route:r,error:t}}function yt(e){let t=[];return z.forEach((n,r)=>{(!e||e(r))&&(n.cancel(),t.push(r),z.delete(r))}),t}function bt(e,t,n){if(y=e,S=t,x=n||null,!ee&&A.navigation===Ne){ee=!0;let e=Ft(A.location,A.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{y=null,S=null,x=null}}function wt(e,t){return x&&x(e,t.map(e=>E(e,A.loaderData)))||e.key}function Pt(e,t){if(y&&S){let n=wt(e,t);y[n]=S()}}function Ft(e,t){if(y){let n=wt(e,t),r=y[n];if(typeof r==`number`)return r}return null}function q(e,t,n){if(m){if(!e)return{active:!0,matches:T(t,n,u,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:T(t,n,u,!0)}}return{active:!1,matches:null}}async function It(e,t,n,r){if(!m)return{type:`success`,matches:e};let o=e;for(;;){let e=l==null,s=l||c,d=a;try{await m({signal:n,path:t,matches:o,fetcherKey:r,patch:(e,t)=>{n.aborted||Je(e,t,s,d,i)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}finally{e&&!n.aborted&&(c=[...c])}if(n.aborted)return{type:`aborted`};let f=w(s,t,u);if(f)return{type:`success`,matches:f};let p=T(s,t,u,!0);if(!p||o.length===p.length&&o.every((e,t)=>e.route.id===p[t].route.id))return{type:`success`,matches:null};o=p}}function J(e){a={},l=C(e,i,void 0,a)}function Lt(e,t){let n=l==null;Je(e,t,l||c,a,i),n&&(c=[...c],V({}))}return k={get basename(){return u},get future(){return h},get state(){return A},get routes(){return c},get window(){return t},initialize:he,subscribe:_e,enableScrollRestoration:bt,navigate:ye,fetch:De,revalidate:be,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ge,deleteFetcher:qe,dispose:ge,getBlocker:it,deleteBlocker:at,patchRoutes:Lt,_internalFetchControllers:I,_internalActiveDeferreds:z,_internalSetRoutes:J},k}function Be(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Ve(e,t,n,r,i,a,o,s){let c,l;if(o){c=[];for(let e of t)if(c.push(e),e.route.id===o){l=e;break}}else c=t,l=t[t.length-1];let u=R(i||`.`,pe(c,a),F(e.pathname,n)||e.pathname,s===`path`);if(i??(u.search=e.search,u.hash=e.hash),(i==null||i===``||i===`.`)&&l){let e=wt(u.search);if(l.route.index&&!e)u.search=u.search?u.search.replace(/^\?/,`?index&`):`?index`;else if(!l.route.index&&e){let e=new URLSearchParams(u.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();u.search=n?`?`+n:``}}return r&&n!==`/`&&(u.pathname=u.pathname===`/`?n:B([n,u.pathname])),_(u)}function He(e,t,n,r){if(!r||!Be(r))return{path:n};if(r.formMethod&&!bt(r.formMethod))return{path:n,error:W(405,{method:r.formMethod})};let i=()=>({path:n,error:W(400,{type:`invalid-body`})}),a=r.formMethod||`get`,o=e?a.toUpperCase():a.toLowerCase(),s=ft(n);if(r.body!==void 0){if(r.formEncType===`text/plain`){if(!K(o))return i();let e=typeof r.body==`string`?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return``+e+n+`=`+r+`
|
|
2
|
+
`},``):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if(r.formEncType===`application/json`){if(!K(o))return i();try{let e=typeof r.body==`string`?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch{return i()}}}f(typeof FormData==`function`,`FormData is not available in this environment`);let c,l;if(r.formData)c=rt(r.formData),l=r.formData;else if(r.body instanceof FormData)c=rt(r.body),l=r.body;else if(r.body instanceof URLSearchParams)c=r.body,l=it(c);else if(r.body==null)c=new URLSearchParams,l=new FormData;else try{c=new URLSearchParams(r.body),l=it(c)}catch{return i()}let u={formMethod:o,formAction:s,formEncType:r&&r.formEncType||`application/x-www-form-urlencoded`,formData:l,json:void 0,text:void 0};if(K(u.formMethod))return{path:n,submission:u};let d=v(n);return t&&d.search&&wt(d.search)&&c.append(`index`,``),d.search=`?`+c,{path:_(d),submission:u}}function H(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(e=>e.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Ue(e,t,n,r,i,a,s,c,l,u,d,f,p,m,h,g){let _=g?G(g[1])?g[1].error:g[1].data:void 0,v=e.createURL(t.location),y=e.createURL(i),b=n;a&&t.errors?b=H(n,Object.keys(t.errors)[0],!0):g&&G(g[1])&&(b=H(n,g[0]));let x=g?g[1].statusCode:void 0,S=s&&x&&x>=400,C=b.filter((e,n)=>{let{route:i}=e;if(i.lazy)return!0;if(i.loader==null)return!1;if(a)return We(i,t.loaderData,t.errors);if(Ge(t.loaderData,t.matches[n],e)||l.some(t=>t===e.route.id))return!0;let s=t.matches[n],u=e;return qe(e,o({currentUrl:v,currentParams:s.params,nextUrl:y,nextParams:u.params},r,{actionResult:_,actionStatus:x,defaultShouldRevalidate:S?!1:c||v.pathname+v.search===y.pathname+y.search||v.search!==y.search||Ke(s,u)}))}),T=[];return f.forEach((e,i)=>{if(a||!n.some(t=>t.route.id===e.routeId)||d.has(i))return;let s=w(m,e.path,h);if(!s){T.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});return}let l=t.fetchers.get(i),f=Tt(s,e.path),g=!1;p.has(i)?g=!1:u.has(i)?(u.delete(i),g=!0):g=l&&l.state!==`idle`&&l.data===void 0?c:qe(f,o({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:_,actionStatus:x,defaultShouldRevalidate:S?!1:c})),g&&T.push({key:i,routeId:e.routeId,path:e.path,matches:s,match:f,controller:new AbortController})}),[C,T]}function We(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function Ge(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Ke(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function qe(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Je(e,t,n,r,i){let a;if(e){let t=r[e];f(t,`No route found to patch children into: routeId = `+e),t.children||(t.children=[]),a=t.children}else a=n;let o=C(t.filter(e=>!a.some(t=>U(e,t))),i,[e||`_`,`patch`,String(a?.length||`0`)],r);a.push(...o)}function U(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((e,n)=>t.children?.some(t=>U(e,t))):!1}async function Ye(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];f(i,`No route found in manifest`);let a={};for(let e in r){let t=i[e]!==void 0&&e!==`hasErrorBoundary`;p(!t,`Route "`+i.id+`" has a static property "`+e+`" defined but its lazy function is also returning a value for this property. `+(`The lazy route property "`+e+`" will be ignored.`)),!t&&!x.has(e)&&(a[e]=r[e])}Object.assign(i,a),Object.assign(i,o({},t(i),{lazy:void 0}))}async function Xe(e){let{matches:t}=e,n=t.filter(e=>e.shouldLoad);return(await Promise.all(n.map(e=>e.resolve()))).reduce((e,t,r)=>Object.assign(e,{[n[r].route.id]:t}),{})}async function Ze(e,t,n,r,i,a,s,c,l,u){let d=a.map(e=>e.route.lazy?Ye(e.route,l,c):void 0),f=await e({matches:a.map((e,n)=>{let a=d[n],s=i.some(t=>t.route.id===e.route.id);return o({},e,{shouldLoad:s,resolve:async n=>(n&&r.method===`GET`&&(e.route.lazy||e.route.loader)&&(s=!0),s?Qe(t,r,e,a,n,u):Promise.resolve({type:b.data,result:void 0}))})}),request:r,params:a[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return f}async function Qe(e,t,n,r,i,a){let o,s,c=r=>{let o,c=new Promise((e,t)=>o=t);s=()=>o(),t.signal.addEventListener(`abort`,s);let l=i=>typeof r==`function`?r({request:t,params:n.params,context:a},...i===void 0?[]:[i]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean `+(`"`+e+`" [routeId: `+n.route.id+`]`))),u=(async()=>{try{return{type:`data`,result:await(i?i(e=>l(e)):l())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([u,c])};try{let i=n.route[e];if(r)if(i){let e,[t]=await Promise.all([c(i).catch(t=>{e=t}),r]);if(e!==void 0)throw e;o=t}else if(await r,i=n.route[e],i)o=await c(i);else if(e===`action`){let e=new URL(t.url),r=e.pathname+e.search;throw W(405,{method:t.method,pathname:r,routeId:n.route.id})}else return{type:b.data,result:void 0};else if(i)o=await c(i);else{let e=new URL(t.url);throw W(404,{pathname:e.pathname+e.search})}f(o.result!==void 0,`You defined `+(e===`action`?`an action`:`a loader`)+` for route `+(`"`+n.route.id+`" but didn't return anything from your \``+e+"` ")+"function. Please return a value or `null`.")}catch(e){return{type:b.error,result:e}}finally{s&&t.signal.removeEventListener(`abort`,s)}return o}async function $e(e){let{result:t,type:n}=e;if(yt(t)){let e;try{let n=t.headers.get(`Content-Type`);e=n&&/\bapplication\/json\b/.test(n)?t.body==null?null:await t.json():await t.text()}catch(e){return{type:b.error,error:e}}return n===b.error?{type:b.error,error:new Te(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:b.data,data:e,statusCode:t.status,headers:t.headers}}if(n===b.error){if(_t(t)){var r;if(t.data instanceof Error){var i;return{type:b.error,error:t.data,statusCode:t.init?.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:b.error,error:new Te(t.init?.status||500,void 0,t.data),statusCode:Ee(t)?t.status:void 0,headers:(r=t.init)!=null&&r.headers?new Headers(t.init.headers):void 0}}return{type:b.error,error:t,statusCode:Ee(t)?t.status:void 0}}if(vt(t))return{type:b.deferred,deferredData:t,statusCode:t.init?.status,headers:t.init?.headers&&new Headers(t.init.headers)};if(_t(t)){var a;return{type:b.data,data:t.data,statusCode:t.init?.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:b.data,data:t}}function et(e,t,n,r,i,a){let o=e.headers.get(`Location`);if(f(o,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ie.test(o)){let s=r.slice(0,r.findIndex(e=>e.route.id===n)+1);o=Ve(new URL(t.url),s,i,!0,o,a),e.headers.set(`Location`,o)}return e}function tt(e,t,n,r){let i=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];if(Ie.test(e)){let r=e,a=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(i.includes(a.protocol))throw Error(`Invalid redirect location`);let o=F(a.pathname,n)!=null;if(a.origin===t.origin&&o)return z(a.pathname)+a.search+a.hash}try{let t=r.createURL(e);if(i.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function nt(e,t,n,r){let i=e.createURL(ft(t)).toString(),a={signal:n};if(r&&K(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=rt(r.formData):a.body=r.formData}return new Request(i,a)}function rt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function it(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function at(e,t,n,r,i){let a={},o=null,s,c=!1,l={},u=n&&G(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,p=t[d];if(f(!gt(p),`Cannot handle redirect results in processLoaderData`),G(p)){let t=p.error;if(u!==void 0&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let n=lt(e,d);o[n.route.id]??(o[n.route.id]=t)}a[d]=void 0,c||(c=!0,s=Ee(p.error)?p.error.status:500),p.headers&&(l[d]=p.headers)}else ht(p)?(r.set(d,p.deferredData),a[d]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[d]=p.headers)):(a[d]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[d]=p.headers))}),u!==void 0&&n&&(o={[n[0]]:u},a[n[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function ot(e,t,n,r,i,a,s){let{loaderData:c,errors:l}=at(t,n,r,s,!1);return i.forEach(t=>{let{key:n,match:r,controller:i}=t,s=a[n];if(f(s,`Did not find corresponding fetcher result`),!(i&&i.signal.aborted))if(G(s)){let t=lt(e.matches,r?.route.id);l&&l[t.route.id]||(l=o({},l,{[t.route.id]:s.error})),e.fetchers.delete(n)}else if(gt(s))f(!1,`Unhandled fetcher revalidation redirect`);else if(ht(s))f(!1,`Unhandled fetcher deferred data`);else{let t=jt(s.data);e.fetchers.set(n,t)}}),{loaderData:c,errors:l}}function st(e,t,n,r){let i=o({},t);for(let a of n){let n=a.route.id;if(t.hasOwnProperty(n)?t[n]!==void 0&&(i[n]=t[n]):e[n]!==void 0&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function ct(e){return e?G(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function lt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function ut(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function W(e,t){let{pathname:n,routeId:r,method:i,type:a,message:o}=t===void 0?{}:t,s=`Unknown Server Error`,c=`Unknown @remix-run/router error`;return e===400?(s=`Bad Request`,i&&n&&r?c=`You made a `+i+` request to "`+n+`" but `+('did not provide a `loader` for route "'+r+`", `)+`so there is no way to handle the request.`:a===`defer-action`?c=`defer() is not supported in actions`:a===`invalid-body`&&(c=`Unable to encode submission body`)):e===403?(s=`Forbidden`,c=`Route "`+r+`" does not match URL "`+n+`"`):e===404?(s=`Not Found`,c=`No route matches URL "`+n+`"`):e===405&&(s=`Method Not Allowed`,i&&n&&r?c=`You made a `+i.toUpperCase()+` request to "`+n+`" but `+('did not provide an `action` for route "'+r+`", `)+`so there is no way to handle the request.`:i&&(c=`Invalid request method "`+i.toUpperCase()+`"`)),new Te(e||500,s,Error(c),!0)}function dt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(gt(r))return{key:n,result:r}}}function ft(e){let t=typeof e==`string`?v(e):e;return _(o({},t,{hash:``}))}function pt(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function mt(e){return yt(e.result)&&je.has(e.result.status)}function ht(e){return e.type===b.deferred}function G(e){return e.type===b.error}function gt(e){return(e&&e.type)===b.redirect}function _t(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function vt(e){let t=e;return t&&typeof t==`object`&&typeof t.data==`object`&&typeof t.subscribe==`function`&&typeof t.cancel==`function`&&typeof t.resolveData==`function`}function yt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function bt(e){return Ae.has(e.toLowerCase())}function K(e){return Oe.has(e.toLowerCase())}async function xt(e,t,n,r,i){let a=Object.entries(t);for(let o=0;o<a.length;o++){let[s,c]=a[o],l=e.find(e=>e?.route.id===s);if(!l)continue;let u=r.find(e=>e.route.id===l.route.id),d=u!=null&&!Ke(u,l)&&(i&&i[l.route.id])!==void 0;ht(c)&&d&&await Ct(c,n,!1).then(e=>{e&&(t[s]=e)})}}async function St(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:o}=n[r],s=t[i];e.find(e=>e?.route.id===a)&&ht(s)&&(f(o,`Expected an AbortController for revalidating fetcher deferred result`),await Ct(s,o.signal,!0).then(e=>{e&&(t[i]=e)}))}}async function Ct(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:b.data,data:e.deferredData.unwrappedData}}catch(e){return{type:b.error,error:e}}return{type:b.data,data:e.deferredData.data}}}function wt(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Tt(e,t){let n=typeof t==`string`?v(t).search:t.search;if(e[e.length-1].route.index&&wt(n||``))return e[e.length-1];let r=fe(e);return r[r.length-1]}function Et(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Dt(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 Ot(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 kt(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 At(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 jt(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 Mt(e,t){try{let n=e.sessionStorage.getItem(Re);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Nt(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Re,JSON.stringify(n))}catch(e){p(!1,`Failed to save applied view transitions in sessionStorage (`+e+`).`)}}}function Pt(){return Pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pt.apply(null,arguments)}var Ft=i.createContext(null),q=i.createContext(null),It=i.createContext(null),J=i.createContext(null),Lt=i.createContext(null),Y=i.createContext({outlet:null,matches:[],isDataRoute:!1}),Rt=i.createContext(null);function zt(e,t){let{relative:n}=t===void 0?{}:t;!Bt()&&f(!1);let{basename:r,navigator:a}=i.useContext(J),{hash:o,pathname:s,search:c}=Xt(e,{relative:n}),l=s;return r!==`/`&&(l=s===`/`?r:B([r,s])),a.createHref({pathname:l,search:c,hash:o})}function Bt(){return i.useContext(Lt)!=null}function X(){return!Bt()&&f(!1),i.useContext(Lt).location}function Vt(){return i.useContext(Lt).navigationType}function Ht(e){!Bt()&&f(!1);let{pathname:t}=X();return i.useMemo(()=>P(e,ce(t)),[t,e])}function Ut(e){i.useContext(J).static||i.useLayoutEffect(e)}function Wt(){let{isDataRoute:e}=i.useContext(Y);return e?Sn():Gt()}function Gt(){!Bt()&&f(!1);let e=i.useContext(Ft),{basename:t,future:n,navigator:r}=i.useContext(J),{matches:a}=i.useContext(Y),{pathname:o}=X(),s=JSON.stringify(pe(a,n.v7_relativeSplatPath)),c=i.useRef(!1);return Ut(()=>{c.current=!0}),i.useCallback(function(n,i){if(i===void 0&&(i={}),!c.current)return;if(typeof n==`number`){r.go(n);return}let a=R(n,JSON.parse(s),o,i.relative===`path`);e==null&&t!==`/`&&(a.pathname=a.pathname===`/`?t:B([t,a.pathname])),(i.replace?r.replace:r.push)(a,i.state,i)},[t,r,s,o,e])}var Kt=i.createContext(null);function qt(){return i.useContext(Kt)}function Jt(e){let t=i.useContext(Y).outlet;return t&&i.createElement(Kt.Provider,{value:e},t)}function Yt(){let{matches:e}=i.useContext(Y),t=e[e.length-1];return t?t.params:{}}function Xt(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=i.useContext(J),{matches:a}=i.useContext(Y),{pathname:o}=X(),s=JSON.stringify(pe(a,r.v7_relativeSplatPath));return i.useMemo(()=>R(e,JSON.parse(s),o,n===`path`),[e,s,o,n])}function Zt(e,t){return Qt(e,t)}function Qt(e,t,n,r){!Bt()&&f(!1);let{navigator:a}=i.useContext(J),{matches:o}=i.useContext(Y),c=o[o.length-1],l=c?c.params:{};c&&c.pathname;let u=c?c.pathnameBase:`/`;c&&c.route;let d=X(),p;if(t){let e=typeof t==`string`?v(t):t;!(u===`/`||e.pathname?.startsWith(u))&&f(!1),p=e}else p=d;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=w(e,{pathname:h}),_=rn(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:B([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:B([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),o,n,r);return t&&_?i.createElement(Lt.Provider,{value:{location:Pt({pathname:`/`,search:``,hash:``,state:null,key:`default`},p),navigationType:s.Pop}},_):_}function $t(){let e=_n(),t=Ee(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return i.createElement(i.Fragment,null,i.createElement(`h2`,null,`Unexpected Application Error!`),i.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?i.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var en=i.createElement($t,null),tn=class extends i.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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return this.state.error===void 0?this.props.children:i.createElement(Y.Provider,{value:this.props.routeContext},i.createElement(Rt.Provider,{value:this.state.error,children:this.props.component}))}};function nn(e){let{routeContext:t,match:n,children:r}=e,a=i.useContext(Ft);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(Y.Provider,{value:t},r)}function rn(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let e=o.findIndex(e=>e.route.id&&s?.[e.route.id]!==void 0);!(e>=0)&&f(!1),o=o.slice(0,Math.min(o.length,e+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){c=!0,o=l>=0?o.slice(0,l+1):[o[0]];break}}}return o.reduceRight((e,r,a)=>{let u,d=!1,f=null,p=null;n&&(u=s&&r.route.id?s[r.route.id]:void 0,f=r.route.errorElement||en,c&&(l<0&&a===0?(wn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):l===a&&(d=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,a+1)),h=()=>{let t;return t=u?f:d?p:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(nn,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||a===0)?i.createElement(tn,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()},null)}var an=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(an||{}),Z=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(Z||{});function on(e){let t=i.useContext(Ft);return!t&&f(!1),t}function sn(e){let t=i.useContext(q);return!t&&f(!1),t}function cn(e){let t=i.useContext(Y);return!t&&f(!1),t}function ln(e){let t=cn(e),n=t.matches[t.matches.length-1];return!n.route.id&&f(!1),n.route.id}function un(){return ln(Z.UseRouteId)}function dn(){return sn(Z.UseNavigation).navigation}function fn(){let e=on(an.UseRevalidator),t=sn(Z.UseRevalidator);return i.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function pn(){let{matches:e,loaderData:t}=sn(Z.UseMatches);return i.useMemo(()=>e.map(e=>E(e,t)),[e,t])}function mn(){let e=sn(Z.UseLoaderData),t=ln(Z.UseLoaderData);if(!(e.errors&&e.errors[t]!=null))return e.loaderData[t]}function hn(e){return sn(Z.UseRouteLoaderData).loaderData[e]}function gn(){let e=sn(Z.UseActionData),t=ln(Z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function _n(){let e=i.useContext(Rt),t=sn(Z.UseRouteError),n=ln(Z.UseRouteError);return e===void 0?t.errors?.[n]:e}function vn(){return i.useContext(It)?._data}function yn(){return i.useContext(It)?._error}var bn=0;function xn(e){let{router:t,basename:n}=on(an.UseBlocker),r=sn(Z.UseBlocker),[a,o]=i.useState(``),s=i.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:Pt({},r,{pathname:F(r.pathname,n)||r.pathname}),nextLocation:Pt({},i,{pathname:F(i.pathname,n)||i.pathname}),historyAction:a})},[n,e]);return i.useEffect(()=>{let e=String(++bn);return o(e),()=>t.deleteBlocker(e)},[t]),i.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&r.blockers.has(a)?r.blockers.get(a):Fe}function Sn(){let{router:e}=on(an.UseNavigateStable),t=ln(Z.UseNavigateStable),n=i.useRef(!1);return Ut(()=>{n.current=!0}),i.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,Pt({fromRouteId:t},i)))},[e,t])}var Cn={};function wn(e,t,n){!t&&!Cn[e]&&(Cn[e]=!0)}var Tn=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function En(e,t){e?.v7_startTransition===void 0&&Tn(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&Tn(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&Tn(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&Tn(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&Tn(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&Tn(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}var Dn=i.startTransition;function On(e){let{basename:t,children:n,initialEntries:r,initialIndex:a,future:o}=e,s=i.useRef();s.current??(s.current=l({initialEntries:r,initialIndex:a,v5Compat:!0}));let c=s.current,[u,d]=i.useState({action:c.action,location:c.location}),{v7_startTransition:f}=o||{},p=i.useCallback(e=>{f&&Dn?Dn(()=>d(e)):d(e)},[d,f]);return i.useLayoutEffect(()=>c.listen(p),[c,p]),i.useEffect(()=>En(o),[o]),i.createElement(Mn,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:c,future:o})}function kn(e){let{to:t,replace:n,state:r,relative:a}=e;!Bt()&&f(!1);let{future:o,static:s}=i.useContext(J),{matches:c}=i.useContext(Y),{pathname:l}=X(),u=Wt(),d=R(t,pe(c,o.v7_relativeSplatPath),l,a===`path`),p=JSON.stringify(d);return i.useEffect(()=>u(JSON.parse(p),{replace:n,state:r,relative:a}),[u,p,a,n,r]),null}function An(e){return Jt(e.context)}function jn(e){f(!1)}function Mn(e){let{basename:t=`/`,children:n=null,location:r,navigationType:a=s.Pop,navigator:o,static:c=!1,future:l}=e;Bt()&&f(!1);let u=t.replace(/^\/*/,`/`),d=i.useMemo(()=>({basename:u,navigator:o,static:c,future:Pt({v7_relativeSplatPath:!1},l)}),[u,l,o,c]);typeof r==`string`&&(r=v(r));let{pathname:p=`/`,search:m=``,hash:h=``,state:g=null,key:_=`default`}=r,y=i.useMemo(()=>{let e=F(p,u);return e==null?null:{location:{pathname:e,search:m,hash:h,state:g,key:_},navigationType:a}},[u,p,m,h,g,_,a]);return y==null?null:i.createElement(J.Provider,{value:d},i.createElement(Lt.Provider,{children:n,value:y}))}function Nn(e){let{children:t,location:n}=e;return Zt(Rn(t),n)}function Pn(e){let{children:t,errorElement:n,resolve:r}=e;return i.createElement(In,{resolve:r,errorElement:n},i.createElement(Ln,null,t))}var Q=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(Q||{}),Fn=new Promise(()=>{}),In=class extends i.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){}render(){let{children:e,errorElement:t,resolve:n}=this.props,r=null,a=Q.pending;if(!(n instanceof Promise))a=Q.success,r=Promise.resolve(),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_data",{get:()=>n});else if(this.state.error){a=Q.error;let e=this.state.error;r=Promise.reject().catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_error",{get:()=>e})}else n._tracked?(r=n,a=`_error`in r?Q.error:`_data`in r?Q.success:Q.pending):(a=Q.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),r=n.then(e=>Object.defineProperty(n,"_data",{get:()=>e}),e=>Object.defineProperty(n,"_error",{get:()=>e})));if(a===Q.error&&r._error instanceof V)throw Fn;if(a===Q.error&&!t)throw r._error;if(a===Q.error)return i.createElement(It.Provider,{value:r,children:t});if(a===Q.success)return i.createElement(It.Provider,{value:r,children:e});throw r}};function Ln(e){let{children:t}=e,n=vn(),r=typeof t==`function`?t(n):t;return i.createElement(i.Fragment,null,r)}function Rn(e,t){t===void 0&&(t=[]);let n=[];return i.Children.forEach(e,(e,r)=>{if(!i.isValidElement(e))return;let a=[...t,r];if(e.type===i.Fragment){n.push.apply(n,Rn(e.props.children,a));return}e.type!==jn&&f(!1),!(!e.props.index||!e.props.children)&&f(!1);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=Rn(e.props.children,a)),n.push(o)}),n}function zn(e){return rn(e)}function Bn(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:i.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Vn(e,t){return ze({basename:t?.basename,future:Pt({},t?.future,{v7_prependBasename:!0}),history:l({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:Bn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation}).initialize()}var Hn=e({AbortedDeferredError:()=>V,Await:()=>Pn,BrowserRouter:()=>wr,Form:()=>jr,HashRouter:()=>Tr,Link:()=>kr,MemoryRouter:()=>On,NavLink:()=>Ar,Navigate:()=>kn,NavigationType:()=>s,Outlet:()=>An,Route:()=>jn,Router:()=>Mn,RouterProvider:()=>xr,Routes:()=>Nn,ScrollRestoration:()=>Mr,UNSAFE_DataRouterContext:()=>Ft,UNSAFE_DataRouterStateContext:()=>q,UNSAFE_ErrorResponseImpl:()=>Te,UNSAFE_FetchersContext:()=>mr,UNSAFE_LocationContext:()=>Lt,UNSAFE_NavigationContext:()=>J,UNSAFE_RouteContext:()=>Y,UNSAFE_ViewTransitionContext:()=>pr,UNSAFE_useRouteId:()=>un,UNSAFE_useScrollRestoration:()=>Jr,createBrowserRouter:()=>lr,createHashRouter:()=>ur,createMemoryRouter:()=>Vn,createPath:()=>_,createRoutesFromChildren:()=>Rn,createRoutesFromElements:()=>Rn,createSearchParams:()=>Qn,defer:()=>xe,generatePath:()=>oe,isRouteErrorResponse:()=>Ee,json:()=>_e,matchPath:()=>P,matchRoutes:()=>w,parsePath:()=>v,redirect:()=>Se,redirectDocument:()=>Ce,renderMatches:()=>zn,replace:()=>we,resolvePath:()=>ue,unstable_HistoryRouter:()=>Er,unstable_usePrompt:()=>Zr,useActionData:()=>gn,useAsyncError:()=>yn,useAsyncValue:()=>vn,useBeforeUnload:()=>Yr,useBlocker:()=>xn,useFetcher:()=>Wr,useFetchers:()=>Gr,useFormAction:()=>Ur,useHref:()=>zt,useInRouterContext:()=>Bt,useLinkClickHandler:()=>Lr,useLoaderData:()=>mn,useLocation:()=>X,useMatch:()=>Ht,useMatches:()=>pn,useNavigate:()=>Wt,useNavigation:()=>dn,useNavigationType:()=>Vt,useOutlet:()=>Jt,useOutletContext:()=>qt,useParams:()=>Yt,useResolvedPath:()=>Xt,useRevalidator:()=>fn,useRouteError:()=>_n,useRouteLoaderData:()=>hn,useRoutes:()=>Zt,useSearchParams:()=>Rr,useSubmit:()=>Hr,useViewTransitionState:()=>Qr});function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(null,arguments)}function Un(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Wn=`get`,Gn=`application/x-www-form-urlencoded`;function Kn(e){return e!=null&&typeof e.tagName==`string`}function qn(e){return Kn(e)&&e.tagName.toLowerCase()===`button`}function Jn(e){return Kn(e)&&e.tagName.toLowerCase()===`form`}function Yn(e){return Kn(e)&&e.tagName.toLowerCase()===`input`}function Xn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zn(e,t){return e.button===0&&(!t||t===`_self`)&&!Xn(e)}function Qn(e){return e===void 0&&(e=``),new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function $n(e,t){let n=Qn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var er=null;function tr(){if(er===null)try{new FormData(document.createElement(`form`),0),er=!1}catch{er=!0}return er}var nr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function rr(e){return e!=null&&!nr.has(e)?null:e}function ir(e,t){let n,r,i,a,o;if(Jn(e)){let o=e.getAttribute(`action`);r=o?F(o,t):null,n=e.getAttribute(`method`)||Wn,i=rr(e.getAttribute(`enctype`))||Gn,a=new FormData(e)}else if(qn(e)||Yn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?F(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Wn,i=rr(e.getAttribute(`formenctype`))||rr(o.getAttribute(`enctype`))||Gn,a=new FormData(o,e),!tr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?t+`.`:``;a.append(e+`x`,`0`),a.append(e+`y`,`0`)}else t&&a.append(t,r)}}else if(Kn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Wn,r=null,i=Gn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ar=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],or=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],sr=[`fetcherKey`,`navigate`,`reloadDocument`,`replace`,`state`,`method`,`action`,`onSubmit`,`relative`,`preventScrollReset`,`viewTransition`],cr=`6`;try{window.__reactRouterVersion=cr}catch{}function lr(e,t){return ze({basename:t?.basename,future:$({},t?.future,{v7_prependBasename:!0}),history:u({window:t?.window}),hydrationData:t?.hydrationData||dr(),routes:e,mapRouteProperties:Bn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function ur(e,t){return ze({basename:t?.basename,future:$({},t?.future,{v7_prependBasename:!0}),history:d({window:t?.window}),hydrationData:t?.hydrationData||dr(),routes:e,mapRouteProperties:Bn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function dr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e=$({},e,{errors:fr(e.errors)})),e}function fr(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Te(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var pr=i.createContext({isTransitioning:!1}),mr=i.createContext(new Map),hr=i.startTransition,gr=a.flushSync,_r=i.useId;function vr(e){hr?hr(e):e()}function yr(e){gr?gr(e):e()}var br=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function xr(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=i.useState(n.state),[s,c]=i.useState(),[l,u]=i.useState({isTransitioning:!1}),[d,f]=i.useState(),[p,m]=i.useState(),[h,g]=i.useState(),_=i.useRef(new Map),{v7_startTransition:v}=r||{},y=i.useCallback(e=>{v?vr(e):e()},[v]),b=i.useCallback((e,t)=>{let{deletedFetchers:r,flushSync:i,viewTransitionOpts:a}=t;e.fetchers.forEach((e,t)=>{e.data!==void 0&&_.current.set(t,e.data)}),r.forEach(e=>_.current.delete(e));let s=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!=`function`;if(!a||s){i?yr(()=>o(e)):y(()=>o(e));return}if(i){yr(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:a.currentLocation,nextLocation:a.nextLocation})});let t=n.window.document.startViewTransition(()=>{yr(()=>o(e))});t.finished.finally(()=>{yr(()=>{f(void 0),m(void 0),c(void 0),u({isTransitioning:!1})})}),yr(()=>m(t));return}p?(d&&d.resolve(),p.skipTransition(),g({state:e,currentLocation:a.currentLocation,nextLocation:a.nextLocation})):(c(e),u({isTransitioning:!0,flushSync:!1,currentLocation:a.currentLocation,nextLocation:a.nextLocation}))},[n.window,p,d,_,y]);i.useLayoutEffect(()=>n.subscribe(b),[n,b]),i.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new br)},[l]),i.useEffect(()=>{if(d&&s&&n.window){let e=s,t=d.promise,r=n.window.document.startViewTransition(async()=>{y(()=>o(e)),await t});r.finished.finally(()=>{f(void 0),m(void 0),c(void 0),u({isTransitioning:!1})}),m(r)}},[y,s,d,n.window]),i.useEffect(()=>{d&&s&&a.location.key===s.location.key&&d.resolve()},[d,p,a.location,s]),i.useEffect(()=>{!l.isTransitioning&&h&&(c(h.state),u({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),g(void 0))},[l.isTransitioning,h]),i.useEffect(()=>{},[]);let x=i.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:r?.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:r?.preventScrollReset})}),[n]),S=n.basename||`/`,C=i.useMemo(()=>({router:n,navigator:x,static:!1,basename:S}),[n,x,S]),w=i.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return i.useEffect(()=>En(r,n.future),[r,n.future]),i.createElement(i.Fragment,null,i.createElement(Ft.Provider,{value:C},i.createElement(q.Provider,{value:a},i.createElement(mr.Provider,{value:_.current},i.createElement(pr.Provider,{value:l},i.createElement(Mn,{basename:S,location:a.location,navigationType:a.historyAction,navigator:x,future:w},a.initialized||n.future.v7_partialHydration?i.createElement(Sr,{routes:n.routes,future:n.future,state:a}):t))))),null)}var Sr=i.memo(Cr);function Cr(e){let{routes:t,future:n,state:r}=e;return Qt(t,void 0,r,n)}function wr(e){let{basename:t,children:n,future:r,window:a}=e,o=i.useRef();o.current??(o.current=u({window:a,v5Compat:!0}));let s=o.current,[c,l]=i.useState({action:s.action,location:s.location}),{v7_startTransition:d}=r||{},f=i.useCallback(e=>{d&&hr?hr(()=>l(e)):l(e)},[l,d]);return i.useLayoutEffect(()=>s.listen(f),[s,f]),i.useEffect(()=>En(r),[r]),i.createElement(Mn,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:r})}function Tr(e){let{basename:t,children:n,future:r,window:a}=e,o=i.useRef();o.current??(o.current=d({window:a,v5Compat:!0}));let s=o.current,[c,l]=i.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},f=i.useCallback(e=>{u&&hr?hr(()=>l(e)):l(e)},[l,u]);return i.useLayoutEffect(()=>s.listen(f),[s,f]),i.useEffect(()=>En(r),[r]),i.createElement(Mn,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:r})}function Er(e){let{basename:t,children:n,future:r,history:a}=e,[o,s]=i.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},l=i.useCallback(e=>{c&&hr?hr(()=>s(e)):s(e)},[s,c]);return i.useLayoutEffect(()=>a.listen(l),[a,l]),i.useEffect(()=>En(r),[r]),i.createElement(Mn,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}var Dr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Or=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kr=i.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:a,replace:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d}=e,f=Un(e,ar),{basename:p}=i.useContext(J),m,h=!1;if(typeof l==`string`&&Or.test(l)&&(m=l,Dr))try{let e=new URL(window.location.href),t=l.startsWith(`//`)?new URL(e.protocol+l):new URL(l),n=F(t.pathname,p);t.origin===e.origin&&n!=null?l=n+t.search+t.hash:h=!0}catch{}let g=zt(l,{relative:r}),_=Lr(l,{replace:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d});function v(e){n&&n(e),e.defaultPrevented||_(e)}return i.createElement(`a`,$({},f,{href:m||g,onClick:h||a?n:v,ref:t,target:c}))}),Ar=i.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:a=``,end:o=!1,style:s,to:c,viewTransition:l,children:u}=e,d=Un(e,or),f=Xt(c,{relative:d.relative}),p=X(),m=i.useContext(q),{navigator:h,basename:g}=i.useContext(J),_=m!=null&&Qr(f)&&l===!0,v=h.encodeLocation?h.encodeLocation(f).pathname:f.pathname,y=p.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;r||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=F(b,g)||b);let x=v!==`/`&&v.endsWith(`/`)?v.length-1:v.length,S=y===v||!o&&y.startsWith(v)&&y.charAt(x)===`/`,C=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)===`/`),w={isActive:S,isPending:C,isTransitioning:_},T=S?n:void 0,E;E=typeof a==`function`?a(w):[a,S?`active`:null,C?`pending`:null,_?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof s==`function`?s(w):s;return i.createElement(kr,$({},d,{"aria-current":T,className:E,ref:t,style:ee,to:c,viewTransition:l}),typeof u==`function`?u(w):u)}),jr=i.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:s,method:c=Wn,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p}=e,m=Un(e,sr),h=Hr(),g=Ur(l,{relative:d}),_=c.toLowerCase()===`get`?`get`:`post`;return i.createElement(`form`,$({ref:t,method:_,action:g,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,i=t?.getAttribute(`formmethod`)||c;h(t||e.currentTarget,{fetcherKey:n,method:i,navigate:r,replace:o,state:s,relative:d,preventScrollReset:f,viewTransition:p})}},m))});function Mr(e){let{getKey:t,storageKey:n}=e;return Jr({getKey:t,storageKey:n}),null}var Nr;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(Nr||(Nr={}));var Pr;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(Pr||(Pr={}));function Fr(e){let t=i.useContext(Ft);return!t&&f(!1),t}function Ir(e){let t=i.useContext(q);return!t&&f(!1),t}function Lr(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:s,viewTransition:c}=t===void 0?{}:t,l=Wt(),u=X(),d=Xt(e,{relative:s});return i.useCallback(t=>{Zn(t,n)&&(t.preventDefault(),l(e,{replace:r===void 0?_(u)===_(d):r,state:a,preventScrollReset:o,relative:s,viewTransition:c}))},[u,l,d,r,a,n,e,o,s,c])}function Rr(e){let t=i.useRef(Qn(e)),n=i.useRef(!1),r=X(),a=i.useMemo(()=>$n(r.search,n.current?null:t.current),[r.search]),o=Wt();return[a,i.useCallback((e,t)=>{let r=Qn(typeof e==`function`?e(a):e);n.current=!0,o(`?`+r,t)},[o,a])]}function zr(){if(typeof document>`u`)throw Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}var Br=0,Vr=()=>`__`+String(++Br)+`__`;function Hr(){let{router:e}=Fr(Nr.UseSubmit),{basename:t}=i.useContext(J),n=un();return i.useCallback(function(r,i){i===void 0&&(i={}),zr();let{action:a,method:o,encType:s,formData:c,body:l}=ir(r,t);if(i.navigate===!1){let t=i.fetcherKey||Vr();e.fetch(t,n,i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:l,formMethod:i.method||o,formEncType:i.encType||s,flushSync:i.flushSync})}else e.navigate(i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:l,formMethod:i.method||o,formEncType:i.encType||s,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function Ur(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=i.useContext(J),a=i.useContext(Y);!a&&f(!1);let[o]=a.matches.slice(-1),s=$({},Xt(e||`.`,{relative:n})),c=X();if(e==null){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===`.`)&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,`?index&`):`?index`),r!==`/`&&(s.pathname=s.pathname===`/`?r:B([r,s.pathname])),_(s)}function Wr(e){let{key:t}=e===void 0?{}:e,{router:n}=Fr(Nr.UseFetcher),r=Ir(Pr.UseFetcher),a=i.useContext(mr),o=i.useContext(Y),s=o.matches[o.matches.length-1]?.route.id;!a&&f(!1),!o&&f(!1),s??f(!1);let c=_r?_r():``,[l,u]=i.useState(t||c);t&&t!==l?u(t):l||u(Vr()),i.useEffect(()=>(n.getFetcher(l),()=>{n.deleteFetcher(l)}),[n,l]);let d=i.useCallback((e,t)=>{!s&&f(!1),n.fetch(l,s,e,t)},[l,s,n]),p=Hr(),m=i.useCallback((e,t)=>{p(e,$({},t,{navigate:!1,fetcherKey:l}))},[l,p]),h=i.useMemo(()=>i.forwardRef((e,t)=>i.createElement(jr,$({},e,{navigate:!1,fetcherKey:l,ref:t}))),[l]),g=r.fetchers.get(l)||Pe,_=a.get(l);return i.useMemo(()=>$({Form:h,submit:m,load:d},g,{data:_}),[h,m,d,g,_])}function Gr(){let e=Ir(Pr.UseFetchers);return Array.from(e.fetchers.entries()).map(e=>{let[t,n]=e;return $({},n,{key:t})})}var Kr=`react-router-scroll-positions`,qr={};function Jr(e){let{getKey:t,storageKey:n}=e===void 0?{}:e,{router:r}=Fr(Nr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:o}=Ir(Pr.UseScrollRestoration),{basename:s}=i.useContext(J),c=X(),l=pn(),u=dn();i.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Xr(i.useCallback(()=>{if(u.state===`idle`){let e=(t?t(c,l):null)||c.key;qr[e]=window.scrollY}try{sessionStorage.setItem(n||Kr,JSON.stringify(qr))}catch{}window.history.scrollRestoration=`auto`},[n,t,u.state,c,l])),typeof document<`u`&&(i.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(n||Kr);e&&(qr=JSON.parse(e))}catch{}},[n]),i.useLayoutEffect(()=>{let e=t&&s!==`/`?(e,n)=>t($({},e,{pathname:F(e.pathname,s)||e.pathname}),n):t,n=r?.enableScrollRestoration(qr,()=>window.scrollY,e);return()=>n&&n()},[r,s,t]),i.useLayoutEffect(()=>{if(a!==!1){if(typeof a==`number`){window.scrollTo(0,a);return}if(c.hash){let e=document.getElementById(decodeURIComponent(c.hash.slice(1)));if(e){e.scrollIntoView();return}}o!==!0&&window.scrollTo(0,0)}},[c,a,o]))}function Yr(e,t){let{capture:n}=t||{};i.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`beforeunload`,e,t),()=>{window.removeEventListener(`beforeunload`,e,t)}},[e,n])}function Xr(e,t){let{capture:n}=t||{};i.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Zr(e){let{when:t,message:n}=e,r=xn(t);i.useEffect(()=>{r.state===`blocked`&&(window.confirm(n)?setTimeout(r.proceed,0):r.reset())},[r,n]),i.useEffect(()=>{r.state===`blocked`&&!t&&r.reset()},[r,t])}function Qr(e,t){t===void 0&&(t={});let n=i.useContext(pr);n??f(!1);let{basename:r}=Fr(Nr.useViewTransitionState),a=Xt(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=F(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=F(n.nextLocation.pathname,r)||n.nextLocation.pathname;return P(a.pathname,s)!=null||P(a.pathname,o)!=null}export{Jt as $,kn as A,gn as B,Hr as C,q as D,Ft as E,Mn as F,Bt as G,vn as H,Nn as I,Ht as J,mn as K,Vn as L,An as M,jn as N,Lt as O,Y as P,Vt as Q,Rn as R,Rr as S,ue as St,Pn as T,xn as U,yn as V,zt as W,Wt as X,pn as Y,dn as Z,Gr as _,w as _t,Er as a,un as at,Zr as b,Ce as bt,xr as c,V as ct,lr as d,_ as dt,qt as et,ur as f,xe as ft,Wr as g,P as gt,Yr as h,_e as ht,Tr as i,_n as it,J as j,On as k,Mr as l,s as lt,Hn as m,Ee as mt,mr as n,Xt as nt,kr as o,hn as ot,Qn as p,oe as pt,X as q,jr as r,fn as rt,Ar as s,Zt as st,wr as t,Yt as tt,pr as u,Te as ut,Ur as v,v as vt,Qr as w,Jr as x,we as xt,Lr as y,Se as yt,zn as z};
|