const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DynamicDashboard-BWfBzitG.js","assets/useToast-CS8pZhce.js","assets/dollar-sign-Bf6JneNn.js","assets/truck-D5o8mTsH.js","assets/utensils-BhILG_B7.js","assets/formatters-WvGQLZg0.js","assets/AreaChart-tvNE-d9G.js","assets/OperationsModule-DlDaJDmo.js","assets/building-BdUpGLM5.js","assets/phone-DpnQw4if.js","assets/user-CuEEaB8a.js","assets/mockData-DAqQG5te.js","assets/InventoryModule-VpTxuRuh.js","assets/useOrders-TRZWcao8.js","assets/currency-DdDs82F5.js","assets/useInventory-C7Fo8GE1.js","assets/SalesModule-Cf0nSO8B.js","assets/CrmModule-l7PoMLhA.js","assets/DynamicFormRenderer-0ioSXYKX.js","assets/types-DMl_5q2N.js","assets/file-text-DR21jZDS.js","assets/list-XDoRqfJ2.js","assets/star-B6hvSjuv.js","assets/upload-CY2IsfiN.js","assets/FinanceModule-D-3_6PUg.js","assets/EmployeesModule-70hl9DMi.js","assets/CommunicationsModule-gCjT_vNw.js","assets/HelpDeskModule-BIrYP26C.js","assets/TasksModule-D4E78liD.js","assets/link-DOg0dLYA.js","assets/CmsModule-DuJnf1QM.js","assets/arrow-down-CWbiHuZO.js","assets/arrow-up-B4Ca-HNG.js","assets/image-B_RO1I7c.js","assets/settings-2-CSojebrG.js","assets/MarketingModule-DyvYzuoi.js","assets/AnalyticsModule-xduYpRUy.js","assets/AutomationModule-DO2GmeS1.js","assets/AiCenterModule-BBao0YAQ.js","assets/AppsCatalogModule-rSx-Kisy.js","assets/types-CTcNpN0z.js","assets/SettingsModule-BbqUjWn1.js","assets/indexedDb-D30TbhA6.js","assets/EntityCatalog-CAg8Pzny.js","assets/panels-top-left-BomsDlf9.js","assets/table-_fqSCPRE.js","assets/FieldBuilder-CLdLCeVX.js","assets/fieldTypesMeta-BCSfJ-2N.js","assets/mail-DOD5KO1v.js","assets/eye-CkF1gwUX.js","assets/pen-D8SS70u3.js","assets/FormBuilder-d4z6JEl5.js","assets/move-up-qiRY8MuU.js","assets/save-D8euL60I.js","assets/CardLayoutBuilder-CiBozXyO.js","assets/ViewBuilder-zR702NRL.js","assets/arrow-up-down--M136cK3.js","assets/CustomEntityPage-B_J0Fvzq.js"])))=>i.map(i=>d[i]); import{a as e,c as t,f as n,h as r,i,l as a,n as o,o as s,p as c,r as l,s as u,u as d}from"./useToast-CS8pZhce.js";import{n as f,t as p}from"./demo-D1nHL60J.js";import{S as m,b as h,c as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as ee,x as A,y as te}from"./indexedDb-D30TbhA6.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ne=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),re=c(((e,t)=>{t.exports=ne()})),ie=c((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ie()})),oe=c((e=>{var t=re(),r=n(),i=ae();function a(e){var t=`https://react.dev/errors/`+e;if(1ye||(e.current=ve[ye],ve[ye]=null,ye--)}function be(e,t){ye++,ve[ye]=e.current,e.current=t}var xe=I(null),Se=I(null),Ce=I(null),we=I(null);function Te(e,t){switch(be(Ce,t),be(Se,e),be(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(xe),be(xe,e)}function Ee(){L(xe),L(Se),L(Ce)}function De(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,be(we,e)),t=xe.current;var n=dp(t,e.type);t!==n&&(be(Se,e),be(xe,n))}function Oe(e){Se.current===e&&(L(xe),L(Se)),we.current===e&&(L(we),sh._currentValue=_e)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=qf(Qr,`onSelect`),0>=o,i-=o,Zi=1<<32-$e(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&$i(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),z&&$i(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&$i(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),z&&$i(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&to(l)===r.type){n(e,r.sibling),c=i(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=to(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===ne)return _(e,r,Da(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=B;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ba&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,dc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ua(c,r),Ad(e)):uc(e,t,r,Ad(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=nc(e).queue;$s(e,i,t,_e,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Ad())}function ic(){return Ea(sh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=_o(n);var r=vo(t,e,n);r!==null&&(Nd(r,t,n),yo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Di(e,t,n,r),n!==null&&(Nd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Ad())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),td===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Nd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(a(479))}else t=Di(e,n,r,2),t!==null&&Nd(t,e,2)}function fc(e){var t=e.alternate;return e===V||t!==null&&t===V}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var hc={readContext:Ea,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:Ea,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,i=os();if(z){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),td===null)throw Error(a(349));q&127||_s(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=td.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ce.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ia,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(a(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),i=!1}else i=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return Ee(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return ba(t.type),yl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return yl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)vl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>hd&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Vo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return yl(t),null}else 2*Ve()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?zo(t,o):(n=o,be(jo,t),be(Ro,n),Mo===null&&(Mo=t)),z&&$i(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(a(156,t.tag))}function xl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(a(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ba(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&L(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ba(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&L(Ga);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function U(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){Q(e,e.return,t)}}}function Tl(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),np(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,P.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,G&6)throw Error(a(331));var c=G;if(G|=4,Xu(o.current),Hu(o,o.current,s,n),G=c,Ef(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{F.p=i,P.T=r,lf(e,t)}}function ff(e,t,n){t=Ui(n,t),t=kc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(pt(e,2),Tf(e))}function Q(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Ui(n,e),n=Ac(2),r=vo(t,n,2),r!==null&&(jc(n,r,t,e),pt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(id=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(q&n)===n&&(od===4||od===3&&(q&62914560)===q&&300>Ve()-Z?G&2?ld|=n:Bd(e,0):ld|=n,dd===q&&(dd=0)),Tf(e)}function hf(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Le(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=q,a=st(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Ve(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}vd!==0&&vd!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=It(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Lt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Ce.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=It(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=It(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=It(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),np(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Lt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Lt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=oe()})),j=r(n(),1),ce=se(),le=`modulepreload`,ue=function(e){return`/`+e},de={},M=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ue(t,n),t=s(t),t in de)return;de[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:le,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},fe=e=>{throw TypeError(e)},pe=(e,t,n)=>t.has(e)||fe(`Cannot `+n),me=(e,t,n)=>(pe(e,t,`read from private field`),n?n.call(e):t.get(e)),he=(e,t,n)=>t.has(e)?fe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(pe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ge=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,P=/^[\\/]{2}/;function F(e,t){return t+e.replace(/\\/g,`/`)}var _e=`popstate`;function ve(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ye(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Se(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ce(t)}return Te(t,n,null,e)}function I(e,t){if(e===!1||e==null)throw Error(t)}function L(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function be(){return Math.random().toString(36).substring(2,10)}function xe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Se(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?we(t):t,state:n,key:t&&t.key||r||be(),mask:i}}function Ce({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 we(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 Te(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ve(e)?e:Se(h.location,e,t);n&&n(r,e),l=u()+1;let d=xe(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ve(e)?e:Se(h.location,e,t);n&&n(r,e),l=u();let i=xe(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(_e,d),c=e,()=>{i.removeEventListener(_e,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),I(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ce(t);return i=i.replace(/ $/,`%20`),!n&&P.test(i)&&(i=r+i),new URL(i,r)}var De,Oe=class{constructor(e){if(he(this,De,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(me(this,De).has(e))return me(this,De).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){me(this,De).set(e,t)}};De=new WeakMap;var ke=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function Ae(e){return ke.has(e)}var je=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Me(e){return je.has(e)}function Ne(e){return e.index===!0}function Pe(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(I(e.index!==!0||!e.children,`Cannot specify children on an index route`),I(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Ne(e)){let n={...e,id:s};return r[s]=Fe(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Fe(n,t(n)),e.children&&(n.children=Pe(e.children,t,o,r,i)),n}})}function Fe(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ie(e,t,n=`/`){return Le(e,t,n,!1)}function Le(e,t,n,r,i){let a=rt((typeof t==`string`?we(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ze(e),s=null,c=nt(a);for(let e=0;s==null&&e{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;I(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=pt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(I(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Be(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Xe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=tt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ve(e.path))a(e,t,!0,n)}),t}function Ve(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ve(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function He(e){e.sort((e,t)=>e.score===t.score?Ze(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ue=/^:[\w-]+$/,We=3,Ge=2,Ke=1,qe=10,Je=-2,Ye=e=>e===`*`;function Xe(e,t){let n=e.split(`/`),r=n.length;return n.some(Ye)&&(r+=Je),t&&(r+=Ge),n.filter(e=>!Ye(e)).reduce((e,t)=>e+(Ue.test(t)?We:t===``?Ke:qe),r)}function Ze(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Qe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e{if(t===`*`){let e=s[r]||``;o=mt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function tt(e,t=!1,n=!0){L(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return L(!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 rt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function it({basename:e,pathname:t}){return t===`/`?e:pt([e,t])}var at=e=>ge.test(e);function ot(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?we(e):e,a;return n?(n=ft(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?st(n.substring(1),`/`):st(n,t)):a=t,{pathname:a,search:gt(r),hash:_t(i)}}function st(e,t){let n=mt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ct(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 and the router will parse it for you.`}function lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ut(e){let t=lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function dt(e,t,n,r=!1){let i;typeof e==`string`?i=we(e):(i={...e},I(!i.pathname||!i.pathname.includes(`?`),ct(`?`,`pathname`,`search`,i)),I(!i.pathname||!i.pathname.includes(`#`),ct(`#`,`pathname`,`hash`,i)),I(!i.search||!i.search.includes(`#`),ct(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ot(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ft=e=>e.replace(/[\\/]{2,}/g,`/`),pt=e=>ft(e.join(`/`));function mt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ht=e=>mt(e).replace(/^\/*/,`/`),gt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,_t=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,vt=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],yt=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 bt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xt(e){return pt(e.map(e=>e.route.path).filter(Boolean))||`/`}var St=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ct(e,t){let n=e;if(typeof n!=`string`||!ge.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(St)try{let e=new URL(window.location.href),r=P.test(n)?new URL(F(n,e.protocol)):new URL(n),a=rt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{L(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var wt=Symbol(`Uninstrumented`);function Tt(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(typeof t.lazy==`function`&&n.lazy.length>0){let e=Dt(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Dt(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[wt]??i,a=Dt(n[e],t,(...e)=>kt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[wt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[wt]??e,r=Dt(n.middleware,t,(...e)=>kt(e[0]));return r?(r[wt]=t,r):e})),r}function Et(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[wt]??e.navigate,r=Dt(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Ce(n):`.`,...At(e,r??{})}});r&&(r[wt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[wt]??e.fetch,r=Dt(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...At(e,i??{})}});r&&(r[wt]=t,e.fetch=r)}return e}function Dt(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ot(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ot(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ot(e,t,n,r-1),a=await o,I(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function kt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:jt(t),params:{...r},pattern:i,context:Mt(n)}}function At(e,t){return{currentUrl:Ce(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 jt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Mt(e){if(Pt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Nt=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Pt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Nt}var Ft=new URL(`http://localhost`);function It(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ft)}catch{return Ft}}function Lt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Rt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function zt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Lt(i,n),s=!Lt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Rt(e,i)||!Lt(i,a)))throw Error(`External navigation is not allowed`)}var Bt=[`POST`,`PUT`,`PATCH`,`DELETE`],Vt=new Set(Bt),Ht=[`GET`,...Bt],Ut=new Set(Ht),Wt=new Set([301,302,303,307,308]),Gt=new Set([307,308]),Kt={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},R={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Jt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Yt=`remix-router-transitions`,Xt=Symbol(`ResetLoaderData`),Zt,Qt,$t,en,tn=class{constructor(e){he(this,Zt),he(this,Qt),he(this,$t),he(this,en),N(this,Zt,e),N(this,Qt,ze(e))}get stableRoutes(){return me(this,Zt)}get activeRoutes(){return me(this,$t)??me(this,Zt)}get branches(){return me(this,en)??me(this,Qt)}get hasHMRRoutes(){return me(this,$t)!=null}setRoutes(e){N(this,Zt,e),N(this,Qt,ze(e))}setHmrRoutes(e){N(this,$t,e),N(this,en,ze(e))}commitHmrRoutes(){me(this,$t)&&(N(this,Zt,me(this,$t)),N(this,Qt,me(this,en)),N(this,$t,void 0),N(this,en,void 0))}};Zt=new WeakMap,Qt=new WeakMap,$t=new WeakMap,en=new WeakMap;function nn(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;I(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Jt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Tt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new tn(Pe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||bn,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Le(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Gn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&it(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=it(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>cn(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=ln(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Kt,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,ee=new Map,A=null,te=!1,ne=!1,re=new Set,ie=new Map,ae=0,oe=-1,se=new Map,j=new Set,ce=new Map,le=new Map,ue=new Set,de=new Map,M,fe=null;function pe(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(M){M(),M=void 0;return}L(de.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ze({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{M=e});e.history.go(r*-1),Xe(i,{state:`blocked`,location:n,proceed(){Xe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,qt),N({blockers:e})}}),E?.resolve(),E=null;return}return ve(t,n)}),n){hr(t,ee);let e=()=>gr(t,ee);t.addEventListener(`pagehide`,e),A=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ve(`POP`,w.location,{initialHydration:!0}),C}function me(){d&&d(),A&&A(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>He(w.fetchers,t)),w.blockers.forEach((e,t)=>Ye(t))}function he(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function N(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(ue.has(t)?n.push(t):r.push(t))}),ue.forEach(e=>{!w.fetchers.has(e)&&!ie.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>He(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ge(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&or(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Vn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,qt)));let l=!te&&nt(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&or(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),te||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=ee.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:ee.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=ee.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}N({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Kt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,te=!1,ne=!1,E?.resolve(),E=null,fe?.resolve(),fe=null}async function F(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=_r();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=on(!1,an(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?we(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},P.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),zt(typeof n.mask==`string`?n.mask:Ce(n.mask),Ce(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=Se(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},zt(t==null?e.history.createHref(w.location):typeof t==`string`?t:Ce(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&or(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ze({currentLocation:s,nextLocation:l,historyAction:d});if(m){Xe(m,{state:`blocked`,location:l,proceed(){Xe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),F(t,n)},reset(){let e=new Map(w.blockers);e.set(m,qt),N({blockers:e})}});return}await ve(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function _e(){fe||=_r(),Fe(),N({revalidation:`loading`});let e=fe.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ve(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ve(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ve(t,n,r){O&&O.abort(),O=null,T=t,te=(r&&r.startUninterruptedRevalidation)===!0,tt(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Le(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ne&&Jn(w.location,n)&&!(r&&r.submission&&or(r.submission.formMethod))){ge(n,{matches:a},{flushSync:o});return}let l=it(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);ge(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=Fn(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new Oe,p;if(r&&r.pendingError)p=[Un(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&or(r.submission.formMethod)){let i=await ye(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if($n(t)&&bt(t.error)&&t.error.status===404){O=null,ge(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=ur(n,a,t,r.submission),o=!1,l.active=!1,d=Fn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await be(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,ge(n,{matches:h||a,...Hn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ye(t,n,i,l,u,d,f,p,m={}){if(Fe(),N({navigation:dr(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ot(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Un(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Qe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=cr(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Gn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Me(t,n,En(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(er(h)){let n;return n=m&&m.replace!=null?m.replace:Pn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await je(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if($n(h)){let e=Un(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function be(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||ur(n,i,l,p),x=p||m||lr(b),S=!te&&!g;if(d){if(S){let e=xe(v);N({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ot(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Un(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=sn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ne,re,ue,ce,j,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(oe=++ae,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Ke(e);return ge(n,{matches:i,loaderData:{},errors:v&&$n(v[1])?{[v[0]]:v[1].error}:null,...Hn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=xe(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Te(E)),N(e,{flushSync:_})}E.forEach(e=>{We(e.key),e.controller&&ie.set(e.key,e.controller)});let D=()=>E.forEach(e=>We(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:ee}=await Ne(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>ie.delete(e.key));let A=Kn(k);if(A)return await je(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=Kn(ee),A)return j.add(A.key),await je(t,A.result,!0,{replace:h}),{shortCircuited:!0};let se=new Map(w.fetchers),{loaderData:le,errors:de}=Bn(w,i,k,v,E,ee,se);g&&w.errors&&(de={...w.errors,...de});let M=Ke(se),fe=qe(oe,se),pe=M||fe||E.length>0;return{matches:i,loaderData:le,errors:de,...pe?{workingFetchers:se}:{}}}function xe(e){if(e&&!$n(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Te(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=fr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function De(t,n,r,i){We(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=an(w.location,w.matches,c,r,n,i?.relative),u=Le(o,l,c,!1,s.branches),d=it(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){ze(t,n,Gn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=on(!0,l,i);if(m){ze(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Oe,g=(i&&i.preventScrollReset)===!0;if(p&&or(p.formMethod)){await ke(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ce.set(t,{routeId:n,path:f}),await Ae(t,n,f,u,h,d.active,a,g,p)}async function ke(t,n,i,l,u,d,f,p,m,h){Fe(),ce.delete(t),Ie(t,pr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Fn(e.history,i,g.signal,m);if(d){let e=await ot(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ze(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{ze(t,n,Gn(404,{pathname:i}),{flushSync:f});return}}let v=cr(l,i);if(!v.route.action&&!v.route.lazy){ze(t,n,Gn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ie.set(t,g);let y=ae,b=En(a,o,_,i,l,v,r,u),x=await Me(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ie.get(t)===g&&ie.delete(t);return}if(ue.has(t)){if(er(S)||$n(S)){Ie(t,mr(void 0));return}}else{if(er(S)){if(ie.delete(t),oe>y){Ie(t,mr(void 0));return}return j.add(t),Ie(t,fr(m)),je(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if($n(S)){ze(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Fn(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Le(D,w.navigation.location,c,!1,s.branches);I(k,`Didn't find any matches after fetcher action`);let ee=++ae;se.set(t,ee);let{dsMatches:A,revalidatingFetchers:te}=sn(E,u,a,o,e.history,w,k,m,C,r,!1,ne,re,ue,ce,j,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),le=fr(m,S.data),de=new Map(w.fetchers);de.set(t,le),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=de.get(t),r=fr(void 0,n?n.data:void 0);de.set(t,r),We(t),e.controller&&ie.set(t,e.controller)}),N({fetchers:de});let M=()=>te.forEach(e=>We(e.key));g.signal.addEventListener(`abort`,M);let{loaderResults:fe,fetcherResults:pe}=await Ne(A,te,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,M),se.delete(t),ie.delete(t),te.forEach(e=>ie.delete(e.key));let me=w.fetchers.has(t),he=e=>{if(!me)return e;let n=new Map(e.fetchers);return n.set(t,mr(S.data)),{...e,fetchers:n}},P=Kn(fe);if(P)return w=he(w),je(E,P.result,!1,{preventScrollReset:p});if(P=Kn(pe),P)return j.add(P.key),w=he(w),je(E,P.result,!1,{preventScrollReset:p});let F=new Map(w.fetchers);me&&F.set(t,mr(S.data));let{loaderData:_e,errors:ve}=Bn(w,k,fe,void 0,te,pe,F);qe(ee,F),w.navigation.state===`loading`&&ee>oe?(I(T,`Expected pending action`),O&&O.abort(),ge(w.navigation.location,{matches:k,loaderData:_e,errors:ve,fetchers:F})):(N({errors:ve,loaderData:Vn(w.loaderData,_e,k,ve),fetchers:F}),ne=!1)}async function Ae(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Ie(t,fr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Fn(e.history,i,m.signal);if(l){let e=await ot(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ze(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{ze(t,n,Gn(404,{pathname:i}),{flushSync:u});return}}let g=cr(s,i);ie.set(t,m);let _=ae,v=await Me(h,i,En(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ie.get(t)===m&&ie.delete(t),!h.signal.aborted){if(ue.has(t)){Ie(t,mr(void 0));return}if(er(y)){if(oe>_){Ie(t,mr(void 0));return}j.add(t),await je(h,y,!1,{preventScrollReset:d});return}if($n(y)){ze(t,n,y.error);return}Ie(t,mr(y.data))}}async function je(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ne=!0);let d=i.response.headers.get(`Location`);I(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Pn(d,p,c,e.history),zt(f,d,p,`allow-explicit`);let m=Se(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(at(d)){let n=Ee(t,d,!0);e=n.origin!==t.location.origin||rt(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=lr(w.navigation));let y=o||s;Gt.has(i.response.status)&&y&&or(y.formMethod)?await ve(h,m,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await ve(h,m,{overrideNavigation:ur(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function Me(e,t,n,r,i){let a,o={};try{a=await Dn(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!or(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Qn(r)){let i=r.result;o[t]={type:`redirect`,response:jn(i,e,t,n,c)}}else o[t]=await An(r);return o}async function Ne(e,t,n,r,i){let a=Me(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Me(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Gn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){ne=!0,ce.forEach((e,t)=>{ie.has(t)&&re.add(t),We(t)})}function Ie(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),N({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function ze(e,t,n,r={}){let i=Un(w.matches,t),a=new Map(w.fetchers);He(a,e),N({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Be(e){return le.set(e,(le.get(e)||0)+1),ue.has(e)&&ue.delete(e),w.fetchers.get(e)||R}function Ve(e,t){We(e,t?.reason),Ie(e,mr(null))}function He(e,t){let n=w.fetchers.get(t);ie.has(t)&&!(n&&n.state===`loading`&&se.has(t))&&We(t),ce.delete(t),se.delete(t),j.delete(t),ue.delete(t),re.delete(t),e.delete(t)}function Ue(e){let t=(le.get(e)||0)-1;t<=0?(le.delete(e),ue.add(e)):le.set(e,t),N({fetchers:new Map(w.fetchers)})}function We(e,t){let n=ie.get(e);n&&(n.abort(t),ie.delete(e))}function Ge(e,t){for(let n of e){let e=t.get(n);I(e,`Expected fetcher: ${n}`);let r=mr(e.data);t.set(n,r)}}function Ke(e){let t=[],n=!1;for(let r of j){let i=e.get(r);I(i,`Expected fetcher: ${r}`),i.state===`loading`&&(j.delete(r),t.push(r),n=!0)}return Ge(t,e),n}function qe(e,t){let n=[];for(let[r,i]of se)if(i0}function Je(e,t){let n=w.blockers.get(e)||qt;return de.get(e)!==t&&de.set(e,t),n}function Ye(e){w.blockers.delete(e),de.delete(e)}function Xe(e,t){let n=w.blockers.get(e)||qt;I(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),N({blockers:r})}function Ze({currentLocation:e,nextLocation:t,historyAction:n}){if(de.size===0)return;de.size>1&&L(!1,`A router only supports one blocker at a time`);let r=Array.from(de.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Qe(e){let t=Gn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Wn(n);return{notFoundMatches:r,route:i,error:t}}function $e(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Kt){_=!0;let e=nt(w.location,w.matches);e!=null&&N({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function et(e,t){return h&&h(e,t.map(e=>Re(e,w.loaderData)))||e.key}function tt(e,t){if(m&&g){let n=et(e,t);m[n]=g()}}function nt(e,t){if(m){let n=et(e,t),r=m[n];if(typeof r==`number`)return r}return null}function it(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Le(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Le(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ot(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||pn(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=Le(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Le(s.activeRoutes,n,c,!0,u),!(f&&l.lengthe.route.id===t[n].route.id)}function ct(e){o={},s.setHmrRoutes(Pe(e,a,void 0,o))}function lt(e,t,n=!1){pn(e,t,s,o,a,n),s.hasHMRRoutes||N({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:pe,subscribe:he,enableScrollRestoration:$e,navigate:F,fetch:De,revalidate:_e,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Be,resetFetcher:Ve,deleteFetcher:Ue,dispose:me,getBlocker:Je,deleteBlocker:Ye,patchRoutes:lt,_internalFetchControllers:ie,_internalSetRoutes:ct,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){N(e)}},e.instrumentations&&(C=Et(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function rn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function an(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=dt(r||`.`,ut(o),rt(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=sr(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=it({basename:n,pathname:c.pathname})),Ce(c)}function on(e,t,n){if(!n||!rn(n))return{path:t};if(n.formMethod&&!ar(n.formMethod))return{path:t,error:Gn(405,{method:n.formMethod})};let r=()=>({path:t,error:Gn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=qn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!or(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!or(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}I(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ln(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ln(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(or(c.formMethod))return{path:t,submission:c};let l=we(t);return e&&l.search&&sr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ce(l),submission:c}}function sn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?$n(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&$n(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=xt(o),ee=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!cn(s))f=!1;else if(u){let{shouldLoad:e}=ln(s,a.loaderData,a.errors);f=e}else un(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Tn(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?dn(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=fn(i,m);return Tn(n,r,e,c,k,i,l,t,h,m,x)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=Le(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=cr(b,e.path),C=new AbortController,w=Fn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=En(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=En(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};fn(S,a)&&(T=En(n,r,w,e.path,b,S,l,t,a))}T&&A.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:ee,revalidatingFetchers:A}}function cn(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ln(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!cn(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function un(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function dn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function fn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function pn(e,t,n,r,i,a){let o;if(e){let t=r[e];I(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>mn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Pe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;et.children?.some(t=>mn(e,t)))??!1}var hn=new WeakMap,gn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(I(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=hn.get(i);o||(o={},hn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Ae(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)L(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)L(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},_n=new WeakMap;function vn(e,t,n,r,i){let a=n[e.id];if(I(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=_n.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{I(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Me(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?L(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?L(!o,`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}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return _n.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=gn({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function yn(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 bn(e){return e.matches.some(e=>e.route.middleware)?xn(e,()=>yn(e)):yn(e)}function xn(e,t){return Sn(e,t,e=>{if(ir(e))throw e;return e},Xn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Un(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Sn(e,t,n,r,i){let{matches:a,...o}=e;return await Cn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Cn(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Cn(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function wn(e,t,n,r,i){let a=gn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=vn(r.route,or(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Tn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=wn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?fn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?fn(a,{...l,defaultShouldRevalidate:e}):fn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!or(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(or(n.method)||!p)?On({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function En(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Tn(e,t,n,r,xt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:wn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Dn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:In(t,n),pattern:xt(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw 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=s;return xn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function On({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=or(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:In(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Gn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Gn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function kn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function An(e){let{result:t,type:n}=e;if(nr(t)){let e;try{e=await kn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new yt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?tr(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:Yn(t),statusCode:bt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:bt(t)?t.status:void 0}:tr(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 jn(e,t,n,r,i){let a=e.headers.get(`Location`);if(I(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!at(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=an(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Mn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Nn(e){try{return Mn.includes(new URL(e).protocol)}catch{return!1}}function Pn(e,t,n,r){if(at(e)){let r=e,i=P.test(r)?new URL(F(r,t.protocol)):new URL(r);if(Nn(i.toString()))throw Error(`Invalid redirect location`);let a=rt(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ft(i.pathname)+i.search+i.hash}try{if(Nn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Fn(e,t,n,r){let i=e.createURL(qn(t)).toString(),a={signal:n};if(r&&or(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ln(r.formData):r.formData}return new Request(i,a)}function In(e,t){let n=new URL(e.url),r=typeof t==`string`?we(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Ln(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&$n(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(I(!er(f),`Cannot handle redirect results in processLoaderData`),$n(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Un(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Xt),c||(c=!0,s=bt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Bn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=zn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(I(s,`Did not find corresponding fetcher result`),$n(s)){let t=Un(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(er(s))I(!1,`Unhandled fetcher revalidation redirect`);else{let e=mr(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Vn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Xt).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&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Hn(e){return e?$n(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Un(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Wn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Gn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`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.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`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&&(s=`Invalid request method "${r.toUpperCase()}"`)),new yt(e||500,o,Error(s),!0)}function Kn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(er(r))return{key:n,result:r}}}function qn(e){return Ce({...typeof e==`string`?we(e):e,hash:``})}function Jn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Yn(e){return new yt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Xn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Zn(t))}function Zn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Qn(e){return nr(e.result)&&Wt.has(e.result.status)}function $n(e){return e.type===`error`}function er(e){return(e&&e.type)===`redirect`}function tr(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function nr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function rr(e){return Wt.has(e)}function ir(e){return nr(e)&&rr(e.status)&&e.headers.has(`Location`)}function ar(e){return Ut.has(e.toUpperCase())}function or(e){return Vt.has(e.toUpperCase())}function sr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function cr(e,t){let n=typeof t==`string`?we(t).search:t.search;if(e[e.length-1].route.index&&sr(n||``))return e[e.length-1];let r=lt(e);return r[r.length-1]}function lr(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ur(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dr(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function fr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pr(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function mr(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 hr(e,t){try{let n=e.sessionStorage.getItem(Yt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function gr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Yt,JSON.stringify(n))}catch(e){L(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function _r(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var vr=j.createContext(null);vr.displayName=`DataRouter`;var yr=j.createContext(null);yr.displayName=`DataRouterState`;var br=j.createContext(!1);function xr(){return j.useContext(br)}var Sr=j.createContext({isTransitioning:!1});Sr.displayName=`ViewTransition`;var Cr=j.createContext(new Map);Cr.displayName=`Fetchers`;var wr=j.createContext(null);wr.displayName=`Await`;var Tr=j.createContext(null);Tr.displayName=`Navigation`;var Er=j.createContext(null);Er.displayName=`Location`;var Dr=j.createContext({outlet:null,matches:[],isDataRoute:!1});Dr.displayName=`Route`;var Or=j.createContext(null);Or.displayName=`RouteError`;var kr=`REACT_ROUTER_ERROR`,Ar=`REDIRECT`,jr=`ROUTE_ERROR_RESPONSE`;function Mr(e){if(e.startsWith(`${kr}:${Ar}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Nr(e){if(e.startsWith(`${kr}:${jr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new yt(t.status,t.statusText,t.data)}catch{}}function Pr(e,{relative:t}={}){I(Fr(),`useHref() may be used only in the context of a component.`);let{basename:n,navigator:r}=j.useContext(Tr),{hash:i,pathname:a,search:o}=Wr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:pt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Fr(){return j.useContext(Er)!=null}function Ir(){return I(Fr(),`useLocation() may be used only in the context of a component.`),j.useContext(Er).location}var Lr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Rr(e){j.useContext(Tr).static||j.useLayoutEffect(e)}function zr(){let{isDataRoute:e}=j.useContext(Dr);return e?oi():Br()}function Br(){I(Fr(),`useNavigate() may be used only in the context of a component.`);let e=j.useContext(vr),{basename:t,navigator:n}=j.useContext(Tr),{matches:r}=j.useContext(Dr),{pathname:i}=Ir(),a=JSON.stringify(ut(r)),o=j.useRef(!1);return Rr(()=>{o.current=!0}),j.useCallback((r,s={})=>{if(L(o.current,Lr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=dt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:pt([t,c.pathname])),zt(typeof r==`string`?r:Ce(r),n.createHref(c),It(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Vr=j.createContext(null);function Hr(e){let t=j.useContext(Dr).outlet;return j.useMemo(()=>t&&j.createElement(Vr.Provider,{value:e},t),[t,e])}function Ur(){let{matches:e}=j.useContext(Dr);return e[e.length-1]?.params??{}}function Wr(e,{relative:t}={}){let{matches:n}=j.useContext(Dr),{pathname:r}=Ir(),i=JSON.stringify(ut(n));return j.useMemo(()=>dt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Gr(e,t,n){I(Fr(),`useRoutes() may be used only in the context of a component.`);let{navigator:r}=j.useContext(Tr),{matches:i}=j.useContext(Dr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ci(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant (or called \`useRoutes()\`) at "${s}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let u=Ir(),d;if(t){let e=typeof t==`string`?we(t):t;I(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ie(e,{pathname:p});L(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),L(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=Qr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:pt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:pt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?j.createElement(Er.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Kr(){let e=ai(),t=bt(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)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=j.createElement(j.Fragment,null,j.createElement(`p`,null,`💿 Hey developer 👋`),j.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,j.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,j.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),j.createElement(j.Fragment,null,j.createElement(`h2`,null,`Unexpected Application Error!`),j.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?j.createElement(`pre`,{style:i},n):null,o)}var qr=j.createElement(Kr,null),Jr=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){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&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Nr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:j.createElement(Dr.Provider,{value:this.props.routeContext},j.createElement(Or.Provider,{value:e,children:this.props.component}));return this.context?j.createElement(Xr,{error:e},t):t}};Jr.contextType=br;var Yr=new WeakMap;function Xr({children:e,error:t}){let{basename:n,navigator:r}=j.useContext(Tr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Mr(t.digest);if(e){let i=Yr.get(t);if(i)throw i;let a=Ct(e.location,n),o=a.absoluteURL||a.to;if(zt(e.location,o,It(r),`allow-explicit`),Nn(o))throw Error(`Invalid redirect location`);if(St&&!Yr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Yr.set(t,n),n}}return j.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Zr({routeContext:e,match:t,children:n}){let r=j.useContext(vr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Dr.Provider,{value:e},n)}function Qr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);I(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||qr,o&&(s<0&&c===0?(ci(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?j.createElement(n.route.Component,null):n.route.element?n.route.element:e,j.createElement(Zr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?j.createElement(Jr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function $r(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ei(e){let t=j.useContext(vr);return I(t,$r(e)),t}function ti(e){let t=j.useContext(yr);return I(t,$r(e)),t}function ni(e){let t=j.useContext(Dr);return I(t,$r(e)),t}function ri(e){let t=ni(e),n=t.matches[t.matches.length-1];return I(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ii(){return ri(`useRouteId`)}function ai(){let e=j.useContext(Or),t=ti(`useRouteError`),n=ri(`useRouteError`);return e===void 0?t.errors?.[n]:e}function oi(){let{router:e}=ei(`useNavigate`),t=ri(`useNavigate`),n=j.useRef(!1);return Rr(()=>{n.current=!0}),j.useCallback(async(r,i={})=>{L(n.current,Lr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var si={};function ci(e,t,n){!t&&!si[e]&&(si[e]=!0,L(!1,n))}var li={};function ui(e,t){!e&&!li[t]&&(li[t]=!0,console.warn(t))}var di=j.useOptimistic,fi=()=>void 0;function pi(e){return di?di(e):[e,fi]}function mi(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&L(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:j.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&L(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&L(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var hi=[`HydrateFallback`,`hydrateFallbackElement`],gi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function _i({router:e,flushSync:t,onError:n,useTransitions:r}){r=xr()||r;let[i,a]=j.useState(e.state),[o,s]=pi(i),[c,l]=j.useState(),[u,d]=j.useState({isTransitioning:!1}),[f,p]=j.useState(),[m,h]=j.useState(),[g,_]=j.useState(),v=j.useRef(new Map),y=j.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:xt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),ui(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` 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 y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ui(g==null||y,"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."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):j.startTransition(()=>{r===!0&&s(e=>vi(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);j.useLayoutEffect(()=>e.subscribe(y),[e,y]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new gi)},[u]),j.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):j.startTransition(()=>{r===!0&&s(e=>vi(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),j.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),j.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=j.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,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]),x=e.basename||`/`,S=j.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return j.createElement(j.Fragment,null,j.createElement(vr.Provider,{value:S},j.createElement(yr.Provider,{value:o},j.createElement(Cr.Provider,{value:v.current},j.createElement(Sr.Provider,{value:u},j.createElement(Ci,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},j.createElement(yi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function vi(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var yi=j.memo(bi);function bi({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Gr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function xi({to:e,replace:t,state:n,relative:r}){I(Fr(),` may be used only in the context of a component.`);let{static:i,navigator:a}=j.useContext(Tr);L(!i,` must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.`);let{matches:o}=j.useContext(Dr),{pathname:s}=Ir(),c=zr(),l=dt(e,ut(o),s,r===`path`);zt(typeof e==`string`?e:Ce(e),a.createHref(l),It(a),`reject`);let u=JSON.stringify(l);return j.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Si(e){return Hr(e.context)}function Ci({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){I(!Fr(),`You cannot render a inside another . You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=j.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=we(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=j.useMemo(()=>{let e=rt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return L(h!=null,` is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the won't render anything.`),h==null?null:j.createElement(Tr.Provider,{value:c},j.createElement(Er.Provider,{children:t,value:h}))}j.Component;var wi=`get`,Ti=`application/x-www-form-urlencoded`;function Ei(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Di(e){return Ei(e)&&e.tagName.toLowerCase()===`button`}function Oi(e){return Ei(e)&&e.tagName.toLowerCase()===`form`}function ki(e){return Ei(e)&&e.tagName.toLowerCase()===`input`}function Ai(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ji(e,t){return e.button===0&&(!t||t===`_self`)&&!Ai(e)}var Mi=null;function Ni(){if(Mi===null)try{new FormData(document.createElement(`form`),0),Mi=!1}catch{Mi=!0}return Mi}var Pi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Fi(e){return e!=null&&!Pi.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ti}"`),null):e}function Ii(e,t){let n,r,i,a,o;if(Oi(e)){let o=e.getAttribute(`action`);r=o?rt(o,t):null,n=e.getAttribute(`method`)||wi,i=Fi(e.getAttribute(`enctype`))||Ti,a=new FormData(e)}else if(Di(e)||ki(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a