diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ca6db6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +core/engine/atrium/static/assets/*.js whitespace=-trailing-space diff --git a/Makefile b/Makefile index 5455896..8d9302b 100644 --- a/Makefile +++ b/Makefile @@ -219,7 +219,7 @@ push-check: # proxies the extension's data routes; a production build has no vite, so a canvas that has # only ever been driven under `npm run dev` has never been driven at all. canvas-build: - cd core/ui/canvas && npx vite build + cd core/ui/canvas && npm run build:package canvas-host: canvas-build uv run uvicorn core.engine.api.canvas_host:app --host 127.0.0.1 --port 5173 diff --git a/core/engine/api/canvas_host.py b/core/engine/api/canvas_host.py index 4559e81..69f7187 100644 --- a/core/engine/api/canvas_host.py +++ b/core/engine/api/canvas_host.py @@ -56,13 +56,36 @@ from fastapi.responses import FileResponse, Response from fastapi.staticfiles import StaticFiles +from core.engine.atrium import static_dir as atrium_static_dir + REPO = Path(__file__).resolve().parents[3] -CANVAS_DIST = REPO / "core" / "ui" / "canvas" / "dist" +CANVAS_DIST = atrium_static_dir() EXTENSIONS = REPO / "extensions" -#: Prefixes the HOST itself routes. An extension may not shadow one. -#: Deliberately tiny — this server exists to serve the canvas and forward, nothing else. -KERNEL_PREFIXES: tuple[str, ...] = ("/__host_health",) +#: Public Core API prefixes used by the production Atrium bundle. The host +#: forwards these server-side to the configured Core API so every browser call +#: remains same-origin. ``/v1`` is the Intelligence OS boundary; the remaining +#: paths preserve the broader Canvas surface during the migration to Atrium. +CORE_API_PREFIXES: tuple[str, ...] = ( + "/v1", + "/auth", + "/health", + "/canvas", + "/proactive", + "/briefings", + "/portal", + "/product", + "/recommendations", + "/decisions", + "/foresight", + "/atc", + "/sentinels", + "/tasks", + "/extension-invocations", +) + +#: Prefixes the host or Core itself routes. An extension may not shadow one. +KERNEL_PREFIXES: tuple[str, ...] = ("/__host_health", *CORE_API_PREFIXES) class ProxyCollisionError(Exception): @@ -178,6 +201,9 @@ def create_app( dist: Path = CANVAS_DIST, extensions_root: Path = EXTENSIONS, env: dict[str, str] | None = None, + core_api_url: str | None = None, + access_token: str | None = None, + transport: httpx.AsyncBaseTransport | None = None, ) -> FastAPI: env = dict(os.environ) if env is None else env @@ -188,6 +214,7 @@ def create_app( app = FastAPI(title="ACE Canvas Host", docs_url=None, redoc_url=None) app.state.proxies = proxies app.state.dist = dist + app.state.core_api_url = core_api_url @app.get("/__host_health") async def host_health() -> dict[str, Any]: @@ -197,22 +224,33 @@ async def host_health() -> dict[str, Any]: return { "ok": True, "canvas_built": dist.is_dir(), + "core_api_configured": core_api_url is not None, "proxies": proxies, } - client = httpx.AsyncClient(timeout=httpx.Timeout(30.0, connect=5.0), follow_redirects=False) + client = httpx.AsyncClient( + timeout=httpx.Timeout(30.0, connect=5.0), + follow_redirects=False, + transport=transport, + ) @app.on_event("shutdown") async def _close() -> None: await client.aclose() - def _install(prefix: str, target: str) -> None: + def _install(prefix: str, target: str, *, unavailable: str = "data plane unreachable") -> None: @app.api_route( f"{prefix}/{{path:path}}", methods=["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], include_in_schema=False, ) - async def _proxy(request: Request, path: str, _t: str = target, _p: str = prefix) -> Response: + async def _proxy( + request: Request, + path: str, + _t: str = target, + _p: str = prefix, + _unavailable: str = unavailable, + ) -> Response: url = httpx.URL(f"{_t}{_p}/{path}").copy_with(query=request.url.query.encode()) headers = {k: v for k, v in request.headers.items() if k.lower() not in _DROP} try: @@ -222,7 +260,7 @@ async def _proxy(request: Request, path: str, _t: str = target, _p: str = prefix # 500 — is how "the data plane is down" gets misdiagnosed as "the canvas is # broken", which is the entire reason the proxy exists rather than CORS. return Response( - content=json.dumps({"error": "data plane unreachable", "target": _t, "detail": str(exc)}), + content=json.dumps({"error": _unavailable, "target": _t, "detail": str(exc)}), status_code=502, media_type="application/json", ) @@ -232,6 +270,21 @@ async def _proxy(request: Request, path: str, _t: str = target, _p: str = prefix headers={k: v for k, v in upstream.headers.items() if k.lower() not in _DROP}, ) + # A packaged browser bundle cannot embed a user's API key. The local host + # instead returns the already-issued CLI bearer token to this same-origin + # page. It is kept in memory by the page and never written to browser + # storage. With no token configured, /auth is forwarded normally. + if access_token is not None: + + @app.post("/auth/token", include_in_schema=False) + async def atrium_token() -> dict[str, str]: + return {"token": access_token} + + if core_api_url is not None: + target = core_api_url.rstrip("/") + for prefix in CORE_API_PREFIXES: + _install(prefix, target, unavailable="Core API unreachable") + for prefix, target in proxies.items(): _install(prefix, target) diff --git a/core/engine/atrium/__init__.py b/core/engine/atrium/__init__.py new file mode 100644 index 0000000..d0c77c0 --- /dev/null +++ b/core/engine/atrium/__init__.py @@ -0,0 +1,27 @@ +"""Packaged Atrium application assets. + +Atrium is the domain-neutral command center for an ACE installation. Its +production bundle ships with ``ace-core`` so a user can open the application +without a JavaScript toolchain or a source checkout. +""" + +from __future__ import annotations + +from importlib.resources import files +from pathlib import Path + + +def static_dir() -> Path: + """Return the installed filesystem directory containing the Atrium bundle.""" + + resource = files(__package__).joinpath("static") + # Wheels are installed as ordinary files by supported Python installers. + # Serving an SPA requires a filesystem path, so deliberately fail clearly + # for exotic zip-import loaders instead of extracting mutable assets. + try: + return Path(resource) + except TypeError as exc: # pragma: no cover - standard wheel installs are filesystem-backed + raise RuntimeError("Atrium assets require a filesystem-backed ace-core installation") from exc + + +__all__ = ["static_dir"] diff --git a/core/engine/atrium/static/assets/index-BaLqTrAb.js b/core/engine/atrium/static/assets/index-BaLqTrAb.js new file mode 100644 index 0000000..fe94545 --- /dev/null +++ b/core/engine/atrium/static/assets/index-BaLqTrAb.js @@ -0,0 +1,787 @@ +var CW=Object.defineProperty;var jW=(e,t,n)=>t in e?CW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var v=(e,t,n)=>jW(e,typeof t!="symbol"?t+"":t,n);function _W(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function La(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xA={exports:{}},Px={},vA={exports:{}},Ve={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ef=Symbol.for("react.element"),EW=Symbol.for("react.portal"),PW=Symbol.for("react.fragment"),IW=Symbol.for("react.strict_mode"),TW=Symbol.for("react.profiler"),AW=Symbol.for("react.provider"),MW=Symbol.for("react.context"),RW=Symbol.for("react.forward_ref"),NW=Symbol.for("react.suspense"),DW=Symbol.for("react.memo"),OW=Symbol.for("react.lazy"),nI=Symbol.iterator;function LW(e){return e===null||typeof e!="object"?null:(e=nI&&e[nI]||e["@@iterator"],typeof e=="function"?e:null)}var bA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wA=Object.assign,SA={};function ou(e,t,n){this.props=e,this.context=t,this.refs=SA,this.updater=n||bA}ou.prototype.isReactComponent={};ou.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ou.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kA(){}kA.prototype=ou.prototype;function _C(e,t,n){this.props=e,this.context=t,this.refs=SA,this.updater=n||bA}var EC=_C.prototype=new kA;EC.constructor=_C;wA(EC,ou.prototype);EC.isPureReactComponent=!0;var rI=Array.isArray,CA=Object.prototype.hasOwnProperty,PC={current:null},jA={key:!0,ref:!0,__self:!0,__source:!0};function _A(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)CA.call(t,r)&&!jA.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,W=L[J];if(0>>1;Js(Q,H))Ees(te,Q)?(L[J]=te,L[Ee]=H,J=Ee):(L[J]=Q,L[ke]=H,J=ke);else if(Ees(te,H))L[J]=te,L[Ee]=H,J=Ee;else break e}}return V}function s(L,V){var H=L.sortIndex-V.sortIndex;return H!==0?H:L.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,h=null,p=3,g=!1,x=!1,m=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(L){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=L)r(d),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(d)}}function C(L){if(m=!1,S(L),!x)if(n(c)!==null)x=!0,F(E);else{var V=n(d);V!==null&&U(C,V.startTime-L)}}function E(L,V){x=!1,m&&(m=!1,y(_),_=-1),g=!0;var H=p;try{for(S(V),h=n(c);h!==null&&(!(h.expirationTime>V)||L&&!R());){var J=h.callback;if(typeof J=="function"){h.callback=null,p=h.priorityLevel;var W=J(h.expirationTime<=V);V=e.unstable_now(),typeof W=="function"?h.callback=W:h===n(c)&&r(c),S(V)}else r(c);h=n(c)}if(h!==null)var ne=!0;else{var ke=n(d);ke!==null&&U(C,ke.startTime-V),ne=!1}return ne}finally{h=null,p=H,g=!1}}var P=!1,j=null,_=-1,I=5,T=-1;function R(){return!(e.unstable_now()-TL||125J?(L.sortIndex=H,t(d,L),n(c)===null&&L===n(d)&&(m?(y(_),_=-1):m=!0,U(C,H-J))):(L.sortIndex=W,t(c,L),x||g||(x=!0,F(E))),L},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(L){var V=p;return function(){var H=p;p=V;try{return L.apply(this,arguments)}finally{p=H}}}})(MA);AA.exports=MA;var YW=AA.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ZW=f,Xr=YW;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zS=Object.prototype.hasOwnProperty,XW=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,iI={},oI={};function qW(e){return zS.call(oI,e)?!0:zS.call(iI,e)?!1:XW.test(e)?oI[e]=!0:(iI[e]=!0,!1)}function QW(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JW(e,t,n,r){if(t===null||typeof t>"u"||QW(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ar(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var An={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){An[e]=new ar(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];An[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){An[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){An[e]=new ar(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){An[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){An[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){An[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){An[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){An[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var TC=/[\-:]([a-z])/g;function AC(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(TC,AC);An[t]=new ar(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(TC,AC);An[t]=new ar(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(TC,AC);An[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){An[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});An.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){An[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function MC(e,t,n,r){var s=An.hasOwnProperty(t)?An[t]:null;(s!==null?s.type!==0:r||!(2l||s[o]!==i[l]){var c=` +`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Vv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?mh(e):""}function eK(e){switch(e.tag){case 5:return mh(e.type);case 16:return mh("Lazy");case 13:return mh("Suspense");case 19:return mh("SuspenseList");case 0:case 2:case 15:return e=Wv(e.type,!1),e;case 11:return e=Wv(e.type.render,!1),e;case 1:return e=Wv(e.type,!0),e;default:return""}}function VS(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zc:return"Fragment";case Fc:return"Portal";case BS:return"Profiler";case RC:return"StrictMode";case US:return"Suspense";case HS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case DA:return(e.displayName||"Context")+".Consumer";case NA:return(e._context.displayName||"Context")+".Provider";case NC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case DC:return t=e.displayName||null,t!==null?t:VS(e.type)||"Memo";case Jo:t=e._payload,e=e._init;try{return VS(e(t))}catch{}}return null}function tK(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return VS(t);case 8:return t===RC?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _a(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function LA(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nK(e){var t=LA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pg(e){e._valueTracker||(e._valueTracker=nK(e))}function $A(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=LA(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function D0(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function WS(e,t){var n=t.checked;return Ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function lI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_a(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function FA(e,t){t=t.checked,t!=null&&MC(e,"checked",t,!1)}function KS(e,t){FA(e,t);var n=_a(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?GS(e,t.type,n):t.hasOwnProperty("defaultValue")&&GS(e,t.type,_a(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cI(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function GS(e,t,n){(t!=="number"||D0(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yh=Array.isArray;function ad(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=fg.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cp(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rK=["Webkit","ms","Moz","O"];Object.keys(Bh).forEach(function(e){rK.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bh[t]=Bh[e]})});function HA(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bh.hasOwnProperty(e)&&Bh[e]?(""+t).trim():t+"px"}function VA(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=HA(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var sK=Ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function XS(e,t){if(t){if(sK[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function qS(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var QS=null;function OC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var JS=null,ld=null,cd=null;function hI(e){if(e=rf(e)){if(typeof JS!="function")throw Error(q(280));var t=e.stateNode;t&&(t=Rx(t),JS(e.stateNode,e.type,t))}}function WA(e){ld?cd?cd.push(e):cd=[e]:ld=e}function KA(){if(ld){var e=ld,t=cd;if(cd=ld=null,hI(e),t)for(e=0;e>>=0,e===0?32:31-(gK(e)/mK|0)|0}var gg=64,mg=4194304;function xh(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function F0(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=xh(l):(i&=o,i!==0&&(r=xh(i)))}else o=n&~s,o!==0?r=xh(o):i!==0&&(r=xh(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function tf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ks(t),e[t]=n}function bK(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Hh),wI=" ",SI=!1;function hM(e,t){switch(e){case"keyup":return YK.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pM(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bc=!1;function XK(e,t){switch(e){case"compositionend":return pM(t);case"keypress":return t.which!==32?null:(SI=!0,wI);case"textInput":return e=t.data,e===wI&&SI?null:e;default:return null}}function qK(e,t){if(Bc)return e==="compositionend"||!VC&&hM(e,t)?(e=dM(),Am=BC=ia=null,Bc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_I(n)}}function yM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xM(){for(var e=window,t=D0();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=D0(e.document)}return t}function WC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function oG(e){var t=xM(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yM(n.ownerDocument.documentElement,n)){if(r!==null&&WC(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=EI(n,i);var o=EI(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Uc=null,i2=null,Wh=null,o2=!1;function PI(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;o2||Uc==null||Uc!==D0(r)||(r=Uc,"selectionStart"in r&&WC(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Wh&&gp(Wh,r)||(Wh=r,r=U0(i2,"onSelect"),0Wc||(e.current=h2[Wc],h2[Wc]=null,Wc--)}function ht(e,t){Wc++,h2[Wc]=e.current,e.current=t}var Ea={},Zn=Fa(Ea),jr=Fa(!1),Nl=Ea;function Id(e,t){var n=e.type.contextTypes;if(!n)return Ea;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function _r(e){return e=e.childContextTypes,e!=null}function V0(){wt(jr),wt(Zn)}function DI(e,t,n){if(Zn.current!==Ea)throw Error(q(168));ht(Zn,t),ht(jr,n)}function EM(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(q(108,tK(e)||"Unknown",s));return Ot({},n,r)}function W0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ea,Nl=Zn.current,ht(Zn,e),ht(jr,jr.current),!0}function OI(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=EM(e,t,Nl),r.__reactInternalMemoizedMergedChildContext=e,wt(jr),wt(Zn),ht(Zn,e)):wt(jr),ht(jr,n)}var io=null,Nx=!1,ib=!1;function PM(e){io===null?io=[e]:io.push(e)}function xG(e){Nx=!0,PM(e)}function za(){if(!ib&&io!==null){ib=!0;var e=0,t=st;try{var n=io;for(st=1;e>=o,s-=o,lo=1<<32-Ks(t)+s|n<_?(I=j,j=null):I=j.sibling;var T=p(y,j,S[_],C);if(T===null){j===null&&(j=I);break}e&&j&&T.alternate===null&&t(y,j),b=i(T,b,_),P===null?E=T:P.sibling=T,P=T,j=I}if(_===S.length)return n(y,j),Ct&&pl(y,_),E;if(j===null){for(;__?(I=j,j=null):I=j.sibling;var R=p(y,j,T.value,C);if(R===null){j===null&&(j=I);break}e&&j&&R.alternate===null&&t(y,j),b=i(R,b,_),P===null?E=R:P.sibling=R,P=R,j=I}if(T.done)return n(y,j),Ct&&pl(y,_),E;if(j===null){for(;!T.done;_++,T=S.next())T=h(y,T.value,C),T!==null&&(b=i(T,b,_),P===null?E=T:P.sibling=T,P=T);return Ct&&pl(y,_),E}for(j=r(y,j);!T.done;_++,T=S.next())T=g(j,y,_,T.value,C),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?_:T.key),b=i(T,b,_),P===null?E=T:P.sibling=T,P=T);return e&&j.forEach(function(O){return t(y,O)}),Ct&&pl(y,_),E}function w(y,b,S,C){if(typeof S=="object"&&S!==null&&S.type===zc&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case hg:e:{for(var E=S.key,P=b;P!==null;){if(P.key===E){if(E=S.type,E===zc){if(P.tag===7){n(y,P.sibling),b=s(P,S.props.children),b.return=y,y=b;break e}}else if(P.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Jo&&FI(E)===P.type){n(y,P.sibling),b=s(P,S.props),b.ref=Bu(y,P,S),b.return=y,y=b;break e}n(y,P);break}else t(y,P);P=P.sibling}S.type===zc?(b=El(S.props.children,y.mode,C,S.key),b.return=y,y=b):(C=Fm(S.type,S.key,S.props,null,y.mode,C),C.ref=Bu(y,b,S),C.return=y,y=C)}return o(y);case Fc:e:{for(P=S.key;b!==null;){if(b.key===P)if(b.tag===4&&b.stateNode.containerInfo===S.containerInfo&&b.stateNode.implementation===S.implementation){n(y,b.sibling),b=s(b,S.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=pb(S,y.mode,C),b.return=y,y=b}return o(y);case Jo:return P=S._init,w(y,b,P(S._payload),C)}if(yh(S))return x(y,b,S,C);if(Ou(S))return m(y,b,S,C);kg(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,S),b.return=y,y=b):(n(y,b),b=hb(S,y.mode,C),b.return=y,y=b),o(y)):n(y,b)}return w}var Ad=MM(!0),RM=MM(!1),Y0=Fa(null),Z0=null,Yc=null,ZC=null;function XC(){ZC=Yc=Z0=null}function qC(e){var t=Y0.current;wt(Y0),e._currentValue=t}function g2(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ud(e,t){Z0=e,ZC=Yc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(wr=!0),e.firstContext=null)}function Ss(e){var t=e._currentValue;if(ZC!==e)if(e={context:e,memoizedValue:t,next:null},Yc===null){if(Z0===null)throw Error(q(308));Yc=e,Z0.dependencies={lanes:0,firstContext:e}}else Yc=Yc.next=e;return t}var bl=null;function QC(e){bl===null?bl=[e]:bl.push(e)}function NM(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,QC(t)):(n.next=s.next,s.next=n),t.interleaved=n,bo(e,r)}function bo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ea=!1;function JC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DM(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function po(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ma(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xe&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,bo(e,n)}return s=r.interleaved,s===null?(t.next=t,QC(r)):(t.next=s.next,s.next=t),r.interleaved=t,bo(e,n)}function Rm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$C(e,n)}}function zI(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function X0(e,t,n,r){var s=e.updateQueue;ea=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var h=s.baseState;o=0,u=d=c=null,l=i;do{var p=l.lane,g=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,m=l;switch(p=t,g=n,m.tag){case 1:if(x=m.payload,typeof x=="function"){h=x.call(g,h,p);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=m.payload,p=typeof x=="function"?x.call(g,h,p):x,p==null)break e;h=Ot({},h,p);break e;case 2:ea=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else g={eventTime:g,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=g,c=h):u=u.next=g,o|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(c=h),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ll|=o,e.lanes=o,e.memoizedState=h}}function BI(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ab.transition;ab.transition={};try{e(!1),t()}finally{st=n,ab.transition=r}}function QM(){return ks().memoizedState}function SG(e,t,n){var r=xa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JM(e))e5(t,n);else if(n=NM(e,t,n,r),n!==null){var s=ir();Gs(n,e,r,s),t5(n,t,r)}}function kG(e,t,n){var r=xa(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JM(e))e5(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(s.hasEagerState=!0,s.eagerState=l,Js(l,o)){var c=t.interleaved;c===null?(s.next=s,QC(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=NM(e,t,s,r),n!==null&&(s=ir(),Gs(n,e,r,s),t5(n,t,r))}}function JM(e){var t=e.alternate;return e===Dt||t!==null&&t===Dt}function e5(e,t){Kh=Q0=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function t5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$C(e,n)}}var J0={readContext:Ss,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useInsertionEffect:On,useLayoutEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useMutableSource:On,useSyncExternalStore:On,useId:On,unstable_isNewReconciler:!1},CG={readContext:Ss,useCallback:function(e,t){return mi().memoizedState=[e,t===void 0?null:t],e},useContext:Ss,useEffect:HI,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dm(4194308,4,GM.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dm(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=SG.bind(null,Dt,e),[r.memoizedState,e]},useRef:function(e){var t=mi();return e={current:e},t.memoizedState=e},useState:UI,useDebugValue:aj,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=UI(!1),t=e[0];return e=wG.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Dt,s=mi();if(Ct){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),fn===null)throw Error(q(349));Ol&30||FM(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,HI(BM.bind(null,r,i,e),[e]),r.flags|=2048,kp(9,zM.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=mi(),t=fn.identifierPrefix;if(Ct){var n=co,r=lo;n=(r&~(1<<32-Ks(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[vi]=t,e[xp]=r,u5(e,t,!1,!1),t.stateNode=e;e:{switch(o=qS(n,r),n){case"dialog":vt("cancel",e),vt("close",e),s=r;break;case"iframe":case"object":case"embed":vt("load",e),s=r;break;case"video":case"audio":for(s=0;sNd&&(t.flags|=128,r=!0,Uu(i,!1),t.lanes=4194304)}else{if(!r)if(e=q0(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Uu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ct)return Ln(t),null}else 2*Vt()-i.renderingStartTime>Nd&&n!==1073741824&&(t.flags|=128,r=!0,Uu(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Vt(),t.sibling=null,n=Tt.current,ht(Tt,r?n&1|2:n&1),t):(Ln(t),null);case 22:case 23:return pj(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?zr&1073741824&&(Ln(t),t.subtreeFlags&6&&(t.flags|=8192)):Ln(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function MG(e,t){switch(GC(t),t.tag){case 1:return _r(t.type)&&V0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Md(),wt(jr),wt(Zn),nj(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tj(t),null;case 13:if(wt(Tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Td()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(Tt),null;case 4:return Md(),null;case 10:return qC(t.type._context),null;case 22:case 23:return pj(),null;case 24:return null;default:return null}}var jg=!1,Vn=!1,RG=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Zc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ft(e,t,r)}else n.current=null}function C2(e,t,n){try{n()}catch(r){Ft(e,t,r)}}var e4=!1;function NG(e,t){if(a2=z0,e=xM(),WC(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var g;h!==n||s!==0&&h.nodeType!==3||(l=o+s),h!==i||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===e)break t;if(p===n&&++d===s&&(l=o),p===i&&++u===r&&(c=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(l2={focusedElem:e,selectionRange:n},z0=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var m=x.memoizedProps,w=x.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ls(t.type,m),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(C){Ft(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return x=e4,e4=!1,x}function Gh(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&C2(t,n,i)}s=s.next}while(s!==r)}}function Lx(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function j2(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function f5(e){var t=e.alternate;t!==null&&(e.alternate=null,f5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[xp],delete t[u2],delete t[mG],delete t[yG])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function g5(e){return e.tag===5||e.tag===3||e.tag===4}function t4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||g5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _2(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=H0));else if(r!==4&&(e=e.child,e!==null))for(_2(e,t,n),e=e.sibling;e!==null;)_2(e,t,n),e=e.sibling}function E2(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(E2(e,t,n),e=e.sibling;e!==null;)E2(e,t,n),e=e.sibling}var wn=null,$s=!1;function Go(e,t,n){for(n=n.child;n!==null;)m5(e,t,n),n=n.sibling}function m5(e,t,n){if(_i&&typeof _i.onCommitFiberUnmount=="function")try{_i.onCommitFiberUnmount(Ix,n)}catch{}switch(n.tag){case 5:Vn||Zc(n,t);case 6:var r=wn,s=$s;wn=null,Go(e,t,n),wn=r,$s=s,wn!==null&&($s?(e=wn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wn.removeChild(n.stateNode));break;case 18:wn!==null&&($s?(e=wn,n=n.stateNode,e.nodeType===8?sb(e.parentNode,n):e.nodeType===1&&sb(e,n),pp(e)):sb(wn,n.stateNode));break;case 4:r=wn,s=$s,wn=n.stateNode.containerInfo,$s=!0,Go(e,t,n),wn=r,$s=s;break;case 0:case 11:case 14:case 15:if(!Vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&C2(n,t,o),s=s.next}while(s!==r)}Go(e,t,n);break;case 1:if(!Vn&&(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ft(n,t,l)}Go(e,t,n);break;case 21:Go(e,t,n);break;case 22:n.mode&1?(Vn=(r=Vn)||n.memoizedState!==null,Go(e,t,n),Vn=r):Go(e,t,n);break;default:Go(e,t,n)}}function n4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new RG),t.forEach(function(r){var s=HG.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function As(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=Vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*OG(r/1960))-r,10e?16:e,oa===null)var r=!1;else{if(e=oa,oa=null,ny=0,Xe&6)throw Error(q(331));var s=Xe;for(Xe|=4,ce=e.current;ce!==null;){var i=ce,o=i.child;if(ce.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cVt()-uj?_l(e,0):dj|=n),Er(e,t)}function C5(e,t){t===0&&(e.mode&1?(t=mg,mg<<=1,!(mg&130023424)&&(mg=4194304)):t=1);var n=ir();e=bo(e,t),e!==null&&(tf(e,t,n),Er(e,n))}function UG(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),C5(e,n)}function HG(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(t),C5(e,n)}var j5;j5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jr.current)wr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return wr=!1,TG(e,t,n);wr=!!(e.flags&131072)}else wr=!1,Ct&&t.flags&1048576&&IM(t,G0,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Om(e,t),e=t.pendingProps;var s=Id(t,Zn.current);ud(t,n),s=sj(null,t,r,e,s,n);var i=ij();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_r(r)?(i=!0,W0(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,JC(t),s.updater=Ox,t.stateNode=s,s._reactInternals=t,y2(t,r,e,n),t=b2(null,t,r,!0,i,n)):(t.tag=0,Ct&&i&&KC(t),rr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Om(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=WG(r),e=Ls(r,e),s){case 0:t=v2(null,t,r,e,n);break e;case 1:t=qI(null,t,r,e,n);break e;case 11:t=ZI(null,t,r,e,n);break e;case 14:t=XI(null,t,r,Ls(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),v2(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),qI(e,t,r,s,n);case 3:e:{if(l5(t),e===null)throw Error(q(387));r=t.pendingProps,i=t.memoizedState,s=i.element,DM(e,t),X0(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Rd(Error(q(423)),t),t=QI(e,t,r,n,s);break e}else if(r!==s){s=Rd(Error(q(424)),t),t=QI(e,t,r,n,s);break e}else for(Hr=ga(t.stateNode.containerInfo.firstChild),Vr=t,Ct=!0,zs=null,n=RM(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Td(),r===s){t=wo(e,t,n);break e}rr(e,t,r,n)}t=t.child}return t;case 5:return OM(t),e===null&&f2(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,c2(r,s)?o=null:i!==null&&c2(r,i)&&(t.flags|=32),a5(e,t),rr(e,t,o,n),t.child;case 6:return e===null&&f2(t),null;case 13:return c5(e,t,n);case 4:return ej(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ad(t,null,r,n):rr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),ZI(e,t,r,s,n);case 7:return rr(e,t,t.pendingProps,n),t.child;case 8:return rr(e,t,t.pendingProps.children,n),t.child;case 12:return rr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,ht(Y0,r._currentValue),r._currentValue=o,i!==null)if(Js(i.value,o)){if(i.children===s.children&&!jr.current){t=wo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=po(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),g2(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(q(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),g2(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}rr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,ud(t,n),s=Ss(s),r=r(s),t.flags|=1,rr(e,t,r,n),t.child;case 14:return r=t.type,s=Ls(r,t.pendingProps),s=Ls(r.type,s),XI(e,t,r,s,n);case 15:return i5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),Om(e,t),t.tag=1,_r(r)?(e=!0,W0(t)):e=!1,ud(t,n),n5(t,r,s),y2(t,r,s,n),b2(null,t,r,!0,e,n);case 19:return d5(e,t,n);case 22:return o5(e,t,n)}throw Error(q(156,t.tag))};function _5(e,t){return JA(e,t)}function VG(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xs(e,t,n,r){return new VG(e,t,n,r)}function gj(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WG(e){if(typeof e=="function")return gj(e)?1:0;if(e!=null){if(e=e.$$typeof,e===NC)return 11;if(e===DC)return 14}return 2}function va(e,t){var n=e.alternate;return n===null?(n=xs(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fm(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")gj(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case zc:return El(n.children,s,i,t);case RC:o=8,s|=8;break;case BS:return e=xs(12,n,t,s|2),e.elementType=BS,e.lanes=i,e;case US:return e=xs(13,n,t,s),e.elementType=US,e.lanes=i,e;case HS:return e=xs(19,n,t,s),e.elementType=HS,e.lanes=i,e;case OA:return Fx(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case NA:o=10;break e;case DA:o=9;break e;case NC:o=11;break e;case DC:o=14;break e;case Jo:o=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=xs(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function El(e,t,n,r){return e=xs(7,e,r,t),e.lanes=n,e}function Fx(e,t,n,r){return e=xs(22,e,r,t),e.elementType=OA,e.lanes=n,e.stateNode={isHidden:!1},e}function hb(e,t,n){return e=xs(6,e,null,t),e.lanes=n,e}function pb(e,t,n){return t=xs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KG(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gv(0),this.expirationTimes=Gv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gv(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function mj(e,t,n,r,s,i,o,l,c){return e=new KG(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xs(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},JC(i),e}function GG(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T5)}catch(e){console.error(e)}}T5(),TA.exports=Jr;var Ba=TA.exports;const QG=La(Ba);var A5,d4=Ba;A5=FS.createRoot=d4.createRoot,FS.hydrateRoot=d4.hydrateRoot;/** + * react-router v7.15.1 + * + * 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 u4="popstate";function h4(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function JG(e={}){function t(r,s){var d;let i=(d=s.state)==null?void 0:d.masked,{pathname:o,search:l,hash:c}=i||r.location;return M2("",{pathname:o,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default",i?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:jp(s)}return tY(t,n,null,e)}function _t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eY(){return Math.random().toString(36).substring(2,10)}function p4(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 M2(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?cu(t):t,state:n,key:t&&t.key||r||eY(),mask:s}}function jp({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 cu(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 tY(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,l="POP",c=null,d=u();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function u(){return(o.state||{idx:null}).idx}function h(){l="POP";let w=u(),y=w==null?null:w-d;d=w,c&&c({action:l,location:m.location,delta:y})}function p(w,y){l="PUSH";let b=h4(w)?w:M2(m.location,w,y);d=u()+1;let S=p4(b,d),C=m.createHref(b.mask||b);try{o.pushState(S,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(C)}i&&c&&c({action:l,location:m.location,delta:1})}function g(w,y){l="REPLACE";let b=h4(w)?w:M2(m.location,w,y);d=u();let S=p4(b,d),C=m.createHref(b.mask||b);o.replaceState(S,"",C),i&&c&&c({action:l,location:m.location,delta:0})}function x(w){return nY(w)}let m={get action(){return l},get location(){return e(s,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(u4,h),c=w,()=>{s.removeEventListener(u4,h),c=null}},createHref(w){return t(s,w)},createURL:x,encodeLocation(w){let y=x(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:g,go(w){return o.go(w)}};return m}function nY(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),_t(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:jp(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function M5(e,t,n="/"){return rY(e,t,n,!1)}function rY(e,t,n,r,s){let i=typeof t=="string"?cu(t):t,o=So(i.pathname||"/",n);if(o==null)return null;let l=sY(e),c=null,d=mY(o);for(let u=0;c==null&&u{let u={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&c)return;_t(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length)}let h=Ys([r,u.relativePath]),p=n.concat(u);o.children&&o.children.length>0&&(_t(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),R5(o.children,t,p,h,c)),!(o.path==null&&!o.index)&&t.push({path:h,score:hY(h,o.index),routesMeta:p})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))i(o,l);else for(let d of N5(o.path))i(o,l,!0,d)}),t}function N5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=N5(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function iY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:pY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var oY=/^:[\w-]+$/,aY=3,lY=2,cY=1,dY=10,uY=-2,f4=e=>e==="*";function hY(e,t){let n=e.split("/"),r=n.length;return n.some(f4)&&(r+=uY),t&&(r+=lY),n.filter(s=>!f4(s)).reduce((s,i)=>s+(oY.test(i)?aY:i===""?cY:dY),r)}function pY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function fY(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",o=[];for(let l=0;l{if(u==="*"){let x=l[p]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const g=l[p];return h&&!g?d[u]=void 0:d[u]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function gY(e,t=!1,n=!0){Cs(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c,d,u)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let h=u.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function mY(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cs(!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 So(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var yY=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xY(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?cu(e):e,i;return n?(n=D5(n),n.startsWith("/")?i=g4(n.substring(1),"/"):i=g4(n,t)):i=t,{pathname:i,search:wY(r),hash:SY(s)}}function g4(e,t){let n=oy(t).split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fb(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 vY(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bj(e){let t=vY(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Vx(e,t,n,r=!1){let s;typeof e=="string"?s=cu(e):(s={...e},_t(!s.pathname||!s.pathname.includes("?"),fb("?","pathname","search",s)),_t(!s.pathname||!s.pathname.includes("#"),fb("#","pathname","hash",s)),_t(!s.search||!s.search.includes("#"),fb("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}l=h>=0?t[h]:"/"}let c=xY(s,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}var D5=e=>e.replace(/\/\/+/g,"/"),Ys=e=>D5(e.join("/")),oy=e=>e.replace(/\/+$/,""),bY=e=>oy(e).replace(/^\/*/,"/"),wY=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,SY=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kY=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 CY(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function jY(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ys(t)||"/"}var O5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function L5(e,t){let n=e;if(typeof n!="string"||!yY.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(O5)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),l=So(o.pathname,t);o.origin===i.origin&&l!=null?n=l+o.search+o.hash:s=!0}catch{Cs(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $5=["POST","PUT","PATCH","DELETE"];new Set($5);var _Y=["GET",...$5];new Set(_Y);var du=f.createContext(null);du.displayName="DataRouter";var Wx=f.createContext(null);Wx.displayName="DataRouterState";var F5=f.createContext(!1);function EY(){return f.useContext(F5)}var z5=f.createContext({isTransitioning:!1});z5.displayName="ViewTransition";var PY=f.createContext(new Map);PY.displayName="Fetchers";var IY=f.createContext(null);IY.displayName="Await";var ts=f.createContext(null);ts.displayName="Navigation";var of=f.createContext(null);of.displayName="Location";var Bi=f.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var wj=f.createContext(null);wj.displayName="RouteError";var B5="REACT_ROUTER_ERROR",TY="REDIRECT",AY="ROUTE_ERROR_RESPONSE";function MY(e){if(e.startsWith(`${B5}:${TY}:{`))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 RY(e){if(e.startsWith(`${B5}:${AY}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new kY(t.status,t.statusText,t.data)}catch{}}function NY(e,{relative:t}={}){_t(uu(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=f.useContext(ts),{hash:s,pathname:i,search:o}=af(e,{relative:t}),l=i;return n!=="/"&&(l=i==="/"?n:Ys([n,i])),r.createHref({pathname:l,search:o,hash:s})}function uu(){return f.useContext(of)!=null}function ns(){return _t(uu(),"useLocation() may be used only in the context of a component."),f.useContext(of).location}var U5="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function H5(e){f.useContext(ts).static||f.useLayoutEffect(e)}function Sj(){let{isDataRoute:e}=f.useContext(Bi);return e?GY():DY()}function DY(){_t(uu(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(du),{basename:t,navigator:n}=f.useContext(ts),{matches:r}=f.useContext(Bi),{pathname:s}=ns(),i=JSON.stringify(bj(r)),o=f.useRef(!1);return H5(()=>{o.current=!0}),f.useCallback((c,d={})=>{if(Cs(o.current,U5),!o.current)return;if(typeof c=="number"){n.go(c);return}let u=Vx(c,JSON.parse(i),s,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Ys([t,u.pathname])),(d.replace?n.replace:n.push)(u,d.state,d)},[t,n,i,s,e])}f.createContext(null);function af(e,{relative:t}={}){let{matches:n}=f.useContext(Bi),{pathname:r}=ns(),s=JSON.stringify(bj(n));return f.useMemo(()=>Vx(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function OY(e,t){return V5(e,t)}function V5(e,t,n){var w;_t(uu(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=f.useContext(ts),{matches:s}=f.useContext(Bi),i=s[s.length-1],o=i?i.params:{},l=i?i.pathname:"/",c=i?i.pathnameBase:"/",d=i&&i.route;{let y=d&&d.path||"";K5(l,!d||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${l}" (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=ns(),h;if(t){let y=typeof t=="string"?cu(t):t;_t(c==="/"||((w=y.pathname)==null?void 0:w.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 "${y.pathname}" was given in the \`location\` prop.`),h=y}else h=u;let p=h.pathname||"/",g=p;if(c!=="/"){let y=c.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=n&&n.state.matches.length?n.state.matches.map(y=>Object.assign(y,{route:n.manifest[y.route.id]||y.route})):M5(e,{pathname:g});Cs(d||x!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Cs(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 m=BY(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:Ys([c,r.encodeLocation?r.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Ys([c,r.encodeLocation?r.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),s,n);return t&&m?f.createElement(of.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},m):m}function LY(){let e=KY(),t=CY(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)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:i},"ErrorBoundary")," or"," ",f.createElement("code",{style:i},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:s},n):null,o)}var $Y=f.createElement(LY,null),W5=class extends f.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?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=RY(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(Bi.Provider,{value:this.props.routeContext},f.createElement(wj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(FY,{error:e},t):t}};W5.contextType=F5;var gb=new WeakMap;function FY({children:e,error:t}){let{basename:n}=f.useContext(ts);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=MY(t.digest);if(r){let s=gb.get(t);if(s)throw s;let i=L5(r.location,n);if(O5&&!gb.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw gb.set(t,o),o}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function zY({routeContext:e,match:t,children:n}){let r=f.useContext(du);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Bi.Provider,{value:e},n)}function BY(e,t=[],n){let r=n==null?void 0: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 s=e,i=r==null?void 0:r.errors;if(i!=null){let u=s.findIndex(h=>h.route.id&&(i==null?void 0:i[h.route.id])!==void 0);_t(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let u=0;u=0?s=s.slice(0,l+1):s=[s[0]];break}}}}let c=n==null?void 0:n.onError,d=r&&c?(u,h)=>{var p,g;c(u,{location:r.location,params:((g=(p=r.matches)==null?void 0:p[0])==null?void 0:g.params)??{},pattern:jY(r.matches),errorInfo:h})}:void 0;return s.reduceRight((u,h,p)=>{let g,x=!1,m=null,w=null;r&&(g=i&&h.route.id?i[h.route.id]:void 0,m=h.route.errorElement||$Y,o&&(l<0&&p===0?(K5("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,w=null):l===p&&(x=!0,w=h.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,p+1)),b=()=>{let S;return g?S=m:x?S=w:h.route.Component?S=f.createElement(h.route.Component,null):h.route.element?S=h.route.element:S=u,f.createElement(zY,{match:h,routeContext:{outlet:u,matches:y,isDataRoute:r!=null},children:S})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?f.createElement(W5,{location:r.location,revalidation:r.revalidation,component:m,error:g,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:d}):b()},null)}function kj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function UY(e){let t=f.useContext(du);return _t(t,kj(e)),t}function HY(e){let t=f.useContext(Wx);return _t(t,kj(e)),t}function VY(e){let t=f.useContext(Bi);return _t(t,kj(e)),t}function Cj(e){let t=VY(e),n=t.matches[t.matches.length-1];return _t(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function WY(){return Cj("useRouteId")}function KY(){var r;let e=f.useContext(wj),t=HY("useRouteError"),n=Cj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function GY(){let{router:e}=UY("useNavigate"),t=Cj("useNavigate"),n=f.useRef(!1);return H5(()=>{n.current=!0}),f.useCallback(async(s,i={})=>{Cs(n.current,U5),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var m4={};function K5(e,t,n){!t&&!m4[e]&&(m4[e]=!0,Cs(!1,n))}f.memo(YY);function YY({routes:e,manifest:t,future:n,state:r,isStatic:s,onError:i}){return V5(e,void 0,{manifest:t,state:r,isStatic:s,onError:i})}function y4({to:e,replace:t,state:n,relative:r}){_t(uu()," may be used only in the context of a component.");let{static:s}=f.useContext(ts);Cs(!s," 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:i}=f.useContext(Bi),{pathname:o}=ns(),l=Sj(),c=Vx(e,bj(i),o,r==="path"),d=JSON.stringify(c);return f.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function Rs(e){_t(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function ZY({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,useTransitions:o}){_t(!uu(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:s,static:i,useTransitions:o,future:{}}),[l,s,i,o]);typeof n=="string"&&(n=cu(n));let{pathname:d="/",search:u="",hash:h="",state:p=null,key:g="default",mask:x}=n,m=f.useMemo(()=>{let w=So(d,l);return w==null?null:{location:{pathname:w,search:u,hash:h,state:p,key:g,mask:x},navigationType:r}},[l,d,u,h,p,g,r,x]);return Cs(m!=null,` is not able to match the URL "${d}${u}${h}" because it does not start with the basename, so the won't render anything.`),m==null?null:f.createElement(ts.Provider,{value:c},f.createElement(of.Provider,{children:t,value:m}))}function XY({children:e,location:t}){return OY(R2(e),t)}function R2(e,t=[]){let n=[];return f.Children.forEach(e,(r,s)=>{if(!f.isValidElement(r))return;let i=[...t,s];if(r.type===f.Fragment){n.push.apply(n,R2(r.props.children,i));return}_t(r.type===Rs,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),_t(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=R2(r.props.children,i)),n.push(o)}),n}var zm="get",Bm="application/x-www-form-urlencoded";function Kx(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function qY(e){return Kx(e)&&e.tagName.toLowerCase()==="button"}function QY(e){return Kx(e)&&e.tagName.toLowerCase()==="form"}function JY(e){return Kx(e)&&e.tagName.toLowerCase()==="input"}function eZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tZ(e,t){return e.button===0&&(!t||t==="_self")&&!eZ(e)}function N2(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(s=>[n,s]):[[n,r]])},[]))}function nZ(e,t){let n=N2(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var Pg=null;function rZ(){if(Pg===null)try{new FormData(document.createElement("form"),0),Pg=!1}catch{Pg=!0}return Pg}var sZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mb(e){return e!=null&&!sZ.has(e)?(Cs(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Bm}"`),null):e}function iZ(e,t){let n,r,s,i,o;if(QY(e)){let l=e.getAttribute("action");r=l?So(l,t):null,n=e.getAttribute("method")||zm,s=mb(e.getAttribute("enctype"))||Bm,i=new FormData(e)}else if(qY(e)||JY(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a