@pih/esm-referrals-queue-app 2.1.1-pre.101 → 2.1.1-pre.103
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/.turbo/turbo-build.log +6 -40
- package/dist/0.js +1 -0
- package/dist/0.js.map +1 -0
- package/dist/117.js +1 -0
- package/dist/117.js.map +1 -0
- package/dist/156.js +5 -0
- package/dist/156.js.map +1 -0
- package/dist/240.js +1 -0
- package/dist/240.js.map +1 -0
- package/dist/291.js +49 -0
- package/dist/291.js.map +1 -0
- package/dist/349.js +1 -0
- package/dist/349.js.map +1 -0
- package/dist/378.js +1 -0
- package/dist/378.js.map +1 -0
- package/dist/466.js +1 -0
- package/dist/466.js.map +1 -0
- package/dist/508.js +1 -0
- package/dist/508.js.map +1 -0
- package/dist/61.js +1 -0
- package/dist/61.js.map +1 -0
- package/dist/633.js +1 -0
- package/dist/633.js.map +1 -0
- package/dist/689.js +1 -0
- package/dist/689.js.map +1 -0
- package/dist/712.js +1 -0
- package/dist/712.js.map +1 -0
- package/dist/771.js +1 -0
- package/dist/771.js.map +1 -0
- package/dist/859.js +1 -0
- package/dist/859.js.map +1 -0
- package/dist/912.js +1 -0
- package/dist/912.js.map +1 -0
- package/dist/913.js +1 -2
- package/dist/913.js.map +1 -1
- package/dist/989.js +1 -0
- package/dist/989.js.map +1 -0
- package/dist/main.js +6 -1
- package/dist/main.js.map +1 -1
- package/dist/pih-esm-referrals-queue-app.js +6 -1
- package/dist/pih-esm-referrals-queue-app.js.buildmanifest.json +232 -239
- package/dist/pih-esm-referrals-queue-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +6 -7
- package/rspack.config.js +1 -0
- package/dist/13.js +0 -2
- package/dist/13.js.LICENSE.txt +0 -38
- package/dist/13.js.map +0 -1
- package/dist/144.js +0 -2
- package/dist/144.js.LICENSE.txt +0 -19
- package/dist/144.js.map +0 -1
- package/dist/146.js +0 -1
- package/dist/146.js.map +0 -1
- package/dist/15.js +0 -2
- package/dist/15.js.LICENSE.txt +0 -28
- package/dist/15.js.map +0 -1
- package/dist/300.js +0 -1
- package/dist/304.js +0 -1
- package/dist/304.js.map +0 -1
- package/dist/372.js +0 -1
- package/dist/372.js.map +0 -1
- package/dist/41.js +0 -2
- package/dist/41.js.LICENSE.txt +0 -9
- package/dist/41.js.map +0 -1
- package/dist/423.js +0 -1
- package/dist/423.js.map +0 -1
- package/dist/470.js +0 -2
- package/dist/470.js.LICENSE.txt +0 -9
- package/dist/470.js.map +0 -1
- package/dist/495.js +0 -1
- package/dist/495.js.map +0 -1
- package/dist/55.js +0 -1
- package/dist/84.js +0 -2
- package/dist/84.js.LICENSE.txt +0 -30
- package/dist/84.js.map +0 -1
- package/dist/876.js +0 -2
- package/dist/876.js.LICENSE.txt +0 -9
- package/dist/876.js.map +0 -1
- package/dist/89.js +0 -1
- package/dist/89.js.map +0 -1
- package/dist/913.js.LICENSE.txt +0 -32
- package/dist/92.js +0 -2
- package/dist/92.js.LICENSE.txt +0 -9
- package/dist/92.js.map +0 -1
- package/dist/99.js +0 -1
- package/webpack.config.js +0 -1
package/dist/913.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/*! For license information please see 913.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_pih_esm_referrals_queue_app=globalThis.webpackChunk_pih_esm_referrals_queue_app||[]).push([[913],{52913:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>Y,Await:()=>Wt,BrowserRouter:()=>Rr,Form:()=>_r,HashRouter:()=>xr,Link:()=>Pr,MemoryRouter:()=>Ft,NavLink:()=>kr,Navigate:()=>Nt,NavigationType:()=>n,Outlet:()=>Bt,Route:()=>It,Router:()=>zt,RouterProvider:()=>Er,Routes:()=>Ht,ScrollRestoration:()=>Tr,UNSAFE_DataRouterContext:()=>qe,UNSAFE_DataRouterStateContext:()=>Je,UNSAFE_FetchersContext:()=>mr,UNSAFE_LocationContext:()=>Xe,UNSAFE_NavigationContext:()=>Ye,UNSAFE_RouteContext:()=>Ge,UNSAFE_ViewTransitionContext:()=>pr,UNSAFE_useRouteId:()=>Rt,UNSAFE_useScrollRestoration:()=>qr,createBrowserRouter:()=>cr,createHashRouter:()=>dr,createMemoryRouter:()=>Gt,createPath:()=>v,createRoutesFromChildren:()=>Vt,createRoutesFromElements:()=>Vt,createSearchParams:()=>nr,defer:()=>Q,generatePath:()=>M,isRouteErrorResponse:()=>re,json:()=>V,matchPath:()=>O,matchRoutes:()=>S,parsePath:()=>y,redirect:()=>Z,redirectDocument:()=>ee,renderMatches:()=>Yt,resolvePath:()=>B,unstable_HistoryRouter:()=>Dr,unstable_usePrompt:()=>Vr,unstable_useViewTransitionState:()=>Yr,useActionData:()=>kt,useAsyncError:()=>At,useAsyncValue:()=>Tt,useBeforeUnload:()=>Jr,useBlocker:()=>jt,useFetcher:()=>Hr,useFetchers:()=>Wr,useFormAction:()=>zr,useHref:()=>Ze,useInRouterContext:()=>et,useLinkClickHandler:()=>Or,useLoaderData:()=>Lt,useLocation:()=>tt,useMatch:()=>nt,useMatches:()=>Ct,useNavigate:()=>ot,useNavigation:()=>xt,useNavigationType:()=>rt,useOutlet:()=>st,useOutletContext:()=>lt,useParams:()=>ut,useResolvedPath:()=>ct,useRevalidator:()=>Dt,useRouteError:()=>_t,useRouteLoaderData:()=>Pt,useRoutes:()=>dt,useSearchParams:()=>Fr,useSubmit:()=>Ir});var n,a=r(1343),o=r(43144),i=r.t(o,2);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const s="popstate";function u(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let i=u(null==a?t.length-1:a),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=m(t?c().pathname:"/",e,r,n);return f("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function h(e){return"string"==typeof e?e:v(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:h,createURL:e=>new URL(h(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?y(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=u(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function c(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:v(t)},null,e)}function d(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=y(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:v(t))},function(e,t){f("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function h(e,t){if(!1===e||null==e)throw new Error(t)}function f(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function m(e,t,r,n){return void 0===r&&(r=null),l({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function v(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function g(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,u=o.history,c=n.Pop,d=null,f=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-f;f=e,d&&d({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:v(e);return r=r.replace(/ $/,"%20"),h(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==f&&(f=0,u.replaceState(l({},u.state,{idx:f}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(s,g),d=e,()=>{o.removeEventListener(s,g),d=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=m(w.location,e,t);r&&r(a,e),f=y()+1;let l=p(a,f),s=w.createHref(a);try{u.pushState(l,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(s)}i&&d&&d({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=m(w.location,e,t);r&&r(a,e),f=y();let o=p(a,f),l=w.createHref(a);u.replaceState(o,"",l),i&&d&&d({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var b;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(b||(b={}));const w=new Set(["lazy","caseSensitive","path","id","index","children"]);function E(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(h(!0!==e.index||!e.children,"Cannot specify children on an index route"),h(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=l({},e,t(e),{id:i});return n[i]=r,r}{let r=l({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=E(e.children,t,o,n)),r}})}function S(e,t,r){void 0===r&&(r="/");let n=N(("string"==typeof t?y(t):t).pathname||"/",r);if(null==n)return null;let a=x(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=F(n);o=j(a[e],t)}return o}function R(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function x(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(h(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=K([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(h(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),x(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:U(l,e.index),routesMeta:s})};return e.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of D(e.path))a(e,t,r);else a(e,t)}),t}function D(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=D(n.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}const C=/^:[\w-]+$/,L=3,P=2,k=1,_=10,T=-2,A=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=T),t&&(n+=P),r.filter(e=>!A(e)).reduce((e,t)=>e+(C.test(t)?L:""===t?k:_),n)}function j(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=O({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:K([a,u.pathname]),pathnameBase:$(K([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=K([a,u.pathnameBase]))}return o}function M(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(f(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:([\w-]+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return h("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function O(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),f("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function F(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return f(!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 N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function B(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?y(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:q(n),hash:J(a)}}function I(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function z(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function H(e,t){let r=z(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function W(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=y(e):(a=l({},e),h(!a.pathname||!a.pathname.includes("?"),I("?","pathname","search",a)),h(!a.pathname||!a.pathname.includes("#"),I("#","pathname","hash",a)),h(!a.search||!a.search.includes("#"),I("#","search","hash",a)));let o,i=""===e||""===a.pathname,s=i?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=B(a,o),c=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!d||(u.pathname+="/"),u}const K=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),q=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",J=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",V=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),l({},r,{headers:n}))};class Y extends Error{}class X{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],h(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise((e,t)=>r=t),this.controller=new AbortController;let n=()=>r(new Y("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})},{}),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 r=Promise.race([t,this.abortPromise]).then(t=>this.onSettle(r,e,void 0,t),t=>this.onSettle(r,e,t));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof Y)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new 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:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach(r=>r(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 r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise(t=>{this.subscribe(n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)})})}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return h(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:G(n)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function G(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const Q=function(e,t){return void 0===t&&(t={}),new X(e,"number"==typeof t?{status:t}:t)},Z=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,l({},r,{headers:n}))},ee=(e,t)=>{let r=Z(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class te{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function re(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ne=["post","put","patch","delete"],ae=new Set(ne),oe=["get",...ne],ie=new Set(oe),le=new Set([301,302,303,307,308]),se=new Set([307,308]),ue={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},de={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},he=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),pe="remix-router-transitions";function me(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,a=!r;let o;if(h(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=fe;let i,s,u={},c=E(e.routes,o,void 0,u),d=e.basename||"/",p=l({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),v=null,y=new Set,g=null,w=null,x=null,D=null!=e.hydrationData,C=S(c,e.history.location,d),L=null;if(null==C){let t=_e(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=ke(c);C=r,L={[n.id]:t}}let P,k=C.some(e=>e.route.lazy),_=C.some(e=>e.route.loader);if(k)s=!1;else if(_)if(p.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=C.findIndex(e=>void 0!==r[e.route.id]);s=C.slice(0,e+1).every(n)}else s=C.every(n)}else s=null!=e.hydrationData;else s=!0;let T,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:s,navigation:ue,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||L,fetchers:new Map,blockers:new Map},U=n.Pop,j=!1,M=!1,O=new Map,F=null,B=!1,I=!1,z=[],H=[],W=new Map,K=0,$=-1,q=new Map,J=new Set,V=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),A=l({},A,e);let r=[],n=[];p.v7_fetcherPersist&&A.fetchers.forEach((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))}),[...y].forEach(e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync})),p.v7_fetcherPersist&&(r.forEach(e=>A.fetchers.delete(e)),n.forEach(e=>be(e)))}function te(t,r,a){var o,s;let u,{flushSync:d}=void 0===a?{}:a,h=null!=A.actionData&&null!=A.navigation.formMethod&&Oe(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?A.actionData:null;let f=r.loaderData?Le(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,p=A.blockers;p.size>0&&(p=new Map(p),p.forEach((e,t)=>p.set(t,de)));let m,v=!0===j||null!=A.navigation.formMethod&&Oe(A.navigation.formMethod)&&!0!==(null==(s=t.state)?void 0:s._isRedirect);if(i&&(c=i,i=void 0),B||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=O.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:O.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(M){let e=O.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}ee(l({},r,{actionData:u,loaderData:f,historyAction:U,location:t,initialized:!0,navigation:ue,revalidation:"idle",restoreScrollPosition:Ve(t,r.matches||A.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),U=n.Pop,j=!1,M=!1,B=!1,I=!1,z=[],H=[]}async function re(t,r,a){T&&T.abort(),T=null,U=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(g&&x){let r=Je(e,t);g[r]=x()}}(A.location,A.matches),j=!0===(a&&a.preventScrollReset),M=!0===(a&&a.enableViewTransition);let s=i||c,h=a&&a.overrideNavigation,f=S(s,r,d),m=!0===(a&&a.flushSync);if(!f){let e=_e(404,{pathname:r.pathname}),{matches:t,route:n}=ke(s);return qe(),void te(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:m})}if(A.initialized&&!I&&(v=A.location,y=r,v.pathname===y.pathname&&v.search===y.search&&(""===v.hash?""!==y.hash:v.hash===y.hash||""!==y.hash))&&!(a&&a.submission&&Oe(a.submission.formMethod)))return void te(r,{matches:f},{flushSync:m});var v,y;T=new AbortController;let w,E,R=Re(e.history,r,T.signal,a&&a.submission);if(a&&a.pendingError)E={[Pe(f).route.id]:a.pendingError};else if(a&&a.submission&&Oe(a.submission.formMethod)){let e=await async function(e,t,r,a,i){void 0===i&&(i={}),oe();let l,s=function(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}}(t,r);ee({navigation:s},{flushSync:!0===i.flushSync});let c=Ie(a,t);if(c.route.action||c.route.lazy){if(l=await Se("action",e,c,a,u,o,d,p.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:b.error,error:_e(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Me(l)){let e;return e=i&&null!=i.replace?i.replace:l.location===A.location.pathname+A.location.search,await ne(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(je(l)){let e=Pe(a,c.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Ue(l))throw _e(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(R,r,a.submission,f,{replace:a.replace,flushSync:m});if(e.shortCircuited)return;w=e.pendingActionData,E=e.pendingActionError,h=He(r,a.submission),m=!1,R=new Request(R.url,{signal:R.signal})}let{shortCircuited:D,loaderData:C,errors:L}=await async function(t,r,n,a,o,s,u,h,f,m,v){let y=a||He(r,o),g=o||s||ze(y),b=i||c,[w,E]=ge(e.history,A,n,g,r,p.v7_partialHydration&&!0===h,I,z,H,X,V,J,b,d,m,v);if(qe(e=>!(n&&n.some(t=>t.route.id===e))||w&&w.some(t=>t.route.id===e)),$=++K,0===w.length&&0===E.length){let e=xe();return te(r,l({matches:n,loaderData:{},errors:v||null},m?{actionData:m}:{},e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(!(B||p.v7_partialHydration&&h)){E.forEach(e=>{let t=A.fetchers.get(e.key),r=We(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)});let e=m||A.actionData;ee(l({navigation:y},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},E.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:f})}E.forEach(e=>{W.has(e.key)&&we(e.key),e.controller&&W.set(e.key,e.controller)});let S=()=>E.forEach(e=>we(e.key));T&&T.signal.addEventListener("abort",S);let{results:R,loaderResults:x,fetcherResults:D}=await ae(A.matches,n,w,E,t);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",S),E.forEach(e=>W.delete(e.key));let C=Te(R);if(C){if(C.idx>=w.length){let e=E[C.idx-w.length].key;J.add(e)}return await ne(A,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:P}=Ce(A,n,w,x,v,E,D,G);G.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&G.delete(t)})}),p.v7_partialHydration&&h&&A.errors&&Object.entries(A.errors).filter(e=>{let[t]=e;return!w.some(e=>e.route.id===t)}).forEach(e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})});let k=xe(),_=De($),U=k||_||E.length>0;return l({loaderData:L,errors:P},U?{fetchers:new Map(A.fetchers)}:{})}(R,r,f,h,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,m,w,E);D||(T=null,te(r,l({matches:f},w?{actionData:w}:{},{loaderData:C,errors:L})))}async function ne(a,o,i){let{submission:s,fetcherSubmission:u,replace:c}=void 0===i?{}:i;o.revalidate&&(I=!0);let f=m(a.location,o.location,{_isRedirect:!0});if(h(f,"Expected a location on the redirect navigation"),r){let r=!1;if(o.reloadDocument)r=!0;else if(he.test(o.location)){const n=e.history.createURL(o.location);r=n.origin!==t.location.origin||null==N(n.pathname,d)}if(r)return void(c?t.location.replace(o.location):t.location.assign(o.location))}T=null;let p=!0===c?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=a.navigation;!s&&!u&&v&&y&&g&&(s=ze(a.navigation));let b=s||u;if(se.has(o.status)&&b&&Oe(b.formMethod))await re(p,f,{submission:l({},b,{formAction:o.location}),preventScrollReset:j});else{let e=He(f,s);await re(p,f,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:j})}}async function ae(t,r,n,a,i){let l=await Promise.all([...n.map(e=>Se("loader",i,e,r,u,o,d,p.v7_relativeSplatPath)),...a.map(t=>t.matches&&t.match&&t.controller?Se("loader",Re(e.history,t.path,t.controller.signal),t.match,t.matches,u,o,d,p.v7_relativeSplatPath):{type:b.error,error:_e(404,{pathname:t.path})})]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Fe(t,n,s,s.map(()=>i.signal),!1,A.loaderData),Fe(t,a.map(e=>e.match),c,a.map(e=>e.controller?e.controller.signal:null),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function oe(){I=!0,z.push(...qe()),V.forEach((e,t)=>{W.has(t)&&(H.push(t),we(t))})}function ie(e,t,r){void 0===r&&(r={}),A.fetchers.set(e,t),ee({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function le(e,t,r,n){void 0===n&&(n={});let a=Pe(A.matches,t);be(e),ee({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function me(e){return p.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),A.fetchers.get(e)||ce}function be(e){let t=A.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&q.has(e)||we(e),V.delete(e),q.delete(e),J.delete(e),X.delete(e),A.fetchers.delete(e)}function we(e){let t=W.get(e);h(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function Ee(e){for(let t of e){let e=Ke(me(t).data);A.fetchers.set(t,e)}}function xe(){let e=[],t=!1;for(let r of J){let n=A.fetchers.get(r);h(n,"Expected fetcher: "+r),"loading"===n.state&&(J.delete(r),e.push(r),t=!0)}return Ee(e),t}function De(e){let t=[];for(let[r,n]of q)if(n<e){let e=A.fetchers.get(r);h(e,"Expected fetcher: "+r),"loading"===e.state&&(we(r),q.delete(r),t.push(r))}return Ee(t),t.length>0}function Ae(e){A.blockers.delete(e),Q.delete(e)}function Be(e,t){let r=A.blockers.get(e)||de;h("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(A.blockers);n.set(e,t),ee({blockers:n})}function $e(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&f(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=A.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function qe(e){let t=[];return G.forEach((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),G.delete(n))}),t}function Je(e,t){return w&&w(e,t.map(e=>R(e,A.loaderData)))||e.key}function Ve(e,t){if(g){let r=Je(e,t),n=g[r];if("number"==typeof n)return n}return null}return P={get basename(){return d},get future(){return p},get state(){return A},get routes(){return c},get window(){return t},initialize:function(){if(v=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(Z)return void(Z=!1);f(0===Q.size||null!=a,"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 o=$e({currentLocation:A.location,nextLocation:n,historyAction:r});return o&&null!=a?(Z=!0,e.history.go(-1*a),void Be(o,{state:"blocked",location:n,proceed(){Be(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(A.blockers);e.set(o,de),ee({blockers:e})}})):re(r,n)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(pe);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,O);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(pe,JSON.stringify(r))}catch(e){f(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,O);t.addEventListener("pagehide",e),F=()=>t.removeEventListener("pagehide",e)}return A.initialized||re(n.Pop,A.location,{initialHydration:!0}),P},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,x=t,w=r||null,!D&&A.navigation===ue){D=!0;let e=Ve(A.location,A.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{g=null,x=null,w=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=ve(A.location,A.matches,d,p.v7_prependBasename,r,p.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:i,submission:s,error:u}=ye(p.v7_normalizeFormMethod,!1,o,a),c=A.location,h=m(A.location,i,a&&a.state);h=l({},h,e.history.encodeLocation(h));let f=a&&null!=a.replace?a.replace:void 0,v=n.Push;!0===f?v=n.Replace:!1===f||null!=s&&Oe(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=!0===(a&&a.unstable_flushSync),b=$e({currentLocation:c,nextLocation:h,historyAction:v});if(!b)return await re(v,h,{submission:s,pendingError:u,preventScrollReset:y,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:g});Be(b,{state:"blocked",location:h,proceed(){Be(b,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(b,de),ee({blockers:e})}})},fetch:function(t,r,n,l){if(a)throw new 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.");W.has(t)&&we(t);let s=!0===(l&&l.unstable_flushSync),f=i||c,m=ve(A.location,A.matches,d,p.v7_prependBasename,n,p.v7_relativeSplatPath,r,null==l?void 0:l.relative),v=S(f,m,d);if(!v)return void le(t,r,_e(404,{pathname:m}),{flushSync:s});let{path:y,submission:g,error:b}=ye(p.v7_normalizeFormMethod,!0,m,l);if(b)return void le(t,r,b,{flushSync:s});let w=Ie(v,y);j=!0===(l&&l.preventScrollReset),g&&Oe(g.formMethod)?async function(t,r,n,a,l,s,f){if(oe(),V.delete(t),!a.route.action&&!a.route.lazy){let e=_e(405,{method:f.formMethod,pathname:n,routeId:r});return void le(t,r,e,{flushSync:s})}let m=A.fetchers.get(t);ie(t,function(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}}(f,m),{flushSync:s});let v=new AbortController,y=Re(e.history,n,v.signal,f);W.set(t,v);let g=K,b=await Se("action",y,a,l,u,o,d,p.v7_relativeSplatPath);if(y.signal.aborted)return void(W.get(t)===v&&W.delete(t));if(p.v7_fetcherPersist&&X.has(t)){if(Me(b)||je(b))return void ie(t,Ke(void 0))}else{if(Me(b))return W.delete(t),$>g?void ie(t,Ke(void 0)):(J.add(t),ie(t,We(f)),ne(A,b,{fetcherSubmission:f}));if(je(b))return void le(t,r,b.error)}if(Ue(b))throw _e(400,{type:"defer-action"});let w=A.navigation.location||A.location,E=Re(e.history,w,v.signal),R=i||c,x="idle"!==A.navigation.state?S(R,A.navigation.location,d):A.matches;h(x,"Didn't find any matches after fetcher action");let D=++K;q.set(t,D);let C=We(f,b.data);A.fetchers.set(t,C);let[L,P]=ge(e.history,A,x,f,w,!1,I,z,H,X,V,J,R,d,{[a.route.id]:b.data},void 0);P.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=A.fetchers.get(t),n=We(void 0,r?r.data:void 0);A.fetchers.set(t,n),W.has(t)&&we(t),e.controller&&W.set(t,e.controller)}),ee({fetchers:new Map(A.fetchers)});let k=()=>P.forEach(e=>we(e.key));v.signal.addEventListener("abort",k);let{results:_,loaderResults:j,fetcherResults:M}=await ae(A.matches,x,L,P,E);if(v.signal.aborted)return;v.signal.removeEventListener("abort",k),q.delete(t),W.delete(t),P.forEach(e=>W.delete(e.key));let O=Te(_);if(O){if(O.idx>=L.length){let e=P[O.idx-L.length].key;J.add(e)}return ne(A,O.result)}let{loaderData:F,errors:N}=Ce(A,A.matches,L,j,void 0,P,M,G);if(A.fetchers.has(t)){let e=Ke(b.data);A.fetchers.set(t,e)}De(D),"loading"===A.navigation.state&&D>$?(h(U,"Expected pending action"),T&&T.abort(),te(A.navigation.location,{matches:x,loaderData:F,errors:N,fetchers:new Map(A.fetchers)})):(ee({errors:N,loaderData:Le(A.loaderData,F,x,N),fetchers:new Map(A.fetchers)}),I=!1)}(t,r,y,w,v,s,g):(V.set(t,{routeId:r,path:y}),async function(t,r,n,a,i,l,s){let c=A.fetchers.get(t);ie(t,We(s,c?c.data:void 0),{flushSync:l});let f=new AbortController,m=Re(e.history,n,f.signal);W.set(t,f);let v=K,y=await Se("loader",m,a,i,u,o,d,p.v7_relativeSplatPath);if(Ue(y)&&(y=await Ne(y,m.signal,!0)||y),W.get(t)===f&&W.delete(t),!m.signal.aborted){if(!X.has(t))return Me(y)?$>v?void ie(t,Ke(void 0)):(J.add(t),void await ne(A,y)):void(je(y)?le(t,r,y.error):(h(!Ue(y),"Unhandled fetcher deferred data"),ie(t,Ke(y.data))));ie(t,Ke(void 0))}}(t,r,y,w,v,s,g))},revalidate:function(){oe(),ee({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?re(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):re(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:me,deleteFetcher:function(e){if(p.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else be(e);ee({fetchers:new Map(A.fetchers)})},dispose:function(){v&&v(),F&&F(),y.clear(),T&&T.abort(),A.fetchers.forEach((e,t)=>be(t)),A.blockers.forEach((e,t)=>Ae(t))},getBlocker:function(e,t){let r=A.blockers.get(e)||de;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:Ae,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){u={},i=E(e,o,void 0,u)}},P}function ve(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=W(a||".",H(s,o),N(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||Be(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:K([r,c.pathname])),v(c)}function ye(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!ie.has(a.toLowerCase())))return{path:r,error:_e(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:_e(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=Ae(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Oe(u))return l();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"},""):String(n.body);return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Oe(u))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(h("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=xe(n.formData),i=n.formData;else if(n.body instanceof FormData)o=xe(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=De(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=De(o)}catch(e){return l()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Oe(d.formMethod))return{path:r,submission:d};let f=y(r);return t&&f.search&&Be(f.search)&&o.append("index",""),f.search="?"+o,{path:v(f),submission:d}}function ge(e,t,r,n,a,o,i,s,u,c,d,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v?Object.keys(v)[0]:void 0,E=function(e,t){let r=e;if(t){let n=e.findIndex(e=>e.route.id===t);n>=0&&(r=e.slice(0,n))}return r}(r,w).filter((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||s.some(t=>t===e.route.id))return!0;let u=t.matches[r],c=e;return we(e,l({currentUrl:g,currentParams:u.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||be(u,c)}))}),R=[];return d.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||c.has(a))return;let s=S(f,e.path,p);if(!s)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let d=t.fetchers.get(a),m=Ie(s,e.path),v=!1;v=!h.has(a)&&(!!u.includes(a)||(d&&"idle"!==d.state&&void 0===d.data?i:we(m,l({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i})))),v&&R.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:m,controller:new AbortController})}),[E,R]}function be(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function we(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function Ee(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];h(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;f(!t,'Route "'+a.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||w.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,l({},t(a),{lazy:void 0}))}async function Se(e,t,r,n,a,o,i,l,s){let u,c,d;void 0===s&&(s={});let f=e=>{let n,a=new Promise((e,t)=>n=t);return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([f(n).catch(t=>{e=t}),Ee(r.route,o,a)]);if(e)throw e;c=t[0]}else{if(await Ee(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw _e(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:b.data,data:void 0}}c=await f(n)}else{if(!n){let e=new URL(t.url);throw _e(404,{pathname:e.pathname+e.search})}c=await f(n)}h(void 0!==c,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){u=b.error,c=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(p=c)&&"number"==typeof p.status&&"string"==typeof p.statusText&&"object"==typeof p.headers&&void 0!==p.body){let e,a=c.status;if(le.has(a)){let e=c.headers.get("Location");if(h(e,"Redirects returned/thrown from loaders/actions must have a Location header"),he.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=N(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=ve(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:b.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:u===b.error?b.error:b.data,response:c};try{let t=c.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==c.body?null:await c.json():await c.text()}catch(e){return{type:b.error,error:e}}return u===b.error?{type:u,error:new te(a,c.statusText,e),headers:c.headers}:{type:b.data,data:e,statusCode:c.status,headers:c.headers}}var p,m,v;return u===b.error?{type:u,error:c}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(c)?{type:b.deferred,deferredData:c,statusCode:null==(m=c.init)?void 0:m.status,headers:(null==(v=c.init)?void 0:v.headers)&&new Headers(c.init.headers)}:{type:b.data,data:c}}function Re(e,t,r,n){let a=e.createURL(Ae(t)).toString(),o={signal:r};if(n&&Oe(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=xe(n.formData):o.body=n.formData}return new Request(a,o)}function xe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function De(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ce(e,t,r,n,a,o,i,s){let{loaderData:u,errors:c}=function(e,t,r,n,a){let o,i={},l=null,s=!1,u={};return r.forEach((r,c)=>{let d=t[c].route.id;if(h(!Me(r),"Cannot handle redirect results in processLoaderData"),je(r)){let t=Pe(e,d),a=r.error;n&&(a=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=a),i[d]=void 0,s||(s=!0,o=re(r.error)?r.error.status:500),r.headers&&(u[d]=r.headers)}else Ue(r)?(a.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null==r.statusCode||200===r.statusCode||s||(o=r.statusCode),r.headers&&(u[d]=r.headers)}),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n,a,s);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];h(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let s=i[t];if(!a||!a.signal.aborted)if(je(s)){let t=Pe(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=l({},c,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(Me(s))h(!1,"Unhandled fetcher revalidation redirect");else if(Ue(s))h(!1,"Unhandled fetcher deferred data");else{let t=Ke(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:c}}function Le(e,t,r,n){let a=l({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Pe(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function ke(e){let t=1===e.length?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 _e(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new te(e||500,i,new Error(l),!0)}function Te(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Me(r))return{result:r,idx:t}}}function Ae(e){return v(l({},"string"==typeof e?y(e):e,{hash:""}))}function Ue(e){return e.type===b.deferred}function je(e){return e.type===b.error}function Me(e){return(e&&e.type)===b.redirect}function Oe(e){return ae.has(e.toLowerCase())}async function Fe(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find(e=>e.route.id===s.route.id),c=null!=u&&!be(u,s)&&void 0!==(o&&o[s.route.id]);if(Ue(l)&&(a||c)){let e=n[i];h(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ne(l,e,a).then(e=>{e&&(r[i]=e||r[i])})}}}async function Ne(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)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 Be(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function Ie(e,t){let r="string"==typeof t?y(t).search:t.search;if(e[e.length-1].route.index&&Be(r||""))return e[e.length-1];let n=z(e);return n[n.length-1]}function ze(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function He(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 We(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 Ke(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 $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$e.apply(this,arguments)}Symbol("deferred");const qe=a.createContext(null),Je=a.createContext(null),Ve=a.createContext(null),Ye=a.createContext(null),Xe=a.createContext(null),Ge=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Qe=a.createContext(null);function Ze(e,t){let{relative:r}=void 0===t?{}:t;et()||h(!1);let{basename:n,navigator:o}=a.useContext(Ye),{hash:i,pathname:l,search:s}=ct(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:K([n,l])),o.createHref({pathname:u,search:s,hash:i})}function et(){return null!=a.useContext(Xe)}function tt(){return et()||h(!1),a.useContext(Xe).location}function rt(){return a.useContext(Xe).navigationType}function nt(e){et()||h(!1);let{pathname:t}=tt();return a.useMemo(()=>O(e,t),[t,e])}function at(e){a.useContext(Ye).static||a.useLayoutEffect(e)}function ot(){let{isDataRoute:e}=a.useContext(Ge);return e?function(){let{router:e}=wt(gt.UseNavigateStable),t=St(bt.UseNavigateStable),r=a.useRef(!1);return at(()=>{r.current=!0}),a.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,$e({fromRouteId:t},a)))},[e,t])}():function(){et()||h(!1);let e=a.useContext(qe),{basename:t,future:r,navigator:n}=a.useContext(Ye),{matches:o}=a.useContext(Ge),{pathname:i}=tt(),l=JSON.stringify(H(o,r.v7_relativeSplatPath)),s=a.useRef(!1);return at(()=>{s.current=!0}),a.useCallback(function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let o=W(r,JSON.parse(l),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:K([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)},[t,n,l,i,e])}()}const it=a.createContext(null);function lt(){return a.useContext(it)}function st(e){let t=a.useContext(Ge).outlet;return t?a.createElement(it.Provider,{value:e},t):t}function ut(){let{matches:e}=a.useContext(Ge),t=e[e.length-1];return t?t.params:{}}function ct(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(Ye),{matches:o}=a.useContext(Ge),{pathname:i}=tt(),l=JSON.stringify(H(o,n.v7_relativeSplatPath));return a.useMemo(()=>W(e,JSON.parse(l),i,"path"===r),[e,l,i,r])}function dt(e,t){return ht(e,t)}function ht(e,t,r,o){et()||h(!1);let{navigator:i}=a.useContext(Ye),{matches:l}=a.useContext(Ge),s=l[l.length-1],u=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,f=tt();if(t){var p;let e="string"==typeof t?y(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||h(!1),d=e}else d=f;let m=d.pathname||"/",v=m;if("/"!==c){let e=c.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=S(e,{pathname:v}),b=yt(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:K([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:K([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,r,o);return t&&b?a.createElement(Xe.Provider,{value:{location:$e({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},b):b}function ft(){let e=_t(),t=re(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const pt=a.createElement(ft,null);class mt extends a.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||"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){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(Ge.Provider,{value:this.props.routeContext},a.createElement(Qe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vt(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(qe);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(Ge.Provider,{value:t},n)}function yt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex(e=>e.route.id&&(null==s?void 0:s[e.route.id]));e>=0||h(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}}return l.reduceRight((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=s&&n.route.id?s[n.route.id]:void 0,h=n.route.errorElement||pt,u&&(c<0&&0===o?(Mt[p="route-fallback"]||(Mt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(vt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(mt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var gt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gt||{}),bt=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}(bt||{});function wt(e){let t=a.useContext(qe);return t||h(!1),t}function Et(e){let t=a.useContext(Je);return t||h(!1),t}function St(e){let t=function(){let e=a.useContext(Ge);return e||h(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||h(!1),r.route.id}function Rt(){return St(bt.UseRouteId)}function xt(){return Et(bt.UseNavigation).navigation}function Dt(){let e=wt(gt.UseRevalidator),t=Et(bt.UseRevalidator);return a.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function Ct(){let{matches:e,loaderData:t}=Et(bt.UseMatches);return a.useMemo(()=>e.map(e=>R(e,t)),[e,t])}function Lt(){let e=Et(bt.UseLoaderData),t=St(bt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function Pt(e){return Et(bt.UseRouteLoaderData).loaderData[e]}function kt(){let e=Et(bt.UseActionData),t=St(bt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function _t(){var e;let t=a.useContext(Qe),r=Et(bt.UseRouteError),n=St(bt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function Tt(){let e=a.useContext(Ve);return null==e?void 0:e._data}function At(){let e=a.useContext(Ve);return null==e?void 0:e._error}let Ut=0;function jt(e){let{router:t,basename:r}=wt(gt.UseBlocker),n=Et(bt.UseBlocker),[o,i]=a.useState(""),l=a.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:$e({},n,{pathname:N(n.pathname,r)||n.pathname}),nextLocation:$e({},a,{pathname:N(a.pathname,r)||a.pathname}),historyAction:o})},[r,e]);return a.useEffect(()=>{let e=String(++Ut);return i(e),()=>t.deleteBlocker(e)},[t]),a.useEffect(()=>{""!==o&&t.getBlocker(o,l)},[t,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):de}const Mt={},Ot=a.startTransition;function Ft(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,l=a.useRef();null==l.current&&(l.current=u({initialEntries:n,initialIndex:o,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:h}=i||{},f=a.useCallback(e=>{h&&Ot?Ot(()=>d(e)):d(e)},[d,h]);return a.useLayoutEffect(()=>s.listen(f),[s,f]),a.createElement(zt,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:s,future:i})}function Nt(e){let{to:t,replace:r,state:n,relative:o}=e;et()||h(!1);let{future:i,static:l}=a.useContext(Ye),{matches:s}=a.useContext(Ge),{pathname:u}=tt(),c=ot(),d=W(t,H(s,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(d);return a.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:o}),[c,f,o,r,n]),null}function Bt(e){return st(e.context)}function It(e){h(!1)}function zt(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:l,static:s=!1,future:u}=e;et()&&h(!1);let c=t.replace(/^\/*/,"/"),d=a.useMemo(()=>({basename:c,navigator:l,static:s,future:$e({v7_relativeSplatPath:!1},u)}),[c,u,l,s]);"string"==typeof o&&(o=y(o));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=o,b=a.useMemo(()=>{let e=N(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}},[c,f,p,m,v,g,i]);return null==b?null:a.createElement(Ye.Provider,{value:d},a.createElement(Xe.Provider,{children:r,value:b}))}function Ht(e){let{children:t,location:r}=e;return dt(Vt(t),r)}function Wt(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(qt,{resolve:n,errorElement:r},a.createElement(Jt,null,t))}var Kt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Kt||{});const $t=new Promise(()=>{});class qt extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=Kt.pending;if(r instanceof Promise)if(this.state.error){o=Kt.error;let e=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o=void 0!==n._error?Kt.error:void 0!==n._data?Kt.success:Kt.pending):(o=Kt.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then(e=>Object.defineProperty(r,"_data",{get:()=>e}),e=>Object.defineProperty(r,"_error",{get:()=>e})));else o=Kt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===Kt.error&&n._error instanceof Y)throw $t;if(o===Kt.error&&!t)throw n._error;if(o===Kt.error)return a.createElement(Ve.Provider,{value:n,children:t});if(o===Kt.success)return a.createElement(Ve.Provider,{value:n,children:e});throw n}}function Jt(e){let{children:t}=e,r=Tt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function Vt(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,(e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,Vt(e.props.children,o));e.type!==It&&h(!1),e.props.index&&e.props.children&&h(!1);let i={id:e.props.id||o.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:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=Vt(e.props.children,o)),r.push(i)}),r}function Yt(e){return yt(e)}function Xt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Gt(e,t){return me({basename:null==t?void 0:t.basename,future:$e({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Xt}).initialize()}function Qt(){return Qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qt.apply(this,arguments)}function Zt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const er="get",tr="application/x-www-form-urlencoded";function rr(e){return null!=e&&"string"==typeof e.tagName}function nr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}let ar=null;const or=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ir(e){return null==e||or.has(e)?e:null}const lr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],sr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ur=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}function cr(e,t){return me({basename:null==t?void 0:t.basename,future:Qt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||hr(),routes:e,mapRouteProperties:Xt,window:null==t?void 0:t.window}).initialize()}function dr(e,t){return me({basename:null==t?void 0:t.basename,future:Qt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:d({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||hr(),routes:e,mapRouteProperties:Xt,window:null==t?void 0:t.window}).initialize()}function hr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Qt({},t,{errors:fr(t.errors)})),t}function fr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new te(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const pr=a.createContext({isTransitioning:!1}),mr=a.createContext(new Map),vr=a.startTransition,yr=i.flushSync,gr=a.useId;function br(e){yr?yr(e):e()}class wr{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}}function Er(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[l,s]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback(e=>{g?function(e){vr?vr(e):e()}(e):e()},[g]),w=a.useCallback((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach(e=>y.current.delete(e)),e.fetchers.forEach((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)});let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(o&&!l){if(a){br(()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=r.window.document.startViewTransition(()=>{br(()=>i(e))});return t.finished.finally(()=>{br(()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})}),void br(()=>p(t))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?br(()=>i(e)):b(()=>i(e))},[r.window,f,d,y,b]);a.useLayoutEffect(()=>r.subscribe(w),[r,w]),a.useEffect(()=>{u.isTransitioning&&!u.flushSync&&h(new wr)},[u]),a.useEffect(()=>{if(d&&l&&r.window){let e=l,t=d.promise,n=r.window.document.startViewTransition(async()=>{b(()=>i(e)),await t});n.finished.finally(()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}),p(n)}},[b,l,d,r.window]),a.useEffect(()=>{d&&l&&o.location.key===l.location.key&&d.resolve()},[d,f,o.location,l]),a.useEffect(()=>{!u.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[u.isTransitioning,m]),a.useEffect(()=>{},[]);let E=a.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})}),[r]),S=r.basename||"/",R=a.useMemo(()=>({router:r,navigator:E,static:!1,basename:S}),[r,E,S]);return a.createElement(a.Fragment,null,a.createElement(qe.Provider,{value:R},a.createElement(Je.Provider,{value:o},a.createElement(mr.Provider,{value:y.current},a.createElement(pr.Provider,{value:u},a.createElement(zt,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(Sr,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Sr(e){let{routes:t,future:r,state:n}=e;return ht(t,void 0,n,r)}function Rr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback(e=>{d&&vr?vr(()=>u(e)):u(e)},[u,d]);return a.useLayoutEffect(()=>l.listen(h),[l,h]),a.createElement(zt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function xr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=d({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:c}=n||{},h=a.useCallback(e=>{c&&vr?vr(()=>u(e)):u(e)},[u,c]);return a.useLayoutEffect(()=>l.listen(h),[l,h]),a.createElement(zt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function Dr(e){let{basename:t,children:r,future:n,history:o}=e,[i,l]=a.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},u=a.useCallback(e=>{s&&vr?vr(()=>l(e)):l(e)},[l,s]);return a.useLayoutEffect(()=>o.listen(u),[o,u]),a.createElement(zt,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Cr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Lr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pr=a.forwardRef(function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=Zt(e,lr),{basename:p}=a.useContext(Ye),m=!1;if("string"==typeof c&&Lr.test(c)&&(r=c,Cr))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=N(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=Ze(c,{relative:o}),y=Or(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",Qt({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))}),kr=a.forwardRef(function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=Zt(e,sr),h=ct(s,{relative:d.relative}),f=tt(),p=a.useContext(Je),{navigator:m,basename:v}=a.useContext(Ye),y=null!=p&&Yr(h)&&!0===u,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,b=f.pathname,w=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&v&&(w=N(w,v)||w);const E="/"!==g&&g.endsWith("/")?g.length-1:g.length;let S,R=b===g||!i&&b.startsWith(g)&&"/"===b.charAt(E),x=null!=w&&(w===g||!i&&w.startsWith(g)&&"/"===w.charAt(g.length)),D={isActive:R,isPending:x,isTransitioning:y},C=R?r:void 0;S="function"==typeof o?o(D):[o,R?"active":null,x?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof l?l(D):l;return a.createElement(Pr,Qt({},d,{"aria-current":C,className:S,ref:t,style:L,to:s,unstable_viewTransition:u}),"function"==typeof c?c(D):c)}),_r=a.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:l,method:s=er,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=Zt(e,ur),m=Ir(),v=zr(u,{relative:d}),y="get"===s.toLowerCase()?"get":"post";return a.createElement("form",Qt({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:l,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))});function Tr(e){let{getKey:t,storageKey:r}=e;return qr({getKey:t,storageKey:r}),null}var Ar,Ur;function jr(e){let t=a.useContext(qe);return t||h(!1),t}function Mr(e){let t=a.useContext(Je);return t||h(!1),t}function Or(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,u=ot(),c=tt(),d=ct(e,{relative:l});return a.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:v(c)===v(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}},[c,u,d,n,o,r,e,i,l,s])}function Fr(e){let t=a.useRef(nr(e)),r=a.useRef(!1),n=tt(),o=a.useMemo(()=>function(e,t){let r=nr(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),i=ot(),l=a.useCallback((e,t)=>{const n=nr("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)},[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ar||(Ar={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ur||(Ur={}));let Nr=0,Br=()=>"__"+String(++Nr)+"__";function Ir(){let{router:e}=jr(Ar.UseSubmit),{basename:t}=a.useContext(Ye),r=Rt();return a.useCallback(function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(rr(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?N(i,t):null,r=e.getAttribute("method")||er,a=ir(e.getAttribute("enctype"))||tr,o=new FormData(e)}else if(function(e){return rr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return rr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?N(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||er,a=ir(e.getAttribute("formenctype"))||ir(i.getAttribute("enctype"))||tr,o=new FormData(i,e),!function(){if(null===ar)try{new FormData(document.createElement("form"),0),ar=!1}catch(e){ar=!0}return ar}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else{if(rr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=er,n=null,a=tr,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||Br();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function zr(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext(Ye),o=a.useContext(Ge);o||h(!1);let[i]=o.matches.slice(-1),l=Qt({},ct(e||".",{relative:r})),s=tt();if(null==e){l.search=s.search;let e=new URLSearchParams(l.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),l.search=e.toString()?"?"+e.toString():"")}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:K([n,l.pathname])),v(l)}function Hr(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=jr(Ar.UseFetcher),o=Mr(Ur.UseFetcher),i=a.useContext(mr),l=a.useContext(Ge),s=null==(t=l.matches[l.matches.length-1])?void 0:t.route.id;i||h(!1),l||h(!1),null==s&&h(!1);let u=gr?gr():"",[c,d]=a.useState(r||u);r&&r!==c?d(r):c||d(Br()),a.useEffect(()=>(n.getFetcher(c),()=>{n.deleteFetcher(c)}),[n,c]);let f=a.useCallback((e,t)=>{s||h(!1),n.fetch(c,s,e,t)},[c,s,n]),p=Ir(),m=a.useCallback((e,t)=>{p(e,Qt({},t,{navigate:!1,fetcherKey:c}))},[c,p]),v=a.useMemo(()=>a.forwardRef((e,t)=>a.createElement(_r,Qt({},e,{navigate:!1,fetcherKey:c,ref:t}))),[c]),y=o.fetchers.get(c)||ce,g=i.get(c);return a.useMemo(()=>Qt({Form:v,submit:m,load:f},y,{data:g}),[v,m,f,y,g])}function Wr(){let e=Mr(Ur.UseFetchers);return Array.from(e.fetchers.entries()).map(e=>{let[t,r]=e;return Qt({},r,{key:t})})}const Kr="react-router-scroll-positions";let $r={};function qr(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=jr(Ar.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=Mr(Ur.UseScrollRestoration),{basename:l}=a.useContext(Ye),s=tt(),u=Ct(),c=xt();a.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e){let{capture:t}={};a.useEffect(()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,t])}(a.useCallback(()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;$r[e]=window.scrollY}try{sessionStorage.setItem(r||Kr,JSON.stringify($r))}catch(e){}window.history.scrollRestoration="auto"},[r,t,c.state,s,u])),"undefined"!=typeof document&&(a.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(r||Kr);e&&($r=JSON.parse(e))}catch(e){}},[r]),a.useLayoutEffect(()=>{let e=t&&"/"!==l?(e,r)=>t(Qt({},e,{pathname:N(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration($r,()=>window.scrollY,e);return()=>r&&r()},[n,l,t]),a.useLayoutEffect(()=>{if(!1!==o)if("number"!=typeof o){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)},[s,o,i]))}function Jr(e,t){let{capture:r}=t||{};a.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}function Vr(e){let{when:t,message:r}=e,n=jt(t);a.useEffect(()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())},[n,r]),a.useEffect(()=>{"blocked"!==n.state||t||n.reset()},[n,t])}function Yr(e,t){void 0===t&&(t={});let r=a.useContext(pr);null==r&&h(!1);let{basename:n}=jr(Ar.useViewTransitionState),o=ct(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=N(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=N(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=O(o.pathname,l)||null!=O(o.pathname,i)}}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunk_pih_esm_referrals_queue_app=globalThis.webpackChunk_pih_esm_referrals_queue_app||[]).push([["913"],{47304(e,t,s){s.r(t),s.d(t,{changeLanguage:()=>G,createInstance:()=>_,default:()=>z,dir:()=>J,exists:()=>ee,getFixedT:()=>X,hasLoadedNamespace:()=>es,init:()=>q,keyFromSelector:()=>w,loadLanguages:()=>ea,loadNamespaces:()=>ei,loadResources:()=>W,reloadResources:()=>Y,setDefaultNamespace:()=>et,t:()=>Z,use:()=>Q});let i=e=>"string"==typeof e,a=()=>{let e,t,s=new Promise((s,i)=>{e=s,t=i});return s.resolve=e,s.reject=t,s},r=e=>null==e?"":""+e,o=/###/g,n=e=>e&&e.indexOf("###")>-1?e.replace(o,"."):e,l=e=>!e||i(e),h=(e,t,s)=>{let a=i(t)?t.split("."):t,r=0;for(;r<a.length-1;){if(l(e))return{};let t=n(a[r]);!e[t]&&s&&(e[t]=new s),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return l(e)?{}:{obj:e,k:n(a[r])}},p=(e,t,s)=>{let{obj:i,k:a}=h(e,t,Object);if(void 0!==i||1===t.length){i[a]=s;return}let r=t[t.length-1],o=t.slice(0,t.length-1),n=h(e,o,Object);for(;void 0===n.obj&&o.length;)r=`${o[o.length-1]}.${r}`,n=h(e,o=o.slice(0,o.length-1),Object),n?.obj&&void 0!==n.obj[`${n.k}.${r}`]&&(n.obj=void 0);n.obj[`${n.k}.${r}`]=s},u=(e,t)=>{let{obj:s,k:i}=h(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},g=(e,t,s)=>{for(let a in t)"__proto__"!==a&&"constructor"!==a&&(a in e?i(e[a])||e[a]instanceof String||i(t[a])||t[a]instanceof String?s&&(e[a]=t[a]):g(e[a],t[a],s):e[a]=t[a]);return e};var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};let c=e=>i(e)?e.replace(/[&<>"'\/]/g,e=>d[e]):e,f=[" ",",","?","!",";"],m=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),y=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let i=t.split(s),a=e;for(let e=0;e<i.length;){let t;if(!a||"object"!=typeof a)return;let r="";for(let o=e;o<i.length;++o)if(o!==e&&(r+=s),r+=i[o],void 0!==(t=a[r])){if(["string","number","boolean"].indexOf(typeof t)>-1&&o<i.length-1)continue;e+=o-e+1;break}a=t}return a},x=e=>e?.replace("_","-"),v={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class b{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||v,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,a){return a&&!this.debug?null:(i(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new b(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new b(this.logger,e)}}var k=new b;class S{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,s])=>{for(let i=0;i<s;i++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let a=0;a<i;a++)s.apply(s,[e,...t])})}}class O extends S{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,a={}){let r,o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,n=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],s&&(Array.isArray(s)?r.push(...s):i(s)&&o?r.push(...s.split(o)):r.push(s)));let l=u(this.data,r);return(!l&&!t&&!s&&e.indexOf(".")>-1&&(e=r[0],t=r[1],s=r.slice(2).join(".")),!l&&n&&i(s))?y(this.data?.[e]?.[t],s,o):l}addResource(e,t,s,i,a={silent:!1}){let r=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,o=[e,t];s&&(o=o.concat(r?s.split(r):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),p(this.data,o,i),a.silent||this.emit("added",e,t,s,i)}addResources(e,t,s,a={silent:!1}){for(let a in s)(i(s[a])||Array.isArray(s[a]))&&this.addResource(e,t,a,s[a],{silent:!0});a.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,a,r={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let n=u(this.data,o)||{};r.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?g(n,s,a):n={...n,...s},p(this.data,o,n),r.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var L={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,a){return e.forEach(e=>{t=this.processors[e]?.process(t,s,i,a)??t}),t}};let $=Symbol("i18next/PATH_KEY");function w(e,t){let s,i,a,{[$]:r}=e((i=[],(a=Object.create(null)).get=(e,t)=>(s?.revoke?.(),t===$)?i:(i.push(t),(s=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return r.join(t?.keySeparator??".")}let R={},C=e=>!i(e)&&"boolean"!=typeof e&&"number"!=typeof e;class P extends S{constructor(e,t={}){super(),((e,t,s)=>{e.forEach(e=>{t[e]&&(s[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=k.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let s={...t};if(null==e)return!1;let i=this.resolve(e,s);if(i?.res===void 0)return!1;let a=C(i.res);return!1!==s.returnObjects||!a}extractFromKey(e,t){let s=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===s&&(s=":");let a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],o=s&&e.indexOf(s)>-1,n=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,s)=>{t=t||"",s=s||"";let i=f.filter(e=>0>t.indexOf(e)&&0>s.indexOf(e));if(0===i.length)return!0;let a=m.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`),r=!a.test(e);if(!r){let t=e.indexOf(s);t>0&&!a.test(e.substring(0,t))&&(r=!0)}return r})(e,s,a);if(o&&!n){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(r)?[r]:r};let o=e.split(s);(s!==a||s===a&&this.options.ns.indexOf(o[0])>-1)&&(r=o.shift()),e=o.join(a)}return{key:e,namespaces:i(r)?[r]:r}}translate(e,t,s){let a="object"==typeof t?{...t}:t;if("object"!=typeof a&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof a&&(a={...a}),a||(a={}),null==e)return"";"function"==typeof e&&(e=w(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]);let r=void 0!==a.returnDetails?a.returnDetails:this.options.returnDetails,o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,{key:n,namespaces:l}=this.extractFromKey(e[e.length-1],a),h=l[l.length-1],p=void 0!==a.nsSeparator?a.nsSeparator:this.options.nsSeparator;void 0===p&&(p=":");let u=a.lng||this.language,g=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return g?r?{res:`${h}${p}${n}`,usedKey:n,exactUsedKey:n,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:`${h}${p}${n}`:r?{res:n,usedKey:n,exactUsedKey:n,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:n;let d=this.resolve(e,a),c=d?.res,f=d?.usedKey||n,m=d?.exactUsedKey||n,y=void 0!==a.joinArrays?a.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==a.count&&!i(a.count),b=P.hasDefaultValue(a),k=v?this.pluralResolver.getSuffix(u,a.count,a):"",S=a.ordinal&&v?this.pluralResolver.getSuffix(u,a.count,{ordinal:!1}):"",O=v&&!a.ordinal&&0===a.count,L=O&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${k}`]||a[`defaultValue${S}`]||a.defaultValue,$=c;x&&!c&&b&&($=L);let R=C($),N=Object.prototype.toString.apply($);if(x&&$&&R&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(N)&&!(i(y)&&Array.isArray($))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,$,{...a,ns:l}):`key '${n} (${this.language})' returned an object instead of string.`;return r?(d.res=e,d.usedParams=this.getUsedParamsDetails(a),d):e}if(o){let e=Array.isArray($),t=e?[]:{},s=e?m:f;for(let e in $)if(Object.prototype.hasOwnProperty.call($,e)){let i=`${s}${o}${e}`;b&&!c?t[e]=this.translate(i,{...a,defaultValue:C(L)?L[e]:void 0,...{joinArrays:!1,ns:l}}):t[e]=this.translate(i,{...a,joinArrays:!1,ns:l}),t[e]===i&&(t[e]=$[e])}c=t}}else if(x&&i(y)&&Array.isArray(c))(c=c.join(y))&&(c=this.extendTranslation(c,e,a,s));else{let t=!1,i=!1;!this.isValidLookup(c)&&b&&(t=!0,c=L),this.isValidLookup(c)||(i=!0,c=n);let r=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:c,l=b&&L!==c&&this.options.updateMissing;if(i||t||l){if(this.logger.log(l?"updateKey":"missingKey",u,h,n,l?L:c),o){let e=this.resolve(n,{...a,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(a.lng||this.language):e.push(a.lng||this.language);let s=(e,t,s)=>{let i=b&&s!==c?s:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,h,t,i,l,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,h,t,i,l,a),this.emit("missingKey",e,h,t,c)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,a);O&&a[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{s([e],n+t,a[`defaultValue${t}`]||L)})}):s(e,n,L))}c=this.extendTranslation(c,e,a,d,s),i&&c===n&&this.options.appendNamespaceToMissingKey&&(c=`${h}${p}${n}`),(i||t)&&this.options.parseMissingKeyHandler&&(c=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${p}${n}`:n,t?c:void 0,a))}return r?(d.res=c,d.usedParams=this.getUsedParamsDetails(a),d):c}extendTranslation(e,t,s,a,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){let o;s.interpolation&&this.interpolator.init({...s,...{interpolation:{...this.options.interpolation,...s.interpolation}}});let n=i(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(n){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let l=s.replace&&!i(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,s.lng||this.language||a.usedLng,s),n){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(s.nest=!1)}!s.lng&&a&&a.res&&(s.lng=this.language||a.usedLng),!1!==s.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||s.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),s)),s.interpolation&&this.interpolator.reset()}let o=s.postProcess||this.options.postProcess,n=i(o)?[o]:o;return null!=e&&n?.length&&!1!==s.applyPostProcessor&&(e=L.handle(n,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,a,r,o,n;return i(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(s))return;let l=this.extractFromKey(e,t),h=l.key;a=h;let p=l.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));let u=void 0!==t.count&&!i(t.count),g=u&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(i(t.context)||"number"==typeof t.context)&&""!==t.context,c=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);p.forEach(e=>{this.isValidLookup(s)||(n=e,!R[`${c[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(n)&&(R[`${c[0]}-${e}`]=!0,this.logger.warn(`key "${a}" for languages "${c.join(", ")}" won't get resolved as namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),c.forEach(i=>{let a;if(this.isValidLookup(s))return;o=i;let n=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,h,i,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(i,t.count,t));let s=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(a)&&n.push(h+e.replace(a,this.options.pluralSeparator)),n.push(h+e),g&&n.push(h+s)),d){let i=`${h}${this.options.contextSeparator||"_"}${t.context}`;n.push(i),u&&(t.ordinal&&0===e.indexOf(a)&&n.push(i+e.replace(a,this.options.pluralSeparator)),n.push(i+e),g&&n.push(i+s))}}for(;a=n.pop();)this.isValidLookup(s)||(r=a,s=this.getResource(i,e,a,t))}))})}),{res:s,usedKey:a,exactUsedKey:r,usedLng:o,usedNS:n}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,s,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(e={}){let t=e.replace&&!i(e.replace),s=t?e.replace:e;if(t&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!t)for(let e of(s={...s},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete s[e];return s}static hasDefaultValue(e){let t="defaultValue";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&void 0!==e[s])return!0;return!1}}class N{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=k.create("languageUtils")}getScriptPartFromCode(e){if(!(e=x(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=x(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let s=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;let i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>{if(e===i||!(0>e.indexOf("-")&&0>i.indexOf("-"))&&(e.indexOf("-")>0&&0>i.indexOf("-")&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){let s=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),a=[],r=e=>{e&&(this.isSupportedCode(e)?a.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):i(e)&&r(this.formatLanguageCode(e)),s.forEach(e=>{0>a.indexOf(e)&&r(this.formatLanguageCode(e))}),a}}let j={zero:0,one:1,two:2,few:3,many:4,other:5},E={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class F{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=k.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let s,i=x("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:a});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];try{s=new Intl.PluralRules(i,{type:a})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),E;if(!e.match(/-|_/))return E;let i=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(i,t)}return this.pluralRulesCache[r]=s,s}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return(s||(s=this.getRule("dev",t)),s)?s.resolvedOptions().pluralCategories.sort((e,t)=>j[e]-j[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,s={}){let i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}let I=(e,t,s,a=".",r=!0)=>{let o,n=void 0!==(o=u(e,s))?o:u(t,s);return!n&&r&&i(s)&&void 0===(n=y(e,s,a))&&(n=y(t,s,a)),n};class T{constructor(e={}){this.logger=k.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:a,prefixEscaped:r,suffix:o,suffixEscaped:n,formatSeparator:l,unescapeSuffix:h,unescapePrefix:p,nestingPrefix:u,nestingPrefixEscaped:g,nestingSuffix:d,nestingSuffixEscaped:f,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:x}=e.interpolation;this.escape=void 0!==t?t:c,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):r||"{{",this.suffix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):n||"}}",this.formatSeparator=l||",",this.unescapePrefix=h?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):g||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==x&&x,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,a){let o,n,l,h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=e=>{if(0>e.indexOf(this.formatSeparator)){let i=I(t,h,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,s,{...a,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),r=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(I(t,h,r,this.options.keySeparator,this.options.ignoreJSONStructure),o,s,{...a,...t,interpolationkey:r})};this.resetRegExp();let u=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(l=0;o=t.regex.exec(e);){let s=o[1].trim();if(void 0===(n=p(s)))if("function"==typeof u){let t=u(e,o,a);n=i(t)?t:""}else if(a&&Object.prototype.hasOwnProperty.call(a,s))n="";else if(g){n=o[0];continue}else this.logger.warn(`missed to pass in variable ${s} for interpolating ${e}`),n="";else i(n)||this.useRawValueToEscape||(n=r(n));let h=t.safeValue(n);if(e=e.replace(o[0],h),g?(t.regex.lastIndex+=n.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++l>=this.maxReplaces)break}}),e}nest(e,t,s={}){let a,o,n,l=(e,t)=>{let s=this.nestingOptionsSeparator;if(0>e.indexOf(s))return e;let i=e.split(RegExp(`${s}[ ]*{`)),a=`{${i[1]}`;e=i[0];let r=(a=this.interpolate(a,n)).match(/'/g),o=a.match(/"/g);((r?.length??0)%2!=0||o)&&o.length%2==0||(a=a.replace(/'/g,'"'));try{n=JSON.parse(a),t&&(n={...t,...n})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${a}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,e};for(;a=this.nestingRegexp.exec(e);){let h=[];(n=(n={...s}).replace&&!i(n.replace)?n.replace:n).applyPostProcessor=!1,delete n.defaultValue;let p=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(-1!==p&&(h=a[1].slice(p).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),a[1]=a[1].slice(0,p)),(o=t(l.call(this,a[1].trim(),n),n))&&a[0]===e&&!i(o))return o;i(o)||(o=r(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),o=""),h.length&&(o=h.reduce((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:a[1].trim()}),o.trim())),e=e.replace(a[0],o),this.regexp.lastIndex=0}return e}}let V=e=>{let t={};return(s,i,a)=>{let r=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(r={...r,[a.interpolationkey]:void 0});let o=i+JSON.stringify(r),n=t[o];return n||(n=e(x(i),a),t[o]=n),n(s)}},D=e=>(t,s,i)=>e(x(s),i)(t);class A{constructor(e={}){this.logger=k.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let s=t.cacheInBuiltFormats?V:D;this.formats={number:s((e,t)=>{let s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)}),currency:s((e,t)=>{let s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)}),datetime:s((e,t)=>{let s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)}),relativetime:s((e,t)=>{let s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")}),list:s((e,t)=>{let s=new Intl.ListFormat(e,{...t});return e=>s.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=V(t)}format(e,t,s,i={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:r}=(e=>{let t=e.toLowerCase().trim(),s={};if(e.indexOf("(")>-1){let i=e.split("(");t=i[0].toLowerCase().trim();let a=i[1].substring(0,i[1].length-1);"currency"===t&&0>a.indexOf(":")?s.currency||(s.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?s.range||(s.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...i]=e.split(":"),a=i.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();s[r]||(s[r]=a),"false"===a&&(s[r]=!1),"true"===a&&(s[r]=!0),isNaN(a)||(s[r]=parseInt(a,10))}})}return{formatName:t,formatOptions:s}})(t);if(this.formats[a]){let t=e;try{let o=i?.formatParams?.[i.interpolationkey]||{},n=o.locale||o.lng||i.locale||i.lng||s;t=this.formats[a](e,n,{...r,...i,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class K extends S{constructor(e,t,s,i={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=k.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,i.backend,i)}queueLoad(e,t,s,i){let a={},r={},o={},n={};return e.forEach(e=>{let i=!0;t.forEach(t=>{let o=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===r[o]&&(r[o]=!0):(this.state[o]=1,i=!1,void 0===r[o]&&(r[o]=!0),void 0===a[o]&&(a[o]=!0),void 0===n[t]&&(n[t]=!0)))}),i||(o[e]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(n)}}loaded(e,t,s){let i=e.split("|"),a=i[0],r=i[1];t&&this.emit("failedLoading",a,r,t),!t&&s&&this.store.addResourceBundle(a,r,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);let o={};this.queue.forEach(s=>{((e,t,s,i)=>{let{obj:a,k:r}=h(e,t,Object);a[r]=a[r]||[],a[r].push(s)})(s.loaded,[a],r),void 0!==s.pending[e]&&(delete s.pending[e],s.pendingCount--),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach(e=>{o[e]||(o[e]={});let t=s.loaded[e];t.length&&t.forEach(t=>{void 0===o[e][t]&&(o[e][t]=!0)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,s,i=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:a,callback:r});this.readingCalls++;let o=(o,n)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&n&&i<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,s,i+1,2*a,r)},a):r(o,n)},n=this.backend[s].bind(this.backend);if(2===n.length){try{let s=n(e,t);s&&"function"==typeof s.then?s.then(e=>o(null,e)).catch(o):o(null,s)}catch(e){o(e)}return}return n(e,t,o)}prepareLoading(e,t,s={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);let r=this.queueLoad(e,t,s,a);if(!r.toLoad.length)return r.pending.length||a(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){let s=e.split("|"),i=s[0],a=s[1];this.read(i,a,"read",void 0,void 0,(s,r)=>{s&&this.logger.warn(`${t}loading namespace ${a} for language ${i} failed`,s),!s&&r&&this.logger.log(`${t}loaded namespace ${a} for language ${i}`,r),this.loaded(e,s,r)})}saveMissing(e,t,s,i,a,r={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=s&&""!==s){if(this.backend?.create){let n={...r,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,s,i,n):l(e,t,s,i))&&"function"==typeof a.then?a.then(e=>o(null,e)).catch(o):o(null,a)}catch(e){o(e)}else l(e,t,s,i,o,n)}e&&e[0]&&this.store.addResource(e[0],t,s,i)}}}let U=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let s=e[3]||e[2];Object.keys(s).forEach(e=>{t[e]=s[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),M=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),H=()=>{};class B extends S{constructor(e={},t){if(super(),this.options=M(e),this.services={},this.logger=k,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(i(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let s=U();this.options={...s,...this.options,...M(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?k.init(r(this.modules.logger),this.options):k.init(null,this.options),e=this.modules.formatter?this.modules.formatter:A;let t=new N(this.options);this.store=new O(this.options.resources,this.options);let i=this.services;i.logger=k,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new F(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new T(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new K(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new P(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=a(),n=()=>{let e=(e,s)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(s),t(e,s)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?n():setTimeout(n,0),o}loadResources(e,t=H){let s=t,a=i(e)?e:this.language;if("function"==typeof e&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(a?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return s();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};a?t(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),s(e)})}else s(null)}reloadResources(e,t,s){let i=a();return"function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,e=>{i.resolve(),s(e)}),i}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&L.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let s=a();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,s.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},n=t=>{e||t||!this.services.languageDetector||(t=[]);let s=i(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(s)?s:this.services.languageUtils.getBestMatchFromCodes(i(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{o(e,a)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(n):this.services.languageDetector.detect(n):n(e):n(this.services.languageDetector.detect()),s}getFixedT(e,t,s){let a=(e,t,...i)=>{let r,o;(r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=r.lng||a.lng,r.lngs=r.lngs||a.lngs,r.ns=r.ns||a.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||s||a.keyPrefix);let n=this.options.keySeparator||".";return r.keyPrefix&&Array.isArray(e)?o=e.map(e=>("function"==typeof e&&(e=w(e,{...this.options,...t})),`${r.keyPrefix}${n}${e}`)):("function"==typeof e&&(e=w(e,{...this.options,...t})),o=r.keyPrefix?`${r.keyPrefix}${n}${e}`:e),this.t(o,r)};return i(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let s=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;let r=(e,t)=>{let s=this.services.backendConnector.state[`${e}|${t}`];return -1===s||0===s||2===s};if(t.precheck){let e=t.precheck(this,r);if(void 0!==e)return e}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(s,e)&&(!i||r(a,e)))}loadNamespaces(e,t){let s=a();return this.options.ns?(i(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{s.resolve(),t&&t(e)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){let s=a();i(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{s.resolve(),t&&t(e)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new N(U());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new B(e,t)}cloneInstance(e={},t=H){let s=e.forkResourceStore;s&&delete e.forkResourceStore;let i={...this.options,...e,isClone:!0},a=new B(i);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},s&&(a.store=new O(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((s,i)=>(s[i]={...e[t][i]},s),e[t]),e),{}),i),a.services.resourceStore=a.store),a.translator=new P(a.services,i),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(i,t),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let z=B.createInstance();z.createInstance=B.createInstance;let _=z.createInstance,J=z.dir,q=z.init,W=z.loadResources,Y=z.reloadResources,Q=z.use,G=z.changeLanguage,X=z.getFixedT,Z=z.t,ee=z.exists,et=z.setDefaultNamespace,es=z.hasLoadedNamespace,ei=z.loadNamespaces,ea=z.loadLanguages}}]);
|