import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{B as r,F as i,I as a,L as o,V as s,W as c,c as l,l as u,u as d}from"./button-BhAQo6Sy.js";var f=n((e=>{var t=c();function n(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=f()})),m=t(c(),1),h=t(p(),1);function g(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _=e=>{switch(e){case`success`:return b;case`info`:return S;case`warning`:return x;case`error`:return C;default:return null}},v=Array(12).fill(0),y=({visible:e,className:t})=>m.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},m.createElement(`div`,{className:`sonner-spinner`},v.map((e,t)=>m.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),b=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},m.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),x=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},m.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),S=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},m.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),C=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},m.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),w=m.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},m.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),m.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),T=()=>{let[e,t]=m.useState(document.hidden);return m.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},E=1,D=100,O=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:E++,k=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-D;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=O(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],m.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(j(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!m.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=O(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},A=(e,t)=>k.message(e,t),j=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,M=Object.assign(A,{success:k.success,info:k.info,warning:k.warning,error:k.error,custom:k.custom,message:k.message,promise:k.promise,dismiss:k.dismiss,loading:k.loading},{getHistory:()=>k.toasts,getToasts:()=>k.getActiveToasts()});g(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function ee(e){return e.label!==void 0}var te=3,N=`24px`,ne=`16px`,re=4e3,ie=356,ae=14,P=45,oe=200;function F(...e){return e.filter(Boolean).join(` `)}function I(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var se=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:h,cancelButtonStyle:g,actionButtonStyle:v,className:b=``,descriptionClassName:x=``,duration:S,position:C,gap:E,expandByDefault:D,classNames:O,icons:k,closeButtonAriaLabel:A=`Close toast`}=e,[j,M]=m.useState(null),[te,N]=m.useState(null),[ne,ie]=m.useState(!1),[ae,se]=m.useState(!1),[ce,le]=m.useState(!1),[ue,de]=m.useState(!1),[L,fe]=m.useState(!1),[pe,me]=m.useState(0),[he,R]=m.useState(0),ge=m.useRef(n.duration||S||re),z=m.useRef(null),B=m.useRef(null),_e=c===0,ve=c+1<=o,V=n.type,ye=V??`default`,be=n.dismissible!==!1,H=n.className||``,U=n.descriptionClassName||``,xe=m.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),Se=m.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Ce=m.useMemo(()=>n.duration||S||re,[n.duration,S]),W=m.useRef(0),G=m.useRef(0),we=m.useRef(0),Te=m.useRef(null),[Ee,De]=C.split(`-`),Oe=m.useMemo(()=>s.reduce((e,t,n)=>n>=xe?e:e+t.height,0),[s,xe]),ke=T(),Ae=m.useMemo(()=>e.swipeDirections??I(C),[e.swipeDirections,C]),je=n.invert||t,Me=V===`loading`;G.current=m.useMemo(()=>xe*E+Oe,[xe,Oe]),m.useEffect(()=>{ge.current=Ce},[Ce]),m.useEffect(()=>{ie(!0)},[]),m.useEffect(()=>{let e=B.current;if(e){let t=e.getBoundingClientRect().height;return R(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),m.useLayoutEffect(()=>{if(!ne)return;let e=B.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,R(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[ne,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ne=m.useCallback(()=>{se(!0),me(G.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},oe)},[n,d,a,G]);m.useEffect(()=>{if(n.promise&&V===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ke?(()=>{if(we.current{n.onAutoClose==null||n.onAutoClose.call(n,n),Ne()},ge.current)),()=>clearTimeout(e)},[u,i,n,V,ke,Ne]),m.useEffect(()=>{n.delete&&(Ne(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ne,n.delete]);function Pe(){return k?.loading?m.createElement(`div`,{className:F(O?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":V===`loading`},k.loading):m.createElement(y,{className:F(O?.loader,n?.classNames?.loader),visible:V===`loading`})}let Fe=n.icon||k?.[V]||_(V);return m.createElement(`li`,{tabIndex:0,ref:B,className:F(b,H,O?.toast,n?.classNames?.toast,O?.[ye],n?.classNames?.[ye]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":ne,"data-promise":!!n.promise,"data-swiped":L,"data-removed":ae,"data-visible":ve,"data-y-position":Ee,"data-x-position":De,"data-index":c,"data-front":_e,"data-swiping":ce,"data-dismissible":be,"data-type":V,"data-invert":je,"data-swipe-out":ue,"data-swipe-direction":te,"data-expanded":!!(u||D&&ne),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ae?pe:G.current}px`,"--initial-height":D?`auto`:`${he}px`,...h,...n.style},onDragEnd:()=>{le(!1),M(null),Te.current=null},onPointerDown:e=>{e.button!==2&&(Me||!be||(z.current=new Date,me(G.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(le(!0),Te.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(ue||!be)return;Te.current=null;let e=Number(B.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(B.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-z.current?.getTime(),i=j===`x`?e:t,a=Math.abs(i)/r;if((j===`x`?Ae.includes(e>0?`right`:`left`):Ae.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=P||a>.11)){me(G.current),n.onDismiss==null||n.onDismiss.call(n,n),N(j===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ne(),de(!0);return}var o,s;(o=B.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=B.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),fe(!1),le(!1),M(null)},onPointerMove:e=>{var t,n;if(!Te.current||!be||window.getSelection()?.toString().length>0)return;let r=e.clientY-Te.current.y,i=e.clientX-Te.current.x;!j&&(Math.abs(i)>1||Math.abs(r)>1)&&M(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(j===`y`){if(Ae.includes(`top`)||Ae.includes(`bottom`))if(Ae.includes(`top`)&&r<0||Ae.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)0||Math.abs(a.y)>0)&&fe(!0),(t=B.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=B.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},Se&&!n.jsx&&V!==`loading`?m.createElement(`button`,{"aria-label":A,"data-disabled":Me,"data-close-button":!0,onClick:Me||!be?()=>{}:()=>{Ne(),n.onDismiss==null||n.onDismiss.call(n,n)},className:F(O?.closeButton,n?.classNames?.closeButton)},k?.close??w):null,(V||n.icon||n.promise)&&n.icon!==null&&(k?.[V]!==null||n.icon)?m.createElement(`div`,{"data-icon":``,className:F(O?.icon,n?.classNames?.icon)},V===`loading`?n.icon||Pe():n.promise?Pe():null,V===`loading`?null:Fe):null,m.createElement(`div`,{"data-content":``,className:F(O?.content,n?.classNames?.content)},m.createElement(`div`,{"data-title":``,className:F(O?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?m.createElement(`div`,{"data-description":``,className:F(x,U,O?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),m.isValidElement(n.cancel)?n.cancel:n.cancel&&ee(n.cancel)?m.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{ee(n.cancel)&&be&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ne())},className:F(O?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,m.isValidElement(n.action)?n.action:n.action&&ee(n.action)?m.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||v,onClick:e=>{ee(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ne())},className:F(O?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function ce(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function le(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ne:N;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var ue=m.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:g,visibleToasts:_=te,toastOptions:v,dir:y=ce(),gap:b=ae,icons:x,customAriaLabel:S,containerAriaLabel:C=`Notifications`}=e,[w,T]=m.useState([]),E=m.useMemo(()=>n?w.filter(e=>e.toasterId===n):w.filter(e=>!e.toasterId),[w,n]),D=m.useMemo(()=>Array.from(new Set([i].concat(E.filter(e=>e.position).map(e=>e.position)))),[E,i]),[O,A]=m.useState([]),[j,M]=m.useState(!1),[ee,N]=m.useState(!1),[ne,re]=m.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=m.useRef(null),oe=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=m.useRef(null),I=m.useRef(!1),ue=m.useCallback(e=>{T(t=>(t.find(t=>t.id===e.id)?.delete||k.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return m.useEffect(()=>k.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{T(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{h.flushSync(()=>{T(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),m.useEffect(()=>{if(d!==`system`){re(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?re(`dark`):re(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{re(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{re(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),m.useEffect(()=>{w.length<=1&&M(!1)},[w]),m.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;M(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&M(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),m.useEffect(()=>{if(P.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[P.current]),m.createElement(`section`,{ref:t,"aria-label":S??`${C} ${oe}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((t,n)=>{let[i,a]=t.split(`-`);return E.length?m.createElement(`ol`,{key:t,dir:y===`auto`?ce():y,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ne,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${O[0]?.height||0}px`,"--width":`${ie}px`,"--gap":`${b}px`,...g,...le(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{ee||M(!1)},onDragEnd:()=>M(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N(!0)},onPointerUp:()=>N(!1)},E.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>m.createElement(se,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:f,duration:v?.duration??p,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:_,closeButton:v?.closeButton??s,interacting:ee,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ue,toasts:E.filter(e=>e.position==n.position),heights:O.filter(e=>e.position==n.position),setHeights:A,expandByDefault:o,gap:b,expanded:j,swipeDirections:e.swipeDirections}))):null}))}),de=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),L=function(e,t){return new URL(e,t).href},fe={},pe=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=L(t,n),t=s(t),t in fe)return;fe[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`:de,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)})},me=e=>{throw TypeError(e)},he=(e,t,n)=>t.has(e)||me(`Cannot `+n),R=(e,t,n)=>(he(e,t,`read from private field`),n?n.call(e):t.get(e)),ge=(e,t,n)=>t.has(e)?me(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(he(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),B=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,_e=/^[\\/]{2}/;function ve(e,t){return t+e.replace(/\\/g,`/`)}var V=`popstate`;function ye(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function be(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=G(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),Ce(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:W(t))}function r(e,t){U(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return we(t,n,r,e)}function H(e,t){if(e===!1||e==null)throw Error(t)}function U(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function xe(){return Math.random().toString(36).substring(2,10)}function Se(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 Ce(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?G(t):t,state:n,key:t&&t.key||r||xe(),mask:i}}function W({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 G(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 we(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=ye(e)?e:Ce(h.location,e,t);n&&n(r,e),l=u()+1;let d=Se(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=ye(e)?e:Ce(h.location,e,t);n&&n(r,e),l=u();let i=Se(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 Te(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(V,d),c=e,()=>{i.removeEventListener(V,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 Te(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),H(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:W(t);return i=i.replace(/ $/,`%20`),!n&&_e.test(i)&&(i=r+i),new URL(i,r)}function Ee(e){return{defaultValue:e}}var De,Oe=class{constructor(e){if(ge(this,De,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(R(this,De).has(e))return R(this,De).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){R(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(H(e.index!==!0||!e.children,`Cannot specify children on an index route`),H(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=K((typeof t==`string`?G(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;H(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=ft([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(H(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=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$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){U(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 U(!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 K(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 rt({basename:e,pathname:t}){return t===`/`?e:ft([e,t])}var it=e=>B.test(e);function at(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?G(e):e,a;return n?(n=dt(n),a=n.startsWith(`/`)?ot(n.substring(1),`/`):ot(n,t)):a=t,{pathname:a,search:ht(r),hash:gt(i)}}function ot(e,t){let n=pt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function st(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 ct(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function lt(e){let t=ct(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ut(e,t,n,r=!1){let i;typeof e==`string`?i=G(e):(i={...e},H(!i.pathname||!i.pathname.includes(`?`),st(`?`,`pathname`,`search`,i)),H(!i.pathname||!i.pathname.includes(`#`),st(`#`,`pathname`,`hash`,i)),H(!i.search||!i.search.includes(`#`),st(`#`,`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=at(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var dt=e=>e.replace(/[\\/]{2,}/g,`/`),ft=e=>dt(e.join(`/`)),pt=e=>e.replace(/\/+$/,``),mt=e=>pt(e).replace(/^\/*/,`/`),ht=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,gt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_t=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],vt=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 yt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function bt(e){return ft(e.map(e=>e.route.path).filter(Boolean))||`/`}var xt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function St(e,t){let n=e;if(typeof n!=`string`||!B.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(xt)try{let e=new URL(window.location.href),r=_e.test(n)?new URL(ve(n,e.protocol)):new URL(n),a=K(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{U(!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 Ct=Symbol(`Uninstrumented`);function wt(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=Et(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=Et(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[Ct]??i,a=Et(n[e],t,(...e)=>Ot(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ct]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ct]??e,r=Et(n.middleware,t,(...e)=>Ot(e[0]));return r?(r[Ct]=t,r):e})),r}function Tt(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[Ct]??e.navigate,r=Et(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?W(n):`.`,...kt(e,r??{})}});r&&(r[Ct]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ct]??e.fetch,r=Et(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...kt(e,i??{})}});r&&(r[Ct]=t,e.fetch=r)}return e}function Et(e,t,n){return e.length===0?null:async(...r)=>{let i=await Dt(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Dt(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=Dt(e,t,n,r-1),a=await o,H(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 Ot(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:At(t),params:{...r},pattern:i,context:jt(n)}}function kt(e,t){return{currentUrl:W(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 At(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function jt(e){if(Nt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Mt=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Nt(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`)===Mt}var Pt=[`POST`,`PUT`,`PATCH`,`DELETE`],Ft=new Set(Pt),It=[`GET`,...Pt],Lt=new Set(It),Rt=new Set([301,302,303,307,308]),zt=new Set([307,308]),Bt={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},Vt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ht={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Ut=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Wt=`remix-router-transitions`,Gt=Symbol(`ResetLoaderData`),Kt,qt,Jt,Yt,Xt=class{constructor(e){ge(this,Kt),ge(this,qt),ge(this,Jt),ge(this,Yt),z(this,Kt,e),z(this,qt,ze(e))}get stableRoutes(){return R(this,Kt)}get activeRoutes(){return R(this,Jt)??R(this,Kt)}get branches(){return R(this,Yt)??R(this,qt)}get hasHMRRoutes(){return R(this,Jt)!=null}setRoutes(e){z(this,Kt,e),z(this,qt,ze(e))}setHmrRoutes(e){z(this,Jt,e),z(this,Yt,ze(e))}commitHmrRoutes(){R(this,Jt)&&(z(this,Kt,R(this,Jt)),z(this,qt,R(this,Yt)),z(this,Jt,void 0),z(this,Yt,void 0))}};Kt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Yt=new WeakMap;function Zt(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;H(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Ut,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...wt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Xt(Pe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||hn,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=Bn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=zn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&qe(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=qe(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=>nn(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=rn(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:Bt,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,A=new Map,j=null,M=!1,ee=!1,te=new Set,N=new Map,ne=0,re=-1,ie=new Map,ae=new Set,P=new Map,oe=new Map,F=new Set,I=new Map,se,ce=null;function le(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(se){se(),se=void 0;return}U(I.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=Ve({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{se=e});e.history.go(r*-1),Be(i,{state:`blocked`,location:n,proceed(){Be(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,Ht),L({blockers:e})}}),E?.resolve(),E=null;return}return he(t,n)}),n){lr(t,A);let e=()=>ur(t,A);t.addEventListener(`pagehide`,e),j=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||he(`POP`,w.location,{initialHydration:!0}),C}function ue(){d&&d(),j&&j(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>ke(w.fetchers,t)),w.blockers.forEach((e,t)=>ze(t))}function de(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 L(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`&&(F.has(t)?n.push(t):r.push(t))}),F.forEach(e=>{!w.fetchers.has(e)&&!N.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=>ke(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function fe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&q(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?In(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,Ht)));let l=!M&&Ke(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&q(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),M||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=A.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}L({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Bt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,M=!1,ee=!1,E?.resolve(),E=null,ce?.resolve(),ce=null}async function pe(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=dr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=en(!1,$t(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?G(n.mask):{...w.location.mask,...n.mask}});let s=w.location,l=Ce(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&q(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=Ve({currentLocation:s,nextLocation:l,historyAction:d});if(m){Be(m,{state:`blocked`,location:l,proceed(){Be(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),pe(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Ht),L({blockers:e})}});return}await he(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function me(){ce||=dr(),Se(),L({revalidation:`loading`});let e=ce.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(he(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(he(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function he(t,n,r){O&&O.abort(),O=null,T=t,M=(r&&r.startUninterruptedRevalidation)===!0,Ge(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&&!ee&&Un(w.location,n)&&!(r&&r.submission&&q(r.submission.formMethod))){fe(n,{matches:a},{flushSync:o});return}let l=qe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);fe(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=An(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new Oe,p;if(r&&r.pendingError)p=[Rn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&q(r.submission.formMethod)){let i=await R(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(Jn(t)&&yt(t.error)&&t.error.status===404){O=null,fe(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=ir(n,a,t,r.submission),o=!1,l.active=!1,d=An(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await ge(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,fe(n,{matches:h||a,...Ln(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function R(t,n,i,l,u,d,f,p,m={}){if(Se(),L({navigation:ar(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await Je(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}=zn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Rn(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}=He(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=nr(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Bn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await be(t,n,xn(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(Yn(h)){let n;return n=m&&m.replace!=null?m.replace:kn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await ye(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Jn(h)){let e=Rn(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 ge(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||ir(n,i,l,p),x=p||m||rr(b),S=!M&&!g;if(d){if(S){let e=z(v);L({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Je(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}=zn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Rn(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}=He(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=tn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ee,te,F,P,ae,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(re=++ne,!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=Ne(e);return fe(n,{matches:i,loaderData:{},errors:v&&Jn(v[1])?{[v[0]]:v[1].error}:null,...Ln(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=z(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=B(E)),L(e,{flushSync:_})}E.forEach(e=>{je(e.key),e.controller&&N.set(e.key,e.controller)});let D=()=>E.forEach(e=>je(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await xe(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>N.delete(e.key));let j=Vn(k);if(j)return await ye(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=Vn(A),j)return ae.add(j.key),await ye(t,j.result,!0,{replace:h}),{shortCircuited:!0};let ie=new Map(w.fetchers),{loaderData:oe,errors:I}=Fn(w,i,k,v,E,A,ie);g&&w.errors&&(I={...w.errors,...I});let se=Ne(ie),ce=Fe(re,ie),le=se||ce||E.length>0;return{matches:i,loaderData:oe,errors:I,...le?{workingFetchers:ie}:{}}}function z(e){if(e&&!Jn(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function B(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=or(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function _e(t,n,r,i){je(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=$t(w.location,w.matches,c,r,n,i?.relative),u=Le(o,l,c,!1,s.branches),d=qe(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){we(t,n,Bn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=en(!0,l,i);if(m){we(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Oe,g=(i&&i.preventScrollReset)===!0;if(p&&q(p.formMethod)){await ve(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}P.set(t,{routeId:n,path:f}),await V(t,n,f,u,h,d.active,a,g,p)}async function ve(t,n,i,l,u,d,f,p,m,h){Se(),P.delete(t),W(t,sr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=An(e.history,i,g.signal,m);if(d){let e=await Je(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{we(t,n,Bn(404,{pathname:i}),{flushSync:f});return}}let v=nr(l,i);if(!v.route.action&&!v.route.lazy){we(t,n,Bn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}N.set(t,g);let y=ne,b=xn(a,o,_,i,l,v,r,u),x=await be(_,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){N.get(t)===g&&N.delete(t);return}if(F.has(t)){if(Yn(S)||Jn(S)){W(t,cr(void 0));return}}else{if(Yn(S)){if(N.delete(t),re>y){W(t,cr(void 0));return}return ae.add(t),W(t,or(m)),ye(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Jn(S)){we(t,n,S.error);return}}let C=w.navigation.location||w.location,E=An(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Le(D,w.navigation.location,c,!1,s.branches);H(k,`Didn't find any matches after fetcher action`);let A=++ne;ie.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=tn(E,u,a,o,e.history,w,k,m,C,r,!1,ee,te,F,P,ae,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),oe=or(m,S.data),I=new Map(w.fetchers);I.set(t,oe),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=I.get(t),r=or(void 0,n?n.data:void 0);I.set(t,r),je(t),e.controller&&N.set(t,e.controller)}),L({fetchers:I});let se=()=>M.forEach(e=>je(e.key));g.signal.addEventListener(`abort`,se);let{loaderResults:ce,fetcherResults:le}=await xe(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,se),ie.delete(t),N.delete(t),M.forEach(e=>N.delete(e.key));let ue=w.fetchers.has(t),de=e=>{if(!ue)return e;let n=new Map(e.fetchers);return n.set(t,cr(S.data)),{...e,fetchers:n}},pe=Vn(ce);if(pe)return w=de(w),ye(E,pe.result,!1,{preventScrollReset:p});if(pe=Vn(le),pe)return ae.add(pe.key),w=de(w),ye(E,pe.result,!1,{preventScrollReset:p});let me=new Map(w.fetchers);ue&&me.set(t,cr(S.data));let{loaderData:he,errors:R}=Fn(w,k,ce,void 0,M,le,me);Fe(A,me),w.navigation.state===`loading`&&A>re?(H(T,`Expected pending action`),O&&O.abort(),fe(w.navigation.location,{matches:k,loaderData:he,errors:R,fetchers:me})):(L({errors:R,loaderData:In(w.loaderData,he,k,R),fetchers:me}),ee=!1)}async function V(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);W(t,or(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=An(e.history,i,m.signal);if(l){let e=await Je(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){we(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{we(t,n,Bn(404,{pathname:i}),{flushSync:u});return}}let g=nr(s,i);N.set(t,m);let _=ne,v=await be(h,i,xn(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(N.get(t)===m&&N.delete(t),!h.signal.aborted){if(F.has(t)){W(t,cr(void 0));return}if(Yn(y))if(re>_){W(t,cr(void 0));return}else{ae.add(t),await ye(h,y,!1,{preventScrollReset:d});return}if(Jn(y)){we(t,n,y.error);return}W(t,cr(y.data))}}async function ye(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ee=!0);let d=i.response.headers.get(`Location`);H(d,`Expected a Location header on the redirect Response`),d=kn(d,new URL(r.url),c,e.history);let f=Ce(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(it(d)){let n=Te(t,d,!0);e=n.origin!==t.location.origin||K(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=rr(w.navigation));let _=o||s;zt.has(i.response.status)&&_&&q(_.formMethod)?await he(p,f,{submission:{..._,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await he(p,f,{overrideNavigation:ir(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function be(e,t,n,r,i){let a,o={};try{a=await Sn(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(!q(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:En(i,e,t,n,c)}}else o[t]=await Tn(r);return o}async function xe(e,t,n,r,i){let a=be(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await be(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:Bn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Se(){ee=!0,P.forEach((e,t)=>{N.has(t)&&te.add(t),je(t)})}function W(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),L({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function we(e,t,n,r={}){let i=Rn(w.matches,t),a=new Map(w.fetchers);ke(a,e),L({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ee(e){return oe.set(e,(oe.get(e)||0)+1),F.has(e)&&F.delete(e),w.fetchers.get(e)||Vt}function De(e,t){je(e,t?.reason),W(e,cr(null))}function ke(e,t){let n=w.fetchers.get(t);N.has(t)&&!(n&&n.state===`loading`&&ie.has(t))&&je(t),P.delete(t),ie.delete(t),ae.delete(t),F.delete(t),te.delete(t),e.delete(t)}function Ae(e){let t=(oe.get(e)||0)-1;t<=0?(oe.delete(e),F.add(e)):oe.set(e,t),L({fetchers:new Map(w.fetchers)})}function je(e,t){let n=N.get(e);n&&(n.abort(t),N.delete(e))}function Me(e,t){for(let n of e){let e=t.get(n);H(e,`Expected fetcher: ${n}`);let r=cr(e.data);t.set(n,r)}}function Ne(e){let t=[],n=!1;for(let r of ae){let i=e.get(r);H(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ae.delete(r),t.push(r),n=!0)}return Me(t,e),n}function Fe(e,t){let n=[];for(let[r,i]of ie)if(i0}function Ie(e,t){let n=w.blockers.get(e)||Ht;return I.get(e)!==t&&I.set(e,t),n}function ze(e){w.blockers.delete(e),I.delete(e)}function Be(e,t){let n=w.blockers.get(e)||Ht;H(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),L({blockers:r})}function Ve({currentLocation:e,nextLocation:t,historyAction:n}){if(I.size===0)return;I.size>1&&U(!1,`A router only supports one blocker at a time`);let r=Array.from(I.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 He(e){let t=Bn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=zn(n);return{notFoundMatches:r,route:i,error:t}}function Ue(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Bt){_=!0;let e=Ke(w.location,w.matches);e!=null&&L({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function We(e,t){return h&&h(e,t.map(e=>Re(e,w.loaderData)))||e.key}function Ge(e,t){if(m&&g){let n=We(e,t);m[n]=g()}}function Ke(e,t){if(m){let n=We(e,t),r=m[n];if(typeof r==`number`)return r}return null}function qe(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 Je(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||cn(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 Xe(e){o={},s.setHmrRoutes(Pe(e,a,void 0,o))}function Ze(e,t,n=!1){cn(e,t,s,o,a,n),s.hasHMRRoutes||L({})}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:le,subscribe:de,enableScrollRestoration:Ue,navigate:pe,fetch:_e,revalidate:me,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ee,resetFetcher:De,deleteFetcher:Ae,dispose:ue,getBlocker:Ie,deleteBlocker:ze,patchRoutes:Ze,_internalFetchControllers:N,_internalSetRoutes:Xe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){L(e)}},e.instrumentations&&(C=Tt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Qt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function $t(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=ut(r||`.`,lt(o),K(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=tr(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=rt({basename:n,pathname:c.pathname})),W(c)}function en(e,t,n){if(!n||!Qt(n))return{path:t};if(n.formMethod&&!er(n.formMethod))return{path:t,error:Bn(405,{method:n.formMethod})};let r=()=>({path:t,error:Bn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Hn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!q(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(!q(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()}}}H(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Mn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Mn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Nn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Nn(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(q(c.formMethod))return{path:t,submission:c};let l=G(t);return e&&l.search&&tr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:W(l),submission:c}}function tn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Jn(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&&Jn(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=bt(o),A=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(!nn(s))f=!1;else if(u){let{shouldLoad:e}=rn(s,a.loaderData,a.errors);f=e}else an(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return bn(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?on(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=sn(i,m);return bn(n,r,e,c,k,i,l,t,h,m,x)}),j=[];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;j.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=nr(b,e.path),C=new AbortController,w=An(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=xn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=xn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};sn(S,a)&&(T=xn(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function nn(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function rn(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!nn(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 an(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function on(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function sn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function cn(e,t,n,r,i,a){let o;if(e){let t=r[e];H(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=>ln(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=>ln(e,t)))??!1}var un=new WeakMap,dn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(H(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=un.get(i);o||(o={},un.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)U(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)U(!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},fn=new WeakMap;function pn(e,t,n,r,i){let a=n[e.id];if(H(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=fn.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{H(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?U(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?U(!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 fn.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=dn({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 mn(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 hn(e){return e.matches.some(e=>e.route.middleware)?gn(e,()=>mn(e)):mn(e)}function gn(e,t){return _n(e,t,e=>{if($n(e))throw e;return e},Gn,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=Rn(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 _n(e,t,n,r,i){let{matches:a,...o}=e;return await vn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function vn(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 vn(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 yn(e,t,n,r,i){let a=dn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=pn(r.route,q(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function bn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=yn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?sn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?sn(a,{...l,defaultShouldRevalidate:e}):sn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!q(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(q(n.method)||!p)?Cn({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 xn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?bn(e,t,n,r,bt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:yn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Sn(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:jn(t,n),pattern:bt(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 gn(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 Cn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=q(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:jn(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 Bn(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 Bn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function wn(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 Tn(e){let{result:t,type:n}=e;if(Zn(t)){let e;try{e=await wn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new vt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Xn(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:Wn(t),statusCode:yt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:yt(t)?t.status:void 0}:Xn(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 En(e,t,n,r,i){let a=e.headers.get(`Location`);if(H(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!it(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=$t(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Dn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function On(e){try{return Dn.includes(new URL(e).protocol)}catch{return!1}}function kn(e,t,n,r){if(it(e)){let r=e,i=_e.test(r)?new URL(ve(r,t.protocol)):new URL(r);if(On(i.toString()))throw Error(`Invalid redirect location`);let a=K(i.pathname,n)!=null;if(i.origin===t.origin&&a)return dt(i.pathname)+i.search+i.hash}try{if(On(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function An(e,t,n,r){let i=e.createURL(Hn(t)).toString(),a={signal:n};if(r&&q(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?Mn(r.formData):r.formData}return new Request(i,a)}function jn(e,t){let n=new URL(e.url),r=typeof t==`string`?G(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 Mn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Nn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Pn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Jn(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(H(!Yn(f),`Cannot handle redirect results in processLoaderData`),Jn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Rn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Gt),c||(c=!0,s=yt(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 Fn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Pn(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(H(s,`Did not find corresponding fetcher result`),Jn(s)){let t=Rn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Yn(s))H(!1,`Unhandled fetcher revalidation redirect`);else{let e=cr(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function In(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Gt).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 Ln(e){return e?Jn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Rn(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 zn(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 Bn(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 vt(e||500,o,Error(s),!0)}function Vn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Yn(r))return{key:n,result:r}}}function Hn(e){return W({...typeof e==`string`?G(e):e,hash:``})}function Un(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Wn(e){return new vt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Gn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Kn(t))}function Kn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function qn(e){return Zn(e.result)&&Rt.has(e.result.status)}function Jn(e){return e.type===`error`}function Yn(e){return(e&&e.type)===`redirect`}function Xn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Zn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Qn(e){return Rt.has(e)}function $n(e){return Zn(e)&&Qn(e.status)&&e.headers.has(`Location`)}function er(e){return Lt.has(e.toUpperCase())}function q(e){return Ft.has(e.toUpperCase())}function tr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function nr(e,t){let n=typeof t==`string`?G(t).search:t.search;if(e[e.length-1].route.index&&tr(n||``))return e[e.length-1];let r=ct(e);return r[r.length-1]}function rr(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 ir(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 ar(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 or(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 sr(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 cr(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 lr(e,t){try{let n=e.sessionStorage.getItem(Wt);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 ur(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Wt,JSON.stringify(n))}catch(e){U(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function dr(){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 fr=m.createContext(null);fr.displayName=`DataRouter`;var pr=m.createContext(null);pr.displayName=`DataRouterState`;var mr=m.createContext(!1);function hr(){return m.useContext(mr)}var gr=m.createContext({isTransitioning:!1});gr.displayName=`ViewTransition`;var _r=m.createContext(new Map);_r.displayName=`Fetchers`;var vr=m.createContext(null);vr.displayName=`Await`;var yr=m.createContext(null);yr.displayName=`Navigation`;var br=m.createContext(null);br.displayName=`Location`;var xr=m.createContext({outlet:null,matches:[],isDataRoute:!1});xr.displayName=`Route`;var Sr=m.createContext(null);Sr.displayName=`RouteError`;var Cr=`REACT_ROUTER_ERROR`,wr=`REDIRECT`,Tr=`ROUTE_ERROR_RESPONSE`;function Er(e){if(e.startsWith(`${Cr}:${wr}:{`))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 Dr(e){if(e.startsWith(`${Cr}:${Tr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new vt(t.status,t.statusText,t.data)}catch{}}function Or(e,{relative:t}={}){H(kr(),`useHref() may be used only in the context of a component.`);let{basename:n,navigator:r}=m.useContext(yr),{hash:i,pathname:a,search:o}=Rr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ft([n,a])),r.createHref({pathname:s,search:o,hash:i})}function kr(){return m.useContext(br)!=null}function Ar(){return H(kr(),`useLocation() may be used only in the context of a component.`),m.useContext(br).location}var jr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Mr(e){m.useContext(yr).static||m.useLayoutEffect(e)}function Nr(){let{isDataRoute:e}=m.useContext(xr);return e?ni():Pr()}function Pr(){H(kr(),`useNavigate() may be used only in the context of a component.`);let e=m.useContext(fr),{basename:t,navigator:n}=m.useContext(yr),{matches:r}=m.useContext(xr),{pathname:i}=Ar(),a=JSON.stringify(lt(r)),o=m.useRef(!1);return Mr(()=>{o.current=!0}),m.useCallback((r,s={})=>{if(U(o.current,jr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ut(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ft([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Fr=m.createContext(null);function Ir(e){let t=m.useContext(xr).outlet;return m.useMemo(()=>t&&m.createElement(Fr.Provider,{value:e},t),[t,e])}function Lr(){let{matches:e}=m.useContext(xr);return e[e.length-1]?.params??{}}function Rr(e,{relative:t}={}){let{matches:n}=m.useContext(xr),{pathname:r}=Ar(),i=JSON.stringify(lt(n));return m.useMemo(()=>ut(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function zr(e,t,n){H(kr(),`useRoutes() may be used only in the context of a component.`);let{navigator:r}=m.useContext(yr),{matches:i}=m.useContext(xr),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||``;ii(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=Ar(),d;if(t){let e=typeof t==`string`?G(t):t;H(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 h=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});U(l||h!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),U(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.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 g=Kr(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ft([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ft([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?m.createElement(br.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},g):g}function Br(){let e=$r(),t=yt(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=m.createElement(m.Fragment,null,m.createElement(`p`,null,`💿 Hey developer 👋`),m.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,m.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,m.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),m.createElement(m.Fragment,null,m.createElement(`h2`,null,`Unexpected Application Error!`),m.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?m.createElement(`pre`,{style:i},n):null,o)}var Vr=m.createElement(Br,null),Hr=class extends m.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=Dr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:m.createElement(xr.Provider,{value:this.props.routeContext},m.createElement(Sr.Provider,{value:e,children:this.props.component}));return this.context?m.createElement(Wr,{error:e},t):t}};Hr.contextType=mr;var Ur=new WeakMap;function Wr({children:e,error:t}){let{basename:n}=m.useContext(yr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Er(t.digest);if(e){let r=Ur.get(t);if(r)throw r;let i=St(e.location,n),a=i.absoluteURL||i.to;if(On(a))throw Error(`Invalid redirect location`);if(xt&&!Ur.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Ur.set(t,n),n}return m.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Gr({routeContext:e,match:t,children:n}){let r=m.useContext(fr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(xr.Provider,{value:e},n)}function Kr(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);H(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:bt(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||Vr,o&&(s<0&&c===0?(ii(`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 h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?p:n.route.Component?m.createElement(n.route.Component,null):n.route.element?n.route.element:e,m.createElement(Gr,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?m.createElement(Hr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function qr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jr(e){let t=m.useContext(fr);return H(t,qr(e)),t}function Yr(e){let t=m.useContext(pr);return H(t,qr(e)),t}function Xr(e){let t=m.useContext(xr);return H(t,qr(e)),t}function Zr(e){let t=Xr(e),n=t.matches[t.matches.length-1];return H(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Qr(){return Zr(`useRouteId`)}function $r(){let e=m.useContext(Sr),t=Yr(`useRouteError`),n=Zr(`useRouteError`);return e===void 0?t.errors?.[n]:e}var ei=0;function ti(e){let{router:t,basename:n}=Jr(`useBlocker`),r=Yr(`useBlocker`),[i,a]=m.useState(``),o=m.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:K(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:K(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return m.useEffect(()=>{let e=String(++ei);return a(e),()=>t.deleteBlocker(e)},[t]),m.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):Ht}function ni(){let{router:e}=Jr(`useNavigate`),t=Zr(`useNavigate`),n=m.useRef(!1);return Mr(()=>{n.current=!0}),m.useCallback(async(r,i={})=>{U(n.current,jr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ri={};function ii(e,t,n){!t&&!ri[e]&&(ri[e]=!0,U(!1,n))}var ai={};function oi(e,t){!e&&!ai[t]&&(ai[t]=!0,console.warn(t))}var si=m.useOptimistic,ci=()=>void 0;function li(e){return si?si(e):[e,ci]}function ui(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&U(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:m.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&U(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&U(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var di=[`HydrateFallback`,`hydrateFallbackElement`],fi=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 pi({router:e,flushSync:t,onError:n,useTransitions:r}){r=hr()||r;let[i,a]=m.useState(e.state),[o,s]=li(i),[c,l]=m.useState(),[u,d]=m.useState({isTransitioning:!1}),[f,p]=m.useState(),[h,g]=m.useState(),[_,v]=m.useState(),y=m.useRef(new Map),b=m.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:bt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),oi(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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(oi(_==null||b,"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."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):m.startTransition(()=>{r===!0&&s(e=>mi(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(f?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n));return}h?(f?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,f,r,s,n]);m.useLayoutEffect(()=>e.subscribe(b),[e,b]),m.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new fi)},[u]),m.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):m.startTransition(()=>{r===!0&&s(e=>mi(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,f,e.window,r,s]),m.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,h,o.location,c]),m.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=m.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=m.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return m.createElement(m.Fragment,null,m.createElement(fr.Provider,{value:C},m.createElement(pr.Provider,{value:o},m.createElement(_r.Provider,{value:y.current},m.createElement(gr.Provider,{value:u},m.createElement(yi,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},m.createElement(hi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function mi(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 hi=m.memo(gi);function gi({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return zr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function _i({to:e,replace:t,state:n,relative:r}){H(kr(),` may be used only in the context of a component.`);let{static:i}=m.useContext(yr);U(!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:a}=m.useContext(xr),{pathname:o}=Ar(),s=Nr(),c=ut(e,lt(a),o,r===`path`),l=JSON.stringify(c);return m.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function vi(e){return Ir(e.context)}function yi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){H(!kr(),`You cannot render a inside another . You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=m.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=G(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:h}=n,g=m.useMemo(()=>{let e=K(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:h},navigationType:r}},[s,l,u,d,f,p,r,h]);return U(g!=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.`),g==null?null:m.createElement(yr.Provider,{value:c},m.createElement(br.Provider,{children:t,value:g}))}m.Component;var bi=`get`,xi=`application/x-www-form-urlencoded`;function Si(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ci(e){return Si(e)&&e.tagName.toLowerCase()===`button`}function wi(e){return Si(e)&&e.tagName.toLowerCase()===`form`}function Ti(e){return Si(e)&&e.tagName.toLowerCase()===`input`}function Ei(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Di(e,t){return e.button===0&&(!t||t===`_self`)&&!Ei(e)}function Oi(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function ki(e,t){let n=Oi(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ai=null;function ji(){if(Ai===null)try{new FormData(document.createElement(`form`),0),Ai=!1}catch{Ai=!0}return Ai}var Mi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ni(e){return e!=null&&!Mi.has(e)?(U(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${xi}"`),null):e}function Pi(e,t){let n,r,i,a,o;if(wi(e)){let o=e.getAttribute(`action`);r=o?K(o,t):null,n=e.getAttribute(`method`)||bi,i=Ni(e.getAttribute(`enctype`))||xi,a=new FormData(e)}else if(Ci(e)||Ti(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a