tocco-admin 3.13.138 → 3.13.139
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/dist/index.js
CHANGED
|
@@ -49,4 +49,4 @@ function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r i
|
|
|
49
49
|
* LICENSE.md file in the root directory of this source tree.
|
|
50
50
|
*
|
|
51
51
|
* @license MIT
|
|
52
|
-
*/function u(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>l(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let a=s(null==r?t.length-1:r),i="POP",c=null;function s(e){return Math.min(Math.max(e,0),t.length-1)}function u(){return t[a]}function l(e,n=null,r){let o=h(t?u().pathname:"/",e,n,r);return f("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:g(e)}return{get index(){return a},get action(){return i},get location(){return u()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?v(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){i="PUSH";let r=l(e,n);a+=1,t.splice(a,t.length,r),o&&c&&c({action:i,location:r,delta:1})},replace(e,n){i="REPLACE";let r=l(e,n);t[a]=r,o&&c&&c({action:i,location:r,delta:0})},go(e){i="POP";let n=s(a+e),r=t[n];a=n,c&&c({action:i,location:r,delta:e})},listen:e=>(c=e,()=>{c=null})}}function l(e={}){return y((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return h("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:g(t)}),null,e)}function d(e={}){return y((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=v(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),h("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:g(t))}),(function(e,t){f("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}),e)}function p(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 m(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,n=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?v(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function g({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function v(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,c="POP",u=null,l=d();function d(){return(i.state||{idx:null}).idx}function p(){c="POP";let e=d(),t=null==e?null:e-l;l=e,u&&u({action:c,location:g.location,delta:t})}function f(e){return b(e)}null==l&&(l=0,i.replaceState({...i.state,idx:l},""));let g={get action(){return c},get location(){return e(o,i)},listen(e){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(s,p),u=e,()=>{o.removeEventListener(s,p),u=null}},createHref:e=>t(o,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c="PUSH";let r=h(g.location,e,t);n&&n(r,e),l=d()+1;let s=m(r,l),p=g.createHref(r);try{i.pushState(s,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&u&&u({action:c,location:g.location,delta:1})},replace:function(e,t){c="REPLACE";let r=h(g.location,e,t);n&&n(r,e),l=d();let o=m(r,l),s=g.createHref(r);i.replaceState(o,"",s),a&&u&&u({action:c,location:g.location,delta:0})},go:e=>i.go(e)};return g}function b(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),p(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:g(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function w(e){return{defaultValue:e}}var x=class{constructor(e){var t,n,r;if(t=this,n=o,r=new Map,n.has(t)?i("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),e)for(let[t,n]of e)this.set(t,n)}get(e){if(c(this,o).has(e))return c(this,o).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){c(this,o).set(e,t)}};o=new WeakMap;var O=new Set(["lazy","caseSensitive","path","id","index","children"]);var k=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function S(e,t,n=[],r={},o=!1){return e.map(((e,a)=>{let i=[...n,String(a)],c="string"==typeof e.id?e.id:i.join("-");if(p(!0!==e.index||!e.children,"Cannot specify children on an index route"),p(o||!r[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let n={...e,id:c};return r[c]=E(n,t(n)),n}{let n={...e,id:c,children:void 0};return r[c]=E(n,t(n)),e.children&&(n.children=S(e.children,t,i,r,o)),n}}))}function E(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function j(e,t,n="/"){return P(e,t,n,!1)}function P(e,t,n,r){let o=V(("string"==typeof t?v(t):t).pathname||"/",n);if(null==o)return null;let a=D(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let i=null;for(let e=0;null==i&&e<a.length;++e){let t=U(o);i=H(a[e],t,r)}return i}function A(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function D(e,t=[],n=[],r="",o=!1){let a=(e,a,i=o,c)=>{let s={relativePath:void 0===c?e.path||"":c,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(r)&&i)return;p(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length)}let u=Q([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(p(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),D(e.children,t,l,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:F(u,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of T(e.path))a(e,t,!0,n);else a(e,t)})),t}function T(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let i=T(r.join("/")),c=[];return c.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&c.push(...i),c.map((t=>e.startsWith("/")&&""===t?"/":t))}var _=/^:[\w-]+$/,C=3,M=2,I=1,R=10,N=-2,L=e=>"*"===e;function F(e,t){let n=e.split("/"),r=n.length;return n.some(L)&&(r+=N),t&&(r+=M),n.filter((e=>!L(e))).reduce(((e,t)=>e+(_.test(t)?C:""===t?I:R)),r)}function H(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",i=[];for(let e=0;e<r.length;++e){let c=r[e],s=e===r.length-1,u="/"===a?t:t.slice(a.length)||"/",l=W({path:c.relativePath,caseSensitive:c.caseSensitive,end:s},u),d=c.route;if(!l&&s&&n&&!r[r.length-1].route.index&&(l=W({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!l)return null;Object.assign(o,l.params),i.push({params:o,pathname:Q([a,l.pathname]),pathnameBase:X(Q([a,l.pathnameBase])),route:d}),"/"!==l.pathnameBase&&(a=Q([a,l.pathnameBase]))}return i}function W(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=B(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=c[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const o=c[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function B(e,t=!1,n=!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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"))).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function U(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 a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function V(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}var Y=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z=e=>Y.test(e);function q(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}function $(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function G(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function K(e){let t=G(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function J(e,t,n,r=!1){let o;"string"==typeof e?o=v(e):(o={...e},p(!o.pathname||!o.pathname.includes("?"),$("?","pathname","search",o)),p(!o.pathname||!o.pathname.includes("#"),$("#","pathname","hash",o)),p(!o.search||!o.search.includes("#"),$("#","search","hash",o)));let a,i=""===e||""===o.pathname,c=i?"/":o.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t="/"){let n,{pathname:r,search:o="",hash:a=""}="string"==typeof e?v(e):e;if(r)if(z(r))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),f(!1,`Pathnames cannot have embedded double slashes - normalizing ${e} -> ${r}`)}n=r.startsWith("/")?q(r.substring(1),"/"):q(r,t)}else n=t;return{pathname:n,search:Z(o),hash:ee(a)}}(o,a),u=c&&"/"!==c&&c.endsWith("/"),l=(i||"."===c)&&n.endsWith("/");return s.pathname.endsWith("/")||!u&&!l||(s.pathname+="/"),s}var Q=e=>e.join("/").replace(/\/\/+/g,"/"),X=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ee=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var te=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ne(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function re(e){return e.map((e=>e.route.path)).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var oe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ae(e,t){let n=e;if("string"!=typeof n||!Y.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(oe)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),a=V(r.pathname,t);r.origin===e.origin&&null!=a?n=a+r.search+r.hash:o=!0}catch(e){f(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}var ie=Symbol("Uninstrumented");function ce(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach((e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}})));let r={};if("function"==typeof t.lazy&&n.lazy.length>0){let e=se(n.lazy,t.lazy,(()=>{}));e&&(r.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach((t=>{let o=e[t],a=n[`lazy.${t}`];if("function"==typeof o&&a.length>0){let e=se(a,o,(()=>{}));e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}}))}return["loader","action"].forEach((e=>{let o=t[e];if("function"==typeof o&&n[e].length>0){let t=o[ie]??o,a=se(n[e],t,((...e)=>le(e[0])));a&&("loader"===e&&!0===t.hydrate&&(a.hydrate=!0),a[ie]=t,r[e]=a)}})),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map((e=>{let t=e[ie]??e,r=se(n.middleware,t,((...e)=>le(e[0])));return r?(r[ie]=t,r):e}))),r}function se(e,t,n){return 0===e.length?null:async(...r)=>{let o=await ue(e,n(...r),(()=>t(...r)),e.length-1);if("error"===o.type)throw o.value;return o.value}}async function ue(e,t,n,r){let o,a=e[r];if(a){let i,c=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=ue(e,t,n,r-1),o=await i,p(o,"Expected a result"),"error"===o.type&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(c,t)}catch(e){console.error("An instrumentation function threw an error:",e)}i||await c(),await i}else try{let e=await n();o={type:"success",value:e}}catch(e){o={type:"error",value:e}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function le(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:pe(t),params:{...r},unstable_pattern:o,context:fe(n)}}function de(e,t){return{currentUrl:g(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function pe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function fe(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===me}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var me=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var he=["POST","PUT","PATCH","DELETE"],ge=new Set(he),ve=["GET",...he],ye=new Set(ve),be=new Set([301,302,303,307,308]),we=new Set([307,308]),xe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Oe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ke={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Se=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ee="remix-router-transitions",je=Symbol("ResetLoaderData");function Pe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;p(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Se,a=o;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...o(e),...ce(t.map((e=>e.route)).filter(Boolean),e)})}let i,c={},s=S(e.routes,a,void 0,c),u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let l,d,m=e.dataStrategy||We,v={...e.future},y=null,w=new Set,O=null,k=null,E=null,D=null!=e.hydrationData,T=j(s,e.history.location,u),_=!1,C=null;if(null!=T||e.patchRoutesOnNavigation){if(T&&!e.hydrationData){Ve(T,s,e.history.location.pathname).active&&(T=null)}if(T)if(T.some((e=>e.route.lazy)))l=!1;else if(T.some((e=>_e(e.route)))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=T.findIndex((e=>void 0!==n[e.route.id]));l=T.slice(0,e+1).every((e=>!Ce(e.route,t,n)))}else l=T.every((e=>!Ce(e.route,t,n)))}else l=!0;else{l=!1,T=[];let t=Ve(null,s,e.history.location.pathname);t.active&&t.matches&&(_=!0,T=t.matches)}}else{let t=ct(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=it(s);l=!0,T=n,C={[r.id]:t}}let M,I,R={historyAction:e.history.action,location:e.history.location,matches:T,initialized:l,navigation:xe,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||C,fetchers:new Map,blockers:new Map},N="POP",L=null,F=!1,H=!1,W=new Map,B=null,U=!1,Y=!1,q=new Set,$=new Map,G=0,K=-1,J=new Map,Q=new Set,X=new Map,Z=new Map,ee=new Set,te=new Map,re=null;function oe(e,t={}){e.matches&&(e.matches=e.matches.map((e=>{let t=c[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}))),R={...R,...e};let n=[],r=[];R.fetchers.forEach(((e,t)=>{"idle"===e.state&&(ee.has(t)?n.push(t):r.push(t))})),ee.forEach((e=>{R.fetchers.has(e)||$.has(e)||n.push(e)})),[...w].forEach((r=>r(R,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>be(e))),r.forEach((e=>R.fetchers.delete(e)))}function ae(t,n,{flushSync:r}={}){let o,a=null!=R.actionData&&null!=R.navigation.formMethod&&wt(R.navigation.formMethod)&&"loading"===R.navigation.state&&!0!==t.state?._isRedirect;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?R.actionData:null;let c=n.loaderData?rt(R.loaderData,n.loaderData,n.matches||[],n.errors):R.loaderData,u=R.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,ke))));let l,d=!U&&Ue(t,n.matches||R.matches),p=!0===F||null!=R.navigation.formMethod&&wt(R.navigation.formMethod)&&!0!==t.state?._isRedirect;if(i&&(s=i,i=void 0),U||"POP"===N||("PUSH"===N?e.history.push(t,t.state):"REPLACE"===N&&e.history.replace(t,t.state)),"POP"===N){let e=W.get(R.location.pathname);e&&e.has(t.pathname)?l={currentLocation:R.location,nextLocation:t}:W.has(t.pathname)&&(l={currentLocation:t,nextLocation:R.location})}else if(H){let e=W.get(R.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),W.set(R.location.pathname,e)),l={currentLocation:R.location,nextLocation:t}}oe({...n,actionData:o,loaderData:c,historyAction:N,location:t,initialized:!0,navigation:xe,revalidation:"idle",restoreScrollPosition:d,preventScrollReset:p,blockers:u},{viewTransitionOpts:l,flushSync:!0===r}),N="POP",F=!1,H=!1,U=!1,Y=!1,L?.resolve(),L=null,re?.resolve(),re=null}async function ue(t,n,o){M&&M.abort(),M=null,N=t,U=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(O&&E){let n=Be(e,t);O[n]=E()}}(R.location,R.matches),F=!0===(o&&o.preventScrollReset),H=!0===(o&&o.enableViewTransition);let l=i||s,d=o&&o.overrideNavigation,p=o?.initialHydration&&R.matches&&R.matches.length>0&&!_?R.matches:j(l,n,u),f=!0===(o&&o.flushSync);if(p&&R.initialized&&!Y&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(R.location,n)&&!(o&&o.submission&&wt(o.submission.formMethod)))return void ae(n,{matches:p},{flushSync:f});let m=Ve(p,l,n.pathname);if(m.active&&m.matches&&(p=m.matches),!p){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);return void ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:f})}M=new AbortController;let h,g=Xe(e.history,n,M.signal,o&&o.submission),v=e.getContext?await e.getContext():new x;if(o&&o.pendingError)h=[at(p).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&wt(o.submission.formMethod)){let t=await async function(t,n,o,i,l,d,p,f={}){he();let m,h=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(n,o);if(oe({navigation:h},{flushSync:!0===f.flushSync}),d){let e=await Ye(i,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=it(s);return{matches:t,pendingActionResult:[n.id,{type:"error",error:e.error}]}}let t=at(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=He(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:t}]}}i=e.matches}let g=Ot(i,n);if(g.route.action||g.route.lazy){let e=qe(a,c,t,i,g,p?[]:r,l),n=await fe(t,e,l,null);if(m=n[g.route.id],!m)for(let e of i)if(n[e.route.id]){m=n[e.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:ct(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};if(ht(m)){let n;if(f&&null!=f.replace)n=f.replace;else{n=Qe(m.response.headers.get("Location"),new URL(t.url),u,e.history)===R.location.pathname+R.location.search}return await pe(t,m,!0,{submission:o,replace:n}),{shortCircuited:!0}}if(mt(m)){let e=at(i,g.route.id);return!0!==(f&&f.replace)&&(N="PUSH"),{matches:i,pendingActionResult:[e.route.id,m,g.route.id]}}return{matches:i,pendingActionResult:[g.route.id,m]}}(g,n,o.submission,p,v,m.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:f});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(mt(r)&&ne(r.error)&&404===r.error.status)return M=null,void ae(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}p=t.matches||p,h=t.pendingActionResult,d=St(n,o.submission),f=!1,m.active=!1,g=Xe(e.history,g.url,g.signal)}let{shortCircuited:y,matches:b,loaderData:w,errors:k}=await async function(t,n,o,l,d,p,f,m,h,g,v,y,b){let w=p||St(n,f),x=f||m||kt(w),O=!U&&!g;if(d){if(O){let e=le(y);oe({navigation:w,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await Ye(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=it(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=at(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}o=e.matches}let k=i||s,{dsMatches:S,revalidatingFetchers:E}=Te(t,l,a,c,e.history,R,o,x,n,g?[]:r,!0===g,Y,q,ee,X,Q,k,u,null!=e.patchRoutesOnNavigation,y,b);if(K=++G,!e.dataStrategy&&!S.some((e=>e.shouldLoad))&&!S.some((e=>e.route.middleware&&e.route.middleware.length>0))&&0===E.length){let e=Me();return ae(n,{matches:o,loaderData:{},errors:y&&mt(y[1])?{[y[0]]:y[1].error}:null,...ot(y),...e?{fetchers:new Map(R.fetchers)}:{}},{flushSync:v}),{shortCircuited:!0}}if(O){let e={};if(!d){e.navigation=w;let t=le(y);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=R.fetchers.get(e.key),n=Et(void 0,t?t.data:void 0);R.fetchers.set(e.key,n)})),new Map(R.fetchers)}(E)),oe(e,{flushSync:v})}E.forEach((e=>{je(e.key),e.controller&&$.set(e.key,e.controller)}));let j=()=>E.forEach((e=>je(e.key)));M&&M.signal.addEventListener("abort",j);let{loaderResults:P,fetcherResults:A}=await me(S,E,t,l);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",j);E.forEach((e=>$.delete(e.key)));let D=st(P);if(D)return await pe(t,D.result,!0,{replace:h}),{shortCircuited:!0};if(D=st(A),D)return Q.add(D.key),await pe(t,D.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:T,errors:_}=nt(R,o,P,y,E,A);g&&R.errors&&(_={...R.errors,..._});let C=Me(),I=Re(K),N=C||I||E.length>0;return{matches:o,loaderData:T,errors:_,...N?{fetchers:new Map(R.fetchers)}:{}}}(g,n,p,v,m.active,d,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,f,h,o&&o.callSiteDefaultShouldRevalidate);y||(M=null,ae(n,{matches:b||p,...ot(h),loaderData:w,errors:k}))}function le(e){return e&&!mt(e[1])?{[e[0]]:e[1].data}:R.actionData?0===Object.keys(R.actionData).length?null:R.actionData:void 0}async function pe(r,o,a,{submission:i,fetcherSubmission:c,preventScrollReset:s,replace:l}={}){a||(L?.resolve(),L=null),o.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let d=o.response.headers.get("Location");p(d,"Expected a Location header on the redirect Response"),d=Qe(d,new URL(r.url),u,e.history);let f=h(R.location,d,{_isRedirect:!0});if(n){let e=!1;if(o.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(z(d)){const n=b(d,!0);e=n.origin!==t.location.origin||null==V(n.pathname,u)}if(e)return void(l?t.location.replace(d):t.location.assign(d))}M=null;let m=!0===l||o.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:g,formAction:v,formEncType:y}=R.navigation;!i&&!c&&g&&v&&y&&(i=kt(R.navigation));let w=i||c;if(we.has(o.response.status)&&w&&wt(w.formMethod))await ue(m,f,{submission:{...w,formAction:d},preventScrollReset:s||F,enableViewTransition:a?H:void 0});else{let e=St(f,i);await ue(m,f,{overrideNavigation:e,fetcherSubmission:c,preventScrollReset:s||F,enableViewTransition:a?H:void 0})}}async function fe(e,t,n,r){let o,a={};try{o=await $e(m,e,t,r,n,!1)}catch(e){return t.filter((e=>e.shouldLoad)).forEach((t=>{a[t.route.id]={type:"error",error:e}})),a}if(e.signal.aborted)return a;if(!wt(e.method))for(let e of t){if("error"===o[e.route.id]?.type)break;o.hasOwnProperty(e.route.id)||R.loaderData.hasOwnProperty(e.route.id)||R.errors&&R.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(o[e.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[n,r]of Object.entries(o))if(ft(r)){let o=r.result;a[n]={type:"redirect",response:Je(o,e,n,t,u)}}else a[n]=await Ke(r);return a}async function me(e,t,n,r){let o=fe(n,e,r,null),a=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await fe(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:ct(404,{pathname:e.path})}})})));return{loaderResults:await o,fetcherResults:(await a).reduce(((e,t)=>Object.assign(e,t)),{})}}function he(){Y=!0,X.forEach(((e,t)=>{$.has(t)&&q.add(t),je(t)}))}function ge(e,t,n={}){R.fetchers.set(e,t),oe({fetchers:new Map(R.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ve(e,t,n,r={}){let o=at(R.matches,t);be(e),oe({errors:{[o.route.id]:n},fetchers:new Map(R.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ye(e){return Z.set(e,(Z.get(e)||0)+1),ee.has(e)&&ee.delete(e),R.fetchers.get(e)||Oe}function be(e){let t=R.fetchers.get(e);!$.has(e)||t&&"loading"===t.state&&J.has(e)||je(e),X.delete(e),J.delete(e),Q.delete(e),ee.delete(e),q.delete(e),R.fetchers.delete(e)}function je(e,t){let n=$.get(e);n&&(n.abort(t),$.delete(e))}function Pe(e){for(let t of e){let e=jt(ye(t).data);R.fetchers.set(t,e)}}function Me(){let e=[],t=!1;for(let n of Q){let r=R.fetchers.get(n);p(r,`Expected fetcher: ${n}`),"loading"===r.state&&(Q.delete(n),e.push(n),t=!0)}return Pe(e),t}function Re(e){let t=[];for(let[n,r]of J)if(r<e){let e=R.fetchers.get(n);p(e,`Expected fetcher: ${n}`),"loading"===e.state&&(je(n),J.delete(n),t.push(n))}return Pe(t),t.length>0}function Ne(e){R.blockers.delete(e),te.delete(e)}function Le(e,t){let n=R.blockers.get(e)||ke;p("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(R.blockers);r.set(e,t),oe({blockers:r})}function Fe({currentLocation:e,nextLocation:t,historyAction:n}){if(0===te.size)return;te.size>1&&f(!1,"A router only supports one blocker at a time");let r=Array.from(te.entries()),[o,a]=r[r.length-1],i=R.blockers.get(o);return i&&"proceeding"===i.state?void 0:a({currentLocation:e,nextLocation:t,historyAction:n})?o:void 0}function He(e){let t=ct(404,{pathname:e}),n=i||s,{matches:r,route:o}=it(n);return{notFoundMatches:r,route:o,error:t}}function Be(e,t){if(k){return k(e,t.map((e=>A(e,R.loaderData))))||e.key}return e.key}function Ue(e,t){if(O){let n=Be(e,t),r=O[n];if("number"==typeof r)return r}return null}function Ve(t,n,r){if(e.patchRoutesOnNavigation){if(!t){return{active:!0,matches:P(n,r,u,!0)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:P(n,r,u,!0)}}}return{active:!1,matches:null}}async function Ye(t,n,r,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let l=t;for(;;){let t=null==i,d=i||s,p=c;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:o,patch:(e,t)=>{r.aborted||Ie(e,t,d,p,a,!1)}})}catch(e){return{type:"error",error:e,partialMatches:l}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:"aborted"};let f=j(d,n,u),m=null;if(f){if(0===Object.keys(f[0].params).length)return{type:"success",matches:f};if(m=P(d,n,u,!0),!(m&&l.length<m.length&&ze(l,m.slice(0,l.length))))return{type:"success",matches:f}}if(m||(m=P(d,n,u,!0)),!m||ze(l,m))return{type:"success",matches:null};l=m}}function ze(e,t){return e.length===t.length&&e.every(((e,n)=>e.route.id===t[n].route.id))}return d={get basename(){return u},get future(){return v},get state(){return R},get routes(){return s},get window(){return t},initialize:function(){if(y=e.history.listen((({action:t,location:n,delta:r})=>{if(I)return I(),void(I=void 0);f(0===te.size||null!=r,"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=Fe({currentLocation:R.location,nextLocation:n,historyAction:t});if(o&&null!=r){let t=new Promise((e=>{I=e}));return e.history.go(-1*r),Le(o,{state:"blocked",location:n,proceed(){Le(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(R.blockers);e.set(o,ke),oe({blockers:e})}}),L?.resolve(),void(L=null)}return ue(t,n)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(Ee);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,W);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ee,JSON.stringify(n))}catch(e){f(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,W);t.addEventListener("pagehide",e),B=()=>t.removeEventListener("pagehide",e)}return R.initialized||ue("POP",R.location,{initialHydration:!0}),d},subscribe:function(e){return w.add(e),()=>w.delete(e)},enableScrollRestoration:function(e,t,n){if(O=e,E=t,k=n||null,!D&&R.navigation===xe){D=!0;let e=Ue(R.location,R.matches);null!=e&&oe({restoreScrollPosition:e})}return()=>{O=null,E=null,k=null}},navigate:async function t(n,r){if(L?.resolve(),L=null,"number"==typeof n){L||(L=Pt());let t=L.promise;return e.history.go(n),t}let o=Ae(R.location,R.matches,u,n,r?.fromRouteId,r?.relative),{path:a,submission:i,error:c}=De(!1,o,r),s=R.location,l=h(R.location,a,r&&r.state);l={...l,...e.history.encodeLocation(l)};let d=r&&null!=r.replace?r.replace:void 0,p="PUSH";!0===d?p="REPLACE":!1===d||null!=i&&wt(i.formMethod)&&i.formAction===R.location.pathname+R.location.search&&(p="REPLACE");let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.flushSync),g=Fe({currentLocation:s,nextLocation:l,historyAction:p});g?Le(g,{state:"blocked",location:l,proceed(){Le(g,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),t(n,r)},reset(){let e=new Map(R.blockers);e.set(g,ke),oe({blockers:e})}}):await ue(p,l,{submission:i,pendingError:c,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:r&&r.unstable_defaultShouldRevalidate})},fetch:async function(t,n,o,l){je(t);let d=!0===(l&&l.flushSync),f=i||s,m=Ae(R.location,R.matches,u,o,n,l?.relative),h=j(f,m,u),g=Ve(h,f,m);if(g.active&&g.matches&&(h=g.matches),!h)return void ve(t,n,ct(404,{pathname:m}),{flushSync:d});let{path:v,submission:y,error:b}=De(!0,m,l);if(b)return void ve(t,n,b,{flushSync:d});let w=e.getContext?await e.getContext():new x,O=!0===(l&&l.preventScrollReset);y&&wt(y.formMethod)?await async function(t,n,o,l,d,f,m,h,g,v){he(),X.delete(t);let y=R.fetchers.get(t);ge(t,function(e,t){let n={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};return n}(g,y),{flushSync:m});let b=new AbortController,w=Xe(e.history,o,b.signal,g);if(f){let e=await Ye(l,new URL(w.url).pathname,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ve(t,n,e.error,{flushSync:m});if(!e.matches)return void ve(t,n,ct(404,{pathname:o}),{flushSync:m});l=e.matches}let x=Ot(l,o);if(!x.route.action&&!x.route.lazy){let e=ct(405,{method:g.formMethod,pathname:o,routeId:n});return void ve(t,n,e,{flushSync:m})}$.set(t,b);let O=G,k=qe(a,c,w,l,x,r,d),S=await fe(w,k,d,t),E=S[x.route.id];if(!E)for(let e of k)if(S[e.route.id]){E=S[e.route.id];break}if(w.signal.aborted)return void($.get(t)===b&&$.delete(t));if(ee.has(t)){if(ht(E)||mt(E))return void ge(t,jt(void 0))}else{if(ht(E))return $.delete(t),K>O?void ge(t,jt(void 0)):(Q.add(t),ge(t,Et(g)),pe(w,E,!1,{fetcherSubmission:g,preventScrollReset:h}));if(mt(E))return void ve(t,n,E.error)}let P=R.navigation.location||R.location,A=Xe(e.history,P,b.signal),D=i||s,T="idle"!==R.navigation.state?j(D,R.navigation.location,u):R.matches;p(T,"Didn't find any matches after fetcher action");let _=++G;J.set(t,_);let C=Et(g,E.data);R.fetchers.set(t,C);let{dsMatches:I,revalidatingFetchers:L}=Te(A,d,a,c,e.history,R,T,g,P,r,!1,Y,q,ee,X,Q,D,u,null!=e.patchRoutesOnNavigation,[x.route.id,E],v);L.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=R.fetchers.get(t),r=Et(void 0,n?n.data:void 0);R.fetchers.set(t,r),je(t),e.controller&&$.set(t,e.controller)})),oe({fetchers:new Map(R.fetchers)});let F=()=>L.forEach((e=>je(e.key)));b.signal.addEventListener("abort",F);let{loaderResults:H,fetcherResults:W}=await me(I,L,A,d);if(b.signal.aborted)return;if(b.signal.removeEventListener("abort",F),J.delete(t),$.delete(t),L.forEach((e=>$.delete(e.key))),R.fetchers.has(t)){let e=jt(E.data);R.fetchers.set(t,e)}let B=st(H);if(B)return pe(A,B.result,!1,{preventScrollReset:h});if(B=st(W),B)return Q.add(B.key),pe(A,B.result,!1,{preventScrollReset:h});let{loaderData:U,errors:V}=nt(R,T,H,void 0,L,W);Re(_),"loading"===R.navigation.state&&_>K?(p(N,"Expected pending action"),M&&M.abort(),ae(R.navigation.location,{matches:T,loaderData:U,errors:V,fetchers:new Map(R.fetchers)})):(oe({errors:V,loaderData:rt(R.loaderData,U,T,V),fetchers:new Map(R.fetchers)}),Y=!1)}(t,n,v,h,w,g.active,d,O,y,l&&l.unstable_defaultShouldRevalidate):(X.set(t,{routeId:n,path:v}),await async function(t,n,o,i,s,u,l,d,p){let f=R.fetchers.get(t);ge(t,Et(p,f?f.data:void 0),{flushSync:l});let m=new AbortController,h=Xe(e.history,o,m.signal);if(u){let e=await Ye(i,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ve(t,n,e.error,{flushSync:l});if(!e.matches)return void ve(t,n,ct(404,{pathname:o}),{flushSync:l});i=e.matches}let g=Ot(i,o);$.set(t,m);let v=G,y=qe(a,c,h,i,g,r,s),b=await fe(h,y,s,t),w=b[g.route.id];$.get(t)===m&&$.delete(t);if(h.signal.aborted)return;if(ee.has(t))return void ge(t,jt(void 0));if(ht(w))return K>v?void ge(t,jt(void 0)):(Q.add(t),void await pe(h,w,!1,{preventScrollReset:d}));if(mt(w))return void ve(t,n,w.error);ge(t,jt(w.data))}(t,n,v,h,w,g.active,d,O,y))},revalidate:function(){re||(re=Pt()),he(),oe({revalidation:"loading"});let e=re.promise;return"submitting"===R.navigation.state?e:"idle"===R.navigation.state?(ue(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),e):(ue(N||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:!0===H}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ye,resetFetcher:function(e,t){je(e,t?.reason),ge(e,jt(null))},deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),ee.add(e)):Z.set(e,t),oe({fetchers:new Map(R.fetchers)})},dispose:function(){y&&y(),B&&B(),w.clear(),M&&M.abort(),R.fetchers.forEach(((e,t)=>be(t))),R.blockers.forEach(((e,t)=>Ne(t)))},getBlocker:function(e,t){let n=R.blockers.get(e)||ke;return te.get(e)!==t&&te.set(e,t),n},deleteBlocker:Ne,patchRoutes:function(e,t,n=!1){let r=null==i;Ie(e,t,i||s,c,a,n),r&&(s=[...s],oe({}))},_internalFetchControllers:$,_internalSetRoutes:function(e){c={},i=S(e,a,void 0,c)},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){oe(e)}},e.unstable_instrumentations&&(d=function(e,t){let n={navigate:[],fetch:[]};if(t.forEach((e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}}))),n.navigate.length>0){let t=e.navigate[ie]??e.navigate,r=se(n.navigate,t,((...t)=>{let[n,r]=t;return{to:"number"==typeof n||"string"==typeof n?n:n?g(n):".",...de(e,r??{})}}));r&&(r[ie]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[ie]??e.fetch,r=se(n.fetch,t,((...t)=>{let[n,,r,o]=t;return{href:r??".",fetcherKey:n,...de(e,o??{})}}));r&&(r[ie]=t,e.fetch=r)}return e}(d,e.unstable_instrumentations.map((e=>e.router)).filter(Boolean))),d}function Ae(e,t,n,r,o,a){let i,c;if(o){i=[];for(let e of t)if(i.push(e),e.route.id===o){c=e;break}}else i=t,c=t[t.length-1];let s=J(r||".",K(i),V(e.pathname,n)||e.pathname,"path"===a);if(null==r&&(s.search=e.search,s.hash=e.hash),(null==r||""===r||"."===r)&&c){let e=xt(s.search);if(c.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}return"/"!==n&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:Q([e,t])}({basename:n,pathname:s.pathname})),g(s)}function De(e,t,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:t};if(n.formMethod&&!bt(n.formMethod))return{path:t,error:ct(405,{method:n.formMethod})};let r,o,a=()=>({path:t,error:ct(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=ut(t);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!wt(i))return a();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,[t,n])=>`${e}${t}=${n}\n`),""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!wt(i))return a();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return a()}}}if(p("function"==typeof FormData,"FormData is not available in this environment"),n.formData)r=Ze(n.formData),o=n.formData;else if(n.body instanceof FormData)r=Ze(n.body),o=n.body;else if(n.body instanceof URLSearchParams)r=n.body,o=et(r);else if(null==n.body)r=new URLSearchParams,o=new FormData;else try{r=new URLSearchParams(n.body),o=et(r)}catch(e){return a()}let s={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(wt(s.formMethod))return{path:t,submission:s};let u=v(t);return e&&u.search&&xt(u.search)&&r.append("index",""),u.search=`?${r}`,{path:g(u),submission:s}}function Te(e,t,n,r,o,a,i,c,s,u,l,d,p,f,m,h,g,v,y,b,w){let x,O=b?mt(b[1])?b[1].error:b[1].data:void 0,k=o.createURL(a.location),S=o.createURL(s);if(l&&a.errors){let e=Object.keys(a.errors)[0];x=i.findIndex((t=>t.route.id===e))}else if(b&&mt(b[1])){let e=b[0];x=i.findIndex((t=>t.route.id===e))-1}let E=b?b[1].statusCode:void 0,P=E&&E>=400,A={currentUrl:k,currentParams:a.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...c,actionResult:O,actionStatus:E},D=re(i),T=i.map(((o,i)=>{let{route:c}=o,s=null;if(null!=x&&i>x?s=!1:c.lazy?s=!0:_e(c)?l?s=Ce(c,a.loaderData,a.errors):function(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}(a.loaderData,a.matches[i],o)&&(s=!0):s=!1,null!==s)return ze(n,r,e,D,o,u,t,s);let p=!1;"boolean"==typeof w?p=w:P?p=!1:(d||k.pathname+k.search===S.pathname+S.search||k.search!==S.search||function(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}(a.matches[i],o))&&(p=!0);let f={...A,defaultShouldRevalidate:p},m=Me(o,f);return ze(n,r,e,D,o,u,t,m,f,w)})),_=[];return m.forEach(((e,c)=>{if(l||!i.some((t=>t.route.id===e.routeId))||f.has(c))return;let s=a.fetchers.get(c),m=s&&"idle"!==s.state&&void 0===s.data,b=j(g,e.path,v);if(!b){if(y&&m)return;return void _.push({key:c,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(h.has(c))return;let x=Ot(b,e.path),O=new AbortController,k=Xe(o,e.path,O.signal),S=null;if(p.has(c))p.delete(c),S=qe(n,r,k,b,x,u,t);else if(m)d&&(S=qe(n,r,k,b,x,u,t));else{let e;e="boolean"==typeof w?w:!P&&d;let o={...A,defaultShouldRevalidate:e};Me(x,o)&&(S=qe(n,r,k,b,x,u,t,o))}S&&_.push({key:c,routeId:e.routeId,path:e.path,matches:S,match:x,request:k,controller:O})})),{dsMatches:T,revalidatingFetchers:_}}function _e(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Ce(e,t,n){if(e.lazy)return!0;if(!_e(e))return!1;let r=null!=t&&e.id in t,o=null!=n&&void 0!==n[e.id];return!(!r&&o)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!o)}function Me(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}function Ie(e,t,n,r,o,a){let i;if(e){let t=r[e];p(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=n;let c=[],s=[];if(t.forEach((e=>{let t=i.find((t=>Re(e,t)));t?s.push({existingRoute:t,newRoute:e}):c.push(e)})),c.length>0){let t=S(c,o,[e||"_","patch",String(i?.length||"0")],r);i.push(...t)}if(a&&s.length>0)for(let e=0;e<s.length;e++){let{existingRoute:t,newRoute:n}=s[e],r=t,[a]=S([n],o,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Re(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every(((e,n)=>t.children?.some((t=>Re(e,t))))))}var Ne=new WeakMap,Le=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(p(o,"No route found in manifest"),!o.lazy||"object"!=typeof o.lazy)return;let a=o.lazy[e];if(!a)return;let i=Ne.get(o);i||(i={},Ne.set(o,i));let c=i[e];if(c)return c;let s=(async()=>{let t=function(e){return O.has(e)}(e),n=void 0!==o[e]&&"hasErrorBoundary"!==e;if(t)f(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(n)f(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();null!=t&&(Object.assign(o,{[e]:t}),Object.assign(o,r(o)))}"object"==typeof o.lazy&&(o.lazy[e]=void 0,Object.values(o.lazy).every((e=>void 0===e))&&(o.lazy=void 0))})();return i[e]=s,s},Fe=new WeakMap;async function He(e){let t=e.matches.filter((e=>e.shouldLoad)),n={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{n[t[r].route.id]=e})),n}async function We(e){return e.matches.some((e=>e.route.middleware))?Be(e,(()=>He(e))):He(e)}function Be(e,t){return Ue(e,t,(e=>{if(yt(e))throw e;return e}),dt,(function(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:"error",result:t}}));{let{matches:r}=e,o=Math.min(Math.max(r.findIndex((e=>e.route.id===n)),0),Math.max(r.findIndex((e=>e.shouldCallHandler())),0)),a=at(r,r[o].route.id).route.id;return Promise.resolve({[a]:{type:"error",result:t}})}}))}async function Ue(e,t,n,r,o){let{matches:a,request:i,params:c,context:s,unstable_pattern:u}=e,l=a.flatMap((e=>e.route.middleware?e.route.middleware.map((t=>[e.route.id,t])):[]));return await Ve({request:i,params:c,context:s,unstable_pattern:u},l,t,n,r,o)}async function Ve(e,t,n,r,o,a,i=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let s=t[i];if(!s){return await n()}let u,[l,d]=s,p=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{let c=await Ve(e,t,n,r,o,a,i+1);return u={value:c},u.value}catch(e){return u={value:await a(e,l,u)},u.value}};try{let t=await d(e,p),n=null!=t?r(t):void 0;return o(n)?n:u?n??u.value:(u={value:await p()},u.value)}catch(e){return await a(e,l,u)}}function Ye(e,t,n,r,o){let a=Le({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=function(e,t,n,r,o){let a=n[e.id];if(p(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=Fe.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{p("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(void 0===r)continue;let i=(o=e,k.has(o)),c=void 0!==a[e]&&"hasErrorBoundary"!==e;i?f(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):c?f(!c,`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.`):n[e]=r}var o;Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Fe.set(a,n),n.catch((()=>{})),{lazyRoutePromise:n,lazyHandlerPromise:n}}let i,c=Object.keys(e.lazy),s=[];for(let a of c){if(o&&o.includes(a))continue;let c=Le({key:a,route:e,manifest:n,mapRouteProperties:r});c&&(s.push(c),a===t&&(i=c))}let u=s.length>0?Promise.all(s).then((()=>{})):void 0;return u?.catch((()=>{})),i?.catch((()=>{})),{lazyRoutePromise:u,lazyHandlerPromise:i}}(r.route,wt(n.method)?"action":"loader",t,e,o);return{middleware:a,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ze(e,t,n,r,o,a,i,c,s=null,u){let l=!1,d=Ye(e,t,n,o,a);return{...o,_lazyPromises:d,shouldLoad:c,shouldRevalidateArgs:s,shouldCallHandler:e=>(l=!0,s?Me(o,"boolean"==typeof u?{...s,defaultShouldRevalidate:u}:"boolean"==typeof e?{...s,defaultShouldRevalidate:e}:s):c),resolve(e){let{lazy:t,loader:a,middleware:s}=o.route,u=l||c||e&&!wt(n.method)&&(t||a),p=s&&s.length>0&&!a&&!t;return!u||!wt(n.method)&&p?Promise.resolve({type:"data",result:void 0}):async function({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:a,scopedContext:i}){let c,s,u=wt(e.method),l=u?"action":"loader",d=r=>{let o,c=new Promise(((e,t)=>o=t));s=()=>o(),e.signal.addEventListener("abort",s);let u=o=>"function"!=typeof r?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${l}" [routeId: ${n.route.id}]`)):r({request:e,unstable_pattern:t,params:n.params,context:i},...void 0!==o?[o]:[]),d=(async()=>{try{return{type:"data",result:await(a?a((e=>u(e))):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([d,c])};try{let t=u?n.route.action:n.route.loader;if(r||o)if(t){let e,[n]=await Promise.all([d(t).catch((t=>{e=t})),r,o]);if(void 0!==e)throw e;c=n}else{await r;let t=u?n.route.action:n.route.loader;if(!t){if("action"===l){let t=new URL(e.url),r=t.pathname+t.search;throw ct(405,{method:e.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}[c]=await Promise.all([d(t),o])}else{if(!t){let t=new URL(e.url);throw ct(404,{pathname:t.pathname+t.search})}c=await d(t)}}catch(e){return{type:"error",result:e}}finally{s&&e.signal.removeEventListener("abort",s)}return c}({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:e,scopedContext:i})}}}function qe(e,t,n,r,o,a,i,c=null){return r.map((s=>s.route.id!==o.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ye(e,t,n,s,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ze(e,t,n,re(r),s,a,i,!0,c)))}async function $e(e,t,n,r,o,a){n.some((e=>e._lazyPromises?.middleware))&&await Promise.all(n.map((e=>e._lazyPromises?.middleware)));let i={request:t,unstable_pattern:re(n),params:n[0].params,context:o,matches:n},c=a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=i;return Be(t,(()=>e({...t,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})))},s=await e({...i,fetcherKey:r,runClientMiddleware:c});try{await Promise.all(n.flatMap((e=>[e._lazyPromises?.handler,e._lazyPromises?.route])))}catch(e){}return s}async function Ge(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function Ke(e){let{result:t,type:n}=e;if(vt(t)){let e;try{e=await Ge(t)}catch(e){return{type:"error",error:e}}return"error"===n?{type:"error",error:new te(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===n?gt(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:lt(t),statusCode:ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ne(t)?t.status:void 0}:gt(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Je(e,t,n,r,o){let a=e.headers.get("Location");if(p(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!z(a)){let i=r.slice(0,r.findIndex((e=>e.route.id===n))+1);a=Ae(new URL(t.url),i,o,a),e.headers.set("Location",a)}return e}function Qe(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(z(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r);if(o.includes(a.protocol))throw new Error("Invalid redirect location");let i=null!=V(a.pathname,n);if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}try{let t=r.createURL(e);if(o.includes(t.protocol))throw new Error("Invalid redirect location")}catch(e){}return e}function Xe(e,t,n,r){let o=e.createURL(ut(t)).toString(),a={signal:n};if(r&&wt(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):"text/plain"===t?a.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?a.body=Ze(r.formData):a.body=r.formData}return new Request(o,a)}function Ze(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"==typeof r?r:r.name);return t}function et(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function tt(e,t,n,r=!1,o=!1){let a,i={},c=null,s=!1,u={},l=n&&mt(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(p(!ht(f),"Cannot handle redirect results in processLoaderData"),mt(f)){let t=f.error;if(void 0!==l&&(t=l,l=void 0),c=c||{},o)c[d]=t;else{let n=at(e,d);null==c[n.route.id]&&(c[n.route.id]=t)}r||(i[d]=je),s||(s=!0,a=ne(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else i[d]=f.data,f.statusCode&&200!==f.statusCode&&!s&&(a=f.statusCode),f.headers&&(u[d]=f.headers)})),void 0!==l&&n&&(c={[n[0]]:l},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:a||200,loaderHeaders:u}}function nt(e,t,n,r,o,a){let{loaderData:i,errors:c}=tt(t,n,r);return o.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:n,match:r,controller:o}=t;if(o&&o.signal.aborted)return;let i=a[n];if(p(i,"Did not find corresponding fetcher result"),mt(i)){let t=at(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:i.error}),e.fetchers.delete(n)}else if(ht(i))p(!1,"Unhandled fetcher revalidation redirect");else{let t=jt(i.data);e.fetchers.set(n,t)}})),{loaderData:i,errors:c}}function rt(e,t,n,r){let o=Object.entries(t).filter((([,e])=>e!==je)).reduce(((e,[t,n])=>(e[t]=n,e)),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(o[n]=e[n]),r&&r.hasOwnProperty(n))break}return o}function ot(e){return e?mt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function at(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 it(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 ct(e,{pathname:t,routeId:n,method:r,type:o,message:a}={}){let i="Unknown Server Error",c="Unknown @remix-run/router error";return 400===e?(i="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:"invalid-body"===o&&(c="Unable to encode submission body")):403===e?(i="Forbidden",c=`Route "${n}" does not match URL "${t}"`):404===e?(i="Not Found",c=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new te(e||500,i,new Error(c),!0)}function st(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(ht(r))return{key:n,result:r}}}function ut(e){return g({..."string"==typeof e?v(e):e,hash:""})}function lt(e){return new te(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function dt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&pt(t)))}function pt(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}function ft(e){return vt(e.result)&&be.has(e.result.status)}function mt(e){return"error"===e.type}function ht(e){return"redirect"===(e&&e.type)}function gt(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function vt(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function yt(e){return vt(e)&&(t=e.status,be.has(t))&&e.headers.has("Location");var t}function bt(e){return ye.has(e.toUpperCase())}function wt(e){return ge.has(e.toUpperCase())}function xt(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ot(e,t){let n="string"==typeof t?v(t).search:t.search;if(e[e.length-1].route.index&&xt(n||""))return e[e.length-1];let r=G(e);return r[r.length-1]}function kt(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:a,json:i}=e;if(t&&n&&r)return null!=o?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}:void 0}function St(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Et(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Pt(){let e,t,n=new Promise(((r,o)=>{e=async e=>{r(e);try{await n}catch(e){}},t=async e=>{o(e);try{await n}catch(e){}}}));return{promise:n,resolve:e,reject:t}}var At=a.createContext(null);At.displayName="DataRouter";var Dt=a.createContext(null);Dt.displayName="DataRouterState";var Tt=a.createContext(!1);function _t(){return a.useContext(Tt)}var Ct=a.createContext({isTransitioning:!1});Ct.displayName="ViewTransition";var Mt=a.createContext(new Map);Mt.displayName="Fetchers";var It=a.createContext(null);It.displayName="Await";var Rt=a.createContext(null);Rt.displayName="Navigation";var Nt=a.createContext(null);Nt.displayName="Location";var Lt=a.createContext({outlet:null,matches:[],isDataRoute:!1});Lt.displayName="Route";var Ft=a.createContext(null);Ft.displayName="RouteError";var Ht=!0,Wt="REACT_ROUTER_ERROR",Bt="REDIRECT";function Ut(){return null!=a.useContext(Nt)}function Vt(){return p(Ut(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(Nt).location}var Yt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zt(e){a.useContext(Rt).static||a.useLayoutEffect(e)}function qt(){let{isDataRoute:e}=a.useContext(Lt);return e?function(){let{router:e}=on("useNavigate"),t=cn("useNavigate"),n=a.useRef(!1);return zt((()=>{n.current=!0})),a.useCallback((async(r,o={})=>{f(n.current,Yt),n.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){p(Ut(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(At),{basename:t,navigator:n}=a.useContext(Rt),{matches:r}=a.useContext(Lt),{pathname:o}=Vt(),i=JSON.stringify(K(r)),c=a.useRef(!1);return zt((()=>{c.current=!0})),a.useCallback(((r,a={})=>{if(f(c.current,Yt),!c.current)return;if("number"==typeof r)return void n.go(r);let s=J(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:Q([t,s.pathname])),(a.replace?n.replace:n.push)(s,a.state,a)}),[t,n,i,o,e])}()}a.createContext(null);function $t(){let{matches:e}=a.useContext(Lt),t=e[e.length-1];return t?t.params:{}}function Gt(e,{relative:t}={}){let{matches:n}=a.useContext(Lt),{pathname:r}=Vt(),o=JSON.stringify(K(n));return a.useMemo((()=>J(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function Kt(e,t,n,r,o){p(Ut(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=a.useContext(Rt),{matches:c}=a.useContext(Lt),s=c[c.length-1],u=s?s.params:{},l=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;if(Ht){let e=m&&m.path||"";pn(l,!m||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let h,g=Vt();if(t){let e="string"==typeof t?v(t):t;p("/"===d||e.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),h=e}else h=g;let y=h.pathname||"/",b=y;if("/"!==d){let e=d.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=j(e,{pathname:b});Ht&&(f(m||null!=w,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),f(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let x=nn(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:Q([d,i.encodeLocation?i.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:Q([d,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])}))),c,n,r,o);return t&&x?a.createElement(Nt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},x):x}function Jt(){let e=sn(),t=ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},c=null;return Ht&&(console.error("Error handled by React Router default ErrorBoundary:",e),c=a.createElement(a.Fragment,null,a.createElement("p",null,"💿 Hey developer 👋"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:i},"ErrorBoundary")," or"," ",a.createElement("code",{style:i},"errorElement")," prop on your route."))),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,c)}var Qt=a.createElement(Jt,null),Xt=class 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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${Wt}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new te(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?a.createElement(Lt.Provider,{value:this.props.routeContext},a.createElement(Ft.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?a.createElement(en,{error:e},t):t}};Xt.contextType=Tt;var Zt=new WeakMap;function en({children:e,error:t}){let{basename:n}=a.useContext(Rt);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${Wt}:${Bt}:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=Zt.get(t);if(r)throw r;let o=ae(e.location,n);if(oe&&!Zt.get(t)){if(!o.isExternal&&!e.reloadDocument){const n=Promise.resolve().then((()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace})));throw Zt.set(t,n),n}window.location.href=o.absoluteURL||o.to}return a.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function tn({routeContext:e,match:t,children:n}){let r=a.useContext(At);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(Lt.Provider,{value:e},n)}function nn(e,t=[],n=null,r=null,o=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let i=e,c=n?.errors;if(null!=c){let e=i.findIndex((e=>e.route.id&&void 0!==c?.[e.route.id]));p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(n)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||o){s=!0,i=u>=0?i.slice(0,u+1):[i[0]];break}}}let l=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:re(n.matches),errorInfo:t})}:void 0;return i.reduceRight(((e,r,o)=>{let d,p=!1,f=null,m=null;n&&(d=c&&r.route.id?c[r.route.id]:void 0,f=r.route.errorElement||Qt,s&&(u<0&&0===o?(pn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):u===o&&(p=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,o+1)),g=()=>{let t;return t=d?f:p?m:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(tn,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(Xt,{location:n.location,revalidation:n.revalidation,component:f,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()}),null)}function rn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function on(e){let t=a.useContext(At);return p(t,rn(e)),t}function an(e){let t=a.useContext(Dt);return p(t,rn(e)),t}function cn(e){let t=function(e){let t=a.useContext(Lt);return p(t,rn(e)),t}(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sn(){let e=a.useContext(Ft),t=an("useRouteError"),n=cn("useRouteError");return void 0!==e?e:t.errors?.[n]}var un=0;function ln(e){let{router:t,basename:n}=on("useBlocker"),r=an("useBlocker"),[o,i]=a.useState(""),c=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:r,nextLocation:o,historyAction:a}=t;return e({currentLocation:{...r,pathname:V(r.pathname,n)||r.pathname},nextLocation:{...o,pathname:V(o.pathname,n)||o.pathname},historyAction:a})}),[n,e]);return a.useEffect((()=>{let e=String(++un);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,c)}),[t,o,c]),o&&r.blockers.has(o)?r.blockers.get(o):ke}var dn={};function pn(e,t,n){t||dn[e]||(dn[e]=!0,f(!1,n))}var fn={};function mn(e,t){e||fn[t]||(fn[t]=!0,console.warn(t))}var hn=(r||(r=n.t(a,2))).useOptimistic,gn=()=>{};function vn(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(Ht&&e.element&&f(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:a.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(Ht&&e.hydrateFallbackElement&&f(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(Ht&&e.errorElement&&f(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var yn=["HydrateFallback","hydrateFallbackElement"];function bn(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:u({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,hydrationRouteProperties:yn,mapRouteProperties:vn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}var wn=class{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 xn({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){let o=_t();r=o||r;let[i,c]=a.useState(e.state),[s,u]=(l=i,hn?hn(l):[l,gn]);var l;let[d,p]=a.useState(),[f,m]=a.useState({isTransitioning:!1}),[h,g]=a.useState(),[v,y]=a.useState(),[b,w]=a.useState(),x=a.useRef(new Map),O=a.useCallback(((o,{deletedFetchers:i,newErrors:s,flushSync:l,viewTransitionOpts:d})=>{s&&n&&Object.values(s).forEach((e=>n(e,{location:o.location,params:o.matches[0]?.params??{},unstable_pattern:re(o.matches)}))),o.fetchers.forEach(((e,t)=>{void 0!==e.data&&x.current.set(t,e.data)})),i.forEach((e=>x.current.delete(e))),mn(!1===l||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let f=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(mn(null==d||f,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&f){if(t&&l){t((()=>{v&&(h?.resolve(),v.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})}));let n=e.window.document.startViewTransition((()=>{t((()=>c(o)))}));return n.finished.finally((()=>{t((()=>{g(void 0),y(void 0),p(void 0),m({isTransitioning:!1})}))})),void t((()=>y(n)))}v?(h?.resolve(),v.skipTransition(),w({state:o,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(p(o),m({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&l?t((()=>c(o))):!1===r?c(o):a.startTransition((()=>{!0===r&&u((e=>On(e,o))),c(o)}))}),[e.window,t,v,h,r,u,n]);a.useLayoutEffect((()=>e.subscribe(O)),[e,O]),a.useEffect((()=>{f.isTransitioning&&!f.flushSync&&g(new wn)}),[f]),a.useEffect((()=>{if(h&&d&&e.window){let t=d,n=h.promise,o=e.window.document.startViewTransition((async()=>{!1===r?c(t):a.startTransition((()=>{!0===r&&u((e=>On(e,t))),c(t)})),await n}));o.finished.finally((()=>{g(void 0),y(void 0),p(void 0),m({isTransitioning:!1})})),y(o)}}),[d,h,e.window,r,u]),a.useEffect((()=>{h&&d&&s.location.key===d.location.key&&h.resolve()}),[h,v,s.location,d]),a.useEffect((()=>{!f.isTransitioning&&b&&(p(b.state),m({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))}),[f.isTransitioning,b]);let k=a.useMemo((()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})})),[e]),S=e.basename||"/",E=a.useMemo((()=>({router:e,navigator:k,static:!1,basename:S,onError:n})),[e,k,S,n]);return a.createElement(a.Fragment,null,a.createElement(At.Provider,{value:E},a.createElement(Dt.Provider,{value:s},a.createElement(Mt.Provider,{value:x.current},a.createElement(Ct.Provider,{value:f},a.createElement(jn,{basename:S,location:s.location,navigationType:s.historyAction,navigator:k,unstable_useTransitions:r},a.createElement(kn,{routes:e.routes,future:e.future,state:s,onError:n})))))),null)}function On(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var kn=a.memo((function({routes:e,future:t,state:n,onError:r}){return Kt(e,void 0,n,r,t)}));function Sn({to:e,replace:t,state:n,relative:r}){p(Ut(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=a.useContext(Rt);f(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=a.useContext(Lt),{pathname:c}=Vt(),s=qt(),u=J(e,K(i),c,"path"===r),l=JSON.stringify(u);return a.useEffect((()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})}),[s,l,r,t,n]),null}function En(e){p(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jn({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1,unstable_useTransitions:c}){p(!Ut(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),u=a.useMemo((()=>({basename:s,navigator:o,static:i,unstable_useTransitions:c,future:{}})),[s,o,i,c]);"string"==typeof n&&(n=v(n));let{pathname:l="/",search:d="",hash:m="",state:h=null,key:g="default"}=n,y=a.useMemo((()=>{let e=V(l,s);return null==e?null:{location:{pathname:e,search:d,hash:m,state:h,key:g},navigationType:r}}),[s,l,d,m,h,g,r]);return f(null!=y,`<Router basename="${s}"> is not able to match the URL "${l}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:a.createElement(Rt.Provider,{value:u},a.createElement(Nt.Provider,{children:t,value:y}))}function Pn({children:e,location:t}){return Kt(An(e),t)}a.Component;function An(e,t=[]){let n=[];return a.Children.forEach(e,((e,r)=>{if(!a.isValidElement(e))return;let o=[...t,r];if(e.type===a.Fragment)return void n.push.apply(n,An(e.props.children,o));p(e.type===En,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,"An index route cannot have child routes.");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,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.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=An(e.props.children,o)),n.push(i)})),n}var Dn="get",Tn="application/x-www-form-urlencoded";function _n(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Cn(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var Mn=null;var In=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rn(e){return null==e||In.has(e)?e:(f(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tn}"`),null)}function Nn(e,t){let n,r,o,a,i;if(function(e){return _n(e)&&"form"===e.tagName.toLowerCase()}(e)){let i=e.getAttribute("action");r=i?V(i,t):null,n=e.getAttribute("method")||Dn,o=Rn(e.getAttribute("enctype"))||Tn,a=new FormData(e)}else if(function(e){return _n(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return _n(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 c=e.getAttribute("formaction")||i.getAttribute("action");if(r=c?V(c,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Dn,o=Rn(e.getAttribute("formenctype"))||Rn(i.getAttribute("enctype"))||Tn,a=new FormData(i,e),!function(){if(null===Mn)try{new FormData(document.createElement("form"),0),Mn=!1}catch(e){Mn=!0}return Mn}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,r)}}else{if(_n(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Dn,r=null,o=Tn,i=e}return a&&"text/plain"===o&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis;function Ln(e,t){if(!1===e||null==e)throw new Error(t)}Symbol("SingleFetchRedirect");function Fn(e,t,n,r){let o="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:"/"===o.pathname?o.pathname=`_root.${r}`:t&&"/"===V(o.pathname,t)?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function Hn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}function Wn(e){return null!=e&&"string"==typeof e.page}function Bn(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Un(e,t,n,r,o,a){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,c=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===a?t.filter(((e,t)=>i(e,t)||c(e,t))):"data"===a?t.filter(((t,a)=>{let s=r.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,a)||c(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function Vn(e,t,{includeHydrateFallback:n}={}){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o})).flat(1),[...new Set(r)];var r}function Yn(e,t){let n=new Set,r=new Set(t);return e.reduce(((e,o)=>{if(t&&!Wn(o)&&"script"===o.as&&o.href&&r.has(o.href))return e;let a=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(o));return n.has(a)||(n.add(a),e.push({key:a,link:o})),e}),[])}function zn(e,t){return"lazy"===e.mode&&!0===t}function qn(){let e=a.useContext(At);return Ln(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $n(){let e=a.useContext(Dt);return Ln(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Gn=a.createContext(void 0);function Kn(){let e=a.useContext(Gn);return Ln(e,"You must render this element inside a <HydratedRouter> element"),e}function Jn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qn(e,t,n){if(n&&!tr)return[e[0]];if(t){let n=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,n+1)}return e}Gn.displayName="FrameworkContext";function Xn({page:e,...t}){let{router:n}=qn(),r=a.useMemo((()=>j(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?a.createElement(er,{page:e,matches:r,...t}):null}function Zn(e){let{manifest:t,routeModules:n}=Kn(),[r,o]=a.useState([]);return a.useEffect((()=>{let r=!1;return async function(e,t,n){return Yn((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await Hn(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(Bn).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}function er({page:e,matches:t,...n}){let r=Vt(),{future:o,manifest:i,routeModules:c}=Kn(),{basename:s}=qn(),{loaderData:u,matches:l}=$n(),d=a.useMemo((()=>Un(e,t,l,i,r,"data")),[e,t,l,i,r]),p=a.useMemo((()=>Un(e,t,l,i,r,"assets")),[e,t,l,i,r]),f=a.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,a=!1;if(t.forEach((e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!d.some((t=>t.route.id===e.route.id))&&e.route.id in u&&c[e.route.id]?.shouldRevalidate||t.hasClientLoader?a=!0:n.add(e.route.id))})),0===n.size)return[];let l=Fn(e,s,o.unstable_trailingSlashAwareDataRequests,"data");return a&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[s,o.unstable_trailingSlashAwareDataRequests,u,r,i,d,t,e,c]),m=a.useMemo((()=>Vn(p,i)),[p,i]),h=Zn(p);return a.createElement(a.Fragment,null,f.map((e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),m.map((e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),h.map((({key:e,link:t})=>a.createElement("link",{key:e,nonce:n.nonce,...t}))))}var tr=!1;function nr(e){let{manifest:t,serverHandoffString:n,isSpaMode:r,renderMeta:o,routeDiscovery:i,ssr:c}=Kn(),{router:s,static:u,staticContext:l}=qn(),{matches:d}=$n(),p=_t(),f=zn(i,c);o&&(o.didRenderScripts=!0);let m=Qn(d,null,r);a.useEffect((()=>{!0}),[]);let h=a.useMemo((()=>{if(p)return null;let r=l?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",o=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};\n${m.map(((e,n)=>{let r=`route${n}`,o=t.routes[e.route.id];Ln(o,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:c,hydrateFallbackModule:s,module:u}=o,l=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...i?[{module:i,varName:`${r}_clientLoader`}]:[],...c?[{module:c,varName:`${r}_clientMiddleware`}]:[],...s?[{module:s,varName:`${r}_HydrateFallback`}]:[],{module:u,varName:`${r}_main`}];return 1===l.length?`import * as ${r} from ${JSON.stringify(u)};`:[l.map((e=>`import * as ${e.varName} from "${e.module}";`)).join("\n"),`const ${r} = {${l.map((e=>`...${e.varName}`)).join(",")}};`].join("\n")})).join("\n")}\n ${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},n){let r=new Set(n.state.matches.map((e=>e.route.id))),o=n.state.location.pathname.split("/").filter(Boolean),a=["/"];for(o.pop();o.length>0;)a.push(`/${o.join("/")}`),o.pop();a.forEach((e=>{let t=j(n.routes,e,n.basename);t&&t.forEach((e=>r.add(e.route.id)))}));let i=[...r].reduce(((e,n)=>Object.assign(e,{[n]:t.routes[n]})),{});return{...t,routes:i,sri:!!e||void 0}}(t,s),null,2)};`:""}\n window.__reactRouterRouteModules = {${m.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return a.createElement(a.Fragment,null,a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r},type:void 0}),a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o},type:"module",async:!0}))}),[]),g=tr||p?[]:function(e){return[...new Set(e)]}(t.entry.imports.concat(Vn(m,t,{includeHydrateFallback:!0}))),v="object"==typeof t.sri?t.sri:{};return mn(!p,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),tr||p?null:a.createElement(a.Fragment,null,"object"==typeof t.sri?a.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,f?null:a.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],suppressHydrationWarning:!0}),a.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],suppressHydrationWarning:!0}),g.map((t=>a.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:v[t],suppressHydrationWarning:!0}))),h)}function rr(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}a.Component;function or({error:e,isOutsideRemixApp:t}){console.error(e);let n,r=a.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(ne(e))return a.createElement(ar,{title:"Unhandled Thrown Response!"},a.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),Ht?r:null);if(e instanceof Error)e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);new Error(t)}return a.createElement(ar,{title:"Application Error!",isOutsideRemixApp:t},a.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),a.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function ar({title:e,renderScripts:t,isOutsideRemixApp:n,children:r}){let{routeModules:o}=Kn();return o.root?.Layout&&!n?r:a.createElement("html",{lang:"en"},a.createElement("head",null,a.createElement("meta",{charSet:"utf-8"}),a.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),a.createElement("title",null,e)),a.createElement("body",null,a.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},r,t?a.createElement(nr,null):null)))}var ir="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{ir&&(window.__reactRouterVersion="7.12.0")}catch(e){}function cr(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:l({window:t?.window}),hydrationData:t?.hydrationData||ur(),routes:e,mapRouteProperties:vn,hydrationRouteProperties:yn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function sr(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:d({window:t?.window}),hydrationData:t?.hydrationData||ur(),routes:e,mapRouteProperties:vn,hydrationRouteProperties:yn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function ur(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:lr(e.errors)}),e}function lr(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)n[e]=new te(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let o=new t(r.message);o.stack="",n[e]=o}catch(e){}}if(null==n[e]){let t=new Error(r.message);t.stack="",n[e]=t}}else n[e]=r;return n}var dr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pr=a.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:i,state:c,target:s,to:u,preventScrollReset:l,viewTransition:d,unstable_defaultShouldRevalidate:f,...m},h){let{basename:v,unstable_useTransitions:y}=a.useContext(Rt),b="string"==typeof u&&dr.test(u),w=ae(u,v),x=function(e,{relative:t}={}){p(Ut(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=a.useContext(Rt),{hash:o,pathname:i,search:c}=Gt(e,{relative:t}),s=i;return"/"!==n&&(s="/"===i?n:Q([n,i])),r.createHref({pathname:s,search:c,hash:o})}(u=w.to,{relative:r}),[O,k,S]=function(e,t){let n=a.useContext(Gn),[r,o]=a.useState(!1),[i,c]=a.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:l,onMouseLeave:d,onTouchStart:p}=t,f=a.useRef(null);a.useEffect((()=>{if("render"===e&&c(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{c(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),a.useEffect((()=>{if(r){let e=setTimeout((()=>{c(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let m=()=>{o(!0)},h=()=>{o(!1),c(!1)};return n?"intent"!==e?[i,f,{}]:[i,f,{onFocus:Jn(s,m),onBlur:Jn(u,h),onMouseEnter:Jn(l,m),onMouseLeave:Jn(d,h),onTouchStart:Jn(p,m)}]:[!1,f,{}]}(n,m),E=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:s,unstable_useTransitions:u}={}){let l=qt(),d=Vt(),p=Gt(e,{relative:i});return a.useCallback((f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,t)){f.preventDefault();let t=void 0!==n?n:g(d)===g(p),m=()=>l(e,{replace:t,state:r,preventScrollReset:o,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:s});u?a.startTransition((()=>m())):m()}}),[d,l,p,n,r,t,e,o,i,c,s,u])}(u,{replace:i,state:c,target:s,preventScrollReset:l,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:y});let j=a.createElement("a",{...m,...S,href:w.absoluteURL||x,onClick:w.isExternal||o?e:function(t){e&&e(t),t.defaultPrevented||E(t)},ref:rr(h,k),target:s,"data-discover":b||"render"!==t?void 0:"true"});return O&&!b?a.createElement(a.Fragment,null,j,a.createElement(Xn,{page:x})):j}));pr.displayName="Link",a.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:i,viewTransition:c,children:s,...u},l){let d=Gt(i,{relative:u.relative}),f=Vt(),m=a.useContext(Dt),{navigator:h,basename:g}=a.useContext(Rt),v=null!=m&&function(e,{relative:t}={}){let n=a.useContext(Ct);p(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hr("useViewTransitionState"),o=Gt(e,{relative:t});if(!n.isTransitioning)return!1;let i=V(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=V(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=W(o.pathname,c)||null!=W(o.pathname,i)}(d)&&!0===c,y=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,b=f.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&g&&(w=V(w,g)||w);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let O,k=b===y||!r&&b.startsWith(y)&&"/"===b.charAt(x),S=null!=w&&(w===y||!r&&w.startsWith(y)&&"/"===w.charAt(y.length)),E={isActive:k,isPending:S,isTransitioning:v},j=k?e:void 0;O="function"==typeof n?n(E):[n,k?"active":null,S?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof o?o(E):o;return a.createElement(pr,{...u,"aria-current":j,className:O,ref:l,style:P,to:i,viewTransition:c},"function"==typeof s?s(E):s)})).displayName="NavLink";var fr=a.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:c=Dn,action:s,onSubmit:u,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:m,...h},v)=>{let{unstable_useTransitions:y}=a.useContext(Rt),b=br(),w=function(e,{relative:t}={}){let{basename:n}=a.useContext(Rt),r=a.useContext(Lt);p(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Gt(e||".",{relative:t})},c=Vt();if(null==e){i.search=c.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();i.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(i.pathname="/"===i.pathname?n:Q([n,i.pathname]));return g(i)}(s,{relative:l}),x="get"===c.toLowerCase()?"get":"post",O="string"==typeof s&&dr.test(s);return a.createElement("form",{ref:v,method:x,action:w,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute("formmethod")||c,p=()=>b(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:o,state:i,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:m});y&&!1!==n?a.startTransition((()=>p())):p()},...h,"data-discover":O||"render"!==e?void 0:"true"})}));function mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hr(e){let t=a.useContext(At);return p(t,mr(e)),t}function gr(e){f("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=a.useRef(Cn(e)),n=a.useRef(!1),r=Vt(),o=a.useMemo((()=>function(e,t){let n=Cn(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),i=qt(),c=a.useCallback(((e,t)=>{const r=Cn("function"==typeof e?e(new URLSearchParams(o)):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,c]}fr.displayName="Form";var vr=0,yr=()=>`__${String(++vr)}__`;function br(){let{router:e}=hr("useSubmit"),{basename:t}=a.useContext(Rt),n=cn("useRouteId"),r=e.fetch,o=e.navigate;return a.useCallback((async(e,a={})=>{let{action:i,method:c,encType:s,formData:u,body:l}=Nn(e,t);if(!1===a.navigate){let e=a.fetcherKey||yr();await r(e,n,a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:l,formMethod:a.method||c,formEncType:a.encType||s,flushSync:a.flushSync})}else await o(a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:l,formMethod:a.method||c,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})}),[r,o,t,n])}},77987:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},88097:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>r})},65166:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},47029:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(88097);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},35412:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{A:()=>r})},2482:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(25134);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},65710:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},25134:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(77987);function o(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},14644:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{HY:()=>u,Qd:()=>c,Tw:()=>f,Zz:()=>p,ve:()=>m,y$:()=>s,zH:()=>d});var o=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),a=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${a()}`,REPLACE:`@@redux/REPLACE${a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a()}`};function c(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function s(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(s)(e,t)}let a=e,u=t,l=new Map,d=l,p=0,f=!1;function m(){d===l&&(d=new Map,l.forEach(((e,t)=>{d.set(t,e)})))}function h(){if(f)throw new Error(r(3));return u}function g(e){if("function"!=typeof e)throw new Error(r(4));if(f)throw new Error(r(5));let t=!0;m();const n=p++;return d.set(n,e),function(){if(t){if(f)throw new Error(r(6));t=!1,m(),d.delete(n),l=null}}}function v(e){if(!c(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(f)throw new Error(r(9));try{f=!0,u=a(u,e)}finally{f=!1}return(l=d).forEach((e=>{e()})),e}v({type:i.INIT});return{dispatch:v,subscribe:g,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));a=e,v({type:i.REPLACE})},[o]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(h())}n();return{unsubscribe:e(n)}},[o](){return this}}}}}function u(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}const o=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const c={};for(let a=0;a<o.length;a++){const s=o[a],u=n[s],l=e[s],d=u(l,t);if(void 0===d){t&&t.type;throw new Error(r(14))}c[s]=d,i=i||d!==l}return i=i||o.length!==Object.keys(e).length,i?c:e}}function l(e,t){return function(...n){return t(e.apply(this,n))}}function d(e,t){if("function"==typeof e)return l(e,t);if("object"!=typeof e||null===e)throw new Error(r(16));const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=l(o,t))}return n}function p(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function f(...e){return t=>(n,o)=>{const a=t(n,o);let i=()=>{throw new Error(r(15))};const c={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(c)));return i=p(...s)(a.dispatch),{...a,dispatch:i}}}function m(e){return c(e)&&"type"in e&&"string"==typeof e.type}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,s.amdD=function(){throw new Error("define cannot be used indirect")},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var a={};n=n||[null,r({}),r([]),r(r)];for(var i=2&t&&e;"object"==typeof i&&!~n.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,s.d(o,a),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"chunk-"+({222:"vendor-libphonenumber-js",236:"actions",262:"html-editor",310:"vendor-fontawesome",556:"docs-actions",672:"phone-formatter",722:"code-editor",916:"vendor-icons"}[e]||e)+"."+{103:"956c3cad3193e2b46078",123:"6e69e488578840d4e34a",136:"8ba6d226aa26680cc00c",172:"5a8562f05605c293e378",201:"a4789b1cdf1cd5228723",211:"9568d8c0d6647d7393b3",222:"86e7e69454f651e8e581",236:"0b63dbf068e74a59c74c",262:"a144c7e379174cfaa68a",264:"fdc1a714ad90a0cef94c",306:"3691c30d7320438a8121",310:"1f5c4d34f611b7f0b69a",348:"d920d92169650dea27fe",350:"b174d19eb181fb88ff0f",356:"edd8889ae5f0d3342952",357:"cae6a953c1c36ceec395",389:"362711d95ad8d73ee7ed",419:"86bf12d44704862c6486",424:"9c7b92cf9e8cbe74166f",467:"b3dd954aafe3140ef1dc",556:"259905e30ed0313a5d02",601:"1304209cea9b5485565a",668:"ffc314407c1fd50dbfbf",672:"f0685e5e63247acbc44a",722:"2bfe654132875144a0af",789:"49834b299877fe035670",916:"35650b60ffb6142ba937",927:"0dd4f6842a7f50fa0d2d"}[e]+".js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="tocco-admin:",s.l=(e,t,n,r)=>{if(o[e])o[e].push(t);else{var i,c;if(void 0!==n)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+n){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",a+n),i.src=e),o[e]=[t];var p=(t,n)=>{i.onerror=i.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="/",(()=>{var e={792:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var a=s.p+s.u(t),i=new Error;s.l(a,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[a,i,c]=n,u=0;if(a.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunktocco_admin=this.webpackChunktocco_admin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),s.nc=void 0;var u={};return(()=>{"use strict";s.r(u),s.d(u,{default:()=>Et});var e=s(5556),t=s.n(e),n=s(4883),r=s.n(n),o=s(81845),a=s.n(o),i=s(6730),c=s(30632),l=s(63061),d=s(97699),p=s(12199),f=s(42851),m=s(18601),h=s(2753),g=s(29255),v=s(17678),y=s(92207),b=s.n(y),w=s(43786),x=s(26396),O=s.n(x),k=s(98671),S=s(24096);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=O()(O()(O()(O()(O()(O()(O()(O()({},S.Se,k.A.singleTransferReducer("menuOpen")),S.GN,k.A.singleTransferReducer("modulesMenuTree")),S.yD,k.A.singleTransferReducer("settingsMenuTree")),S.Kz,k.A.singleTransferReducer("systemMenuTree")),S.kl,k.A.singleTransferReducer("completeMenuTree")),S.w,(function(e){return j(j({},e),{},{menuOpen:!e.menuOpen})})),S.cv,k.A.singleTransferReducer("activeMenuTab")),S.Qw,(function(e,t){var n=t.payload.activeMenuTab;return j(j({},e),{},{menuOpen:e.activeMenuTab!==n||!e.menuOpen})})),A={menuOpen:!1,entities:[],activeMenuTab:"modules"};var D=s(70661),T=s(93575),_=s(74978),C=b().mark(F),M=b().mark(H),I=b().mark(U),R=b().mark(Y),N=function(e){return e.navigation},L="admin.activeMenu";function F(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.requestSaga,"client/menus/".concat(e));case 2:return t=n.sent,n.abrupt("return",t.body.menuItems);case 4:case"end":return n.stop()}}),C)}function H(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.T1)(F,"modules");case 2:return e=o.sent,o.next=5,(0,w.yJ)(S.lF(e));case 5:return o.next=7,(0,w.T1)(F,"settings");case 7:return t=o.sent,o.next=10,(0,w.yJ)(S.J8(t));case 10:return o.next=12,(0,w.T1)(F,"system");case 12:return n=o.sent,o.next=15,(0,w.yJ)(S.BA(n));case 15:return o.next=17,(0,w.T1)(F,"all");case 17:return r=o.sent,o.next=20,(0,w.yJ)(S.$Y(r));case 20:case"end":return o.stop()}}),M)}function W(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[L])){e.next=4;break}return e.next=4,(0,w.yJ)(S.Tr(n));case 4:case"end":return e.stop()}}),e)}))()}function B(e){var t=e.payload.activeMenuTab;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.yJ)((0,_.bM)(O()({},L,t)));case 2:case"end":return e.stop()}}),e)}))()}function U(e){var t,n,r,o,a;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,w.Lt)(N);case 2:if(t=i.sent,n=t.settingsMenuTree,r=t.modulesMenuTree,o=t.systemMenuTree,a=t.completeMenuTree,e!==T.WV.MODULES){i.next=9;break}return i.abrupt("return",r);case 9:if(e!==T.WV.SETTINGS){i.next=11;break}return i.abrupt("return",n);case 11:if(e!==T.WV.SYSTEM){i.next=13;break}return i.abrupt("return",o);case 13:if(e!==T.WV.COMPLETE){i.next=15;break}return i.abrupt("return",a);case 15:return i.abrupt("return",null);case 16:case"end":return i.stop()}}),I)}function V(e){var t=e.payload.menuTab;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(U,t);case 2:if(n=e.sent,!((null==n?void 0:n.length)>0)){e.next=9;break}return e.next=7,(0,w.yJ)(S.YV(t));case 7:return e.next=9,(0,w.yJ)(S.Tr(t));case 9:case"end":return e.stop()}}),e)}))()}function Y(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(S.OZ,H),(0,w.sg)(500,S.cv,B),(0,w.p8)(_.CF,W),(0,w.p8)(S.KY,V)]);case 2:case"end":return e.stop()}}),R)}var z=b().mark(q);function q(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(Y)]);case 2:case"end":return e.stop()}}),z)}const $=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t=arguments.length>1?arguments[1]:void 0,n=P[t.type];return n?n(e,t):e};function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var J=O()(O()(O()(O()({},_.PP,k.A.singleTransferReducer("serverSettings")),_.oB,k.A.singleTransferReducer("isLoading")),_.CF,k.A.singleTransferReducer("userPreferences")),_.lz,(function(e,t){var n=t.payload;return K(K({},e),{},{userPreferences:K(K({},e.userPreferences),n.preferences)})})),Q={isLoading:!0,serverSettings:{},userPreferences:{}};var X=s(58065),Z=s(79859),ee=s(76419),te=s(22056),ne=s.n(te);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ae,ie,ce,se,ue=function(e){return Object.entries(e).reduce((function(e,t){var n=ne()(t,2),r=n[0],o=n[1];return oe(oe({},e),{},O()({},r,function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(o)))}),{})},le=s(74848),de=b().mark(ve),pe=b().mark(we),fe=b().mark(xe);function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ge="admin.theme";function ve(){var e,t,n,r,o;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,w.yJ)(_.F6(!0));case 2:return a.next=4,(0,w.T1)(D.A.fetchServerSettings);case 4:return e=a.sent,a.next=7,(0,w.yJ)(_.Ve(e));case 7:return a.next=9,(0,w.T1)(D.A.fetchUserPreferences,"admin.*");case 9:return t=a.sent,a.next=12,(0,w.T1)(ue,t);case 12:return n=a.sent,a.next=15,(0,w.T1)(D.A.fetchUserPreferences,"admintree.*");case 15:return r=a.sent,a.next=18,(0,w.T1)(ue,r);case 18:return o=a.sent,a.next=21,(0,w.yJ)(_.A2(he(he({},o),n)));case 21:return a.next=23,(0,w.yJ)(_.F6(!1));case 23:case"end":return a.stop()}}),de)}function ye(e){var t=e.payload.preferences;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(D.A.savePreferences,t);case 2:case"end":return e.stop()}}),e)}))()}function be(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[ge])){e.next=8;break}return e.next=4,(0,w.T1)(ee.A.addLongTerm,"admin","theme",n);case 4:return e.next=6,(0,w.yJ)(c.A.setThemeType(n));case 6:e.next=12;break;case 8:return e.next=10,(0,w.T1)(ee.A.removeLongTerm,"admin","theme");case 10:return e.next=12,(0,w.yJ)(c.A.initThemeType());case 12:case"end":return e.stop()}}),e)}))()}function we(){var e,t,n;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,w.T1)(Z.Ix);case 2:return e=r.sent,t=function(){return e.put(!0)},n=function(){return e.put(!1)},r.next=7,(0,w.yJ)(h.A.confirm(ae||(ae=(0,le.jsx)(X.A,{id:"client.admin.menu.resetPreferences.title"})),ie||(ie=(0,le.jsx)(X.A,{id:"client.admin.menu.resetPreferences.question"})),ce||(ce=(0,le.jsx)(X.A,{id:"client.common.ok"})),se||(se=(0,le.jsx)(X.A,{id:"client.common.cancel"})),t,n));case 7:return r.next=9,(0,w.s)(e);case 9:if(!r.sent){r.next=19;break}return r.next=13,(0,w.T1)(D.A.resetAllPreferences);case 13:return r.next=15,(0,w.T1)(ee.A.removeLongTerm,"admin","theme");case 15:return r.next=17,(0,w.yJ)(c.A.initThemeType());case 17:return r.next=19,(0,w.yJ)(h.A.toaster({type:"success",title:"client.admin.menu.resetPreferences.success"}));case 19:case"end":return r.stop()}}),pe)}function xe(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(_.U3,ve),(0,w.p8)(_.lz,ye),(0,w.p8)(_.CF,be),(0,w.p8)(_.fE,we)]);case 2:case"end":return e.stop()}}),fe)}var Oe=b().mark(ke);function ke(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(xe)]);case 2:case"end":return e.stop()}}),Oe)}const Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,t=arguments.length>1?arguments[1]:void 0,n=J[t.type];return n?n(e,t):e};var Ee=s(27948),je=O()(O()(O()(O()(O()(O()(O()({},Ee.mW,k.A.singleTransferReducer("username")),Ee.XA,k.A.singleTransferReducer("currentBusinessUnit")),Ee.E_,k.A.singleTransferReducer("businessUnits")),Ee.tb,k.A.singleTransferReducer("ssoAvailable")),Ee.ZW,k.A.singleTransferReducer("pendingChanges")),Ee.tP,k.A.singleTransferReducer("hasOutlookAddInModule")),Ee.zI,k.A.singleTransferReducer("inWrongBusinessUnit")),Pe={username:"",currentBusinessUnit:{label:"",id:""},businessUnits:[],ssoAvailable:!1,pendingChanges:!1,hasOutlookAddInModule:!1,inWrongBusinessUnit:void 0};var Ae=s(18987),De=s(25204),Te=b().mark(Ce),_e=b().mark(Me);function Ce(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.fetchModules);case 2:if(e=n.sent,e.includes("nice.optional.sso")){n.next=6;break}return n.abrupt("return",!1);case 6:return n.next=8,(0,w.T1)(D.A.fetchEntityCount,"Openid_provider",{where:"active == true"});case 8:return t=n.sent,n.abrupt("return",t>0);case 10:case"end":return n.stop()}}),Te)}function Me(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===(e=ee.A.getLongTerm("server","ssoAvailable"))){n.next=5;break}return n.abrupt("return",e);case 5:return n.next=7,(0,w.T1)(Ce);case 7:return t=n.sent,ee.A.addLongTerm("server","ssoAvailable",t),n.abrupt("return",t);case 10:case"end":return n.stop()}}),_e)}var Ie=s(27399),Re=s(88691),Ne=b().mark(Qe),Le=b().mark(Xe),Fe=b().mark(Ze),He=b().mark(et),We=b().mark(tt),Be=b().mark(rt),Ue=b().mark(at),Ve=b().mark(it),Ye=b().mark(ct),ze=b().mark(ut),qe=b().mark(lt),$e=b().mark(dt),Ge=function(e){return e.session},Ke=function(e){return e.input},Je=function(e){return e.app};function Qe(e){var t,n,r,o;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=e/2*60*1e3,a.next=3,(0,w.T1)(m.A.doSessionRequest);case 3:return n=a.sent,r=n.success,o=n.adminAllowed,a.next=8,(0,w.yJ)(m.A.setLoggedIn(r));case 8:return a.next=10,(0,w.yJ)(m.A.setAdminAllowed(o));case 10:return a.next=12,(0,w.T1)(Xe,t);case 12:return a.next=14,(0,w.T1)(Qe,e);case 14:case"end":return a.stop()}}),Ne)}function Xe(e){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.cb)(e);case 2:case"end":return t.stop()}}),Le)}function Ze(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(m.A.doRequest,"logout",{method:"POST"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),Fe)}function et(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.Lt)(Ke);case 2:e=n.sent,t=e.baseRoute,window.location.href=t||"/";case 5:case"end":return n.stop()}}),He)}function tt(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.Lt)(Je);case 2:return e=o.sent,t=e.textResourceModules,o.next=6,(0,w.T1)(Re.A.getUserLocale);case 6:return n=o.sent,o.next=9,(0,w.T1)(Re.A.getChangeLocaleAction,t,n);case 9:return r=o.sent,o.next=12,(0,w.yJ)(r);case 12:case"end":return o.stop()}}),We)}function nt(e){var t=e.payload;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sessionTimeout,e.next=3,(0,w.T1)(tt);case 3:return e.next=5,(0,w.yJ)(m.A.setAdminAllowed(void 0));case 5:return e.next=7,(0,w.yJ)(m.A.setLoggedIn(!0));case 7:return e.next=9,(0,w.yJ)(h.A.connectSocket());case 9:return e.next=11,(0,w.T1)(Qe,n);case 11:case"end":return e.stop()}}),e)}))()}function rt(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(Z.Ix);case 2:return t=n.sent,n.next=5,(0,w.yJ)(h.A.modal("navigation-pending-changes","client.admin.confirmTouchedFormTitle",e,(function(e){var n=e.close;return(0,le.jsx)(Ie.A,{onYes:function(){n(),t.put("yes")},onNo:function(){n(),t.put("no")}})}),!0,(function(){return t.put("no")})));case 5:return n.next=7,(0,w.s)(t);case 7:return n.abrupt("return",n.sent);case 8:case"end":return n.stop()}}),Be)}function ot(e){var t=e.payload;return b().mark((function e(){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.message,r=t.confirmCallback,e.next=3,(0,w.T1)(rt,n);case 3:if("yes"!==e.sent){e.next=9;break}return e.next=7,(0,w.T1)(r,!0);case 7:e.next=11;break;case 9:return e.next=11,(0,w.T1)(r,!1);case 11:case"end":return e.stop()}}),e)}))()}function at(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.Lt)(Ge);case 2:if(e=t.sent,!e.pendingChanges){t.next=10;break}return t.next=7,(0,w.T1)(rt,"client.admin.confirmTouchedFormLogout");case 7:if("yes"===t.sent){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,(0,w.T1)(Ae.A.remove,De.v);case 12:return t.next=14,(0,w.T1)(Ze);case 14:return t.next=16,(0,w.yJ)(m.A.setLoggedIn(!1));case 16:return t.next=18,(0,w.yJ)(h.A.closeSocket());case 18:return t.next=20,(0,w.T1)(et);case 20:case"end":return t.stop()}}),Ue)}function it(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.T1)(D.A.fetchPrincipal);case 2:return e=o.sent,t=e.username,n=e.currentBusinessUnit,r=e.inWrongBusinessUnit,o.next=8,(0,w.yJ)(Ee.P(t));case 8:return o.next=10,(0,w.yJ)(Ee.Ml(n));case 10:return o.next=12,(0,w.yJ)(Ee.xI(r));case 12:case"end":return o.stop()}}),Ve)}function ct(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.T1)(D.A.requestSaga,"principals/businessunits");case 2:return e=t.sent,t.next=5,(0,w.yJ)(Ee.Qp(e.body.data));case 5:case"end":return t.stop()}}),Ye)}function st(e){var t=e.payload.businessUnitId;return b().mark((function e(){var n,r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Lt)(Ge);case 2:return n=e.sent,r=n.username,o="principals/".concat(r,"/businessunit"),e.next=7,(0,w.T1)(D.A.requestSaga,o,{method:"PUT",body:{businessUnit:t}});case 7:return e.next=9,(0,w.T1)(c.A.reinitialiseCache);case 9:location.reload();case 10:case"end":return e.stop()}}),e)}))()}function ut(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.T1)(Me);case 2:return e=t.sent,t.next=5,(0,w.yJ)(Ee.d4(e));case 5:case"end":return t.stop()}}),ze)}function lt(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.fetchModules);case 2:return e=n.sent,t=e.includes("nice.optional.officeintegration"),n.next=6,(0,w.yJ)(Ee.Wm(t));case 6:case"end":return n.stop()}}),qe)}function dt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(Ee.hO,nt),(0,w.p8)(Ee.tZ,at),(0,w.p8)(Ee.AZ,it),(0,w.p8)(Ee.Cm,ct),(0,w.p8)(Ee.zu,st),(0,w.p8)(Ee.Ff,ut),(0,w.p8)(Ee.sR,ot),(0,w.p8)(Ee.$H,lt)]);case 2:case"end":return e.stop()}}),$e)}var pt=b().mark(ft);function ft(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(dt)]);case 2:case"end":return e.stop()}}),pt)}const mt={session:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe,t=arguments.length>1?arguments[1]:void 0,n=je[t.type];return n?n(e,t):e},navigation:$,preferences:Se};var ht=[ft,q,ke],gt=s(35693);const vt=[{ctrl:!0,alt:!0,code:"KeyM",actions:[(0,S.ad)("modules")],global:!0},{ctrl:!0,alt:!0,code:"KeyN",actions:[(0,S.ad)("settings")],global:!0},{ctrl:!0,alt:!0,code:"KeyO",actions:[(0,S.ad)("complete")],global:!0},{ctrl:!0,alt:!0,code:"KeyK",actions:[(0,S.ad)("system")],global:!0}];var yt,bt,wt="admin",xt=r().lazy((function(){return Promise.all([s.e(927),s.e(601),s.e(172),s.e(419),s.e(136),s.e(356)]).then(s.bind(s,85356))})),Ot=function(){return yt||(yt=(0,le.jsx)(le.Fragment,{children:(0,le.jsx)(n.Suspense,{fallback:"",children:(0,le.jsx)(xt,{})})}))},kt=function(e,t,n,o){window.reactRegistry&&window.reactRegistry.setReact&&window.reactRegistry.setReact(r(),a());var s=bt||(bt=(0,le.jsx)(Ot,{})),u=c.A.createStore(mt,ht,t,wt);return p.A.addToStore(u,(function(){return{}})),i.A.addToStore(u),l.A.addToStore(u,(function(){return{appComponent:gt.A,formApp:v.A}})),l.A.dynamicActionsAddToStore(u),d.A.addToStore(u,!0,["console","remote","notification"]),h.A.addToStore(u,!0,{withNotificationCenter:!0}),m.A.addToStore(u),f.A.addToStore(u,vt),g.A.addToStore(u),c.A.createApp(wt,s,u,{input:t,events:n,actions:[],publicPath:o,textResourceModules:["component","common","actions","login","sso-login","entity-browser","entity-list","entity-detail","dashboard","docs-browser","entities",wt]})};c.A.registerAppInRegistry(wt,kt);var St=function(e){return c.A.useApp({initApp:kt,props:e,packageName:wt}).component};St.propTypes={baseRoute:t().string,memoryHistory:t().bool};const Et=St})(),u})()));
|
|
52
|
+
*/function u(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>l(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let a=s(null==r?t.length-1:r),i="POP",c=null;function s(e){return Math.min(Math.max(e,0),t.length-1)}function u(){return t[a]}function l(e,n=null,r){let o=h(t?u().pathname:"/",e,n,r);return f("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:g(e)}return{get index(){return a},get action(){return i},get location(){return u()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?v(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){i="PUSH";let r=l(e,n);a+=1,t.splice(a,t.length,r),o&&c&&c({action:i,location:r,delta:1})},replace(e,n){i="REPLACE";let r=l(e,n);t[a]=r,o&&c&&c({action:i,location:r,delta:0})},go(e){i="POP";let n=s(a+e),r=t[n];a=n,c&&c({action:i,location:r,delta:e})},listen:e=>(c=e,()=>{c=null})}}function l(e={}){return y((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return h("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:g(t)}),null,e)}function d(e={}){return y((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=v(e.location.hash.substring(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),h("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:g(t))}),(function(e,t){f("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}),e)}function p(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 m(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,n=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?v(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function g({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function v(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,c="POP",u=null,l=d();function d(){return(i.state||{idx:null}).idx}function p(){c="POP";let e=d(),t=null==e?null:e-l;l=e,u&&u({action:c,location:g.location,delta:t})}function f(e){return b(e)}null==l&&(l=0,i.replaceState({...i.state,idx:l},""));let g={get action(){return c},get location(){return e(o,i)},listen(e){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(s,p),u=e,()=>{o.removeEventListener(s,p),u=null}},createHref:e=>t(o,e),createURL:f,encodeLocation(e){let t=f(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c="PUSH";let r=h(g.location,e,t);n&&n(r,e),l=d()+1;let s=m(r,l),p=g.createHref(r);try{i.pushState(s,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&u&&u({action:c,location:g.location,delta:1})},replace:function(e,t){c="REPLACE";let r=h(g.location,e,t);n&&n(r,e),l=d();let o=m(r,l),s=g.createHref(r);i.replaceState(o,"",s),a&&u&&u({action:c,location:g.location,delta:0})},go:e=>i.go(e)};return g}function b(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),p(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:g(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function w(e){return{defaultValue:e}}var x=class{constructor(e){var t,n,r;if(t=this,n=o,r=new Map,n.has(t)?i("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,r),e)for(let[t,n]of e)this.set(t,n)}get(e){if(c(this,o).has(e))return c(this,o).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){c(this,o).set(e,t)}};o=new WeakMap;var O=new Set(["lazy","caseSensitive","path","id","index","children"]);var k=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function S(e,t,n=[],r={},o=!1){return e.map(((e,a)=>{let i=[...n,String(a)],c="string"==typeof e.id?e.id:i.join("-");if(p(!0!==e.index||!e.children,"Cannot specify children on an index route"),p(o||!r[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let n={...e,id:c};return r[c]=E(n,t(n)),n}{let n={...e,id:c,children:void 0};return r[c]=E(n,t(n)),e.children&&(n.children=S(e.children,t,i,r,o)),n}}))}function E(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function j(e,t,n="/"){return P(e,t,n,!1)}function P(e,t,n,r){let o=V(("string"==typeof t?v(t):t).pathname||"/",n);if(null==o)return null;let a=D(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let i=null;for(let e=0;null==i&&e<a.length;++e){let t=U(o);i=H(a[e],t,r)}return i}function A(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function D(e,t=[],n=[],r="",o=!1){let a=(e,a,i=o,c)=>{let s={relativePath:void 0===c?e.path||"":c,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(r)&&i)return;p(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length)}let u=Q([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(p(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),D(e.children,t,l,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:F(u,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of T(e.path))a(e,t,!0,n);else a(e,t)})),t}function T(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let i=T(r.join("/")),c=[];return c.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&c.push(...i),c.map((t=>e.startsWith("/")&&""===t?"/":t))}var _=/^:[\w-]+$/,C=3,M=2,I=1,R=10,N=-2,L=e=>"*"===e;function F(e,t){let n=e.split("/"),r=n.length;return n.some(L)&&(r+=N),t&&(r+=M),n.filter((e=>!L(e))).reduce(((e,t)=>e+(_.test(t)?C:""===t?I:R)),r)}function H(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",i=[];for(let e=0;e<r.length;++e){let c=r[e],s=e===r.length-1,u="/"===a?t:t.slice(a.length)||"/",l=W({path:c.relativePath,caseSensitive:c.caseSensitive,end:s},u),d=c.route;if(!l&&s&&n&&!r[r.length-1].route.index&&(l=W({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!l)return null;Object.assign(o,l.params),i.push({params:o,pathname:Q([a,l.pathname]),pathnameBase:X(Q([a,l.pathnameBase])),route:d}),"/"!==l.pathnameBase&&(a=Q([a,l.pathnameBase]))}return i}function W(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=B(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=c[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const o=c[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function B(e,t=!1,n=!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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"))).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function U(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 a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function V(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}var Y=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z=e=>Y.test(e);function q(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}function $(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function G(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function K(e){let t=G(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function J(e,t,n,r=!1){let o;"string"==typeof e?o=v(e):(o={...e},p(!o.pathname||!o.pathname.includes("?"),$("?","pathname","search",o)),p(!o.pathname||!o.pathname.includes("#"),$("#","pathname","hash",o)),p(!o.search||!o.search.includes("#"),$("#","search","hash",o)));let a,i=""===e||""===o.pathname,c=i?"/":o.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t="/"){let n,{pathname:r,search:o="",hash:a=""}="string"==typeof e?v(e):e;if(r)if(z(r))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),f(!1,`Pathnames cannot have embedded double slashes - normalizing ${e} -> ${r}`)}n=r.startsWith("/")?q(r.substring(1),"/"):q(r,t)}else n=t;return{pathname:n,search:Z(o),hash:ee(a)}}(o,a),u=c&&"/"!==c&&c.endsWith("/"),l=(i||"."===c)&&n.endsWith("/");return s.pathname.endsWith("/")||!u&&!l||(s.pathname+="/"),s}var Q=e=>e.join("/").replace(/\/\/+/g,"/"),X=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ee=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var te=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ne(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function re(e){return e.map((e=>e.route.path)).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var oe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ae(e,t){let n=e;if("string"!=typeof n||!Y.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(oe)try{let e=new URL(window.location.href),r=n.startsWith("//")?new URL(e.protocol+n):new URL(n),a=V(r.pathname,t);r.origin===e.origin&&null!=a?n=a+r.search+r.hash:o=!0}catch(e){f(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}var ie=Symbol("Uninstrumented");function ce(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach((e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}})));let r={};if("function"==typeof t.lazy&&n.lazy.length>0){let e=se(n.lazy,t.lazy,(()=>{}));e&&(r.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach((t=>{let o=e[t],a=n[`lazy.${t}`];if("function"==typeof o&&a.length>0){let e=se(a,o,(()=>{}));e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}}))}return["loader","action"].forEach((e=>{let o=t[e];if("function"==typeof o&&n[e].length>0){let t=o[ie]??o,a=se(n[e],t,((...e)=>le(e[0])));a&&("loader"===e&&!0===t.hydrate&&(a.hydrate=!0),a[ie]=t,r[e]=a)}})),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map((e=>{let t=e[ie]??e,r=se(n.middleware,t,((...e)=>le(e[0])));return r?(r[ie]=t,r):e}))),r}function se(e,t,n){return 0===e.length?null:async(...r)=>{let o=await ue(e,n(...r),(()=>t(...r)),e.length-1);if("error"===o.type)throw o.value;return o.value}}async function ue(e,t,n,r){let o,a=e[r];if(a){let i,c=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=ue(e,t,n,r-1),o=await i,p(o,"Expected a result"),"error"===o.type&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(c,t)}catch(e){console.error("An instrumentation function threw an error:",e)}i||await c(),await i}else try{let e=await n();o={type:"success",value:e}}catch(e){o={type:"error",value:e}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function le(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:pe(t),params:{...r},unstable_pattern:o,context:fe(n)}}function de(e,t){return{currentUrl:g(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function pe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function fe(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===me}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var me=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var he=["POST","PUT","PATCH","DELETE"],ge=new Set(he),ve=["GET",...he],ye=new Set(ve),be=new Set([301,302,303,307,308]),we=new Set([307,308]),xe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Oe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ke={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Se=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ee="remix-router-transitions",je=Symbol("ResetLoaderData");function Pe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;p(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||Se,a=o;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...o(e),...ce(t.map((e=>e.route)).filter(Boolean),e)})}let i,c={},s=S(e.routes,a,void 0,c),u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let l,d,m=e.dataStrategy||We,v={...e.future},y=null,w=new Set,O=null,k=null,E=null,D=null!=e.hydrationData,T=j(s,e.history.location,u),_=!1,C=null;if(null!=T||e.patchRoutesOnNavigation){if(T&&!e.hydrationData){Ve(T,s,e.history.location.pathname).active&&(T=null)}if(T)if(T.some((e=>e.route.lazy)))l=!1;else if(T.some((e=>_e(e.route)))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=T.findIndex((e=>void 0!==n[e.route.id]));l=T.slice(0,e+1).every((e=>!Ce(e.route,t,n)))}else l=T.every((e=>!Ce(e.route,t,n)))}else l=!0;else{l=!1,T=[];let t=Ve(null,s,e.history.location.pathname);t.active&&t.matches&&(_=!0,T=t.matches)}}else{let t=ct(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=it(s);l=!0,T=n,C={[r.id]:t}}let M,I,R={historyAction:e.history.action,location:e.history.location,matches:T,initialized:l,navigation:xe,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||C,fetchers:new Map,blockers:new Map},N="POP",L=null,F=!1,H=!1,W=new Map,B=null,U=!1,Y=!1,q=new Set,$=new Map,G=0,K=-1,J=new Map,Q=new Set,X=new Map,Z=new Map,ee=new Set,te=new Map,re=null;function oe(e,t={}){e.matches&&(e.matches=e.matches.map((e=>{let t=c[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}))),R={...R,...e};let n=[],r=[];R.fetchers.forEach(((e,t)=>{"idle"===e.state&&(ee.has(t)?n.push(t):r.push(t))})),ee.forEach((e=>{R.fetchers.has(e)||$.has(e)||n.push(e)})),[...w].forEach((r=>r(R,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync}))),n.forEach((e=>be(e))),r.forEach((e=>R.fetchers.delete(e)))}function ae(t,n,{flushSync:r}={}){let o,a=null!=R.actionData&&null!=R.navigation.formMethod&&wt(R.navigation.formMethod)&&"loading"===R.navigation.state&&!0!==t.state?._isRedirect;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:a?R.actionData:null;let c=n.loaderData?rt(R.loaderData,n.loaderData,n.matches||[],n.errors):R.loaderData,u=R.blockers;u.size>0&&(u=new Map(u),u.forEach(((e,t)=>u.set(t,ke))));let l,d=!U&&Ue(t,n.matches||R.matches),p=!0===F||null!=R.navigation.formMethod&&wt(R.navigation.formMethod)&&!0!==t.state?._isRedirect;if(i&&(s=i,i=void 0),U||"POP"===N||("PUSH"===N?e.history.push(t,t.state):"REPLACE"===N&&e.history.replace(t,t.state)),"POP"===N){let e=W.get(R.location.pathname);e&&e.has(t.pathname)?l={currentLocation:R.location,nextLocation:t}:W.has(t.pathname)&&(l={currentLocation:t,nextLocation:R.location})}else if(H){let e=W.get(R.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),W.set(R.location.pathname,e)),l={currentLocation:R.location,nextLocation:t}}oe({...n,actionData:o,loaderData:c,historyAction:N,location:t,initialized:!0,navigation:xe,revalidation:"idle",restoreScrollPosition:d,preventScrollReset:p,blockers:u},{viewTransitionOpts:l,flushSync:!0===r}),N="POP",F=!1,H=!1,U=!1,Y=!1,L?.resolve(),L=null,re?.resolve(),re=null}async function ue(t,n,o){M&&M.abort(),M=null,N=t,U=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(O&&E){let n=Be(e,t);O[n]=E()}}(R.location,R.matches),F=!0===(o&&o.preventScrollReset),H=!0===(o&&o.enableViewTransition);let l=i||s,d=o&&o.overrideNavigation,p=o?.initialHydration&&R.matches&&R.matches.length>0&&!_?R.matches:j(l,n,u),f=!0===(o&&o.flushSync);if(p&&R.initialized&&!Y&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(R.location,n)&&!(o&&o.submission&&wt(o.submission.formMethod)))return void ae(n,{matches:p},{flushSync:f});let m=Ve(p,l,n.pathname);if(m.active&&m.matches&&(p=m.matches),!p){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);return void ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:f})}M=new AbortController;let h,g=Xe(e.history,n,M.signal,o&&o.submission),v=e.getContext?await e.getContext():new x;if(o&&o.pendingError)h=[at(p).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&wt(o.submission.formMethod)){let t=await async function(t,n,o,i,l,d,p,f={}){he();let m,h=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(n,o);if(oe({navigation:h},{flushSync:!0===f.flushSync}),d){let e=await Ye(i,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=it(s);return{matches:t,pendingActionResult:[n.id,{type:"error",error:e.error}]}}let t=at(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=He(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:"error",error:t}]}}i=e.matches}let g=Ot(i,n);if(g.route.action||g.route.lazy){let e=qe(a,c,t,i,g,p?[]:r,l),n=await fe(t,e,l,null);if(m=n[g.route.id],!m)for(let e of i)if(n[e.route.id]){m=n[e.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:ct(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};if(ht(m)){let n;if(f&&null!=f.replace)n=f.replace;else{n=Qe(m.response.headers.get("Location"),new URL(t.url),u,e.history)===R.location.pathname+R.location.search}return await pe(t,m,!0,{submission:o,replace:n}),{shortCircuited:!0}}if(mt(m)){let e=at(i,g.route.id);return!0!==(f&&f.replace)&&(N="PUSH"),{matches:i,pendingActionResult:[e.route.id,m,g.route.id]}}return{matches:i,pendingActionResult:[g.route.id,m]}}(g,n,o.submission,p,v,m.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:f});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(mt(r)&&ne(r.error)&&404===r.error.status)return M=null,void ae(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}p=t.matches||p,h=t.pendingActionResult,d=St(n,o.submission),f=!1,m.active=!1,g=Xe(e.history,g.url,g.signal)}let{shortCircuited:y,matches:b,loaderData:w,errors:k}=await async function(t,n,o,l,d,p,f,m,h,g,v,y,b){let w=p||St(n,f),x=f||m||kt(w),O=!U&&!g;if(d){if(O){let e=le(y);oe({navigation:w,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await Ye(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:n}=it(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=at(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}o=e.matches}let k=i||s,{dsMatches:S,revalidatingFetchers:E}=Te(t,l,a,c,e.history,R,o,x,n,g?[]:r,!0===g,Y,q,ee,X,Q,k,u,null!=e.patchRoutesOnNavigation,y,b);if(K=++G,!e.dataStrategy&&!S.some((e=>e.shouldLoad))&&!S.some((e=>e.route.middleware&&e.route.middleware.length>0))&&0===E.length){let e=Me();return ae(n,{matches:o,loaderData:{},errors:y&&mt(y[1])?{[y[0]]:y[1].error}:null,...ot(y),...e?{fetchers:new Map(R.fetchers)}:{}},{flushSync:v}),{shortCircuited:!0}}if(O){let e={};if(!d){e.navigation=w;let t=le(y);void 0!==t&&(e.actionData=t)}E.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=R.fetchers.get(e.key),n=Et(void 0,t?t.data:void 0);R.fetchers.set(e.key,n)})),new Map(R.fetchers)}(E)),oe(e,{flushSync:v})}E.forEach((e=>{je(e.key),e.controller&&$.set(e.key,e.controller)}));let j=()=>E.forEach((e=>je(e.key)));M&&M.signal.addEventListener("abort",j);let{loaderResults:P,fetcherResults:A}=await me(S,E,t,l);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",j);E.forEach((e=>$.delete(e.key)));let D=st(P);if(D)return await pe(t,D.result,!0,{replace:h}),{shortCircuited:!0};if(D=st(A),D)return Q.add(D.key),await pe(t,D.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:T,errors:_}=nt(R,o,P,y,E,A);g&&R.errors&&(_={...R.errors,..._});let C=Me(),I=Re(K),N=C||I||E.length>0;return{matches:o,loaderData:T,errors:_,...N?{fetchers:new Map(R.fetchers)}:{}}}(g,n,p,v,m.active,d,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,f,h,o&&o.callSiteDefaultShouldRevalidate);y||(M=null,ae(n,{matches:b||p,...ot(h),loaderData:w,errors:k}))}function le(e){return e&&!mt(e[1])?{[e[0]]:e[1].data}:R.actionData?0===Object.keys(R.actionData).length?null:R.actionData:void 0}async function pe(r,o,a,{submission:i,fetcherSubmission:c,preventScrollReset:s,replace:l}={}){a||(L?.resolve(),L=null),o.response.headers.has("X-Remix-Revalidate")&&(Y=!0);let d=o.response.headers.get("Location");p(d,"Expected a Location header on the redirect Response"),d=Qe(d,new URL(r.url),u,e.history);let f=h(R.location,d,{_isRedirect:!0});if(n){let e=!1;if(o.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(z(d)){const n=b(d,!0);e=n.origin!==t.location.origin||null==V(n.pathname,u)}if(e)return void(l?t.location.replace(d):t.location.assign(d))}M=null;let m=!0===l||o.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:g,formAction:v,formEncType:y}=R.navigation;!i&&!c&&g&&v&&y&&(i=kt(R.navigation));let w=i||c;if(we.has(o.response.status)&&w&&wt(w.formMethod))await ue(m,f,{submission:{...w,formAction:d},preventScrollReset:s||F,enableViewTransition:a?H:void 0});else{let e=St(f,i);await ue(m,f,{overrideNavigation:e,fetcherSubmission:c,preventScrollReset:s||F,enableViewTransition:a?H:void 0})}}async function fe(e,t,n,r){let o,a={};try{o=await $e(m,e,t,r,n,!1)}catch(e){return t.filter((e=>e.shouldLoad)).forEach((t=>{a[t.route.id]={type:"error",error:e}})),a}if(e.signal.aborted)return a;if(!wt(e.method))for(let e of t){if("error"===o[e.route.id]?.type)break;o.hasOwnProperty(e.route.id)||R.loaderData.hasOwnProperty(e.route.id)||R.errors&&R.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(o[e.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[n,r]of Object.entries(o))if(ft(r)){let o=r.result;a[n]={type:"redirect",response:Je(o,e,n,t,u)}}else a[n]=await Ke(r);return a}async function me(e,t,n,r){let o=fe(n,e,r,null),a=Promise.all(t.map((async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await fe(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:ct(404,{pathname:e.path})}})})));return{loaderResults:await o,fetcherResults:(await a).reduce(((e,t)=>Object.assign(e,t)),{})}}function he(){Y=!0,X.forEach(((e,t)=>{$.has(t)&&q.add(t),je(t)}))}function ge(e,t,n={}){R.fetchers.set(e,t),oe({fetchers:new Map(R.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function ve(e,t,n,r={}){let o=at(R.matches,t);be(e),oe({errors:{[o.route.id]:n},fetchers:new Map(R.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ye(e){return Z.set(e,(Z.get(e)||0)+1),ee.has(e)&&ee.delete(e),R.fetchers.get(e)||Oe}function be(e){let t=R.fetchers.get(e);!$.has(e)||t&&"loading"===t.state&&J.has(e)||je(e),X.delete(e),J.delete(e),Q.delete(e),ee.delete(e),q.delete(e),R.fetchers.delete(e)}function je(e,t){let n=$.get(e);n&&(n.abort(t),$.delete(e))}function Pe(e){for(let t of e){let e=jt(ye(t).data);R.fetchers.set(t,e)}}function Me(){let e=[],t=!1;for(let n of Q){let r=R.fetchers.get(n);p(r,`Expected fetcher: ${n}`),"loading"===r.state&&(Q.delete(n),e.push(n),t=!0)}return Pe(e),t}function Re(e){let t=[];for(let[n,r]of J)if(r<e){let e=R.fetchers.get(n);p(e,`Expected fetcher: ${n}`),"loading"===e.state&&(je(n),J.delete(n),t.push(n))}return Pe(t),t.length>0}function Ne(e){R.blockers.delete(e),te.delete(e)}function Le(e,t){let n=R.blockers.get(e)||ke;p("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(R.blockers);r.set(e,t),oe({blockers:r})}function Fe({currentLocation:e,nextLocation:t,historyAction:n}){if(0===te.size)return;te.size>1&&f(!1,"A router only supports one blocker at a time");let r=Array.from(te.entries()),[o,a]=r[r.length-1],i=R.blockers.get(o);return i&&"proceeding"===i.state?void 0:a({currentLocation:e,nextLocation:t,historyAction:n})?o:void 0}function He(e){let t=ct(404,{pathname:e}),n=i||s,{matches:r,route:o}=it(n);return{notFoundMatches:r,route:o,error:t}}function Be(e,t){if(k){return k(e,t.map((e=>A(e,R.loaderData))))||e.key}return e.key}function Ue(e,t){if(O){let n=Be(e,t),r=O[n];if("number"==typeof r)return r}return null}function Ve(t,n,r){if(e.patchRoutesOnNavigation){if(!t){return{active:!0,matches:P(n,r,u,!0)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:P(n,r,u,!0)}}}return{active:!1,matches:null}}async function Ye(t,n,r,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let l=t;for(;;){let t=null==i,d=i||s,p=c;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:o,patch:(e,t)=>{r.aborted||Ie(e,t,d,p,a,!1)}})}catch(e){return{type:"error",error:e,partialMatches:l}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:"aborted"};let f=j(d,n,u),m=null;if(f){if(0===Object.keys(f[0].params).length)return{type:"success",matches:f};if(m=P(d,n,u,!0),!(m&&l.length<m.length&&ze(l,m.slice(0,l.length))))return{type:"success",matches:f}}if(m||(m=P(d,n,u,!0)),!m||ze(l,m))return{type:"success",matches:null};l=m}}function ze(e,t){return e.length===t.length&&e.every(((e,n)=>e.route.id===t[n].route.id))}return d={get basename(){return u},get future(){return v},get state(){return R},get routes(){return s},get window(){return t},initialize:function(){if(y=e.history.listen((({action:t,location:n,delta:r})=>{if(I)return I(),void(I=void 0);f(0===te.size||null!=r,"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=Fe({currentLocation:R.location,nextLocation:n,historyAction:t});if(o&&null!=r){let t=new Promise((e=>{I=e}));return e.history.go(-1*r),Le(o,{state:"blocked",location:n,proceed(){Le(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),t.then((()=>e.history.go(r)))},reset(){let e=new Map(R.blockers);e.set(o,ke),oe({blockers:e})}}),L?.resolve(),void(L=null)}return ue(t,n)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(Ee);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,W);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ee,JSON.stringify(n))}catch(e){f(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,W);t.addEventListener("pagehide",e),B=()=>t.removeEventListener("pagehide",e)}return R.initialized||ue("POP",R.location,{initialHydration:!0}),d},subscribe:function(e){return w.add(e),()=>w.delete(e)},enableScrollRestoration:function(e,t,n){if(O=e,E=t,k=n||null,!D&&R.navigation===xe){D=!0;let e=Ue(R.location,R.matches);null!=e&&oe({restoreScrollPosition:e})}return()=>{O=null,E=null,k=null}},navigate:async function t(n,r){if(L?.resolve(),L=null,"number"==typeof n){L||(L=Pt());let t=L.promise;return e.history.go(n),t}let o=Ae(R.location,R.matches,u,n,r?.fromRouteId,r?.relative),{path:a,submission:i,error:c}=De(!1,o,r),s=R.location,l=h(R.location,a,r&&r.state);l={...l,...e.history.encodeLocation(l)};let d=r&&null!=r.replace?r.replace:void 0,p="PUSH";!0===d?p="REPLACE":!1===d||null!=i&&wt(i.formMethod)&&i.formAction===R.location.pathname+R.location.search&&(p="REPLACE");let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,m=!0===(r&&r.flushSync),g=Fe({currentLocation:s,nextLocation:l,historyAction:p});g?Le(g,{state:"blocked",location:l,proceed(){Le(g,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),t(n,r)},reset(){let e=new Map(R.blockers);e.set(g,ke),oe({blockers:e})}}):await ue(p,l,{submission:i,pendingError:c,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:r&&r.unstable_defaultShouldRevalidate})},fetch:async function(t,n,o,l){je(t);let d=!0===(l&&l.flushSync),f=i||s,m=Ae(R.location,R.matches,u,o,n,l?.relative),h=j(f,m,u),g=Ve(h,f,m);if(g.active&&g.matches&&(h=g.matches),!h)return void ve(t,n,ct(404,{pathname:m}),{flushSync:d});let{path:v,submission:y,error:b}=De(!0,m,l);if(b)return void ve(t,n,b,{flushSync:d});let w=e.getContext?await e.getContext():new x,O=!0===(l&&l.preventScrollReset);y&&wt(y.formMethod)?await async function(t,n,o,l,d,f,m,h,g,v){he(),X.delete(t);let y=R.fetchers.get(t);ge(t,function(e,t){let n={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};return n}(g,y),{flushSync:m});let b=new AbortController,w=Xe(e.history,o,b.signal,g);if(f){let e=await Ye(l,new URL(w.url).pathname,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ve(t,n,e.error,{flushSync:m});if(!e.matches)return void ve(t,n,ct(404,{pathname:o}),{flushSync:m});l=e.matches}let x=Ot(l,o);if(!x.route.action&&!x.route.lazy){let e=ct(405,{method:g.formMethod,pathname:o,routeId:n});return void ve(t,n,e,{flushSync:m})}$.set(t,b);let O=G,k=qe(a,c,w,l,x,r,d),S=await fe(w,k,d,t),E=S[x.route.id];if(!E)for(let e of k)if(S[e.route.id]){E=S[e.route.id];break}if(w.signal.aborted)return void($.get(t)===b&&$.delete(t));if(ee.has(t)){if(ht(E)||mt(E))return void ge(t,jt(void 0))}else{if(ht(E))return $.delete(t),K>O?void ge(t,jt(void 0)):(Q.add(t),ge(t,Et(g)),pe(w,E,!1,{fetcherSubmission:g,preventScrollReset:h}));if(mt(E))return void ve(t,n,E.error)}let P=R.navigation.location||R.location,A=Xe(e.history,P,b.signal),D=i||s,T="idle"!==R.navigation.state?j(D,R.navigation.location,u):R.matches;p(T,"Didn't find any matches after fetcher action");let _=++G;J.set(t,_);let C=Et(g,E.data);R.fetchers.set(t,C);let{dsMatches:I,revalidatingFetchers:L}=Te(A,d,a,c,e.history,R,T,g,P,r,!1,Y,q,ee,X,Q,D,u,null!=e.patchRoutesOnNavigation,[x.route.id,E],v);L.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=R.fetchers.get(t),r=Et(void 0,n?n.data:void 0);R.fetchers.set(t,r),je(t),e.controller&&$.set(t,e.controller)})),oe({fetchers:new Map(R.fetchers)});let F=()=>L.forEach((e=>je(e.key)));b.signal.addEventListener("abort",F);let{loaderResults:H,fetcherResults:W}=await me(I,L,A,d);if(b.signal.aborted)return;if(b.signal.removeEventListener("abort",F),J.delete(t),$.delete(t),L.forEach((e=>$.delete(e.key))),R.fetchers.has(t)){let e=jt(E.data);R.fetchers.set(t,e)}let B=st(H);if(B)return pe(A,B.result,!1,{preventScrollReset:h});if(B=st(W),B)return Q.add(B.key),pe(A,B.result,!1,{preventScrollReset:h});let{loaderData:U,errors:V}=nt(R,T,H,void 0,L,W);Re(_),"loading"===R.navigation.state&&_>K?(p(N,"Expected pending action"),M&&M.abort(),ae(R.navigation.location,{matches:T,loaderData:U,errors:V,fetchers:new Map(R.fetchers)})):(oe({errors:V,loaderData:rt(R.loaderData,U,T,V),fetchers:new Map(R.fetchers)}),Y=!1)}(t,n,v,h,w,g.active,d,O,y,l&&l.unstable_defaultShouldRevalidate):(X.set(t,{routeId:n,path:v}),await async function(t,n,o,i,s,u,l,d,p){let f=R.fetchers.get(t);ge(t,Et(p,f?f.data:void 0),{flushSync:l});let m=new AbortController,h=Xe(e.history,o,m.signal);if(u){let e=await Ye(i,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ve(t,n,e.error,{flushSync:l});if(!e.matches)return void ve(t,n,ct(404,{pathname:o}),{flushSync:l});i=e.matches}let g=Ot(i,o);$.set(t,m);let v=G,y=qe(a,c,h,i,g,r,s),b=await fe(h,y,s,t),w=b[g.route.id];$.get(t)===m&&$.delete(t);if(h.signal.aborted)return;if(ee.has(t))return void ge(t,jt(void 0));if(ht(w))return K>v?void ge(t,jt(void 0)):(Q.add(t),void await pe(h,w,!1,{preventScrollReset:d}));if(mt(w))return void ve(t,n,w.error);ge(t,jt(w.data))}(t,n,v,h,w,g.active,d,O,y))},revalidate:function(){re||(re=Pt()),he(),oe({revalidation:"loading"});let e=re.promise;return"submitting"===R.navigation.state?e:"idle"===R.navigation.state?(ue(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),e):(ue(N||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:!0===H}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ye,resetFetcher:function(e,t){je(e,t?.reason),ge(e,jt(null))},deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),ee.add(e)):Z.set(e,t),oe({fetchers:new Map(R.fetchers)})},dispose:function(){y&&y(),B&&B(),w.clear(),M&&M.abort(),R.fetchers.forEach(((e,t)=>be(t))),R.blockers.forEach(((e,t)=>Ne(t)))},getBlocker:function(e,t){let n=R.blockers.get(e)||ke;return te.get(e)!==t&&te.set(e,t),n},deleteBlocker:Ne,patchRoutes:function(e,t,n=!1){let r=null==i;Ie(e,t,i||s,c,a,n),r&&(s=[...s],oe({}))},_internalFetchControllers:$,_internalSetRoutes:function(e){c={},i=S(e,a,void 0,c)},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){oe(e)}},e.unstable_instrumentations&&(d=function(e,t){let n={navigate:[],fetch:[]};if(t.forEach((e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}}))),n.navigate.length>0){let t=e.navigate[ie]??e.navigate,r=se(n.navigate,t,((...t)=>{let[n,r]=t;return{to:"number"==typeof n||"string"==typeof n?n:n?g(n):".",...de(e,r??{})}}));r&&(r[ie]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[ie]??e.fetch,r=se(n.fetch,t,((...t)=>{let[n,,r,o]=t;return{href:r??".",fetcherKey:n,...de(e,o??{})}}));r&&(r[ie]=t,e.fetch=r)}return e}(d,e.unstable_instrumentations.map((e=>e.router)).filter(Boolean))),d}function Ae(e,t,n,r,o,a){let i,c;if(o){i=[];for(let e of t)if(i.push(e),e.route.id===o){c=e;break}}else i=t,c=t[t.length-1];let s=J(r||".",K(i),V(e.pathname,n)||e.pathname,"path"===a);if(null==r&&(s.search=e.search,s.hash=e.hash),(null==r||""===r||"."===r)&&c){let e=xt(s.search);if(c.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}return"/"!==n&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:Q([e,t])}({basename:n,pathname:s.pathname})),g(s)}function De(e,t,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:t};if(n.formMethod&&!bt(n.formMethod))return{path:t,error:ct(405,{method:n.formMethod})};let r,o,a=()=>({path:t,error:ct(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=ut(t);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!wt(i))return a();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,[t,n])=>`${e}${t}=${n}\n`),""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!wt(i))return a();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return a()}}}if(p("function"==typeof FormData,"FormData is not available in this environment"),n.formData)r=Ze(n.formData),o=n.formData;else if(n.body instanceof FormData)r=Ze(n.body),o=n.body;else if(n.body instanceof URLSearchParams)r=n.body,o=et(r);else if(null==n.body)r=new URLSearchParams,o=new FormData;else try{r=new URLSearchParams(n.body),o=et(r)}catch(e){return a()}let s={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(wt(s.formMethod))return{path:t,submission:s};let u=v(t);return e&&u.search&&xt(u.search)&&r.append("index",""),u.search=`?${r}`,{path:g(u),submission:s}}function Te(e,t,n,r,o,a,i,c,s,u,l,d,p,f,m,h,g,v,y,b,w){let x,O=b?mt(b[1])?b[1].error:b[1].data:void 0,k=o.createURL(a.location),S=o.createURL(s);if(l&&a.errors){let e=Object.keys(a.errors)[0];x=i.findIndex((t=>t.route.id===e))}else if(b&&mt(b[1])){let e=b[0];x=i.findIndex((t=>t.route.id===e))-1}let E=b?b[1].statusCode:void 0,P=E&&E>=400,A={currentUrl:k,currentParams:a.matches[0]?.params||{},nextUrl:S,nextParams:i[0].params,...c,actionResult:O,actionStatus:E},D=re(i),T=i.map(((o,i)=>{let{route:c}=o,s=null;if(null!=x&&i>x?s=!1:c.lazy?s=!0:_e(c)?l?s=Ce(c,a.loaderData,a.errors):function(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}(a.loaderData,a.matches[i],o)&&(s=!0):s=!1,null!==s)return ze(n,r,e,D,o,u,t,s);let p=!1;"boolean"==typeof w?p=w:P?p=!1:(d||k.pathname+k.search===S.pathname+S.search||k.search!==S.search||function(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}(a.matches[i],o))&&(p=!0);let f={...A,defaultShouldRevalidate:p},m=Me(o,f);return ze(n,r,e,D,o,u,t,m,f,w)})),_=[];return m.forEach(((e,c)=>{if(l||!i.some((t=>t.route.id===e.routeId))||f.has(c))return;let s=a.fetchers.get(c),m=s&&"idle"!==s.state&&void 0===s.data,b=j(g,e.path,v);if(!b){if(y&&m)return;return void _.push({key:c,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(h.has(c))return;let x=Ot(b,e.path),O=new AbortController,k=Xe(o,e.path,O.signal),S=null;if(p.has(c))p.delete(c),S=qe(n,r,k,b,x,u,t);else if(m)d&&(S=qe(n,r,k,b,x,u,t));else{let e;e="boolean"==typeof w?w:!P&&d;let o={...A,defaultShouldRevalidate:e};Me(x,o)&&(S=qe(n,r,k,b,x,u,t,o))}S&&_.push({key:c,routeId:e.routeId,path:e.path,matches:S,match:x,request:k,controller:O})})),{dsMatches:T,revalidatingFetchers:_}}function _e(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function Ce(e,t,n){if(e.lazy)return!0;if(!_e(e))return!1;let r=null!=t&&e.id in t,o=null!=n&&void 0!==n[e.id];return!(!r&&o)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!o)}function Me(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}function Ie(e,t,n,r,o,a){let i;if(e){let t=r[e];p(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=n;let c=[],s=[];if(t.forEach((e=>{let t=i.find((t=>Re(e,t)));t?s.push({existingRoute:t,newRoute:e}):c.push(e)})),c.length>0){let t=S(c,o,[e||"_","patch",String(i?.length||"0")],r);i.push(...t)}if(a&&s.length>0)for(let e=0;e<s.length;e++){let{existingRoute:t,newRoute:n}=s[e],r=t,[a]=S([n],o,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Re(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every(((e,n)=>t.children?.some((t=>Re(e,t))))))}var Ne=new WeakMap,Le=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(p(o,"No route found in manifest"),!o.lazy||"object"!=typeof o.lazy)return;let a=o.lazy[e];if(!a)return;let i=Ne.get(o);i||(i={},Ne.set(o,i));let c=i[e];if(c)return c;let s=(async()=>{let t=function(e){return O.has(e)}(e),n=void 0!==o[e]&&"hasErrorBoundary"!==e;if(t)f(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(n)f(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();null!=t&&(Object.assign(o,{[e]:t}),Object.assign(o,r(o)))}"object"==typeof o.lazy&&(o.lazy[e]=void 0,Object.values(o.lazy).every((e=>void 0===e))&&(o.lazy=void 0))})();return i[e]=s,s},Fe=new WeakMap;async function He(e){let t=e.matches.filter((e=>e.shouldLoad)),n={};return(await Promise.all(t.map((e=>e.resolve())))).forEach(((e,r)=>{n[t[r].route.id]=e})),n}async function We(e){return e.matches.some((e=>e.route.middleware))?Be(e,(()=>He(e))):He(e)}function Be(e,t){return Ue(e,t,(e=>{if(yt(e))throw e;return e}),dt,(function(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:"error",result:t}}));{let{matches:r}=e,o=Math.min(Math.max(r.findIndex((e=>e.route.id===n)),0),Math.max(r.findIndex((e=>e.shouldCallHandler())),0)),a=at(r,r[o].route.id).route.id;return Promise.resolve({[a]:{type:"error",result:t}})}}))}async function Ue(e,t,n,r,o){let{matches:a,request:i,params:c,context:s,unstable_pattern:u}=e,l=a.flatMap((e=>e.route.middleware?e.route.middleware.map((t=>[e.route.id,t])):[]));return await Ve({request:i,params:c,context:s,unstable_pattern:u},l,t,n,r,o)}async function Ve(e,t,n,r,o,a,i=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let s=t[i];if(!s){return await n()}let u,[l,d]=s,p=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{let c=await Ve(e,t,n,r,o,a,i+1);return u={value:c},u.value}catch(e){return u={value:await a(e,l,u)},u.value}};try{let t=await d(e,p),n=null!=t?r(t):void 0;return o(n)?n:u?n??u.value:(u={value:await p()},u.value)}catch(e){return await a(e,l,u)}}function Ye(e,t,n,r,o){let a=Le({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=function(e,t,n,r,o){let a=n[e.id];if(p(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=Fe.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{p("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(void 0===r)continue;let i=(o=e,k.has(o)),c=void 0!==a[e]&&"hasErrorBoundary"!==e;i?f(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):c?f(!c,`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.`):n[e]=r}var o;Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Fe.set(a,n),n.catch((()=>{})),{lazyRoutePromise:n,lazyHandlerPromise:n}}let i,c=Object.keys(e.lazy),s=[];for(let a of c){if(o&&o.includes(a))continue;let c=Le({key:a,route:e,manifest:n,mapRouteProperties:r});c&&(s.push(c),a===t&&(i=c))}let u=s.length>0?Promise.all(s).then((()=>{})):void 0;return u?.catch((()=>{})),i?.catch((()=>{})),{lazyRoutePromise:u,lazyHandlerPromise:i}}(r.route,wt(n.method)?"action":"loader",t,e,o);return{middleware:a,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function ze(e,t,n,r,o,a,i,c,s=null,u){let l=!1,d=Ye(e,t,n,o,a);return{...o,_lazyPromises:d,shouldLoad:c,shouldRevalidateArgs:s,shouldCallHandler:e=>(l=!0,s?Me(o,"boolean"==typeof u?{...s,defaultShouldRevalidate:u}:"boolean"==typeof e?{...s,defaultShouldRevalidate:e}:s):c),resolve(e){let{lazy:t,loader:a,middleware:s}=o.route,u=l||c||e&&!wt(n.method)&&(t||a),p=s&&s.length>0&&!a&&!t;return!u||!wt(n.method)&&p?Promise.resolve({type:"data",result:void 0}):async function({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:a,scopedContext:i}){let c,s,u=wt(e.method),l=u?"action":"loader",d=r=>{let o,c=new Promise(((e,t)=>o=t));s=()=>o(),e.signal.addEventListener("abort",s);let u=o=>"function"!=typeof r?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${l}" [routeId: ${n.route.id}]`)):r({request:e,unstable_pattern:t,params:n.params,context:i},...void 0!==o?[o]:[]),d=(async()=>{try{return{type:"data",result:await(a?a((e=>u(e))):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([d,c])};try{let t=u?n.route.action:n.route.loader;if(r||o)if(t){let e,[n]=await Promise.all([d(t).catch((t=>{e=t})),r,o]);if(void 0!==e)throw e;c=n}else{await r;let t=u?n.route.action:n.route.loader;if(!t){if("action"===l){let t=new URL(e.url),r=t.pathname+t.search;throw ct(405,{method:e.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}[c]=await Promise.all([d(t),o])}else{if(!t){let t=new URL(e.url);throw ct(404,{pathname:t.pathname+t.search})}c=await d(t)}}catch(e){return{type:"error",result:e}}finally{s&&e.signal.removeEventListener("abort",s)}return c}({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:e,scopedContext:i})}}}function qe(e,t,n,r,o,a,i,c=null){return r.map((s=>s.route.id!==o.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Ye(e,t,n,s,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ze(e,t,n,re(r),s,a,i,!0,c)))}async function $e(e,t,n,r,o,a){n.some((e=>e._lazyPromises?.middleware))&&await Promise.all(n.map((e=>e._lazyPromises?.middleware)));let i={request:t,unstable_pattern:re(n),params:n[0].params,context:o,matches:n},c=a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=i;return Be(t,(()=>e({...t,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})))},s=await e({...i,fetcherKey:r,runClientMiddleware:c});try{await Promise.all(n.flatMap((e=>[e._lazyPromises?.handler,e._lazyPromises?.route])))}catch(e){}return s}async function Ge(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function Ke(e){let{result:t,type:n}=e;if(vt(t)){let e;try{e=await Ge(t)}catch(e){return{type:"error",error:e}}return"error"===n?{type:"error",error:new te(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===n?gt(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:lt(t),statusCode:ne(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ne(t)?t.status:void 0}:gt(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Je(e,t,n,r,o){let a=e.headers.get("Location");if(p(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!z(a)){let i=r.slice(0,r.findIndex((e=>e.route.id===n))+1);a=Ae(new URL(t.url),i,o,a),e.headers.set("Location",a)}return e}function Qe(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(z(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r);if(o.includes(a.protocol))throw new Error("Invalid redirect location");let i=null!=V(a.pathname,n);if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}try{let t=r.createURL(e);if(o.includes(t.protocol))throw new Error("Invalid redirect location")}catch(e){}return e}function Xe(e,t,n,r){let o=e.createURL(ut(t)).toString(),a={signal:n};if(r&&wt(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):"text/plain"===t?a.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?a.body=Ze(r.formData):a.body=r.formData}return new Request(o,a)}function Ze(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"==typeof r?r:r.name);return t}function et(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function tt(e,t,n,r=!1,o=!1){let a,i={},c=null,s=!1,u={},l=n&&mt(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(p(!ht(f),"Cannot handle redirect results in processLoaderData"),mt(f)){let t=f.error;if(void 0!==l&&(t=l,l=void 0),c=c||{},o)c[d]=t;else{let n=at(e,d);null==c[n.route.id]&&(c[n.route.id]=t)}r||(i[d]=je),s||(s=!0,a=ne(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else i[d]=f.data,f.statusCode&&200!==f.statusCode&&!s&&(a=f.statusCode),f.headers&&(u[d]=f.headers)})),void 0!==l&&n&&(c={[n[0]]:l},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:a||200,loaderHeaders:u}}function nt(e,t,n,r,o,a){let{loaderData:i,errors:c}=tt(t,n,r);return o.filter((e=>!e.matches||e.matches.some((e=>e.shouldLoad)))).forEach((t=>{let{key:n,match:r,controller:o}=t;if(o&&o.signal.aborted)return;let i=a[n];if(p(i,"Did not find corresponding fetcher result"),mt(i)){let t=at(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:i.error}),e.fetchers.delete(n)}else if(ht(i))p(!1,"Unhandled fetcher revalidation redirect");else{let t=jt(i.data);e.fetchers.set(n,t)}})),{loaderData:i,errors:c}}function rt(e,t,n,r){let o=Object.entries(t).filter((([,e])=>e!==je)).reduce(((e,[t,n])=>(e[t]=n,e)),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(o[n]=e[n]),r&&r.hasOwnProperty(n))break}return o}function ot(e){return e?mt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function at(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 it(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 ct(e,{pathname:t,routeId:n,method:r,type:o,message:a}={}){let i="Unknown Server Error",c="Unknown @remix-run/router error";return 400===e?(i="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:"invalid-body"===o&&(c="Unable to encode submission body")):403===e?(i="Forbidden",c=`Route "${n}" does not match URL "${t}"`):404===e?(i="Not Found",c=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new te(e||500,i,new Error(c),!0)}function st(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(ht(r))return{key:n,result:r}}}function ut(e){return g({..."string"==typeof e?v(e):e,hash:""})}function lt(e){return new te(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function dt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&pt(t)))}function pt(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}function ft(e){return vt(e.result)&&be.has(e.result.status)}function mt(e){return"error"===e.type}function ht(e){return"redirect"===(e&&e.type)}function gt(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function vt(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function yt(e){return vt(e)&&(t=e.status,be.has(t))&&e.headers.has("Location");var t}function bt(e){return ye.has(e.toUpperCase())}function wt(e){return ge.has(e.toUpperCase())}function xt(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ot(e,t){let n="string"==typeof t?v(t).search:t.search;if(e[e.length-1].route.index&&xt(n||""))return e[e.length-1];let r=G(e);return r[r.length-1]}function kt(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:a,json:i}=e;if(t&&n&&r)return null!=o?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}:void 0}function St(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Et(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Pt(){let e,t,n=new Promise(((r,o)=>{e=async e=>{r(e);try{await n}catch(e){}},t=async e=>{o(e);try{await n}catch(e){}}}));return{promise:n,resolve:e,reject:t}}var At=a.createContext(null);At.displayName="DataRouter";var Dt=a.createContext(null);Dt.displayName="DataRouterState";var Tt=a.createContext(!1);function _t(){return a.useContext(Tt)}var Ct=a.createContext({isTransitioning:!1});Ct.displayName="ViewTransition";var Mt=a.createContext(new Map);Mt.displayName="Fetchers";var It=a.createContext(null);It.displayName="Await";var Rt=a.createContext(null);Rt.displayName="Navigation";var Nt=a.createContext(null);Nt.displayName="Location";var Lt=a.createContext({outlet:null,matches:[],isDataRoute:!1});Lt.displayName="Route";var Ft=a.createContext(null);Ft.displayName="RouteError";var Ht=!0,Wt="REACT_ROUTER_ERROR",Bt="REDIRECT";function Ut(){return null!=a.useContext(Nt)}function Vt(){return p(Ut(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(Nt).location}var Yt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zt(e){a.useContext(Rt).static||a.useLayoutEffect(e)}function qt(){let{isDataRoute:e}=a.useContext(Lt);return e?function(){let{router:e}=on("useNavigate"),t=cn("useNavigate"),n=a.useRef(!1);return zt((()=>{n.current=!0})),a.useCallback((async(r,o={})=>{f(n.current,Yt),n.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){p(Ut(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(At),{basename:t,navigator:n}=a.useContext(Rt),{matches:r}=a.useContext(Lt),{pathname:o}=Vt(),i=JSON.stringify(K(r)),c=a.useRef(!1);return zt((()=>{c.current=!0})),a.useCallback(((r,a={})=>{if(f(c.current,Yt),!c.current)return;if("number"==typeof r)return void n.go(r);let s=J(r,JSON.parse(i),o,"path"===a.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:Q([t,s.pathname])),(a.replace?n.replace:n.push)(s,a.state,a)}),[t,n,i,o,e])}()}a.createContext(null);function $t(){let{matches:e}=a.useContext(Lt),t=e[e.length-1];return t?t.params:{}}function Gt(e,{relative:t}={}){let{matches:n}=a.useContext(Lt),{pathname:r}=Vt(),o=JSON.stringify(K(n));return a.useMemo((()=>J(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function Kt(e,t,n,r,o){p(Ut(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=a.useContext(Rt),{matches:c}=a.useContext(Lt),s=c[c.length-1],u=s?s.params:{},l=s?s.pathname:"/",d=s?s.pathnameBase:"/",m=s&&s.route;if(Ht){let e=m&&m.path||"";pn(l,!m||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let h,g=Vt();if(t){let e="string"==typeof t?v(t):t;p("/"===d||e.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),h=e}else h=g;let y=h.pathname||"/",b=y;if("/"!==d){let e=d.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=j(e,{pathname:b});Ht&&(f(m||null!=w,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),f(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let x=nn(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:Q([d,i.encodeLocation?i.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:Q([d,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])}))),c,n,r,o);return t&&x?a.createElement(Nt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},x):x}function Jt(){let e=sn(),t=ne(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},c=null;return Ht&&(console.error("Error handled by React Router default ErrorBoundary:",e),c=a.createElement(a.Fragment,null,a.createElement("p",null,"💿 Hey developer 👋"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:i},"ErrorBoundary")," or"," ",a.createElement("code",{style:i},"errorElement")," prop on your route."))),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,c)}var Qt=a.createElement(Jt,null),Xt=class 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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=function(e){if(e.startsWith(`${Wt}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new te(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?a.createElement(Lt.Provider,{value:this.props.routeContext},a.createElement(Ft.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?a.createElement(en,{error:e},t):t}};Xt.contextType=Tt;var Zt=new WeakMap;function en({children:e,error:t}){let{basename:n}=a.useContext(Rt);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${Wt}:${Bt}:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let r=Zt.get(t);if(r)throw r;let o=ae(e.location,n);if(oe&&!Zt.get(t)){if(!o.isExternal&&!e.reloadDocument){const n=Promise.resolve().then((()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace})));throw Zt.set(t,n),n}window.location.href=o.absoluteURL||o.to}return a.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function tn({routeContext:e,match:t,children:n}){let r=a.useContext(At);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),a.createElement(Lt.Provider,{value:e},n)}function nn(e,t=[],n=null,r=null,o=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let i=e,c=n?.errors;if(null!=c){let e=i.findIndex((e=>e.route.id&&void 0!==c?.[e.route.id]));p(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,u=-1;if(n)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||o){s=!0,i=u>=0?i.slice(0,u+1):[i[0]];break}}}let l=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:re(n.matches),errorInfo:t})}:void 0;return i.reduceRight(((e,r,o)=>{let d,p=!1,f=null,m=null;n&&(d=c&&r.route.id?c[r.route.id]:void 0,f=r.route.errorElement||Qt,s&&(u<0&&0===o?(pn("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,m=null):u===o&&(p=!0,m=r.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,o+1)),g=()=>{let t;return t=d?f:p?m:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(tn,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(Xt,{location:n.location,revalidation:n.revalidation,component:f,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()}),null)}function rn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function on(e){let t=a.useContext(At);return p(t,rn(e)),t}function an(e){let t=a.useContext(Dt);return p(t,rn(e)),t}function cn(e){let t=function(e){let t=a.useContext(Lt);return p(t,rn(e)),t}(e),n=t.matches[t.matches.length-1];return p(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sn(){let e=a.useContext(Ft),t=an("useRouteError"),n=cn("useRouteError");return void 0!==e?e:t.errors?.[n]}var un=0;function ln(e){let{router:t,basename:n}=on("useBlocker"),r=an("useBlocker"),[o,i]=a.useState(""),c=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:r,nextLocation:o,historyAction:a}=t;return e({currentLocation:{...r,pathname:V(r.pathname,n)||r.pathname},nextLocation:{...o,pathname:V(o.pathname,n)||o.pathname},historyAction:a})}),[n,e]);return a.useEffect((()=>{let e=String(++un);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,c)}),[t,o,c]),o&&r.blockers.has(o)?r.blockers.get(o):ke}var dn={};function pn(e,t,n){t||dn[e]||(dn[e]=!0,f(!1,n))}var fn={};function mn(e,t){e||fn[t]||(fn[t]=!0,console.warn(t))}var hn=(r||(r=n.t(a,2))).useOptimistic,gn=()=>{};function vn(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(Ht&&e.element&&f(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:a.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(Ht&&e.hydrateFallbackElement&&f(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(Ht&&e.errorElement&&f(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var yn=["HydrateFallback","hydrateFallbackElement"];function bn(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:u({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,hydrationRouteProperties:yn,mapRouteProperties:vn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}var wn=class{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 xn({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){let o=_t();r=o||r;let[i,c]=a.useState(e.state),[s,u]=(l=i,hn?hn(l):[l,gn]);var l;let[d,p]=a.useState(),[f,m]=a.useState({isTransitioning:!1}),[h,g]=a.useState(),[v,y]=a.useState(),[b,w]=a.useState(),x=a.useRef(new Map),O=a.useCallback(((o,{deletedFetchers:i,newErrors:s,flushSync:l,viewTransitionOpts:d})=>{s&&n&&Object.values(s).forEach((e=>n(e,{location:o.location,params:o.matches[0]?.params??{},unstable_pattern:re(o.matches)}))),o.fetchers.forEach(((e,t)=>{void 0!==e.data&&x.current.set(t,e.data)})),i.forEach((e=>x.current.delete(e))),mn(!1===l||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let f=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(mn(null==d||f,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&f){if(t&&l){t((()=>{v&&(h?.resolve(),v.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})}));let n=e.window.document.startViewTransition((()=>{t((()=>c(o)))}));return n.finished.finally((()=>{t((()=>{g(void 0),y(void 0),p(void 0),m({isTransitioning:!1})}))})),void t((()=>y(n)))}v?(h?.resolve(),v.skipTransition(),w({state:o,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(p(o),m({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&l?t((()=>c(o))):!1===r?c(o):a.startTransition((()=>{!0===r&&u((e=>On(e,o))),c(o)}))}),[e.window,t,v,h,r,u,n]);a.useLayoutEffect((()=>e.subscribe(O)),[e,O]),a.useEffect((()=>{f.isTransitioning&&!f.flushSync&&g(new wn)}),[f]),a.useEffect((()=>{if(h&&d&&e.window){let t=d,n=h.promise,o=e.window.document.startViewTransition((async()=>{!1===r?c(t):a.startTransition((()=>{!0===r&&u((e=>On(e,t))),c(t)})),await n}));o.finished.finally((()=>{g(void 0),y(void 0),p(void 0),m({isTransitioning:!1})})),y(o)}}),[d,h,e.window,r,u]),a.useEffect((()=>{h&&d&&s.location.key===d.location.key&&h.resolve()}),[h,v,s.location,d]),a.useEffect((()=>{!f.isTransitioning&&b&&(p(b.state),m({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))}),[f.isTransitioning,b]);let k=a.useMemo((()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})})),[e]),S=e.basename||"/",E=a.useMemo((()=>({router:e,navigator:k,static:!1,basename:S,onError:n})),[e,k,S,n]);return a.createElement(a.Fragment,null,a.createElement(At.Provider,{value:E},a.createElement(Dt.Provider,{value:s},a.createElement(Mt.Provider,{value:x.current},a.createElement(Ct.Provider,{value:f},a.createElement(jn,{basename:S,location:s.location,navigationType:s.historyAction,navigator:k,unstable_useTransitions:r},a.createElement(kn,{routes:e.routes,future:e.future,state:s,onError:n})))))),null)}function On(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var kn=a.memo((function({routes:e,future:t,state:n,onError:r}){return Kt(e,void 0,n,r,t)}));function Sn({to:e,replace:t,state:n,relative:r}){p(Ut(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=a.useContext(Rt);f(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=a.useContext(Lt),{pathname:c}=Vt(),s=qt(),u=J(e,K(i),c,"path"===r),l=JSON.stringify(u);return a.useEffect((()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})}),[s,l,r,t,n]),null}function En(e){p(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function jn({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1,unstable_useTransitions:c}){p(!Ut(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),u=a.useMemo((()=>({basename:s,navigator:o,static:i,unstable_useTransitions:c,future:{}})),[s,o,i,c]);"string"==typeof n&&(n=v(n));let{pathname:l="/",search:d="",hash:m="",state:h=null,key:g="default"}=n,y=a.useMemo((()=>{let e=V(l,s);return null==e?null:{location:{pathname:e,search:d,hash:m,state:h,key:g},navigationType:r}}),[s,l,d,m,h,g,r]);return f(null!=y,`<Router basename="${s}"> is not able to match the URL "${l}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:a.createElement(Rt.Provider,{value:u},a.createElement(Nt.Provider,{children:t,value:y}))}function Pn({children:e,location:t}){return Kt(An(e),t)}a.Component;function An(e,t=[]){let n=[];return a.Children.forEach(e,((e,r)=>{if(!a.isValidElement(e))return;let o=[...t,r];if(e.type===a.Fragment)return void n.push.apply(n,An(e.props.children,o));p(e.type===En,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),p(!e.props.index||!e.props.children,"An index route cannot have child routes.");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,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.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=An(e.props.children,o)),n.push(i)})),n}var Dn="get",Tn="application/x-www-form-urlencoded";function _n(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Cn(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map((e=>[n,e])):[[n,r]])}),[]))}var Mn=null;var In=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rn(e){return null==e||In.has(e)?e:(f(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tn}"`),null)}function Nn(e,t){let n,r,o,a,i;if(function(e){return _n(e)&&"form"===e.tagName.toLowerCase()}(e)){let i=e.getAttribute("action");r=i?V(i,t):null,n=e.getAttribute("method")||Dn,o=Rn(e.getAttribute("enctype"))||Tn,a=new FormData(e)}else if(function(e){return _n(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return _n(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 c=e.getAttribute("formaction")||i.getAttribute("action");if(r=c?V(c,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Dn,o=Rn(e.getAttribute("formenctype"))||Rn(i.getAttribute("enctype"))||Tn,a=new FormData(i,e),!function(){if(null===Mn)try{new FormData(document.createElement("form"),0),Mn=!1}catch(e){Mn=!0}return Mn}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,r)}}else{if(_n(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Dn,r=null,o=Tn,i=e}return a&&"text/plain"===o&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!=typeof window?window:"undefined"!=typeof globalThis&&globalThis;function Ln(e,t){if(!1===e||null==e)throw new Error(t)}Symbol("SingleFetchRedirect");function Fn(e,t,n,r){let o="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:"/"===o.pathname?o.pathname=`_root.${r}`:t&&"/"===V(o.pathname,t)?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function Hn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}function Wn(e){return null!=e&&"string"==typeof e.page}function Bn(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Un(e,t,n,r,o,a){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,c=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===a?t.filter(((e,t)=>i(e,t)||c(e,t))):"data"===a?t.filter(((t,a)=>{let s=r.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,a)||c(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function Vn(e,t,{includeHydrateFallback:n}={}){return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o})).flat(1),[...new Set(r)];var r}function Yn(e,t){let n=new Set,r=new Set(t);return e.reduce(((e,o)=>{if(t&&!Wn(o)&&"script"===o.as&&o.href&&r.has(o.href))return e;let a=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(o));return n.has(a)||(n.add(a),e.push({key:a,link:o})),e}),[])}function zn(e,t){return"lazy"===e.mode&&!0===t}function qn(){let e=a.useContext(At);return Ln(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $n(){let e=a.useContext(Dt);return Ln(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Gn=a.createContext(void 0);function Kn(){let e=a.useContext(Gn);return Ln(e,"You must render this element inside a <HydratedRouter> element"),e}function Jn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qn(e,t,n){if(n&&!tr)return[e[0]];if(t){let n=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,n+1)}return e}Gn.displayName="FrameworkContext";function Xn({page:e,...t}){let{router:n}=qn(),r=a.useMemo((()=>j(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?a.createElement(er,{page:e,matches:r,...t}):null}function Zn(e){let{manifest:t,routeModules:n}=Kn(),[r,o]=a.useState([]);return a.useEffect((()=>{let r=!1;return async function(e,t,n){return Yn((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await Hn(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(Bn).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}function er({page:e,matches:t,...n}){let r=Vt(),{future:o,manifest:i,routeModules:c}=Kn(),{basename:s}=qn(),{loaderData:u,matches:l}=$n(),d=a.useMemo((()=>Un(e,t,l,i,r,"data")),[e,t,l,i,r]),p=a.useMemo((()=>Un(e,t,l,i,r,"assets")),[e,t,l,i,r]),f=a.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,a=!1;if(t.forEach((e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!d.some((t=>t.route.id===e.route.id))&&e.route.id in u&&c[e.route.id]?.shouldRevalidate||t.hasClientLoader?a=!0:n.add(e.route.id))})),0===n.size)return[];let l=Fn(e,s,o.unstable_trailingSlashAwareDataRequests,"data");return a&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[s,o.unstable_trailingSlashAwareDataRequests,u,r,i,d,t,e,c]),m=a.useMemo((()=>Vn(p,i)),[p,i]),h=Zn(p);return a.createElement(a.Fragment,null,f.map((e=>a.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),m.map((e=>a.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),h.map((({key:e,link:t})=>a.createElement("link",{key:e,nonce:n.nonce,...t}))))}var tr=!1;function nr(e){let{manifest:t,serverHandoffString:n,isSpaMode:r,renderMeta:o,routeDiscovery:i,ssr:c}=Kn(),{router:s,static:u,staticContext:l}=qn(),{matches:d}=$n(),p=_t(),f=zn(i,c);o&&(o.didRenderScripts=!0);let m=Qn(d,null,r);a.useEffect((()=>{!0}),[]);let h=a.useMemo((()=>{if(p)return null;let r=l?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",o=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};\n${m.map(((e,n)=>{let r=`route${n}`,o=t.routes[e.route.id];Ln(o,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:c,hydrateFallbackModule:s,module:u}=o,l=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...i?[{module:i,varName:`${r}_clientLoader`}]:[],...c?[{module:c,varName:`${r}_clientMiddleware`}]:[],...s?[{module:s,varName:`${r}_HydrateFallback`}]:[],{module:u,varName:`${r}_main`}];return 1===l.length?`import * as ${r} from ${JSON.stringify(u)};`:[l.map((e=>`import * as ${e.varName} from "${e.module}";`)).join("\n"),`const ${r} = {${l.map((e=>`...${e.varName}`)).join(",")}};`].join("\n")})).join("\n")}\n ${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},n){let r=new Set(n.state.matches.map((e=>e.route.id))),o=n.state.location.pathname.split("/").filter(Boolean),a=["/"];for(o.pop();o.length>0;)a.push(`/${o.join("/")}`),o.pop();a.forEach((e=>{let t=j(n.routes,e,n.basename);t&&t.forEach((e=>r.add(e.route.id)))}));let i=[...r].reduce(((e,n)=>Object.assign(e,{[n]:t.routes[n]})),{});return{...t,routes:i,sri:!!e||void 0}}(t,s),null,2)};`:""}\n window.__reactRouterRouteModules = {${m.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return a.createElement(a.Fragment,null,a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r},type:void 0}),a.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:o},type:"module",async:!0}))}),[]),g=tr||p?[]:function(e){return[...new Set(e)]}(t.entry.imports.concat(Vn(m,t,{includeHydrateFallback:!0}))),v="object"==typeof t.sri?t.sri:{};return mn(!p,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),tr||p?null:a.createElement(a.Fragment,null,"object"==typeof t.sri?a.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,f?null:a.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],suppressHydrationWarning:!0}),a.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],suppressHydrationWarning:!0}),g.map((t=>a.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:v[t],suppressHydrationWarning:!0}))),h)}function rr(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}a.Component;function or({error:e,isOutsideRemixApp:t}){console.error(e);let n,r=a.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(ne(e))return a.createElement(ar,{title:"Unhandled Thrown Response!"},a.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),Ht?r:null);if(e instanceof Error)e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);new Error(t)}return a.createElement(ar,{title:"Application Error!",isOutsideRemixApp:t},a.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),a.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function ar({title:e,renderScripts:t,isOutsideRemixApp:n,children:r}){let{routeModules:o}=Kn();return o.root?.Layout&&!n?r:a.createElement("html",{lang:"en"},a.createElement("head",null,a.createElement("meta",{charSet:"utf-8"}),a.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),a.createElement("title",null,e)),a.createElement("body",null,a.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},r,t?a.createElement(nr,null):null)))}var ir="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{ir&&(window.__reactRouterVersion="7.12.0")}catch(e){}function cr(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:l({window:t?.window}),hydrationData:t?.hydrationData||ur(),routes:e,mapRouteProperties:vn,hydrationRouteProperties:yn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function sr(e,t){return Pe({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:d({window:t?.window}),hydrationData:t?.hydrationData||ur(),routes:e,mapRouteProperties:vn,hydrationRouteProperties:yn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function ur(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:lr(e.errors)}),e}function lr(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)n[e]=new te(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let o=new t(r.message);o.stack="",n[e]=o}catch(e){}}if(null==n[e]){let t=new Error(r.message);t.stack="",n[e]=t}}else n[e]=r;return n}var dr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pr=a.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:i,state:c,target:s,to:u,preventScrollReset:l,viewTransition:d,unstable_defaultShouldRevalidate:f,...m},h){let{basename:v,unstable_useTransitions:y}=a.useContext(Rt),b="string"==typeof u&&dr.test(u),w=ae(u,v),x=function(e,{relative:t}={}){p(Ut(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=a.useContext(Rt),{hash:o,pathname:i,search:c}=Gt(e,{relative:t}),s=i;return"/"!==n&&(s="/"===i?n:Q([n,i])),r.createHref({pathname:s,search:c,hash:o})}(u=w.to,{relative:r}),[O,k,S]=function(e,t){let n=a.useContext(Gn),[r,o]=a.useState(!1),[i,c]=a.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:l,onMouseLeave:d,onTouchStart:p}=t,f=a.useRef(null);a.useEffect((()=>{if("render"===e&&c(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{c(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),a.useEffect((()=>{if(r){let e=setTimeout((()=>{c(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let m=()=>{o(!0)},h=()=>{o(!1),c(!1)};return n?"intent"!==e?[i,f,{}]:[i,f,{onFocus:Jn(s,m),onBlur:Jn(u,h),onMouseEnter:Jn(l,m),onMouseLeave:Jn(d,h),onTouchStart:Jn(p,m)}]:[!1,f,{}]}(n,m),E=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:s,unstable_useTransitions:u}={}){let l=qt(),d=Vt(),p=Gt(e,{relative:i});return a.useCallback((f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,t)){f.preventDefault();let t=void 0!==n?n:g(d)===g(p),m=()=>l(e,{replace:t,state:r,preventScrollReset:o,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:s});u?a.startTransition((()=>m())):m()}}),[d,l,p,n,r,t,e,o,i,c,s,u])}(u,{replace:i,state:c,target:s,preventScrollReset:l,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:y});let j=a.createElement("a",{...m,...S,href:w.absoluteURL||x,onClick:w.isExternal||o?e:function(t){e&&e(t),t.defaultPrevented||E(t)},ref:rr(h,k),target:s,"data-discover":b||"render"!==t?void 0:"true"});return O&&!b?a.createElement(a.Fragment,null,j,a.createElement(Xn,{page:x})):j}));pr.displayName="Link",a.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:i,viewTransition:c,children:s,...u},l){let d=Gt(i,{relative:u.relative}),f=Vt(),m=a.useContext(Dt),{navigator:h,basename:g}=a.useContext(Rt),v=null!=m&&function(e,{relative:t}={}){let n=a.useContext(Ct);p(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hr("useViewTransitionState"),o=Gt(e,{relative:t});if(!n.isTransitioning)return!1;let i=V(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=V(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=W(o.pathname,c)||null!=W(o.pathname,i)}(d)&&!0===c,y=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,b=f.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&g&&(w=V(w,g)||w);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let O,k=b===y||!r&&b.startsWith(y)&&"/"===b.charAt(x),S=null!=w&&(w===y||!r&&w.startsWith(y)&&"/"===w.charAt(y.length)),E={isActive:k,isPending:S,isTransitioning:v},j=k?e:void 0;O="function"==typeof n?n(E):[n,k?"active":null,S?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof o?o(E):o;return a.createElement(pr,{...u,"aria-current":j,className:O,ref:l,style:P,to:i,viewTransition:c},"function"==typeof s?s(E):s)})).displayName="NavLink";var fr=a.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:c=Dn,action:s,onSubmit:u,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:m,...h},v)=>{let{unstable_useTransitions:y}=a.useContext(Rt),b=br(),w=function(e,{relative:t}={}){let{basename:n}=a.useContext(Rt),r=a.useContext(Lt);p(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Gt(e||".",{relative:t})},c=Vt();if(null==e){i.search=c.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();i.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(i.pathname="/"===i.pathname?n:Q([n,i.pathname]));return g(i)}(s,{relative:l}),x="get"===c.toLowerCase()?"get":"post",O="string"==typeof s&&dr.test(s);return a.createElement("form",{ref:v,method:x,action:w,onSubmit:r?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute("formmethod")||c,p=()=>b(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:o,state:i,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:m});y&&!1!==n?a.startTransition((()=>p())):p()},...h,"data-discover":O||"render"!==e?void 0:"true"})}));function mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hr(e){let t=a.useContext(At);return p(t,mr(e)),t}function gr(e){f("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=a.useRef(Cn(e)),n=a.useRef(!1),r=Vt(),o=a.useMemo((()=>function(e,t){let n=Cn(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),i=qt(),c=a.useCallback(((e,t)=>{const r=Cn("function"==typeof e?e(new URLSearchParams(o)):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,c]}fr.displayName="Form";var vr=0,yr=()=>`__${String(++vr)}__`;function br(){let{router:e}=hr("useSubmit"),{basename:t}=a.useContext(Rt),n=cn("useRouteId"),r=e.fetch,o=e.navigate;return a.useCallback((async(e,a={})=>{let{action:i,method:c,encType:s,formData:u,body:l}=Nn(e,t);if(!1===a.navigate){let e=a.fetcherKey||yr();await r(e,n,a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:l,formMethod:a.method||c,formEncType:a.encType||s,flushSync:a.flushSync})}else await o(a.action||i,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:u,body:l,formMethod:a.method||c,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})}),[r,o,t,n])}},77987:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},88097:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>r})},65166:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},47029:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(88097);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},35412:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{A:()=>r})},2482:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(25134);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},65710:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},25134:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(77987);function o(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},14644:(e,t,n)=>{"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{HY:()=>u,Qd:()=>c,Tw:()=>f,Zz:()=>p,ve:()=>m,y$:()=>s,zH:()=>d});var o=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),a=()=>Math.random().toString(36).substring(7).split("").join("."),i={INIT:`@@redux/INIT${a()}`,REPLACE:`@@redux/REPLACE${a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a()}`};function c(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function s(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(s)(e,t)}let a=e,u=t,l=new Map,d=l,p=0,f=!1;function m(){d===l&&(d=new Map,l.forEach(((e,t)=>{d.set(t,e)})))}function h(){if(f)throw new Error(r(3));return u}function g(e){if("function"!=typeof e)throw new Error(r(4));if(f)throw new Error(r(5));let t=!0;m();const n=p++;return d.set(n,e),function(){if(t){if(f)throw new Error(r(6));t=!1,m(),d.delete(n),l=null}}}function v(e){if(!c(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(f)throw new Error(r(9));try{f=!0,u=a(u,e)}finally{f=!1}return(l=d).forEach((e=>{e()})),e}v({type:i.INIT});return{dispatch:v,subscribe:g,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));a=e,v({type:i.REPLACE})},[o]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(h())}n();return{unsubscribe:e(n)}},[o](){return this}}}}}function u(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}const o=Object.keys(n);let a;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:i.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:i.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){a=e}return function(e={},t){if(a)throw a;let i=!1;const c={};for(let a=0;a<o.length;a++){const s=o[a],u=n[s],l=e[s],d=u(l,t);if(void 0===d){t&&t.type;throw new Error(r(14))}c[s]=d,i=i||d!==l}return i=i||o.length!==Object.keys(e).length,i?c:e}}function l(e,t){return function(...n){return t(e.apply(this,n))}}function d(e,t){if("function"==typeof e)return l(e,t);if("object"!=typeof e||null===e)throw new Error(r(16));const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=l(o,t))}return n}function p(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function f(...e){return t=>(n,o)=>{const a=t(n,o);let i=()=>{throw new Error(r(15))};const c={getState:a.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(c)));return i=p(...s)(a.dispatch),{...a,dispatch:i}}}function m(e){return c(e)&&"type"in e&&"string"==typeof e.type}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=i,s.amdD=function(){throw new Error("define cannot be used indirect")},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var a={};n=n||[null,r({}),r([]),r(r)];for(var i=2&t&&e;"object"==typeof i&&!~n.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,s.d(o,a),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"chunk-"+({222:"vendor-libphonenumber-js",236:"actions",262:"html-editor",310:"vendor-fontawesome",556:"docs-actions",672:"phone-formatter",722:"code-editor",916:"vendor-icons"}[e]||e)+"."+{103:"956c3cad3193e2b46078",123:"6e69e488578840d4e34a",136:"8ba6d226aa26680cc00c",172:"5a8562f05605c293e378",201:"a4789b1cdf1cd5228723",211:"9568d8c0d6647d7393b3",222:"86e7e69454f651e8e581",236:"04f65d09c1fefc4c5788",262:"a144c7e379174cfaa68a",264:"fdc1a714ad90a0cef94c",306:"3691c30d7320438a8121",310:"1f5c4d34f611b7f0b69a",348:"d920d92169650dea27fe",350:"b174d19eb181fb88ff0f",356:"16d70c3c8419f2098c38",357:"cae6a953c1c36ceec395",389:"362711d95ad8d73ee7ed",419:"86bf12d44704862c6486",424:"9c7b92cf9e8cbe74166f",467:"b3dd954aafe3140ef1dc",556:"259905e30ed0313a5d02",601:"1304209cea9b5485565a",668:"ffc314407c1fd50dbfbf",672:"f0685e5e63247acbc44a",722:"2bfe654132875144a0af",789:"49834b299877fe035670",916:"35650b60ffb6142ba937",927:"0dd4f6842a7f50fa0d2d"}[e]+".js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},a="tocco-admin:",s.l=(e,t,n,r)=>{if(o[e])o[e].push(t);else{var i,c;if(void 0!==n)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+n){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",a+n),i.src=e),o[e]=[t];var p=(t,n)=>{i.onerror=i.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="/",(()=>{var e={792:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var a=s.p+s.u(t),i=new Error;s.l(a,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,r[1](i)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[a,i,c]=n,u=0;if(a.some((t=>0!==e[t]))){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(c)c(s)}for(t&&t(n);u<a.length;u++)o=a[u],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunktocco_admin=this.webpackChunktocco_admin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),s.nc=void 0;var u={};return(()=>{"use strict";s.r(u),s.d(u,{default:()=>Et});var e=s(5556),t=s.n(e),n=s(4883),r=s.n(n),o=s(81845),a=s.n(o),i=s(6730),c=s(30632),l=s(63061),d=s(97699),p=s(12199),f=s(42851),m=s(18601),h=s(2753),g=s(29255),v=s(17678),y=s(92207),b=s.n(y),w=s(43786),x=s(26396),O=s.n(x),k=s(98671),S=s(24096);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=O()(O()(O()(O()(O()(O()(O()(O()({},S.Se,k.A.singleTransferReducer("menuOpen")),S.GN,k.A.singleTransferReducer("modulesMenuTree")),S.yD,k.A.singleTransferReducer("settingsMenuTree")),S.Kz,k.A.singleTransferReducer("systemMenuTree")),S.kl,k.A.singleTransferReducer("completeMenuTree")),S.w,(function(e){return j(j({},e),{},{menuOpen:!e.menuOpen})})),S.cv,k.A.singleTransferReducer("activeMenuTab")),S.Qw,(function(e,t){var n=t.payload.activeMenuTab;return j(j({},e),{},{menuOpen:e.activeMenuTab!==n||!e.menuOpen})})),A={menuOpen:!1,entities:[],activeMenuTab:"modules"};var D=s(70661),T=s(93575),_=s(74978),C=b().mark(F),M=b().mark(H),I=b().mark(U),R=b().mark(Y),N=function(e){return e.navigation},L="admin.activeMenu";function F(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.requestSaga,"client/menus/".concat(e));case 2:return t=n.sent,n.abrupt("return",t.body.menuItems);case 4:case"end":return n.stop()}}),C)}function H(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.T1)(F,"modules");case 2:return e=o.sent,o.next=5,(0,w.yJ)(S.lF(e));case 5:return o.next=7,(0,w.T1)(F,"settings");case 7:return t=o.sent,o.next=10,(0,w.yJ)(S.J8(t));case 10:return o.next=12,(0,w.T1)(F,"system");case 12:return n=o.sent,o.next=15,(0,w.yJ)(S.BA(n));case 15:return o.next=17,(0,w.T1)(F,"all");case 17:return r=o.sent,o.next=20,(0,w.yJ)(S.$Y(r));case 20:case"end":return o.stop()}}),M)}function W(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[L])){e.next=4;break}return e.next=4,(0,w.yJ)(S.Tr(n));case 4:case"end":return e.stop()}}),e)}))()}function B(e){var t=e.payload.activeMenuTab;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.yJ)((0,_.bM)(O()({},L,t)));case 2:case"end":return e.stop()}}),e)}))()}function U(e){var t,n,r,o,a;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,w.Lt)(N);case 2:if(t=i.sent,n=t.settingsMenuTree,r=t.modulesMenuTree,o=t.systemMenuTree,a=t.completeMenuTree,e!==T.WV.MODULES){i.next=9;break}return i.abrupt("return",r);case 9:if(e!==T.WV.SETTINGS){i.next=11;break}return i.abrupt("return",n);case 11:if(e!==T.WV.SYSTEM){i.next=13;break}return i.abrupt("return",o);case 13:if(e!==T.WV.COMPLETE){i.next=15;break}return i.abrupt("return",a);case 15:return i.abrupt("return",null);case 16:case"end":return i.stop()}}),I)}function V(e){var t=e.payload.menuTab;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(U,t);case 2:if(n=e.sent,!((null==n?void 0:n.length)>0)){e.next=9;break}return e.next=7,(0,w.yJ)(S.YV(t));case 7:return e.next=9,(0,w.yJ)(S.Tr(t));case 9:case"end":return e.stop()}}),e)}))()}function Y(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(S.OZ,H),(0,w.sg)(500,S.cv,B),(0,w.p8)(_.CF,W),(0,w.p8)(S.KY,V)]);case 2:case"end":return e.stop()}}),R)}var z=b().mark(q);function q(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(Y)]);case 2:case"end":return e.stop()}}),z)}const $=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t=arguments.length>1?arguments[1]:void 0,n=P[t.type];return n?n(e,t):e};function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var J=O()(O()(O()(O()({},_.PP,k.A.singleTransferReducer("serverSettings")),_.oB,k.A.singleTransferReducer("isLoading")),_.CF,k.A.singleTransferReducer("userPreferences")),_.lz,(function(e,t){var n=t.payload;return K(K({},e),{},{userPreferences:K(K({},e.userPreferences),n.preferences)})})),Q={isLoading:!0,serverSettings:{},userPreferences:{}};var X=s(58065),Z=s(79859),ee=s(76419),te=s(22056),ne=s.n(te);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ae,ie,ce,se,ue=function(e){return Object.entries(e).reduce((function(e,t){var n=ne()(t,2),r=n[0],o=n[1];return oe(oe({},e),{},O()({},r,function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(o)))}),{})},le=s(74848),de=b().mark(ve),pe=b().mark(we),fe=b().mark(xe);function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){O()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ge="admin.theme";function ve(){var e,t,n,r,o;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,w.yJ)(_.F6(!0));case 2:return a.next=4,(0,w.T1)(D.A.fetchServerSettings);case 4:return e=a.sent,a.next=7,(0,w.yJ)(_.Ve(e));case 7:return a.next=9,(0,w.T1)(D.A.fetchUserPreferences,"admin.*");case 9:return t=a.sent,a.next=12,(0,w.T1)(ue,t);case 12:return n=a.sent,a.next=15,(0,w.T1)(D.A.fetchUserPreferences,"admintree.*");case 15:return r=a.sent,a.next=18,(0,w.T1)(ue,r);case 18:return o=a.sent,a.next=21,(0,w.yJ)(_.A2(he(he({},o),n)));case 21:return a.next=23,(0,w.yJ)(_.F6(!1));case 23:case"end":return a.stop()}}),de)}function ye(e){var t=e.payload.preferences;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(D.A.savePreferences,t);case 2:case"end":return e.stop()}}),e)}))()}function be(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[ge])){e.next=8;break}return e.next=4,(0,w.T1)(ee.A.addLongTerm,"admin","theme",n);case 4:return e.next=6,(0,w.yJ)(c.A.setThemeType(n));case 6:e.next=12;break;case 8:return e.next=10,(0,w.T1)(ee.A.removeLongTerm,"admin","theme");case 10:return e.next=12,(0,w.yJ)(c.A.initThemeType());case 12:case"end":return e.stop()}}),e)}))()}function we(){var e,t,n;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,w.T1)(Z.Ix);case 2:return e=r.sent,t=function(){return e.put(!0)},n=function(){return e.put(!1)},r.next=7,(0,w.yJ)(h.A.confirm(ae||(ae=(0,le.jsx)(X.A,{id:"client.admin.menu.resetPreferences.title"})),ie||(ie=(0,le.jsx)(X.A,{id:"client.admin.menu.resetPreferences.question"})),ce||(ce=(0,le.jsx)(X.A,{id:"client.common.ok"})),se||(se=(0,le.jsx)(X.A,{id:"client.common.cancel"})),t,n));case 7:return r.next=9,(0,w.s)(e);case 9:if(!r.sent){r.next=19;break}return r.next=13,(0,w.T1)(D.A.resetAllPreferences);case 13:return r.next=15,(0,w.T1)(ee.A.removeLongTerm,"admin","theme");case 15:return r.next=17,(0,w.yJ)(c.A.initThemeType());case 17:return r.next=19,(0,w.yJ)(h.A.toaster({type:"success",title:"client.admin.menu.resetPreferences.success"}));case 19:case"end":return r.stop()}}),pe)}function xe(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(_.U3,ve),(0,w.p8)(_.lz,ye),(0,w.p8)(_.CF,be),(0,w.p8)(_.fE,we)]);case 2:case"end":return e.stop()}}),fe)}var Oe=b().mark(ke);function ke(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(xe)]);case 2:case"end":return e.stop()}}),Oe)}const Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,t=arguments.length>1?arguments[1]:void 0,n=J[t.type];return n?n(e,t):e};var Ee=s(27948),je=O()(O()(O()(O()(O()(O()(O()({},Ee.mW,k.A.singleTransferReducer("username")),Ee.XA,k.A.singleTransferReducer("currentBusinessUnit")),Ee.E_,k.A.singleTransferReducer("businessUnits")),Ee.tb,k.A.singleTransferReducer("ssoAvailable")),Ee.ZW,k.A.singleTransferReducer("pendingChanges")),Ee.tP,k.A.singleTransferReducer("hasOutlookAddInModule")),Ee.zI,k.A.singleTransferReducer("inWrongBusinessUnit")),Pe={username:"",currentBusinessUnit:{label:"",id:""},businessUnits:[],ssoAvailable:!1,pendingChanges:!1,hasOutlookAddInModule:!1,inWrongBusinessUnit:void 0};var Ae=s(18987),De=s(25204),Te=b().mark(Ce),_e=b().mark(Me);function Ce(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.fetchModules);case 2:if(e=n.sent,e.includes("nice.optional.sso")){n.next=6;break}return n.abrupt("return",!1);case 6:return n.next=8,(0,w.T1)(D.A.fetchEntityCount,"Openid_provider",{where:"active == true"});case 8:return t=n.sent,n.abrupt("return",t>0);case 10:case"end":return n.stop()}}),Te)}function Me(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===(e=ee.A.getLongTerm("server","ssoAvailable"))){n.next=5;break}return n.abrupt("return",e);case 5:return n.next=7,(0,w.T1)(Ce);case 7:return t=n.sent,ee.A.addLongTerm("server","ssoAvailable",t),n.abrupt("return",t);case 10:case"end":return n.stop()}}),_e)}var Ie=s(27399),Re=s(88691),Ne=b().mark(Qe),Le=b().mark(Xe),Fe=b().mark(Ze),He=b().mark(et),We=b().mark(tt),Be=b().mark(rt),Ue=b().mark(at),Ve=b().mark(it),Ye=b().mark(ct),ze=b().mark(ut),qe=b().mark(lt),$e=b().mark(dt),Ge=function(e){return e.session},Ke=function(e){return e.input},Je=function(e){return e.app};function Qe(e){var t,n,r,o;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return t=e/2*60*1e3,a.next=3,(0,w.T1)(m.A.doSessionRequest);case 3:return n=a.sent,r=n.success,o=n.adminAllowed,a.next=8,(0,w.yJ)(m.A.setLoggedIn(r));case 8:return a.next=10,(0,w.yJ)(m.A.setAdminAllowed(o));case 10:return a.next=12,(0,w.T1)(Xe,t);case 12:return a.next=14,(0,w.T1)(Qe,e);case 14:case"end":return a.stop()}}),Ne)}function Xe(e){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.cb)(e);case 2:case"end":return t.stop()}}),Le)}function Ze(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.T1)(m.A.doRequest,"logout",{method:"POST"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),Fe)}function et(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.Lt)(Ke);case 2:e=n.sent,t=e.baseRoute,window.location.href=t||"/";case 5:case"end":return n.stop()}}),He)}function tt(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.Lt)(Je);case 2:return e=o.sent,t=e.textResourceModules,o.next=6,(0,w.T1)(Re.A.getUserLocale);case 6:return n=o.sent,o.next=9,(0,w.T1)(Re.A.getChangeLocaleAction,t,n);case 9:return r=o.sent,o.next=12,(0,w.yJ)(r);case 12:case"end":return o.stop()}}),We)}function nt(e){var t=e.payload;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sessionTimeout,e.next=3,(0,w.T1)(tt);case 3:return e.next=5,(0,w.yJ)(m.A.setAdminAllowed(void 0));case 5:return e.next=7,(0,w.yJ)(m.A.setLoggedIn(!0));case 7:return e.next=9,(0,w.yJ)(h.A.connectSocket());case 9:return e.next=11,(0,w.T1)(Qe,n);case 11:case"end":return e.stop()}}),e)}))()}function rt(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(Z.Ix);case 2:return t=n.sent,n.next=5,(0,w.yJ)(h.A.modal("navigation-pending-changes","client.admin.confirmTouchedFormTitle",e,(function(e){var n=e.close;return(0,le.jsx)(Ie.A,{onYes:function(){n(),t.put("yes")},onNo:function(){n(),t.put("no")}})}),!0,(function(){return t.put("no")})));case 5:return n.next=7,(0,w.s)(t);case 7:return n.abrupt("return",n.sent);case 8:case"end":return n.stop()}}),Be)}function ot(e){var t=e.payload;return b().mark((function e(){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.message,r=t.confirmCallback,e.next=3,(0,w.T1)(rt,n);case 3:if("yes"!==e.sent){e.next=9;break}return e.next=7,(0,w.T1)(r,!0);case 7:e.next=11;break;case 9:return e.next=11,(0,w.T1)(r,!1);case 11:case"end":return e.stop()}}),e)}))()}function at(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.Lt)(Ge);case 2:if(e=t.sent,!e.pendingChanges){t.next=10;break}return t.next=7,(0,w.T1)(rt,"client.admin.confirmTouchedFormLogout");case 7:if("yes"===t.sent){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,(0,w.T1)(Ae.A.remove,De.v);case 12:return t.next=14,(0,w.T1)(Ze);case 14:return t.next=16,(0,w.yJ)(m.A.setLoggedIn(!1));case 16:return t.next=18,(0,w.yJ)(h.A.closeSocket());case 18:return t.next=20,(0,w.T1)(et);case 20:case"end":return t.stop()}}),Ue)}function it(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.T1)(D.A.fetchPrincipal);case 2:return e=o.sent,t=e.username,n=e.currentBusinessUnit,r=e.inWrongBusinessUnit,o.next=8,(0,w.yJ)(Ee.P(t));case 8:return o.next=10,(0,w.yJ)(Ee.Ml(n));case 10:return o.next=12,(0,w.yJ)(Ee.xI(r));case 12:case"end":return o.stop()}}),Ve)}function ct(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.T1)(D.A.requestSaga,"principals/businessunits");case 2:return e=t.sent,t.next=5,(0,w.yJ)(Ee.Qp(e.body.data));case 5:case"end":return t.stop()}}),Ye)}function st(e){var t=e.payload.businessUnitId;return b().mark((function e(){var n,r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Lt)(Ge);case 2:return n=e.sent,r=n.username,o="principals/".concat(r,"/businessunit"),e.next=7,(0,w.T1)(D.A.requestSaga,o,{method:"PUT",body:{businessUnit:t}});case 7:return e.next=9,(0,w.T1)(c.A.reinitialiseCache);case 9:location.reload();case 10:case"end":return e.stop()}}),e)}))()}function ut(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.T1)(Me);case 2:return e=t.sent,t.next=5,(0,w.yJ)(Ee.d4(e));case 5:case"end":return t.stop()}}),ze)}function lt(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.T1)(D.A.fetchModules);case 2:return e=n.sent,t=e.includes("nice.optional.officeintegration"),n.next=6,(0,w.yJ)(Ee.Wm(t));case 6:case"end":return n.stop()}}),qe)}function dt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.p8)(Ee.hO,nt),(0,w.p8)(Ee.tZ,at),(0,w.p8)(Ee.AZ,it),(0,w.p8)(Ee.Cm,ct),(0,w.p8)(Ee.zu,st),(0,w.p8)(Ee.Ff,ut),(0,w.p8)(Ee.sR,ot),(0,w.p8)(Ee.$H,lt)]);case 2:case"end":return e.stop()}}),$e)}var pt=b().mark(ft);function ft(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Q7)([(0,w.Zy)(dt)]);case 2:case"end":return e.stop()}}),pt)}const mt={session:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe,t=arguments.length>1?arguments[1]:void 0,n=je[t.type];return n?n(e,t):e},navigation:$,preferences:Se};var ht=[ft,q,ke],gt=s(35693);const vt=[{ctrl:!0,alt:!0,code:"KeyM",actions:[(0,S.ad)("modules")],global:!0},{ctrl:!0,alt:!0,code:"KeyN",actions:[(0,S.ad)("settings")],global:!0},{ctrl:!0,alt:!0,code:"KeyO",actions:[(0,S.ad)("complete")],global:!0},{ctrl:!0,alt:!0,code:"KeyK",actions:[(0,S.ad)("system")],global:!0}];var yt,bt,wt="admin",xt=r().lazy((function(){return Promise.all([s.e(927),s.e(601),s.e(172),s.e(419),s.e(136),s.e(356)]).then(s.bind(s,85356))})),Ot=function(){return yt||(yt=(0,le.jsx)(le.Fragment,{children:(0,le.jsx)(n.Suspense,{fallback:"",children:(0,le.jsx)(xt,{})})}))},kt=function(e,t,n,o){window.reactRegistry&&window.reactRegistry.setReact&&window.reactRegistry.setReact(r(),a());var s=bt||(bt=(0,le.jsx)(Ot,{})),u=c.A.createStore(mt,ht,t,wt);return p.A.addToStore(u,(function(){return{}})),i.A.addToStore(u),l.A.addToStore(u,(function(){return{appComponent:gt.A,formApp:v.A}})),l.A.dynamicActionsAddToStore(u),d.A.addToStore(u,!0,["console","remote","notification"]),h.A.addToStore(u,!0,{withNotificationCenter:!0}),m.A.addToStore(u),f.A.addToStore(u,vt),g.A.addToStore(u),c.A.createApp(wt,s,u,{input:t,events:n,actions:[],publicPath:o,textResourceModules:["component","common","actions","login","sso-login","entity-browser","entity-list","entity-detail","dashboard","docs-browser","entities",wt]})};c.A.registerAppInRegistry(wt,kt);var St=function(e){return c.A.useApp({initApp:kt,props:e,packageName:wt}).component};St.propTypes={baseRoute:t().string,memoryHistory:t().bool};const Et=St})(),u})()));
|