diff --git a/src/GreenHome.Api/Controllers/AdminController.cs b/src/GreenHome.Api/Controllers/AdminController.cs
index 975a570..eb9a682 100644
--- a/src/GreenHome.Api/Controllers/AdminController.cs
+++ b/src/GreenHome.Api/Controllers/AdminController.cs
@@ -254,6 +254,17 @@ public sealed class AdminController : ControllerBase
return Ok(result);
}
+ ///
+ /// Queues a one-shot reset: the device's next AddData response is the bare token "RST".
+ ///
+ [HttpPost("devices/{id:int}/request-reset")]
+ public async Task> RequestDeviceReset(int id, CancellationToken cancellationToken)
+ {
+ var currentAdminId = ((UserDto)HttpContext.Items["AdminUser"]!).Id;
+ var result = await _adminService.RequestDeviceResetAsync(id, currentAdminId, cancellationToken);
+ return Ok(result);
+ }
+
// ==================== Reports ====================
[HttpGet("reports/users")]
diff --git a/src/GreenHome.Api/Controllers/TelemetryController.cs b/src/GreenHome.Api/Controllers/TelemetryController.cs
index 10bf97c..afdca56 100644
--- a/src/GreenHome.Api/Controllers/TelemetryController.cs
+++ b/src/GreenHome.Api/Controllers/TelemetryController.cs
@@ -35,10 +35,15 @@ public class TelemetryController : ControllerBase
telementry.TimestampUtc = DateTime.UtcNow;
telementry.RelayStates = ParseRelayStates(Request.Query);
var id = await telemetryService.AddAsync(telementry, cancellationToken);
+ var deviceId = telementry.DeviceId;
+
+ // A queued reset is answered with the bare token "RST" and nothing else. The flag is
+ // consumed here, so every request after this one follows the normal routine again.
+ if (deviceId > 0 && await telemetryService.ConsumeResetRequestAsync(deviceId, cancellationToken))
+ return Ok("RST");
var parts = new List { $"ID:{id}" };
- var deviceId = telementry.DeviceId;
-
+
if (deviceId > 0)
{
// 1. Check alerts and power status
diff --git a/src/GreenHome.Api/Program.cs b/src/GreenHome.Api/Program.cs
index e2420c9..030e8b4 100644
--- a/src/GreenHome.Api/Program.cs
+++ b/src/GreenHome.Api/Program.cs
@@ -121,20 +121,10 @@ void ApplyMigrations(WebApplication app)
try
{
+ // Both providers now own a real migration set, so the schema only ever comes from
+ // Migrate(): SqlServer -> Data/Migrations/Migrations, Postgres -> Data/Migrations/Postgres.
var context = services.GetRequiredService();
- var provider = app.Configuration["Database:Provider"] ?? "SqlServer";
-
- if (provider == "Postgres")
- {
- // Soft-migration path: Postgres starts empty. EnsureCreated() is
- // idempotent — it builds the full schema from the model only when no
- // tables exist yet, and is a no-op once schema + data are in place.
- context.Database.EnsureCreated();
- }
- else
- {
- context.Database.Migrate();
- }
+ context.Database.Migrate();
}
catch (Exception ex)
{
diff --git a/src/GreenHome.Api/wwwroot/assets/AnalysisTab-C68ADY84.js b/src/GreenHome.Api/wwwroot/assets/AnalysisTab-Cx882vvN.js
similarity index 99%
rename from src/GreenHome.Api/wwwroot/assets/AnalysisTab-C68ADY84.js
rename to src/GreenHome.Api/wwwroot/assets/AnalysisTab-Cx882vvN.js
index 66018b4..0d6a951 100644
--- a/src/GreenHome.Api/wwwroot/assets/AnalysisTab-C68ADY84.js
+++ b/src/GreenHome.Api/wwwroot/assets/AnalysisTab-Cx882vvN.js
@@ -1,4 +1,4 @@
-import{e as br,g as Pt,j as W,r as Te,h as wr,L as Sr,E as Er,B as Cr,R as Ir,k as Tr,t as en}from"./index-BNRf8j5s.js";/**
+import{e as br,g as Pt,j as W,r as Te,h as wr,L as Sr,E as Er,B as Cr,R as Ir,k as Tr,t as en}from"./index-DJFTNPFV.js";/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
diff --git a/src/GreenHome.Api/wwwroot/assets/WeatherTab-CRtiHhGA.js b/src/GreenHome.Api/wwwroot/assets/WeatherTab-Ds0s1BtG.js
similarity index 97%
rename from src/GreenHome.Api/wwwroot/assets/WeatherTab-CRtiHhGA.js
rename to src/GreenHome.Api/wwwroot/assets/WeatherTab-Ds0s1BtG.js
index e63e848..3d8152d 100644
--- a/src/GreenHome.Api/wwwroot/assets/WeatherTab-CRtiHhGA.js
+++ b/src/GreenHome.Api/wwwroot/assets/WeatherTab-Ds0s1BtG.js
@@ -1 +1 @@
-import{j as s,T as g,P as N,S as b,W as v,r,i as m,f as T,a as W,b as E,Q as S,c as w,L as C,E as L,B as M,R as H,M as P,d as k}from"./index-BNRf8j5s.js";function O({weatherData:e,selectedDate:a}){return s.jsx("div",{className:"space-y-6",children:s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[s.jsx("div",{className:"bg-blue-600 p-5",children:s.jsxs("div",{className:"text-center text-white",children:[s.jsx("p",{className:"text-sm opacity-90 mb-1",children:"📅 وضعیت آب و هوای روز"}),s.jsx("p",{className:"text-xl font-bold",children:a})]})}),s.jsxs("div",{className:"p-4 grid grid-cols-2 gap-3",children:[s.jsx(g,{weatherData:e,isToday:!1}),s.jsx(N,{weatherData:e}),s.jsx(b,{weatherData:e}),s.jsx(v,{weatherData:e})]})]})})}function R({selectedDate:e}){const[a,t]=r.useState(null),[h,o]=r.useState(!1),[c,n]=r.useState(null),[f,d]=r.useState(null),[j,i]=r.useState("در حال دریافت..."),x=r.useCallback(async()=>{if(!a){o(!0),n(null);try{const l=m(e),[p,y]=await Promise.all([l?T():W(e),E(S,w)]);t(p),i(y)}catch(l){console.error("Error loading weather:",l),n("خطا در دریافت اطلاعات آب و هوا. لطفاً دوباره تلاش کنید."),i("کهک قم، ایران")}finally{o(!1)}}},[e,a]);if(r.useEffect(()=>{t(null),n(null),d(null),i("در حال دریافت...")},[e]),h)return s.jsx(C,{message:"در حال دریافت اطلاعات آب و هوا...",fullScreen:!1});if(c)return s.jsx(L,{message:c,action:s.jsx(M,{onClick:()=>{t(null),x()},variant:"primary",icon:H,children:"تلاش مجدد"})});if(!a)return x(),null;const u=m(e);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(P,{className:"w-5 h-5 text-sky-500"}),s.jsx("span",{className:"font-medium",children:j})]}),s.jsx("span",{className:"text-xs text-gray-400",children:u?"پیشبینی هواشناسی برای مدیریت گلخانه":"وضعیت آب و هوای روز انتخاب شده"})]}),u?s.jsx(k,{weatherData:a,expandedDayIndex:f,onDayToggle:d}):s.jsx(O,{weatherData:a,selectedDate:e})]})}export{R as WeatherTab};
+import{j as s,T as g,P as N,S as b,W as v,r,i as m,f as T,a as W,b as E,Q as S,c as w,L as C,E as L,B as M,R as H,M as P,d as k}from"./index-DJFTNPFV.js";function O({weatherData:e,selectedDate:a}){return s.jsx("div",{className:"space-y-6",children:s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[s.jsx("div",{className:"bg-blue-600 p-5",children:s.jsxs("div",{className:"text-center text-white",children:[s.jsx("p",{className:"text-sm opacity-90 mb-1",children:"📅 وضعیت آب و هوای روز"}),s.jsx("p",{className:"text-xl font-bold",children:a})]})}),s.jsxs("div",{className:"p-4 grid grid-cols-2 gap-3",children:[s.jsx(g,{weatherData:e,isToday:!1}),s.jsx(N,{weatherData:e}),s.jsx(b,{weatherData:e}),s.jsx(v,{weatherData:e})]})]})})}function R({selectedDate:e}){const[a,t]=r.useState(null),[h,o]=r.useState(!1),[c,n]=r.useState(null),[f,d]=r.useState(null),[j,i]=r.useState("در حال دریافت..."),x=r.useCallback(async()=>{if(!a){o(!0),n(null);try{const l=m(e),[p,y]=await Promise.all([l?T():W(e),E(S,w)]);t(p),i(y)}catch(l){console.error("Error loading weather:",l),n("خطا در دریافت اطلاعات آب و هوا. لطفاً دوباره تلاش کنید."),i("کهک قم، ایران")}finally{o(!1)}}},[e,a]);if(r.useEffect(()=>{t(null),n(null),d(null),i("در حال دریافت...")},[e]),h)return s.jsx(C,{message:"در حال دریافت اطلاعات آب و هوا...",fullScreen:!1});if(c)return s.jsx(L,{message:c,action:s.jsx(M,{onClick:()=>{t(null),x()},variant:"primary",icon:H,children:"تلاش مجدد"})});if(!a)return x(),null;const u=m(e);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(P,{className:"w-5 h-5 text-sky-500"}),s.jsx("span",{className:"font-medium",children:j})]}),s.jsx("span",{className:"text-xs text-gray-400",children:u?"پیشبینی هواشناسی برای مدیریت گلخانه":"وضعیت آب و هوای روز انتخاب شده"})]}),u?s.jsx(k,{weatherData:a,expandedDayIndex:f,onDayToggle:d}):s.jsx(O,{weatherData:a,selectedDate:e})]})}export{R as WeatherTab};
diff --git a/src/GreenHome.Api/wwwroot/assets/index-BNRf8j5s.js b/src/GreenHome.Api/wwwroot/assets/index-BNRf8j5s.js
deleted file mode 100644
index 2199c77..0000000
--- a/src/GreenHome.Api/wwwroot/assets/index-BNRf8j5s.js
+++ /dev/null
@@ -1,417 +0,0 @@
-var RS=Object.defineProperty;var OS=(n,t,a)=>t in n?RS(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var _e=(n,t,a)=>OS(n,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=a(l);fetch(l.href,o)}})();function ly(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sf={exports:{}},Al={};/**
- * @license React
- * react-jsx-runtime.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Bp;function LS(){if(Bp)return Al;Bp=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var d in l)d!=="key"&&(o[d]=l[d])}else o=l;return l=o.ref,{$$typeof:n,type:s,key:u,ref:l!==void 0?l:null,props:o}}return Al.Fragment=t,Al.jsx=a,Al.jsxs=a,Al}var Up;function HS(){return Up||(Up=1,sf.exports=LS()),sf.exports}var h=HS(),lf={exports:{}},be={};/**
- * @license React
- * react.production.js
- *
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var $p;function BS(){if($p)return be;$p=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function N(O,I,W){this.props=O,this.context=I,this.refs=S,this.updater=W||M}N.prototype.isReactComponent={},N.prototype.setState=function(O,I){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,I,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function C(){}C.prototype=N.prototype;function k(O,I,W){this.props=O,this.context=I,this.refs=S,this.updater=W||M}var E=k.prototype=new C;E.constructor=k,j(E,N.prototype),E.isPureReactComponent=!0;var A=Array.isArray;function z(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function X(O,I,W){var ee=W.ref;return{$$typeof:n,type:O,key:I,ref:ee!==void 0?ee:null,props:W}}function de(O,I){return X(O.type,I,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function ae(O){var I={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(W){return I[W]})}var Ee=/\/+/g;function Oe(O,I){return typeof O=="object"&&O!==null&&O.key!=null?ae(""+O.key):I.toString(36)}function he(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(z,z):(O.status="pending",O.then(function(I){O.status==="pending"&&(O.status="fulfilled",O.value=I)},function(I){O.status==="pending"&&(O.status="rejected",O.reason=I)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function U(O,I,W,ee,ne){var le=typeof O;(le==="undefined"||le==="boolean")&&(O=null);var ge=!1;if(O===null)ge=!0;else switch(le){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(O.$$typeof){case n:case t:ge=!0;break;case x:return ge=O._init,U(ge(O._payload),I,W,ee,ne)}}if(ge)return ne=ne(O),ge=ee===""?"."+Oe(O,0):ee,A(ne)?(W="",ge!=null&&(W=ge.replace(Ee,"$&/")+"/"),U(ne,I,W,"",function(kn){return kn})):ne!=null&&(Q(ne)&&(ne=de(ne,W+(ne.key==null||O&&O.key===ne.key?"":(""+ne.key).replace(Ee,"$&/")+"/")+ge)),I.push(ne)),1;ge=0;var rt=ee===""?".":ee+":";if(A(O))for(var ye=0;ye>>1,P=U[we];if(0>>1;wel(W,fe))ee
T)break;var q=D.transferSize,Z=D.initiatorType;q&&lp(Z)&&(D=D.responseEnd,y+=q*(D"u"?null:document;function bp(e,i,r){var c=fs;if(c&&typeof i=="string"&&i){var m=ln(i);m='link[rel="'+e+'"][href="'+m+'"]',typeof r=="string"&&(m+='[crossorigin="'+r+'"]'),xp.has(m)||(xp.add(m),e={rel:e,crossOrigin:r,href:i},c.querySelector(m)===null&&(i=c.createElement("link"),Nt(i,"link",e),bt(i),c.head.appendChild(i)))}}function mS(e){aa.D(e),bp("dns-prefetch",e,null)}function gS(e,i){aa.C(e,i),bp("preconnect",e,i)}function pS(e,i,r){aa.L(e,i,r);var c=fs;if(c&&e&&i){var m='link[rel="preload"][as="'+ln(i)+'"]';i==="image"&&r&&r.imageSrcSet?(m+='[imagesrcset="'+ln(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(m+='[imagesizes="'+ln(r.imageSizes)+'"]')):m+='[href="'+ln(e)+'"]';var p=m;switch(i){case"style":p=hs(e);break;case"script":p=ms(e)}mn.has(p)||(e=b({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:e,as:i},r),mn.set(p,e),c.querySelector(m)!==null||i==="style"&&c.querySelector(Nl(p))||i==="script"&&c.querySelector(Ml(p))||(i=c.createElement("link"),Nt(i,"link",e),bt(i),c.head.appendChild(i)))}}function xS(e,i){aa.m(e,i);var r=fs;if(r&&e){var c=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+ln(c)+'"][href="'+ln(e)+'"]',p=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ms(e)}if(!mn.has(p)&&(e=b({rel:"modulepreload",href:e},i),mn.set(p,e),r.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ml(p)))return}c=r.createElement("link"),Nt(c,"link",e),bt(c),r.head.appendChild(c)}}}function bS(e,i,r){aa.S(e,i,r);var c=fs;if(c&&e){var m=Oi(c).hoistableStyles,p=hs(e);i=i||"default";var y=m.get(p);if(!y){var T={loading:0,preload:null};if(y=c.querySelector(Nl(p)))T.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":i},r),(r=mn.get(p))&&Zd(e,r);var D=y=c.createElement("link");bt(D),Nt(D,"link",e),D._p=new Promise(function(V,q){D.onload=V,D.onerror=q}),D.addEventListener("load",function(){T.loading|=1}),D.addEventListener("error",function(){T.loading|=2}),T.loading|=4,po(y,i,c)}y={type:"stylesheet",instance:y,count:1,state:T},m.set(p,y)}}}function yS(e,i){aa.X(e,i);var r=fs;if(r&&e){var c=Oi(r).hoistableScripts,m=ms(e),p=c.get(m);p||(p=r.querySelector(Ml(m)),p||(e=b({src:e,async:!0},i),(i=mn.get(m))&&Kd(e,i),p=r.createElement("script"),bt(p),Nt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(m,p))}}function vS(e,i){aa.M(e,i);var r=fs;if(r&&e){var c=Oi(r).hoistableScripts,m=ms(e),p=c.get(m);p||(p=r.querySelector(Ml(m)),p||(e=b({src:e,async:!0,type:"module"},i),(i=mn.get(m))&&Kd(e,i),p=r.createElement("script"),bt(p),Nt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(m,p))}}function yp(e,i,r,c){var m=(m=le.current)?go(m):null;if(!m)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(i=hs(r.href),r=Oi(m).hoistableStyles,c=r.get(i),c||(c={type:"style",instance:null,count:0,state:null},r.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=hs(r.href);var p=Oi(m).hoistableStyles,y=p.get(e);if(y||(m=m.ownerDocument||m,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,y),(p=m.querySelector(Nl(e)))&&!p._p&&(y.instance=p,y.state.loading=5),mn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},mn.set(e,r),p||SS(m,e,r,y.state))),i&&c===null)throw Error(s(528,""));return y}if(i&&c!==null)throw Error(s(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ms(r),r=Oi(m).hoistableScripts,c=r.get(i),c||(c={type:"script",instance:null,count:0,state:null},r.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function hs(e){return'href="'+ln(e)+'"'}function Nl(e){return'link[rel="stylesheet"]['+e+"]"}function vp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function SS(e,i,r,c){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=e.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),Nt(i,"link",r),bt(i),e.head.appendChild(i))}function ms(e){return'[src="'+ln(e)+'"]'}function Ml(e){return"script[async]"+e}function Sp(e,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var c=e.querySelector('style[data-href~="'+ln(r.href)+'"]');if(c)return i.instance=c,bt(c),c;var m=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return c=(e.ownerDocument||e).createElement("style"),bt(c),Nt(c,"style",m),po(c,r.precedence,e),i.instance=c;case"stylesheet":m=hs(r.href);var p=e.querySelector(Nl(m));if(p)return i.state.loading|=4,i.instance=p,bt(p),p;c=vp(r),(m=mn.get(m))&&Zd(c,m),p=(e.ownerDocument||e).createElement("link"),bt(p);var y=p;return y._p=new Promise(function(T,D){y.onload=T,y.onerror=D}),Nt(p,"link",c),i.state.loading|=4,po(p,r.precedence,e),i.instance=p;case"script":return p=ms(r.src),(m=e.querySelector(Ml(p)))?(i.instance=m,bt(m),m):(c=r,(m=mn.get(p))&&(c=b({},r),Kd(c,m)),e=e.ownerDocument||e,m=e.createElement("script"),bt(m),Nt(m,"link",c),e.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,po(c,r.precedence,e));return i.instance}function po(e,i,r){for(var c=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,p=m,y=0;y title"):null)}function _S(e,i,r){if(r===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function jp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wS(e,i,r,c){if(r.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var m=hs(c.href),p=i.querySelector(Nl(m));if(p){i=p._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=bo.bind(e),i.then(e,e)),r.state.loading|=4,r.instance=p,bt(p);return}p=i.ownerDocument||i,c=vp(c),(m=mn.get(m))&&Zd(c,m),p=p.createElement("link"),bt(p);var y=p;y._p=new Promise(function(T,D){y.onload=T,y.onerror=D}),Nt(p,"link",c),r.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=bo.bind(e),i.addEventListener("load",r),i.addEventListener("error",r))}}var Pd=0;function jS(e,i){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0Pd?50:800)+i);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yo=null;function vo(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,i.forEach(NS,e),yo=null,bo.call(e))}function NS(e,i){if(!(i.state.loading&4)){var r=yo.get(e);if(r)var c=r.get(null);else{r=new Map,yo.set(e,r);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),rf.exports=GS(),rf.exports}var XS=qS();const IS=ly(XS);/**
- * react-router v7.18.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */var th=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,oy=/^[\\/]{2}/;function FS(n,t){return t+n.replace(/\\/g,"/")}var Qp="popstate";function Zp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function QS(n={}){function t(s,l){var g;let o=(g=l.state)==null?void 0:g.masked,{pathname:u,search:d,hash:f}=o||s.location;return Cf("",{pathname:u,search:d,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,l){return typeof l=="string"?l:Ni(l)}return KS(t,a,null,n)}function tt(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function xn(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZS(){return Math.random().toString(36).substring(2,10)}function Kp(n,t){return{usr:n.state,key:n.key,idx:t,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Cf(n,t,a=null,s,l){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof t=="string"?As(t):t,state:a,key:t&&t.key||s||ZS(),mask:l}}function Ni({pathname:n="/",search:t="",hash:a=""}){return t&&t!=="?"&&(n+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function As(n){let t={};if(n){let a=n.indexOf("#");a>=0&&(t.hash=n.substring(a),n=n.substring(0,a));let s=n.indexOf("?");s>=0&&(t.search=n.substring(s),n=n.substring(0,s)),n&&(t.pathname=n)}return t}function KS(n,t,a,s={}){let{window:l=document.defaultView,v5Compat:o=!1}=s,u=l.history,d="POP",f=null,g=x();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function x(){return(u.state||{idx:null}).idx}function b(){d="POP";let S=x(),N=S==null?null:S-g;g=S,f&&f({action:d,location:j.location,delta:N})}function v(S,N){d="PUSH";let C=Zp(S)?S:Cf(j.location,S,N);g=x()+1;let k=Kp(C,g),E=j.createHref(C.mask||C);try{u.pushState(k,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;l.location.assign(E)}o&&f&&f({action:d,location:j.location,delta:1})}function _(S,N){d="REPLACE";let C=Zp(S)?S:Cf(j.location,S,N);g=x();let k=Kp(C,g),E=j.createHref(C.mask||C);u.replaceState(k,"",E),o&&f&&f({action:d,location:j.location,delta:0})}function M(S){return PS(l,S)}let j={get action(){return d},get location(){return n(l,u)},listen(S){if(f)throw new Error("A history only accepts one active listener");return l.addEventListener(Qp,b),f=S,()=>{l.removeEventListener(Qp,b),f=null}},createHref(S){return t(l,S)},createURL:M,encodeLocation(S){let N=M(S);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:_,go(S){return u.go(S)}};return j}function PS(n,t,a=!1){let s="http://localhost";n&&(s=n.location.origin!=="null"?n.location.origin:n.location.href),tt(s,"No window.location.(origin|href) available to create URL");let l=typeof t=="string"?t:Ni(t);return l=l.replace(/ $/,"%20"),!a&&oy.test(l)&&(l=s+l),new URL(l,s)}function cy(n,t,a="/"){return WS(n,t,a,!1)}function WS(n,t,a,s,l){let o=typeof t=="string"?As(t):t,u=da(o.pathname||"/",a);if(u==null)return null;let d=JS(n),f=null,g=u_(u);for(let x=0;f==null&&x{let x={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&f)return;tt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let b=Nn([s,x.relativePath]),v=a.concat(x);u.children&&u.children.length>0&&(tt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),uy(u.children,t,v,b,f)),!(u.path==null&&!u.index)&&t.push({path:b,score:r_(b,u.index),routesMeta:v.map((_,M)=>{let[j,S]=hy(_.relativePath,_.caseSensitive,M===v.length-1);return{..._,matcher:j,compiledParams:S}})})};return n.forEach((u,d)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))o(u,d);else for(let g of dy(u.path))o(u,d,!0,g)}),t}function dy(n){let t=n.split("/");if(t.length===0)return[];let[a,...s]=t,l=a.endsWith("?"),o=a.replace(/\?$/,"");if(s.length===0)return l?[o,""]:[o];let u=dy(s.join("/")),d=[];return d.push(...u.map(f=>f===""?o:[o,f].join("/"))),l&&d.push(...u),d.map(f=>n.startsWith("/")&&f===""?"/":f)}function e_(n){n.sort((t,a)=>t.score!==a.score?a.score-t.score:o_(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var t_=/^:[\w-]+$/,n_=3,a_=2,i_=1,s_=10,l_=-2,Pp=n=>n==="*";function r_(n,t){let a=n.split("/"),s=a.length;return a.some(Pp)&&(s+=l_),t&&(s+=a_),a.filter(l=>!Pp(l)).reduce((l,o)=>l+(t_.test(o)?n_:o===""?i_:s_),s)}function o_(n,t){return n.length===t.length&&n.slice(0,-1).every((s,l)=>s===t[l])?n[n.length-1]-t[t.length-1]:0}function c_(n,t,a=!1){let{routesMeta:s}=n,l={},o="/",u=[];for(let d=0;d{if(x==="*"){let M=d[v]||"";u=js(o.slice(0,o.length-M.length),1)}const _=d[v];return b&&!_?g[x]=void 0:g[x]=(_||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:u,pattern:n}}function hy(n,t=!1,a=!0){xn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,f,g,x)=>{if(s.push({paramName:d,isOptional:f!=null}),f){let b=x.charAt(g+u.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(s.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),s]}function u_(n){try{return n.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),n}}function da(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=n.charAt(a);return s&&s!=="/"?null:n.slice(a)||"/"}function d_(n,t="/"){let{pathname:a,search:s="",hash:l=""}=typeof n=="string"?As(n):n,o;return a?(a=my(a),a.startsWith("/")||a.startsWith("\\")?o=Wp(a.substring(1),"/"):o=Wp(a,t)):o=t,{pathname:o,search:m_(s),hash:g_(l)}}function Wp(n,t){let a=js(t).split("/");return n.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function df(n,t,a,s){return`Cannot include a '${n}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function f_(n){return n.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function nh(n){let t=f_(n);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function Cc(n,t,a,s=!1){let l;typeof n=="string"?l=As(n):(l={...n},tt(!l.pathname||!l.pathname.includes("?"),df("?","pathname","search",l)),tt(!l.pathname||!l.pathname.includes("#"),df("#","pathname","hash",l)),tt(!l.search||!l.search.includes("#"),df("#","search","hash",l)));let o=n===""||l.pathname==="",u=o?"/":l.pathname,d;if(u==null)d=a;else{let b=t.length-1;if(!s&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),b-=1;l.pathname=v.join("/")}d=b>=0?t[b]:"/"}let f=d_(l,d),g=u&&u!=="/"&&u.endsWith("/"),x=(o||u===".")&&a.endsWith("/");return!f.pathname.endsWith("/")&&(g||x)&&(f.pathname+="/"),f}var my=n=>n.replace(/[\\/]{2,}/g,"/"),Nn=n=>my(n.join("/"));function js(n,t=0){let a=n.length;for(;a>t&&n.charCodeAt(a-1)===47;)a--;return a===n.length?n:n.slice(0,a)}var h_=n=>js(n).replace(/^\/*/,"/"),m_=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,g_=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,p_=class{constructor(n,t,a,s=!1){this.status=n,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function x_(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function b_(n){let t=n.map(a=>a.route.path).filter(Boolean);return Nn(t)||"/"}var gy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function py(n,t){let a=n;if(typeof a!="string"||!th.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,l=!1;if(gy)try{let o=new URL(window.location.href),u=oy.test(a)?new URL(FS(a,o.protocol)):new URL(a),d=da(u.pathname,t);u.origin===o.origin&&d!=null?a=d+u.search+u.hash:l=!0}catch{xn(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jp=new URL("http://localhost");function ah(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),Jp)}catch{return Jp}}function ff(n,t){return n.origin===t.origin&&(n.origin!=="null"||n.protocol===t.protocol&&n.host===t.host)}function y_(n,t){if(n.startsWith("//"))return!0;let a=t.protocol.toLowerCase();return n.toLowerCase().startsWith(a)?t.host===""||n.slice(a.length).startsWith("//"):!1}function ih(n,t,a,s){let l=null;try{l=n==null?null:new URL(n,a)}catch{}let o=new URL(t,a),u=l!=null&&!ff(l,a),d=!ff(o,a);if(s==="reject"){if(u||d)throw new Error("External navigation is not allowed")}else if(d&&(l==null||!y_(n,l)||!ff(l,o)))throw new Error("External navigation is not allowed")}var xy=["POST","PUT","PATCH","DELETE"];new Set(xy);var v_=["GET",...xy];new Set(v_);var S_=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function __(n){try{return S_.includes(new URL(n).protocol)}catch{return!1}}var Ds=w.createContext(null);Ds.displayName="DataRouter";var Ec=w.createContext(null);Ec.displayName="DataRouterState";var by=w.createContext(!1);function w_(){return w.useContext(by)}var yy=w.createContext({isTransitioning:!1});yy.displayName="ViewTransition";var j_=w.createContext(new Map);j_.displayName="Fetchers";var N_=w.createContext(null);N_.displayName="Await";var tn=w.createContext(null);tn.displayName="Navigation";var ir=w.createContext(null);ir.displayName="Location";var Bn=w.createContext({outlet:null,matches:[],isDataRoute:!1});Bn.displayName="Route";var sh=w.createContext(null);sh.displayName="RouteError";var vy="REACT_ROUTER_ERROR",M_="REDIRECT",T_="ROUTE_ERROR_RESPONSE";function k_(n){if(n.startsWith(`${vy}:${M_}:{`))try{let t=JSON.parse(n.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 C_(n){if(n.startsWith(`${vy}:${T_}:{`))try{let t=JSON.parse(n.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new p_(t.status,t.statusText,t.data)}catch{}}function E_(n,{relative:t}={}){tt(zs(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:s}=w.useContext(tn),{hash:l,pathname:o,search:u}=sr(n,{relative:t}),d=o;return a!=="/"&&(d=o==="/"?a:Nn([a,o])),s.createHref({pathname:d,search:u,hash:l})}function zs(){return w.useContext(ir)!=null}function nn(){return tt(zs(),"useLocation() may be used only in the context of a component."),w.useContext(ir).location}var Sy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _y(n){w.useContext(tn).static||w.useLayoutEffect(n)}function Ac(){let{isDataRoute:n}=w.useContext(Bn);return n?G_():A_()}function A_(){tt(zs(),"useNavigate() may be used only in the context of a component.");let n=w.useContext(Ds),{basename:t,navigator:a}=w.useContext(tn),{matches:s}=w.useContext(Bn),{pathname:l}=nn(),o=JSON.stringify(nh(s)),u=w.useRef(!1);return _y(()=>{u.current=!0}),w.useCallback((f,g={})=>{if(xn(u.current,Sy),!u.current)return;if(typeof f=="number"){a.go(f);return}let x=Cc(f,JSON.parse(o),l,g.relative==="path");n==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Nn([t,x.pathname])),ih(typeof f=="string"?f:Ni(f),a.createHref(x),ah(a),"reject"),(g.replace?a.replace:a.push)(x,g.state,g)},[t,a,o,l,n])}w.createContext(null);function sr(n,{relative:t}={}){let{matches:a}=w.useContext(Bn),{pathname:s}=nn(),l=JSON.stringify(nh(a));return w.useMemo(()=>Cc(n,JSON.parse(l),s,t==="path"),[n,l,s,t])}function D_(n,t){return wy(n,t)}function wy(n,t,a){var S;tt(zs(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=w.useContext(tn),{matches:l}=w.useContext(Bn),o=l[l.length-1],u=o?o.params:{},d=o?o.pathname:"/",f=o?o.pathnameBase:"/",g=o&&o.route;{let N=g&&g.path||"";Ny(d,!g||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (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 x=nn(),b;if(t){let N=typeof t=="string"?As(t):t;tt(f==="/"||((S=N.pathname)==null?void 0:S.startsWith(f)),`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 "${f}" but pathname "${N.pathname}" was given in the \`location\` prop.`),b=N}else b=x;let v=b.pathname||"/",_=v;if(f!=="/"){let N=f.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(N.length).join("/")}let M=a&&a.state.matches.length?a.state.matches.map(N=>Object.assign(N,{route:a.manifest[N.route.id]||N.route})):cy(n,{pathname:_});xn(g||M!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),xn(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 j=H_(M&&M.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:Nn([f,s.encodeLocation?s.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?f:Nn([f,s.encodeLocation?s.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,a);return t&&j?w.createElement(ir.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},j):j}function z_(){let n=Y_(),t=x_(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),a?w.createElement("pre",{style:l},a):null,u)}var R_=w.createElement(z_,null),jy=class extends w.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,t){return t.location!==n.location||t.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:t.error,location:t.location,revalidation:n.revalidation||t.revalidation}}componentDidCatch(n,t){this.props.onError?this.props.onError(n,t):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const a=C_(n.digest);a&&(n=a)}let t=n!==void 0?w.createElement(Bn.Provider,{value:this.props.routeContext},w.createElement(sh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?w.createElement(O_,{error:n},t):t}};jy.contextType=by;var hf=new WeakMap;function O_({children:n,error:t}){let{basename:a,navigator:s}=w.useContext(tn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let l=k_(t.digest);if(l){let o=hf.get(t);if(o)throw o;let u=py(l.location,a),d=u.absoluteURL||u.to;if(ih(l.location,d,ah(s),"allow-explicit"),__(d))throw new Error("Invalid redirect location");if(gy&&!hf.get(t))if(u.isExternal||l.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw hf.set(t,f),f}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return n}function L_({routeContext:n,match:t,children:a}){let s=w.useContext(Ds);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Bn.Provider,{value:n},a)}function H_(n,t=[],a){let s=a==null?void 0:a.state;if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let l=n,o=s==null?void 0:s.errors;if(o!=null){let x=l.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,x+1))}let u=!1,d=-1;if(a&&s){u=s.renderFallback;for(let x=0;x=0?l=l.slice(0,d+1):l=[l[0]];break}}}}let f=a==null?void 0:a.onError,g=s&&f?(x,b)=>{var v,_;f(x,{location:s.location,params:((_=(v=s.matches)==null?void 0:v[0])==null?void 0:_.params)??{},pattern:b_(s.matches),errorInfo:b})}:void 0;return l.reduceRight((x,b,v)=>{let _,M=!1,j=null,S=null;s&&(_=o&&b.route.id?o[b.route.id]:void 0,j=b.route.errorElement||R_,u&&(d<0&&v===0?(Ny("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),M=!0,S=null):d===v&&(M=!0,S=b.route.hydrateFallbackElement||null)));let N=t.concat(l.slice(0,v+1)),C=()=>{let k;return _?k=j:M?k=S:b.route.Component?k=w.createElement(b.route.Component,null):b.route.element?k=b.route.element:k=x,w.createElement(L_,{match:b,routeContext:{outlet:x,matches:N,isDataRoute:s!=null},children:k})};return s&&(b.route.ErrorBoundary||b.route.errorElement||v===0)?w.createElement(jy,{location:s.location,revalidation:s.revalidation,component:j,error:_,children:C(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:g}):C()},null)}function lh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function B_(n){let t=w.useContext(Ds);return tt(t,lh(n)),t}function U_(n){let t=w.useContext(Ec);return tt(t,lh(n)),t}function $_(n){let t=w.useContext(Bn);return tt(t,lh(n)),t}function rh(n){let t=$_(n),a=t.matches[t.matches.length-1];return tt(a.route.id,`${n} can only be used on routes that contain a unique "id"`),a.route.id}function V_(){return rh("useRouteId")}function Y_(){var s;let n=w.useContext(sh),t=U_("useRouteError"),a=rh("useRouteError");return n!==void 0?n:(s=t.errors)==null?void 0:s[a]}function G_(){let{router:n}=B_("useNavigate"),t=rh("useNavigate"),a=w.useRef(!1);return _y(()=>{a.current=!0}),w.useCallback(async(l,o={})=>{xn(a.current,Sy),a.current&&(typeof l=="number"?await n.navigate(l):await n.navigate(l,{fromRouteId:t,...o}))},[n,t])}var ex={};function Ny(n,t,a){!t&&!ex[n]&&(ex[n]=!0,xn(!1,a))}w.memo(q_);function q_({routes:n,manifest:t,future:a,state:s,isStatic:l,onError:o}){return wy(n,void 0,{manifest:t,state:s,isStatic:l,onError:o})}function My({to:n,replace:t,state:a,relative:s}){tt(zs()," may be used only in the context of a component.");let{static:l,navigator:o}=w.useContext(tn);xn(!l," 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:u}=w.useContext(Bn),{pathname:d}=nn(),f=Ac(),g=Cc(n,nh(u),d,s==="path");ih(typeof n=="string"?n:Ni(n),o.createHref(g),ah(o),"reject");let x=JSON.stringify(g);return w.useEffect(()=>{f(JSON.parse(x),{replace:t,state:a,relative:s})},[f,x,s,t,a]),null}function Ut(n){tt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function X_({basename:n="/",children:t=null,location:a,navigationType:s="POP",navigator:l,static:o=!1,useTransitions:u}){tt(!zs(),"You cannot render a inside another . You should never have more than one in your app.");let d=n.replace(/^\/*/,"/"),f=w.useMemo(()=>({basename:d,navigator:l,static:o,useTransitions:u,future:{}}),[d,l,o,u]);typeof a=="string"&&(a=As(a));let{pathname:g="/",search:x="",hash:b="",state:v=null,key:_="default",mask:M}=a,j=w.useMemo(()=>{let S=da(g,d);return S==null?null:{location:{pathname:S,search:x,hash:b,state:v,key:_,mask:M},navigationType:s}},[d,g,x,b,v,_,s,M]);return xn(j!=null,` is not able to match the URL "${g}${x}${b}" because it does not start with the basename, so the won't render anything.`),j==null?null:w.createElement(tn.Provider,{value:f},w.createElement(ir.Provider,{children:t,value:j}))}function I_({children:n,location:t}){return D_(Ef(n),t)}function Ef(n,t=[]){let a=[];return w.Children.forEach(n,(s,l)=>{if(!w.isValidElement(s))return;let o=[...t,l];if(s.type===w.Fragment){a.push.apply(a,Ef(s.props.children,o));return}tt(s.type===Ut,`[${typeof s.type=="string"?s.type:s.type.name}] is not a component. All component children of must be a or `),tt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Ef(s.props.children,o)),a.push(u)}),a}var Wo="get",Jo="application/x-www-form-urlencoded";function Dc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function F_(n){return Dc(n)&&n.tagName.toLowerCase()==="button"}function Q_(n){return Dc(n)&&n.tagName.toLowerCase()==="form"}function Z_(n){return Dc(n)&&n.tagName.toLowerCase()==="input"}function K_(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function P_(n,t){return n.button===0&&(!t||t==="_self")&&!K_(n)}function Af(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((t,a)=>{let s=n[a];return t.concat(Array.isArray(s)?s.map(l=>[a,l]):[[a,s]])},[]))}function W_(n,t){let a=Af(n);return t&&t.forEach((s,l)=>{a.has(l)||t.getAll(l).forEach(o=>{a.append(l,o)})}),a}var ko=null;function J_(){if(ko===null)try{new FormData(document.createElement("form"),0),ko=!1}catch{ko=!0}return ko}var ew=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mf(n){return n!=null&&!ew.has(n)?(xn(!1,`"${n}" is not a valid \`encType\` for \`